Idris2/tests/idris2/total011/Issue1859-2.idr

12 lines
227 B
Idris
Raw Normal View History

2021-08-27 18:18:24 +03:00
%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 ()