[Haskell-beginners] function - argument termination problem

Chaddaï Fouché chaddai.fouche at gmail.com
Wed Sep 2 14:46:35 EDT 2009


2009/9/2 Magnus Therning <magnus at therning.org>:
>> 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?
>>
>> Thanks in advance :-),
>
> Isn't this the halting problem?

It is, since to ensure that f terminates and evaluates to a given
value for every A that do not terminate it must be able to determine
that it don't terminate in finite time, thus solving the halting
problem.

In other words this can't be written in Haskell and a fortiori can't
be written on a computer in any language.

-- 
Jedaï


More information about the Beginners mailing list