Created
July 21, 2014 23:24
-
-
Save phylake/24a0e7861feb7a5774c0 to your computer and use it in GitHub Desktop.
could not deduce b ~ b1
This file contains 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
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