Past Meetup

Artem Chirkin - Experimenting with Constraints

This Meetup is past

20 people went

Location image of event venue

Details

This talk is about things we can do with ConstraintKinds. First, we will have a look at the constraints library [1]: how it uses (Dict :: Constraint -> *) to move around instances of type classes. Then, we will follow an amazing reflection [2] tutorial by Austin Seipp [3] explaining how to dynamically construct type-class instances. Finally, I will present my experimental GHC plugin that turns a manually-constructed Dict into a vanilla type-class instance. Also I will try to justify why I need such a weird trickery by means of an intersting example: implementing a type-class instance for a closed type family.

[1] http://hackage.haskell.org/package/constraints
[2] http://hackage.haskell.org/package/reflection
[3] https://www.schoolofhaskell.com/user/thoughtpolice/using-reflection