-
-
Save ryantm/1f09efb25d06dbe63370 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
f :: a -> String | |
f a = "Cool" | |
g :: (a -> String) -> String | |
g h = h 1 | |
main = do | |
putStrLn (f 1) | |
putStrLn (g f) |
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
runhaskell a.hs | |
a.hs:5:9: | |
No instance for (Num a) arising from the literal ‘1’ | |
Possible fix: | |
add (Num a) to the context of | |
the type signature for g :: (a -> String) -> String | |
In the first argument of ‘h’, namely ‘1’ | |
In the expression: h 1 | |
In an equation for ‘g’: g h = h 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment