[Haskell-cafe] type and data constructors in CT
Gregg Reynolds
dev at mobileink.com
Sat Jan 31 12:00:09 EST 2009
Hi,
I think I've finally figured out what a monad is, but there's one
thing I haven't seen addressed in category theory stuff I've found
online. That is the relation between type constructors and data
constructors.
As I understand it, a type constructor Tcon a is basically the object
component of a functor T that maps one Haskell type to another.
Haskell types are construed as the objects of category "HaskellType".
I think that's a pretty straightforward interpretation of the CT
definition of functor.
But a data constructor Dcon a is an /element/ mapping taking elements
(values) of one type to elements of another type. So it too can be
construed as a functor, if each type itself is construed as a
category.
So this gives us two functors, but they operate on different things,
and I don't see how to get from one to the other in CT terms. Or
rather, they're obviously related, but I don't see how to express that
relation formally.
If somebody could point me in the right direction I'd be grateful.
Might even write a tutorial. Can't have too many of those.
Thanks,
Gregg
More information about the Haskell-Cafe
mailing list