Skip to content

Add fromLeftM and fromRightM #115

@solomon-b

Description

@solomon-b

I often find these functions helpful and end up defining them:

fromLeftM :: Monad m => (b -> m a) -> m (Either a b) -> m a
fromLeftM = eitherM pure

fromRightM :: Monad m => (a -> m b) -> m (Either a b) -> m b
fromRightM f = eitherM f pure

I was wondering what you thought about including them in extra?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions