1 {-# OPTIONS -fglasgow-exts #-}
\r
3 --!!! Rank 2 polymorphism
\r
4 -- Both f and g are rejected by Hugs [April 2001]
\r
8 data T = T { t1 :: forall a. a -> a , t2 :: forall a b. a->b->b }
\r
10 -- Test pattern bindings for polymorphic fields
\r
11 f :: T -> (Int,Char)
\r
12 f t = let T { t1 = my_t1 } = t
\r
14 (my_t1 3, my_t1 'c')
\r
16 -- Test record update with polymorphic fields
\r
18 g t = t { t2 = \x y -> y }
\r