mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-26 13:11:30 +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
|