Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add function to lift Maybe value into MaybeT #230

Closed
gpevnev opened this issue Aug 19, 2020 · 0 comments · Fixed by #231
Closed

Add function to lift Maybe value into MaybeT #230

gpevnev opened this issue Aug 19, 2020 · 0 comments · Fixed by #231
Assignees
Labels
type:feature Something new is added.

Comments

@gpevnev
Copy link
Contributor

gpevnev commented Aug 19, 2020

Problem: Currently to lift a value ma :: Maybe a into MaybeT m a you need to write MaybeT (pure ma), which is bloating code with unnecessary boilerplate.

Proposed solution: Add function hoistMaybe :: Applicative m => Maybe a -> MaybeT m a which already have been implemented in relude.

This will make working with MaybeT transformer more convinient

gpevnev added a commit that referenced this issue Aug 19, 2020
Problem: Currently to lift a value `ma :: Maybe a` into `MaybeT m a``
you need to write `MaybeT (pure ma)`, which is bloating code with
unnecessary boilerplate.
Same idea applies for `Either e a` and `ExceptT e m a`.
`

Proposed solution:
Add functions `hoistMaybe :: Applicative m => Maybe a -> MaybeT m a` and
`hoistEither :: Applicative m => Either e a -> ExceptT e m a `
@gpevnev gpevnev self-assigned this Aug 19, 2020
@gpevnev gpevnev added the type:feature Something new is added. label Aug 24, 2020
gpevnev added a commit that referenced this issue Aug 26, 2020
Problem: Currently to lift a value `ma :: Maybe a` into `MaybeT m a``
you need to write `MaybeT (pure ma)`, which is bloating code with
unnecessary boilerplate.
Same idea applies for `Either e a` and `ExceptT e m a`.
`

Proposed solution:
Add functions `hoistMaybe :: Applicative m => Maybe a -> MaybeT m a` and
`hoistEither :: Applicative m => Either e a -> ExceptT e m a `
gromakovsky added a commit that referenced this issue Aug 26, 2020
[#230] Add `hoistMaybe` and `hoistEither` functions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature Something new is added.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant