Ticket #1807: Test2.hs
| File Test2.hs, 404 bytes (added by Remi, 6 years ago) |
|---|
| Line | |
|---|---|
| 1 | {-# LANGUAGE TypeFamilies, GADTs, KindSignatures, TypeOperators, RankNTypes, FlexibleContexts #-} |
| 2 | module Foo where |
| 3 | |
| 4 | data Equal a b = (b ~ a) => Refl |
| 5 | |
| 6 | foo :: forall a b. ((a ~ b) => a -> b -> Bool) -> Equal a b -> a -> b -> Bool |
| 7 | foo f Refl a b = f a b |
| 8 | |
| 9 | x :: Eq b => Equal a b -> a -> b -> Bool |
| 10 | x = foo (==) |
| 11 | |
| 12 | -- Doesn't typecheck |
| 13 | {- |
| 14 | y :: Eq a => Equal a b -> a -> b -> Bool |
| 15 | y = foo (==) |
| 16 | -} |
