Idris2/tests/idris2/total011/Issue1859-2.idr
2021-08-27 16:18:24 +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 ()