Commit e8d8c2e9 authored by chak@cse.unsw.edu.au.'s avatar chak@cse.unsw.edu.au.

Type families: Roman's test for normalisation of reduced dicts

parent 97621295
{-# LANGUAGE TypeFamilies, FlexibleContexts #-}
{-# LANGUAGE EmptyDataDecls, FlexibleInstances #-}
module InstContextNorm
where
data EX _x _y (p :: * -> *)
data ANY
class Base p
class Base (Def p) => Prop p where
type Def p
instance Base ()
instance Prop () where
type Def () = ()
instance (Base (Def (p ANY))) => Base (EX _x _y p)
instance (Prop (p ANY)) => Prop (EX _x _y p) where
type Def (EX _x _y p) = EX _x _y p
data FOO x
instance Prop (FOO x) where
type Def (FOO x) = ()
data BAR
instance Prop BAR where
type Def BAR = EX () () FOO
......@@ -95,6 +95,8 @@ test('InstEqContext2', if_compiler_lt('ghc', '6.9', expect_fail),
compile, [''])
test('InstEqContext3', normal, compile, [''])
test('InstContextNorm', if_compiler_lt('ghc', '6.9', expect_fail), compile, [''])
test('HO', normal, compile, [''])
test('GivenCheck', 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