Commit 3870919a authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

Test Trac #4178

parent 5520f790
{-# LANGUAGE
FlexibleContexts,
Rank2Types,
TypeFamilies,
MultiParamTypeClasses,
FlexibleInstances #-}
-- See Trac #4178
module T4178 where
data True = T
data False = F
class Decide tf a b where
type If tf a b
nonFunctionalIf :: tf -> a -> b -> If tf a b
instance Decide True a b where
type If True a b = a
nonFunctionalIf T a b = a
instance Decide False a b where
type If False a b = b
nonFunctionalIf F a b = b
useRank2 :: (forall a . a -> b) -> b
useRank2 f = f "foo"
hasTrouble a = nonFunctionalIf F a (2 :: Int)
blurg = useRank2 hasTrouble
hasNoTrouble :: a -> Int
hasNoTrouble = hasTrouble
blurg2 = useRank2 hasNoTrouble
......@@ -149,6 +149,3 @@ test('IndTypesPerf',
test('T4120', normal, compile_fail, [''])
test('T3787', reqlib('mtl'), compile, [''])
test('T3826', normal, compile, [''])
test('T4200', normal, compile, [''])
test('T3851', 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