[Haskell-cafe] category design approach for inconvenient concepts
Christopher Howard
christopher.howard at frigidcode.com
Tue Dec 18 23:03:22 CET 2012
On 12/17/2012 06:30 PM, Richard O'Keefe wrote:
>
> On 18/12/2012, at 3:45 PM, Christopher Howard wrote:
>
> It's basically the very old idea that an Abstract Data Type
> should be a nice algebra: things that look as though they
> ought to fit together should just work, and rearrangements
> of things ought not to change the semantics in surprising
> ways (i.e., Don't Be SQL).
>
>
>
> Categories contain two things:
> "objects"
> and "arrows" that connect objects. Some important things about arrows:
> - for any object x there must be an identity id<x> : x -> x
> - any two compatible arrows must compose in one and only one way:
> f : x -> y & g : y -> z => g . f : x -> z
> - composition must be associative (f . g) . h = f . (g . h)
> when the arrows fit together.
>
> Of course for any category there is a dual category,
> so what I'm about to say doesn't really make sense,
> but there's sense in it somewhere: the things you are
> trying to hook together with your <.> operator seem to me more
> like objects than arrows, and it does not seem as if
> they hook together in one and only one way, so it's not so
> much _associativity_ being broken, as the idea of <.> being
> a composition in the first place.
>
>
Since I received the two responses to my question, I've been trying to
think deeply about this subject, and go back and understand the core
ideas. I think the problem is that I really don't have a clear
understanding of the basics of category theory, and even less clear idea
of the connection to Haskell programming. I have been reading every link
I can find, but I'm still finding the ideas of "objects" and especially
"morphisms" to be quite vague.
The original link I gave
<http://www.haskellforall.com/2012_08_01_archive.html> purposely skipped
over any discussion of objects, morphisms, domains, and codomains. The
author stated, in his first example, that "Haskell functions" are a
category, and proceeded to describe function composition. But here I am
confused: If "functions" are a category, this would seem to imply (by
the phrasing) that functions are the objects of the category. However,
since we compose functions, and only morphisms are composed, it would
follow that functions are actually morphisms. So, in the "function"
category, are functions objects or morphisms? If they are morphisms,
then what are the objects of the category?
--
frigidcode.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 553 bytes
Desc: OpenPGP digital signature
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20121218/a346897b/attachment.pgp>
More information about the Haskell-Cafe
mailing list