Last active
August 29, 2015 14:25
-
-
Save hiroshi-maybe/25b84a1879b0a0776ab8 to your computer and use it in GitHub Desktop.
Type class default implementation
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
| class MyEq a where | |
| equalsTo :: a -> a -> Bool | |
| equalsTo x y = not (notEqualsTo x y) | |
| notEqualsTo :: a -> a -> Bool | |
| notEqualsTo x y = not (equalsTo x y) | |
| instance MyEq Integer where | |
| equalsTo x y = x == y | |
| main = do putStrLn (show $ notEqualsTo (1::Integer) (2::Integer)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment