How to structure modules providing instances

It’s just occurred to me that the Monad analogy can be extended - in Haskell, it originally had four methods. Over time, some of those methods were split off into their own type classes e.g. fail and MonadFail.

This could also be a possibility for Transformable (I’ll leave it to you to decide the names for the extra type classes…). If they end up being large enough, they can then be moved into their own modules.

2 Likes