Created
February 12, 2017 15:17
-
-
Save deech/6fe465b67281876390dcebd2d6a60592 to your computer and use it in GitHub Desktop.
Typeclasses in the REPL.
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
GHCi, version 8.0.1: http://www.haskell.org/ghc/ :? for help | |
Loaded GHCi configuration from /tmp/ghci7261/ghci-script | |
Prelude> class Foo a where { foo :: a -> Int } | |
Prelude> instance Foo () where { foo _ = 1 } | |
Prelude> f = foo () | |
Prelude> class Foo a where { foo :: a -> IO () } | |
Prelude> f | |
1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment