Add composition of MonadTransformers
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
Research direction
Start by reading the proposed ComposeT definition and the existing MonadTrans implementations in the transformers package. Check how the type and kind signatures fit the library's supported language features, then verify that the OkT deriving example works; done means composed transformers can provide MonadTrans as described.
Written by the indexing model from the issue text.
Description
[original issue 84 by @Icelandjack]
Add
-- ComposeT :: MonadTransformer -> MonadTransformer -> MonadTransformer
type ComposeT :: (k3 -> k2 -> Type) -> (k1 -> k3) -> (k1 -> k2 -> Type)
newtype ComposeT trans1 trans2 m a = ComposeT (trans1 (trans2 m) a)
deriving newtype (Functor, Applicative, Monad)
instance (MonadTrans trans1, MonadTrans trans2) => MonadTrans (ComposeT trans1 trans2) where
lift :: Monad m => m ~> ComposeT trans1 trans2 m
lift = ComposeT . lift . lift
where MonadTransformer = (Type -> Type) -> (Type -> Type).
Now we can derive MonadTrans for transformers like
type OkT :: MonadTransformer
newtype OkT m a = OkT (Int -> Int -> m a)
deriving (Functor, Applicative, Monad)
via ReaderT Int (ReaderT Int m)
deriving MonadTrans
via ComposeT (ReaderT Int) (ReaderT Int)
- Dominant language
- Haskell
- Stars
- 5
- Forks
- 10
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from haskell/transformers
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
haskell/transformers#21 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
haskell/transformers#130 · 1 comment ·
-
Strictness testing of transformersMay be free again @ynishiza claimed this 111 days ago, and no pull request is open. Openenhancement good first issue help wanted
haskell/transformers#123 · 21 comments · 1 assignee ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
haskell/transformers#100 · 2 comments ·
-
good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
haskell/transformers#98 · 4 comments · 1 reaction ·
All issues in haskell/transformers
Similar issues
-
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
objectionary/phino#1724 ·
Maintainers usually reply within 1 day
-
infrastructure
Difficulty 1/5 Under an hour Newbie friendliness 92/100
alunduil/collection-json.hs#373 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
digital-asset/daml#23439 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100