GADT allows us to reify a constraint as an explicit dictionary. With ConstraintKinds, we can further generalize this trick. In this post, I will explain how this trick works.
Reified dictionaries
- February 6, 2017Avoid overlapping instances with closed type families
- February 5, 2017Overlapping instances are one of the most controversial features in Haskell. Fortunately, there are many tricks that let us avoid overlapping instances. In this post, I will introduce one such trick which uses closed type families.
Context reduction
- February 2, 2017Hello, Haskellers! Today I am going to explain what context reduction is and why it is necessary.
Simple benchmarking with GHCi
- February 1, 2017GHCi has a lesser known option :set +s. When turned on, GHCi displays some stats for each expression evaluated.
Type-level insertion sort
- January 30, 2017Multi-parameter type classes and functional dependencies made type-level programming possible. Back in 2000, Thomas Hallgren showed an implementation of insertion sort as an example of static computation using functional dependencies. The code has a strong resemblance to logic programming which looks bizarre to most functional programmers. In this post, I will show you a more “functional-style” implementation of insertion sort using closed type families.
…or you can find more in the archives.