[Haskell-cafe] type and data constructors in CT
Ben Moseley
ben_moseley at mac.com
Sat Jan 31 14:02:19 EST 2009
You can view a polymorphic unary type constructor of type ":: a -> T"
as a polymorphic function.
In general, polymorphic functions correspond roughly to natural
transformations (in this case from the identity functor to T).
--Ben
On 31 Jan 2009, at 17:00, Gregg Reynolds wrote:
> 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
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
More information about the Haskell-Cafe
mailing list