Skip to content

how to declare instances for typeclasses with functional dependencies? #119

Answered by arybczak
dark-ether asked this question in Q&A
Discussion options

You must be logged in to vote

Oh. Indeed, I forgot about this particular case.

You can force GHC to ignore the coverage condition by using a trick, i.e. including the instance head in the context:

instance forall e s es. (Ord e ,P.Stream s, Megaparsec e s :> es, MonadParsec e s (Eff es))=> MonadParsec e s (Eff es ) where

For the record, I didn't think too much about potential consequences for this particular case, but it should work as expected.

Also, you'll probably want to use effectful-plugin for good user experience with this effect.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by dark-ether
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants