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

Type families: Tricky GADT/RankN/TF example

parent 2f5cacd8
{-# LANGUAGE TypeFamilies, TypeOperators, GADTs, RankNTypes, FlexibleContexts #-}
module Equality( (:=:), eq_elim, eq_refl ) where
data a:=: b where
EQUAL :: a :=: a
eq_refl :: a :=: a
eq_refl = EQUAL
eq_elim :: (a~b) => a :=: b -> (a~b => p) -> p
eq_elim EQUAL p = p
......@@ -69,6 +69,7 @@ test('GADT10', expect_fail, compile, [''])
test('GADT11', normal, compile, [''])
test('GADT12', expect_fail, compile, [''])
test('GADT13', expect_fail, compile, [''])
test('GADT14', normal, compile, [''])
test('Class1', normal, compile, [''])
test('Class2', 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