Re: [Haskell-cafe] type and data constructors in CT

2009-02-03 Thread Gregg Reynolds
On Mon, Feb 2, 2009 at 3:27 PM, David Menendez wrote: > Does that help at all? > I think it does. But ... it gives me crazy ideas. Like: a functor is a kind of magic non-computing function! That's why they didn't call it a function? We know it maps A to FA, but we don't know how (maybe we

Re: [Haskell-cafe] type and data constructors in CT

2009-02-02 Thread David Menendez
On Sun, Feb 1, 2009 at 12:36 PM, Gregg Reynolds wrote: > On Sat, Jan 31, 2009 at 3:14 PM, David Menendez wrote: >> >> There's a paper about defining catamorphisms for GADTs and nested >> recursive types that models type constructors that way. > > If you recall a title or author I'll google it. I

Re: [Haskell-cafe] type and data constructors in CT

2009-02-02 Thread wren ng thornton
Gregg Reynolds wrote: On Sat, Jan 31, 2009 at 4:26 PM, wren ng thornton wrote: > > 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 > > c

Re: [Haskell-cafe] type and data constructors in CT

2009-02-01 Thread Gregg Reynolds
On Sat, Jan 31, 2009 at 5:11 PM, Derek Elkins wrote: >> >> 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. > > What are "elemen

Re: [Haskell-cafe] type and data constructors in CT

2009-02-01 Thread Gregg Reynolds
On Sat, Jan 31, 2009 at 4:26 PM, wren ng thornton wrote: >> 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. > > Actually no, i

Re: [Haskell-cafe] type and data constructors in CT

2009-02-01 Thread Gregg Reynolds
On Sat, Jan 31, 2009 at 3:14 PM, David Menendez wrote: > > There's a paper about defining catamorphisms for GADTs and nested > recursive types that models type constructors that way. If you recall a title or author I'll google it. >> So this gives us two functors, but they operate on different t

Re: [Haskell-cafe] type and data constructors in CT

2009-02-01 Thread Gregg Reynolds
On Sun, Feb 1, 2009 at 8:26 AM, Ben Moseley wrote: > ]> > So, the idea is that any polymorphic Haskell function (including Data > constructors) can be seen as a natural transformation - so a "function" from > any object (ie type) to an arrow (ie function). So, take "listToMaybe :: [a] > -> Maybe a

Re: [Haskell-cafe] type and data constructors in CT

2009-02-01 Thread Ben Moseley
On 31 Jan 2009, at 20:54, Gregg Reynolds wrote: On Sat, Jan 31, 2009 at 1:02 PM, Ben Moseley wrote: You can view a polymorphic unary type constructor of type ":: a -> T" as a polymorphic function. Shouldn't that be * :: a -> T a ? Yes, you're right. And when I say "polymorphic unary t

Re: [Haskell-cafe] type and data constructors in CT

2009-01-31 Thread Derek Elkins
On Sat, 2009-01-31 at 11:00 -0600, 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. The typical

Re: [Haskell-cafe] type and data constructors in CT

2009-01-31 Thread wren ng thornton
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 basical

Re: [Haskell-cafe] type and data constructors in CT

2009-01-31 Thread David Menendez
On Sat, Jan 31, 2009 at 12:00 PM, Gregg Reynolds wrote: > 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. What sort of relatio

Re: [Haskell-cafe] type and data constructors in CT

2009-01-31 Thread Gregg Reynolds
On Sat, Jan 31, 2009 at 1:02 PM, Ben Moseley wrote: > You can view a polymorphic unary type constructor of type ":: a -> T" as a > polymorphic function. Shouldn't that be * :: a -> T a ? > In general, polymorphic functions correspond roughly to natural > transformations (in this case from the i

Re: [Haskell-cafe] type and data constructors in CT

2009-01-31 Thread Ben Moseley
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 thi

[Haskell-cafe] type and data constructors in CT

2009-01-31 Thread Gregg Reynolds
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