Reading GHC Core

Core is GHC’s intermediate language. Reading Core can help you better understand the performance of your program. Someone asked me for documentation or tutorials on reading Core, but I couldn’t find much. What documentation is available for reading GHC Core? Here’s what I’ve found so far: Write Haskell as fast as C: exploiting strictness, laziness … Read more

When is -XAllowAmbiguousTypes appropriate?

I’ve recently posted a question about syntactic-2.0 regarding the definition of share. I’ve had this working in GHC 7.6: {-# LANGUAGE GADTs, TypeOperators, FlexibleContexts #-} import Data.Syntactic import Data.Syntactic.Sugar.BindingT data Let a where Let :: Let (a :-> (a -> b) :-> Full b) share :: (Let :<: sup, sup ~ Domain b, sup ~ … Read more

Why is Haskell (GHC) so darn fast?

Haskell (with the GHC compiler) is a lot faster than you’d expect. Used correctly, it can get close-ish to low-level languages. (A favorite thing for Haskellers to do is to try and get within 5% of C (or even beat it, but that means you are using an inefficient C program, since GHC compiles Haskell … Read more