Last active
August 29, 2015 14:20
-
-
Save int-index/bf5cd1a200257a53c0fc to your computer and use it in GitHub Desktop.
GHC 7.10 bug
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 PartialTypeSignatures #-} | |
module Main where | |
data I a = I a | |
instance Functor I where | |
fmap f (I a) = I (f a) | |
newtype B t a = B a | |
instance Functor (B t) where | |
fmap f (B a) = B (f a) | |
newtype H f = H (f ()) | |
app :: H (B t) | |
app = h (H . I) (B ()) | |
h :: _ | |
--h :: Functor m => (a -> b) -> m a -> H m | |
h f b = (H . fmap (const ())) (fmap f b) | |
-- the compiler crashes if the signature is partial (involves underscores) | |
-- | |
-- it does not crash if the signature is specified completely or isn't | |
-- specified at all (inferred) |
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
Bug.hs:15:10: | |
Couldn't match type `b' with `H I' | |
`b' is untouchable | |
inside the constraints () | |
bound by the type signature for app :: H (B t) | |
at Bug.hs:14:8-14ghc: panic! (the 'impossible' happened) | |
(GHC version 7.10.1 for x86_64-unknown-linux): | |
No skolem info: b_a3gc[sk] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment