[Haskell-cafe] Re: Laws and partial values

Thomas Davie tom.davie at gmail.com
Sat Jan 24 16:31:54 EST 2009


On 24 Jan 2009, at 22:19, Henning Thielemann wrote:

>
> 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?

Yes, they would, but not in any way that's defined, or written in, the  
fact that they have a nice property of being able to tell something  
about what bottom looks like is rather nice actually.

Bob


More information about the Haskell-Cafe mailing list