Re: [Haskell-cafe] Why monad tutorials don't work

On 8/14/07, Dan Weston
Conor McBride and Ross Paterson said it best in the introduction to their paper "Applicative programming with effects" [1]:
As von Neumann said: "Young man, in mathematics you don't understand
things, you just get used to them."
Getting used to something is, practically by definition, something
that you can't do just by reading the ultimate tutorial. You just have
to write the code, see the pattern happen again and again, and
abstract it. There's no short cut. (Well...sometimes...)
On 8/14/07, Michael Vanier
I'm reminded of a physics teacher who was having a similar problem explaining the concept of tensors, until he said that "a tensor is something that transforms like a tensor does!".
Grrr...must...hold...my...tongue... -- Dan

On Tue, 2007-08-14 at 16:02 -0700, Dan Piponi wrote: . . .
On 8/14/07, Michael Vanier
wrote: I'm reminded of a physics teacher who was having a similar problem explaining the concept of tensors, until he said that "a tensor is something that transforms like a tensor does!".
Grrr...must...hold...my...tongue...
Dan, as a former student of a clone of that physics teacher, I am really interested in what you will say when you fail to hold your tongue. -- Bill Wood

Bill Wood wrote:
On Tue, 2007-08-14 at 16:02 -0700, Dan Piponi wrote: . . .
On 8/14/07, Michael Vanier
wrote: I'm reminded of a physics teacher who was having a similar problem explaining the concept of tensors, until he said that "a tensor is something that transforms like a tensor does!". Grrr...must...hold...my...tongue...
Dan, as a former student of a clone of that physics teacher, I am really interested in what you will say when you fail to hold your tongue.
-- Bill Wood
I have to admit I was wondering the same thing myself. Mike

Grrr...must...hold...my...tongue...
Dan, as a former student of a clone of that physics teacher, I am really interested in what you will say when you fail to hold your tongue.
-- Bill Wood
MV> I have to admit I was wondering the same thing myself. So was I.

Miguel Mitrofanov
Grrr...must...hold...my...tongue...
Dan, as a former student of a clone of that physics teacher, I am really interested in what you will say when you fail to hold your tongue.
-- Bill Wood
MV> I have to admit I was wondering the same thing myself.
So was I.
I'm guessing that Dan means that thinking of tensors as things that transform between co-ordinate systems in a certain way (e.g. via the Jacobian of the transition maps) isn't a terribly good way of thinking about them. Vector fields, co-vector fields and tensor fields are really co-ordinate independent notions and the transformation laws (if I may call them that) are a consequence of the way they transform under (smooth) maps. But perhaps this is better discussed on a differential geometry mailing list? Dominic.

On Wed, Aug 15, 2007 at 12:50:42PM +0000, Dominic Steinitz wrote:
Miguel Mitrofanov
writes: Grrr...must...hold...my...tongue...
Dan, as a former student of a clone of that physics teacher, I am really interested in what you will say when you fail to hold your tongue.
MV> I have to admit I was wondering the same thing myself.
So was I.
I'm guessing that Dan means that thinking of tensors as things that transform between co-ordinate systems in a certain way (e.g. via the Jacobian of the transition maps) isn't a terribly good way of thinking about them. Vector fields, co-vector fields and tensor fields are really co-ordinate independent notions and the transformation laws (if I may call them that) are a consequence of the way they transform under (smooth) maps. But perhaps this is better discussed on a differential geometry mailing list?
I assumed he was just trying not to sing the "Spider Pig" song. ( http://uk.youtube.com/watch?v=5XQ_GWKvDE0 ) ;-) -- Andy Gimblett Computer Science Department University of Wales Swansea http://www.cs.swan.ac.uk/~csandy/

On 8/15/07, Andy Gimblett
I assumed he was just trying not to sing the "Spider Pig" song.
I've been banned from singing that around the house. And the cat version. But I was mainly thinking about how the physicist's definition of tensor needn't be accepted as an irreducible given, but is a consequence of the definition of tensor product through its universal property: http://planetmath.org/encyclopedia/TensorProduct.html Having said that, I still completely agree with Michael that tensors are a great analogy for monads because I found the concept of a universal property tricky in the same way that I subsequently found monads tricky. BTW I think the concept of a universal property is probably the single most useful idea from category theory that can be used in Haskell programming. I recommend it to everyone :-) -- Dan

Dan Piponi wrote:
But I was mainly thinking about how the physicist's definition of tensor needn't be accepted as an irreducible given, but is a consequence of the definition of tensor product through its universal property: http://planetmath.org/encyclopedia/TensorProduct.html
Having said that, I still completely agree with Michael that tensors are a great analogy for monads because I found the concept of a universal property tricky in the same way that I subsequently found monads tricky. BTW I think the concept of a universal property is probably the single most useful idea from category theory that can be used in Haskell programming. I recommend it to everyone :-)
If only my Linear Algebra professor had just uttered the magic words: "For all R-modules M, the functor (-) * M is left-adjoint to the functor Hom(M,-)" I could have just skipped out on the entire semester. Why are teachers always so long-winded? The above is so much clearer! That the above is "the single most useful idea from category theory that can be used in Haskell programming" is so obvious, it belongs in a tutorial titled "You too could have invented Universal Algebra and Category Theory". I nominate Dan Piponi to write it and eagerly await its release! Dan Weston

On 8/15/07, Dan Weston
"You too could have invented Universal Algebra and Category Theory". I nominate Dan Piponi to write it and eagerly await its release!
I've already started on it. Well, that's not the exact title and subject. And as an example I'll probably use the definition of tensor product that I linked to, not the even more compact and elegant one that you just gave. I'm a strong believer that lots of (but not all) tricky looking mathematics is just fancy language for intuitions that people already have. I suspect that most computer scientists already have much of the intuition behind the idea of a universal property, and that it is in fact easier to grasp for a computer scientist than a mathematician. :-) -- Dan

At this point I must mention that Tim Gowers has an excellent article on Tensor Products, entitled "How to lose your fear of tensor products": http://www.dpmms.cam.ac.uk/~wtg10/tensors3.html Tim Gowers is a pretty ok mathematician - worth taking tips from, I'd say ;) http://en.wikipedia.org/wiki/William_Timothy_Gowers On Wed, 15 Aug 2007, Dan Piponi wrote:
On 8/15/07, Dan Weston
wrote: "You too could have invented Universal Algebra and Category Theory". I nominate Dan Piponi to write it and eagerly await its release!
I've already started on it. Well, that's not the exact title and subject. And as an example I'll probably use the definition of tensor product that I linked to, not the even more compact and elegant one that you just gave.
I'm a strong believer that lots of (but not all) tricky looking mathematics is just fancy language for intuitions that people already have. I suspect that most computer scientists already have much of the intuition behind the idea of a universal property, and that it is in fact easier to grasp for a computer scientist than a mathematician.
:-) -- Dan _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Dan Piponi
On 8/15/07, Dan Weston
wrote: "You too could have invented Universal Algebra and Category Theory". I nominate Dan Piponi to write it and eagerly await its release!
I've already started on it. Well, that's not the exact title and subject. And as an example I'll probably use the definition of tensor product that I linked to, not the even more compact and elegant one that you just gave.
I'm a strong believer that lots of (but not all) tricky looking mathematics is just fancy language for intuitions that people already have. I suspect that most computer scientists already have much of the intuition behind the idea of a universal property, and that it is in fact easier to grasp for a computer scientist than a mathematician.
-- Dan
Some universal properties (initial algebras and final co-algebras) are covered in Functional Programming with Bananas, Lenses, Envelopes and Barbed Wire (1991) (http://citeseer.ist.psu.edu/meijer91functional.html). And of course there's Wadler's Theorems for Free. Dominic.
participants (8)
-
Andy Gimblett
-
Bill Wood
-
Dan Piponi
-
Dan Weston
-
Dipankar Ray
-
Dominic Steinitz
-
Michael Vanier
-
Miguel Mitrofanov