[Haskell-beginners] function - argument termination problem

Γιάννης Μαντζουράτος giannismantz at gmail.com
Wed Sep 2 11:48:27 EDT 2009


Hello,

Is it possible to implement in haskell a function f (A) such that if A
does not ever terminate then f always terminates, and if A always
terminates then f does not ever terminate? I've been thinking it for a
while, with no results unfortunately. the actual problem is that i can
think of no way to force both ifs: a function that always terminates
independently from its argument could be f (a) = 1, and a function
that does not terminate even if its argument terminates could be: f
(a) = f (a + 1), but i can't figure out a "hybrid" version... Is there
any idea on this?

Thanks in advance :-),
yannis


More information about the Beginners mailing list