
On Thu, Jul 28, 2011 at 21:26, Jake Penton
Does that mean then that there is no definition possible of f other than 'undefined'? I mean this compiles:
f::a f = undefined
But is there any other possible second line defining f?
Only more complicated forms of the same thing:
f = error "impossible value" f = let x = x in x -- infinite evaluation
You'll occasionally see discussion of the role of "bottom" in the language; that's what this is. Technically, bottom is the least defined value of a type, and since in standard Haskell all types are "lifted" (their values are computed via thunks of some kind; this is what enables laziness) bottom inhabits every type, and is the only "value" that does so. (Various extensions introduce and make use of unlifted types, which are always strict; as such, they can never really be bottom, as any attempt to use bottom in the context of an unlifted type leads to a runtime error, infinite loop, crash, or other form of nontermination.) -- brandon s allbery allbery.b@gmail.com wandering unix systems administrator (available) (412) 475-9364 vm/sms