In this episode, we'll see how deriving-via can be used to capture rules that relate type classes to each other. As a specific example, we will discuss the definition of the Monad type class: ever since this definition was changed back in 2015 in the Applicative Monad Proposal, instantiating Monad to a new datatype requires quite a bit of boilerplate code. By making the relation between
The Haskell Unfolder Episode 16: monads and deriving via
https://well-typed.com/blog/2023/12/haskell-unfolder-episode-16-monads-and-deriving-via/
1 Comments
jaror@kbin.social · 1 pts · 2y
For more details on
DerivingVia, check out the paper:https://ryanglscott.github.io/papers/deriving-via.pdf
Especially Section 4 which lists many use cases including the superclasses demonstrated in the video.