Re: Fixed-length vectors in Haskell, Part 3: Using Fixed Enums
11 May
2005
11 May
'05
8:07 p.m.
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
7779
Age (days ago)
7779
Last active (days ago)
0 comments
1 participants
participants (1)
-
Yitzchak Gale