Created
February 13, 2013 22:24
-
-
Save luqui/4948933 to your computer and use it in GitHub Desktop.
Type unsoundness in Haskell
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
{-# LANGUAGE GeneralizedNewtypeDeriving, TypeFamilies #-} | |
-- related to http://hackage.haskell.org/trac/ghc/ticket/1496 | |
type family F a | |
type instance F Int = Int | |
type instance F X = Int -> Int | |
class Fable a where | |
fify :: a -> F a | |
instance Fable Int where | |
fify = id | |
newtype X = X Int | |
deriving Fable | |
main = print (fify (X 0) 0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment