Idris-dev/test/reg055/reg055a.idr
Edwin Brady 40f6534cf0 Better typecase check
Only allow matching on polymorphic arguments if they have been refined
to something concrete due to some other argument by the time they're
elaborated.
2014-12-22 11:22:42 +00:00

16 lines
255 B
Idris

module Foo
data Cheat : Type -> Type where
CAny : a -> Cheat a
CInt : Cheat Int
foo : Cheat a -> Int
foo (CAny Nothing) = 42
foo (CAny (Just x)) = 43
foo CInt = 0
apply : (a -> a -> b) -> a -> a
apply (\x => \y => x) a = a
apply f a = a