What does the GHC source mean by “zonk”?

An un-zonked type can have type variables which are mutable references filled in during unification (and this mutability is heavily used by the type checker to increase performance). Zonking traverses a type and replaces all mutable references with the type that they dereference to; thus, the resulting structure is immutable and requires no dereferencing to … Read more

How to use a DLL in a Haskell project?

You’ll need to use extra-lib-dirs and extra-libraries in the executable section of your .cabal file like so: name: MyApp version: 0.1.0.0 synopsis: homepage: author: simon.bourne category: build-type: Simple cabal-version: >=1.10 library exposed-modules: HelloWorld build-depends: base >= 4.7 && < 5 hs-source-dirs: src default-language: Haskell2010 executable MyApp main-is: Main.hs extra-lib-dirs: lib extra-libraries: helloWorld build-depends: base >= … Read more

Functions don’t just have types: They ARE Types. And Kinds. And Sorts. Help put a blown mind back together

You touch so many interesting points in your question, so I am afraid this is going to be a long answer 🙂 Kind of (->) The kind of (->) is * -> * -> *, if we disregard the boxity GHC inserts. But there is no circularity going on, the ->s in the kind of … Read more

Is there any reason not to use the INLINABLE pragma for a function?

There are three differences between using INLINABLE and not using a pragma at all: Without INLINABLE, the definition that goes in the interface file is the code after optimisation, whereas with INLINABLE, it is the code you wrote (more or less). In particular, without INLINABLE, GHC might inline other functions into the function’s definition. Without … Read more

Good introductory text about GHC implementation?

The majority of the technical information about the architecture and approach of the GHC system is in their wiki. I’ll link to the key pieces, and some related papers that people may not know about. What typical optimizations are applied? The key paper on this is: A transformation-based optimiser for Haskell, SL Peyton Jones and … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)