Gabriella439 / Gabriella439/Haskell-MMorph-Library

Having trouble deriving MMonad for monad stacks

Open
#34 14 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
53
Forks
24
PR merge metrics
No merged PRs in 30d

Description

Given some random transformer stack, where all of the transformers implement `MMonad`:
```
newtype FooT m a = FooT { unFoo :: ExceptT () (StateT Int (BarT m)) a }
```

I'm finding it difficult to create instances of `MMonad` for `Foo`, without just running everything and manually implementing `embed` for the entire stack.

Am I missing something, or is this because monads don't compose? Is there an equivalent of monad transformers for the category of monads? Maybe that would make creating these instances easier.

Any thoughts appreciated, hopefully I'm just missing something obvious.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.