[Haskell-cafe] A type level puzzle

Silvio Frischknecht silvio.frischi at gmail.com
Sat Aug 15 13:35:29 UTC 2015

> A good headache or a bad headache?  If it's hard to learn but ultimately
> satisfying and useful then I'm all up for it.  If it's hard to learn because
> Haskell doesn't really support it naturally then I'll probably avoid it.

Well that depends on how you look at it. GHC has a fair number of
extensions for dealing with type level programming. And there surely is
a reason for all of them. And you can get some elegant type level
programming. But it's hard to get right. It's is especially hard if you
want Haskell to infer your types. It can definitely be worth it. I coded
a unit system the day before yesterday. I'm using it in my project now
and that was definitely worth it. But I've done stuff like this before
and it usually takes a few days for me to wrap my head around things.

Btw. I'm just an enthusiast. I don't do this professionally.

I can tell you the extensions you will probably need and that you should
have a look at.

TypeFamilies - often useful (closed type families for defaults)
KindSignatures - for working with different kinds such as Symbol
TypeOperators - for making typelevel operators

DataKinds - If you want to make your own kinds (probably not needed)


More information about the Haskell-Cafe mailing list