In this video, we show how to use datatype promotion to create length-indexed vectors in Haskell. We also look at how to implement some basic functions and typeclass instances for the datatype.
Haskell library for length-indexed vectors:
https://hackage.haskell.org/package/vec
Get FP merch that doesn't suck 👇
https://shop.serokell.io/
Follow us on social media:
/ serokell
Learn more about us:
https://serokell.io/
https://github.com/serokell
Contact us:
[email protected]
0:00 Intro
0:26 Is it possible to pass terms as type parameters?
1:22 Datatype promotion
3:00 Datatype of length-indexed vectors
4:03 Closed type families
5:02 Basic functions on vectors
5:52 Vector concatenation
7:08 Basic typeclass instances
7:48 Applicative instance
8:35 Structural induction
9:48 Monad and monoid instances
10:35 Transforming lists into vectors
13:28 Conclusion