[Haskell-cafe] Category theory as a design tool

Alexander Solla alex.solla at gmail.com
Thu Jun 23 22:30:31 CEST 2011


On Thu, Jun 23, 2011 at 1:15 PM, wren ng thornton <wren at freegeek.org> wrote:

>
>
> To put a different spin on it, in the dual case we can show that Haskell's
> (,) is not a categorical product. There's a good deal of historical debate
> about why it works the way it does, but if we're looking to make a better
> system then the fact that tuples are not well-behaved suggests a place for
> improvement. The current (,) is a compromise between two different notions
> of product in domain theory. On the one hand we have domain products
> (which do not produce domains) and on the other hand we have smash
> products (which can "lose" information). I've had in mind for a while to
> make a Haskell-like language with a total functional core. In a total
> language (even a lazy one), we don't have bottom so we don't need domain
> theory to reason about the language. So in a language which is only
> partially total, it's reasonable to have two different kinds of
> products--- which means we can get away from Haskell's compromise, but do
> so in a way that's harmonious with the rest of the language. Would this
> new system be "better"? I dunno. It would behave in a more lawful manner,
> so it should be easier to reason about; but then we're making programmers
> keep that reasoning in mind, and maybe that's too much work. A decent
> system has to be both correct but also usable, and human factors are messy
> and hard to predict.
>


Please read "Fast and Loose Reasoning is Morally Correct".
http://www.comlab.ox.ac.uk/people/jeremy.gibbons/publications/fast+loose.pdf

As I have told you before, it is perfectly appropriate to ignore
bottom-the-type and bottoms-the-inexpressible proto-values to recover the
categorical product semantics of (,).  It's not even hard.  It will make
your life easier.  All you have to do is apply an equivalence relation that
considers all bottom-proto-values as equivalent.  Domain theory is an
unnecessary complication.  All bottoms have the same semantics anyway --
they all diverge.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20110623/6171176b/attachment.htm>


More information about the Haskell-Cafe mailing list