mirror of
https://github.com/ilyakooo0/Idris-dev.git
synced 2024-11-10 15:16:54 +03:00
40f6534cf0
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.
16 lines
255 B
Idris
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
|
|
|