Idris2/tests/idris2/basic050/Ilc.idr

16 lines
286 B
Idris
Raw Normal View History

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