Commit 60e39fad authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

Test Trac #7891 and #7903

parent cd5b6ba1
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TypeFamilies #-}
module T7891 where
newtype T = T (forall t. t -> t)
tf :: T
tf = T id
-- Can't write this type signature:
-- f :: t -> t
T f = tf
-- But with an indirection we can:
g :: t -> t
g = f
-- We can still use f as it were fully polymorphic (which is good):
a :: ()
a = f ()
b :: Char
b = f 'b'
-------------
class C t where
data F t :: *
mkF :: t -> F t
instance C () where
data F () = FUnit (forall t. t -> t)
mkF () = FUnit id
-- Can't write a type for f here either:
k :: t -> t
FUnit k = mkF ()
module T7903 where
instance Eq (((->) a) b)
instance (Ord b) => Ord (((->) a) b)
......@@ -402,3 +402,5 @@ test('T7827', normal, compile, [''])
test('T7875', normal, compile, [''])
test('T7268', normal, compile, [''])
test('T7888', normal, compile, [''])
test('T7891', normal, compile, [''])
test('T7903', normal, compile, [''])
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment