[Haskell-cafe] Re: Laws and partial values

Henning Thielemann lemming at henning-thielemann.de
Sat Jan 24 16:19:39 EST 2009


On Sat, 24 Jan 2009, Thomas Davie wrote:

> On 24 Jan 2009, at 21:31, Dan Doel wrote:
>
>> For integers, is _|_ equal to 0? 1? 2? ...
> Hypothetically (as it's already been pointed out that this is not the case in 
> Haskell), _|_ in the integers would not be known, until it became more 
> defined.  I'm coming at this from the point of view that bottom would contain 
> all the information we could possibly know about a value  while still being 
> the least value in the set.
>
> In such a scheme, bottom for Unit would be (), as we always know that the 
> value in that type is (); bottom for pairs would be (_|_, _|_), as all pairs 
> look like that (this incidentally would allow fmap and second to be equal on 
> pairs); bottom for integers would contain no information, etc.

Zero- and one-constructor data types would then significantly differ from 
two- and more-constructor data types, wouldn't they?


More information about the Haskell-Cafe mailing list