Lambda the Ultimate

inactiveTopic Category theory for non-mathematicians
started 8/20/2001; 1:48:22 PM - last post 8/27/2001; 2:04:14 AM
Ehud Lamm - Category theory for non-mathematicians  blueArrow
8/20/2001; 1:48:22 PM (reads: 2761, responses: 4)
Category theory for non-mathematicians
Book suggestions on comp.lang.functional.
Posted to Misc-Books by Ehud Lamm on 8/20/01; 1:48:38 PM

jon fernquest - Re: Category theory for non-mathematicians  blueArrow
8/21/2001; 12:56:54 AM (reads: 2033, responses: 0)
Are there any books in which programming and the math (category theory) are developed in parallel? Like a book on category theory with actual ML code?

All the books I've seen are either pure abstract math (i.e. theorem / proof) or functional programming with at most a cursory reference to category theory, like "A fold function is a catamorphism."

Also is there any glossary out there that relates different language constructs and category theory terminology? Like "Monad" seems to be strongly attached to Haskell and the writings of Wadler. Never seen "Monad" in CAML code. Monads seem to have a parallel in Scheme closures, but I've never seen anyone make this analogy.

Cheers,

Jon Fernquest

More Questions: Will there ever be a unified theory of computer programming or will programmers always be tied to an eternal wheel of language advocacy, myopia, and obsolescence? Is there any code that will last forever? Is all code destined to be thrown away? What is the maximum lifespan of any artifact created by a programmer artisan? Will future programming archaeologists unearth long forgotten creations?

Chris Rathman - Re: Category theory for non-mathematicians  blueArrow
8/21/2001; 7:29:34 AM (reads: 2010, responses: 0)
Is there any code that will last forever?
There's lots of code that's destined to last forever. Unfortunately it's all written in COBOL.

Is all code destined to be thrown away?
One can hope!!! :-)

Oleg - Monads everywhere  blueArrow
8/24/2001; 8:36:10 PM (reads: 1985, responses: 0)
Like "Monad" seems to be strongly attached to Haskell and the writings of Wadler. Never seen "Monad" in CAML code.

Monadic programming is indeed very convenient in Haskell, thanks to type classes. It is certainly possible in ML, for example,

http://groups.google.com/groups?selm=r8td785em7f.fsf%40chinstrap.CS.Princeton.EDU

You can program monadically even in Unix shell! It is rather common, actually. Everybody who piped "echo" or "cat" into another program did monadic programming!

http://pobox.com/~oleg/ftp/Computation/monadic-shell.html

Monads seem to have a parallel in Scheme closures, but I've never seen anyone make this analogy.

Monadic programming is closely related to "staging." You first write code (a "compiler") that creates a sequence of "commands". Afterwards, you execute the commands. The two passes are apparent. The command executor is a strict evaluator (whereas the evaluator that creates a "command stream" may be lazy). To achieve such staging in Scheme -- i.e., to create a "command" to be evaluated later -- you typically wrap it into a closure (or use 'delay' to make it a promise). Any "instruction" stream can be regarded as a "monad", providing the stream is associative and the instruction set contains a no-op "instruction" that can be dropped from the instruction stream with impunity.

see also the third paragraph of

http://groups.google.com/groups?selm=8d8kd2%24sr4%241%40nnrp1.deja.com

jon fernquest - Re: Category theory for non-mathematicians  blueArrow
8/27/2001; 2:04:14 AM (reads: 1954, responses: 0)
Re: Oleg's Response:

Thanks for the insights (that can't be found in any book).

I'm one step closer to getting the generalized tree traversal strategies that use monads and folds discussed in an earlier "Lambda the Ultimate" thread "Generic Programming in Haskell" working in Scheme.

Cheers,

Jon Fernquest

Searching for programming ideas that can be used across multiple programming languages.