[Haskell-cafe] Re: ANN: data-category, restricted categories

Dan Doel dan.doel at gmail.com
Wed Mar 31 05:16:51 EDT 2010


On Tuesday 30 March 2010 4:34:10 pm Ashley Yakeley wrote:
> Worse than that, if bottom is a value, then Hask is not a category! Note
> that while undefined is bottom, (id . undefined) and (undefined . id)
> are not.

Hask can be a category even if bottom is a value, with slight modification. 
That specific problem can be overcome by eliminating seq (and associated 
stuff; strict fields, bang patterns, ...), because it is the only thing in the 
language that can distinguish between the extensionally equal:

  undefined
  \_ -> undefined

the latter being what you get from id . undefined and undefined . id.

Bottom, or more specifically, lifted types, tend to ruin other nice 
categorical constructions, though. Lifted sums are not Hask coproducts, lifted 
products are not Hask products, the "empty" type is terminal, rather than 
initial, and () isn't terminal. But, if we ignore bottoms, these deficiencies 
disappear.

See, of course, Fast and Loose Reasoning is Morally Correct. *

-- Dan

[*] http://www.comlab.ox.ac.uk/jeremy.gibbons/publications/fast+loose.pdf


More information about the Haskell-Cafe mailing list