Created
September 3, 2014 08:31
-
-
Save a-hisame/eb6bf5c03c886ef25774 to your computer and use it in GitHub Desktop.
当たり前だけれど、Eqのデフォルト実装を上書きしない場合、無限ループに陥る。
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
-- test on ghci console | |
data Present a = Redbox a | Bluebox a deriving Show | |
instance Eq (Present a) | |
let a = Redbox 10 | |
let b = Redbox 30 | |
-- never stop | |
a == b |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment