External Explanations
Contravariant
- George Wilson's Contravariant Functors: The Other Side of the Coin
Comonad
- Chris Penner's Comonads by Example (I highly recommend it).
- Gabriel Gonzalez's You Could have Invented Comonad
- Phil Freeman's Comonads as Spaces
- Nihil Shah's Cofree Comonads and their Uses
IndexedMonad (i.e. IxMonad
)
An IndexedMonad uses the compiler to ensure:
- monadic computations occur in the proper order
- one monadic computation will change what the final output will be
Links:
- Kwan's Indexed Monad overview
What I wish I knew when Learning Haskell
's Indexed Monad section- Justin Woo's Using IxMonad to enforce good hamburger building in PureScript
Real-world problem where it would help: purescript-selda
, a library that allows one to write type-safe database queries, would prevent some aggregate queries from working when they are invalid. The (thesis' (PDF)) relevant sections are 2.3, 2.4, and 5 (paragraph 5 and down).