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

Failed Instance Resolution for State #28

Closed
pseudonom opened this issue Feb 25, 2015 · 2 comments
Closed

Failed Instance Resolution for State #28

pseudonom opened this issue Feb 25, 2015 · 2 comments

Comments

@pseudonom
Copy link
Contributor

If I define

module Foo where

import qualified Control.Monad.State as ST
import qualified Control.Monad.State.Class as ST

ident :: forall a. a -> a
ident a = a
ident' :: Number -> Number
ident' a = a

then

a :: ST.State Number Unit
a = ST.modify ident'

compiles/works fine.

However,

a :: ST.State Number Unit
a = ST.modify ident

complains that

No instance found for Control.Monad.State.Class.MonadState u7 (Control.Monad.State.Trans.StateT Prim.Number Data.Identity.Identity)

.

(Both versions work in Haskell.)

@hdgarrood
Copy link
Contributor

I think the solution to this might be functional dependencies, which would make this a duplicate of purescript/purescript#1580. Not entirely sure, though.

@garyb
Copy link
Member

garyb commented Oct 10, 2016

I'm pretty sure this is related to the lack of functional dependencies too, so this should be fixed in the next release.

@garyb garyb closed this as completed Oct 10, 2016
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

No branches or pull requests

3 participants