DMaps for Delightful Dynamism
Living in a statically typed world is great, but sometimes a part of your problem really does need to be modelled as something a bit more dynamic. Maybe something in your domain really should be modelled as a heterogenous collection. Maybe you just have a bunch of things you want to group together and work with via a common typeclass, but their types are all different. Maybe you're interfacing with a system that doesn't care about types. You might just want to feel the wind through your hair like when you were working with dynamically typed languages.
The dependent-map library (and friends) has you covered for all of these things. It gives you a heterogenous collection with great usability, where you use GADTs as the keys and have the "Functor Functor" pattern wrapped up in the mix for good measure.
This talk will start by looking at GADTs and the "Functor Functor" pattern to make sure everyone is on the same page, before spending some time getting to know the the details of DSum, DMap and friends. After that we'll spend some time looking at some of the additional things you can do using related libraries from the ecosystem, and then we'll spend the rest of the time looking at examples and applications.
Outline/Structure of the Talk
- Some motivating examples
- An explanation of GADTs
- An explanation of the Functor Functor idea
- Introducing DSum
- Nested keys
- Classy prisms for keys
- Working with constraints for all of the keys in a DMap
- Introducing Vessel
A better understanding of how using some more-advanced-than-ordinary type system features can lead to better code in practical situations, along with knowing and how and when you could use dependent-map in your code.
Prerequisites for Attendees
You should have a decent understanding of Haskell, and either some knowledge of GADTs or the willingness to passively absorb knowledge about GADTs as the talk progresses.