Created
January 28, 2020 13:42
-
-
Save monadplus/e4cd788c3ca8675d7c84a8f755065205 to your computer and use it in GitHub Desktop.
Incoherent: use it with care
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 Foo a where | |
foo :: a -> Int | |
instance Foo Char where | |
foo _ = 2 | |
instance {-# INCOHERENT #-} Foo a where | |
foo _ = 3 | |
incoherent :: Char -> Bool | |
incoherent x = foo x /= foo' x | |
where | |
foo' :: (Foo a) => a -> Int | |
foo' = foo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment