Created
October 18, 2015 20:54
-
-
Save bryant/adb972acf9d041907ef7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE MultiParamTypeClasses #-} | |
class C a b where | |
idk :: a -> b -> Maybe (a, b) | |
instance C Int Bool where idk _ _ = Nothing | |
f :: Int -> Bool -> [Either Int Bool] | |
f a b = | |
let g a b = maybe [] (const $ []) $ idk a b in | |
let h thing = g a thing in | |
g a b | |
{- | |
wtfwtf.hs:11:9: | |
Non type-variable argument in the constraint: C Int b | |
(Use FlexibleContexts to permit this) | |
When checking that ‘h’ has the inferred type | |
h :: forall t b. C Int b => b -> [t] | |
In the expression: let h thing = g a thing in g a b | |
In the expression: | |
let g a b = maybe [] (const $ []) $ idk a b in | |
let h thing = g a thing in g a b | |
Failed, modules loaded: none. | |
-} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment