Skip to content

Instantly share code, notes, and snippets.

@jwatte
Last active June 16, 2016 05:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jwatte/3c308ac0afbdc1df268ca0c837756127 to your computer and use it in GitHub Desktop.
Save jwatte/3c308ac0afbdc1df268ca0c837756127 to your computer and use it in GitHub Desktop.
class A a where
getB :: B b => a -> b
class B b where
getA :: A a => b -> a
data X = X
instance A X where
getB x = x
instance B X where
getA x = x
{-
Foo.hs:16:14:
Could not deduce (b ~ X)
from the context (B b)
bound by the type signature for getB :: B b => X -> b
at Foo.hs:16:5-14
`b' is a rigid type variable bound by
the type signature for getB :: B b => X -> b at Foo.hs:16:5
In the expression: x
In an equation for `getB': getB x = x
In the instance declaration for `A X'
Foo.hs:19:14:
Could not deduce (a ~ X)
from the context (A a)
bound by the type signature for getA :: A a => X -> a
at Foo.hs:19:5-14
`a' is a rigid type variable bound by
the type signature for getA :: A a => X -> a at Foo.hs:19:5
In the expression: x
In an equation for `getA': getA x = x
In the instance declaration for `B X'
-}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment