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

Generalize Functor and Traversable for FreeT #154

Closed
wants to merge 2 commits into from
Closed

Generalize Functor and Traversable for FreeT #154

wants to merge 2 commits into from

Conversation

mniip
Copy link

@mniip mniip commented May 25, 2017

I have just been bitten by the Monad constraints on these instances...

It is worth noting that I believe it's impossible to write an Applicative m => Applicative (FreeT f m) instance that would be in agreement with ap, so Applicative and Alternative are sadly tainted with monad.

@mniip
Copy link
Author

mniip commented May 25, 2017

Just realized how this affects pre-AMP haskell. Should I rather add Functor constraints on subclasses, or only enable the generalized instances on new ghcs?

@mniip
Copy link
Author

mniip commented May 25, 2017

Done the former because it made more sense. Would it be possible to, perhaps, do something along the lines of:

import Prelude hiding (Monad)
import qualified Prelude (Monad)

type Monad m = (Functor m, Monad m)

as a pre-AMP compatibility layer? Just an idea.

@fizruk
Copy link
Collaborator

fizruk commented May 25, 2017

Can/should we also generalise Traversable for FT?
It should be possible, although current implementation depends on Monad m constraint apparently.

@RyanGlScott
Copy link
Collaborator

Superseded by #225.

@RyanGlScott RyanGlScott closed this Feb 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants