Idris2/tests/idris2/basic/basic021/CaseDep.idr
2023-09-07 14:57:22 +01:00

10 lines
202 B
Idris

IntOrChar : Bool -> Type
IntOrChar True = Int
IntOrChar False = Char
foo : Nat -> (x : Bool) -> IntOrChar x -> String
foo num x i
= case x of
True => show num
False => show i