[Haskell] Re: Fixed-length vectors in Haskell, Part 3: Using Fixed Enums

Yitzchak Gale gale at sefer.org
Wed May 11 16:07:18 EDT 2005


>>impossible :: Empty -> a
>>impossible _ = undefined
> 
> 
> It's unfortunate that we can't define impossible without using bottom. I 
> dislike using bottom, and here we have a function that cannot return 
> bottom unless it is passed bottom. Such functions should be definable 
> without using bottom, but this one isn't.

You may not think this is any less ugly, but here
is one way:

 >class Impossible t where impossible :: t -> a
 >instance Impossible Empty

Regards,
Yitz


More information about the Haskell mailing list