Idris2/tests/idris2/total/total011/Issue1859-2.idr
2023-09-07 14:57:22 +01:00

12 lines
227 B
Idris

%default total
tailRecId : (a -> Either a b) -> a -> b
tailRecId f a = case f a of
Left a2 => tailRecId f a2
Right b => b
iamvoid : Void
iamvoid = tailRecId go ()
where go : () -> Either () Void
go () = Left ()