summaryrefslogtreecommitdiff
path: root/testsuite/tests/impredicative/T2193.hs
blob: dee542c65c622ddccf03de6d6ab7807630122377 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{-# LANGUAGE ImpredicativeTypes  #-}

-- Sept 16: now scraping through with -XImpredicateTypes

module Main where

data Foo x y = Foo {foo1 :: x, foo2 :: y}
instance Functor (Foo x) where
    fmap f (Foo x y) = Foo x (f y)

bar :: a -> Foo (forall s. s) a
bar a = Foo undefined a

main = print (foo2 (fmap (*2) (bar 2)))