mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-28 06:05:56 +03:00
16 lines
286 B
Idris
16 lines
286 B
Idris
|
f : (Int -> Bool) -> Int
|
||
|
f p = case (p 0, p 1) of
|
||
|
(False, False) => 0
|
||
|
(False, True) => 1
|
||
|
(True , False) => 2
|
||
|
(True , True) => 4
|
||
|
|
||
|
il : Int
|
||
|
il = f \x => x > 0
|
||
|
|
||
|
lc : Int
|
||
|
lc = f $ \case 0 => True ; _ => False
|
||
|
|
||
|
ilc : Int
|
||
|
ilc = f \case 0 => True; _ => False
|