Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {-# LANGUAGE MultiParamTypeClasses #-}
- class F a b where
- f :: a -> b
- class O a where
- o :: a
- data K = K
- data L = L
- data M = M
- instance O K where
- o = K
- instance O L where
- o = L
- instance F K L where
- f K = L
- instance F L K where
- f L = K
- instance F L L where
- f L = L
- instance F M K where
- f M = K
- F K L
- F L K
- F L L
- F M K
- O K
- O L
- f o :: K
- *Main> f o :: K
- <interactive>:2:1:
- No instance for (F a0 K) arising from a use of `f'
- The type variable `a0' is ambiguous
- Possible fix: add a type signature that fixes these type variable(s)
- Note: there are several potential instances:
- instance F M K -- Defined at hw.hs:28:10
- instance F L K -- Defined at hw.hs:22:10
- Possible fix: add an instance declaration for (F a0 K)
- In the expression: f o :: K
- In an equation for `it': it = f o :: K
- <interactive>:2:3:
- No instance for (O a0) arising from a use of `o'
- The type variable `a0' is ambiguous
- Possible fix: add a type signature that fixes these type variable(s)
- Note: there are several potential instances:
- instance O L -- Defined at hw.hs:16:10
- instance O K -- Defined at hw.hs:13:10
- In the first argument of `f', namely `o'
- In the expression: f o :: K
- In an equation for `it': it = f o :: K
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement