Skip to content

GHC crashes on a partial type signature

The following code crashes GHC 7.10.1 as is, but doesn't result in a crash if the signature is specified completely or isn't specified at all (inferred):

{-# LANGUAGE PartialTypeSignatures #-}
module Main where

main :: IO ()
main = return ()

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)
Edited by Artyom.Kazak
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information