garyb / purescript-indexed-monad

MIT License
21 stars 11 forks source link

Implement Monad type class hierarchy instances for Indexed #21

Closed JordanMartinez closed 4 years ago

JordanMartinez commented 4 years ago

Per my exploration on the indexed capability design pattern (or indexed finally tagless pattern?), a default implementation (i.e. IxExceptT) for IxMonadError cannot be defined because ibind always assumes that some forward progress is made. However, if we treat Indexed as a monad whose indices don't change when normal bind is used, we can then use regular monad transformers without issue.

So I propose adding such instances.