Skip to content

Instantly share code, notes, and snippets.

@ryantm
Last active August 29, 2015 14:08
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 ryantm/1f09efb25d06dbe63370 to your computer and use it in GitHub Desktop.
Save ryantm/1f09efb25d06dbe63370 to your computer and use it in GitHub Desktop.
f :: a -> String
f a = "Cool"
g :: (a -> String) -> String
g h = h 1
main = do
putStrLn (f 1)
putStrLn (g f)
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