Dominic Steinitz dominic.steinitz at blueyonder.co.uk
Thu Mar 29 16:18:40 EDT 2007

> On 3/27/07, Dave at haskell.org <Dave at haskell.org> wrote:
> > Given the amount of material posted at haskell.org and elsewhere
> > explaining IO, monads and functors, has anyone considered publishing
> > a comprehensive book explaining those subjects?  (I am trying to
> > read all the material online, but books are easier to read and don't
> > require sitting in front of a computer to do so. Plus I can write in
> > books :-). )
>
> I've thought about writing extended tutorials on the relationship
> between Haskell programming and category theory but there's a problem
> I run into. It's tempting to make the identifications:
> types<->objects, Haskell function<->arrows, suitably polymorphic
> functions<->natural transformations, and so on. But the fact is, this
> doesn't really work in the obvious way even though it seems like it
> should at first (eg. Haskell functions aren't always total functions
> in the mathematical sense and if you allow partial functions you can
> do weird stuff). So either:
>
> (1) we need some technical work to patch up the differences (and
> unfortunately I don't know what the patch-up is),
> (2) we restrict ourselves to certain types of Haskell function for
> which the theory works or
> (3) we deliberately leave things a little vague.
>
> I usually tend to go for option (3), but that wouldn't be satisfactory
> for an extended treatment.
>
> Has anyone else given this subject much thought?
> --
> Dan
Dan,

It's a long time since I looked at this so this might be a complete red
herring but have you thought about using the category of \omega-CPOs. Types
are then objects (\omega-cpos) and functions are then arrows (continuous
functions in the \omega-cpo sense).

These papers may be of use:
1. Meijer http://research.microsoft.com/~emeijer/Papers/CWIReport.pdf
2. Mitchell Wand: Fixed-Point Constructions in Order-Enriched Categories
3. Freyd: Recursive Types Reduced to Inductive Types.

Dominic.