[Haskell-cafe] Re: Laws and partial values

Henning Thielemann lemming at henning-thielemann.de
Sat Jan 24 17:56:44 EST 2009

On Sat, 24 Jan 2009, Thomas Davie wrote:

> I'm not sure why you're saying that this semantics does not capture 
> non-termination – the only change is that computations resulting in the unit 
> type *can't* non terminate, because we can always optimize them down to (). 
> Of course, if you want to be able to deal with non-termination, one could use 
> the Maybe () type!

I find the current semantics better: All types are handled the same way by 
default and whenever you want to "optimize" (undefined::()) to () you can 
    optimizeNull :: () -> ()
    optimizeNull _ = ()

More information about the Haskell-Cafe mailing list