This is an excerpt from Manning's book Type-Driven Development with Idris. Login to get full access to this book.
Listing 12.17. Defining Functor, Applicative, and Monad implementations together (StateMonad.idr)