Skip to content

Instantly share code, notes, and snippets.

@phylake
Created July 21, 2014 23:24
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 phylake/24a0e7861feb7a5774c0 to your computer and use it in GitHub Desktop.
Save phylake/24a0e7861feb7a5774c0 to your computer and use it in GitHub Desktop.
could not deduce b ~ b1
module Main where
class A a where
class B a where
foo :: (A a, B b) => IO a -> (a -> IO b) -> IO ()
foo _ func = return ()
where
-- this breaks because func is not passed in
barBroken :: (A a, B b) => a -> IO b
barBroken = func
barWorks :: (A a, B b) => (a -> IO b) -> a -> IO b
barWorks f a = f a
main = return ()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment