Monad/Functor Book

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Monad/Functor Book

Dave-86
Given the amount of material posted at haskell.org and elsewhere
explaining IO, monads and functors, has anyone considered publishing
a comprehensive book explaining those subjects?  (I am trying to
read all the material online, but books are easier to read and don't
require sitting in front of a computer to do so. Plus I can write in
books :-). )

Thanks, Dave Feustel
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Monad/Functor Book

Creighton Hogg-4


On 3/27/07, [hidden email] <[hidden email]> wrote:
Given the amount of material posted at haskell.org and elsewhere
explaining IO, monads and functors, has anyone considered publishing
a comprehensive book explaining those subjects?  (I am trying to
read all the material online, but books are easier to read and don't
require sitting in front of a computer to do so. Plus I can write in
books :-). )

Well, how much in depth are you interested in getting?  I started reading Categories for the Working Mathematician a couple of months ago, and while it sometimes takes a bit of work it's a very good introduction.  The only caution I have is that if you don't have that strong of a math background, or hadn't done it in a few years (like myself), you may have to lookup a lot of definitions in order to understand his examples.  Wikipedia usually provides enough of a detailed description that you can get the point.



_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Monad/Functor Book

Dan Piponi-2
In reply to this post by Dave-86
On 3/27/07, [hidden email] <[hidden email]> wrote:
> Given the amount of material posted at haskell.org and elsewhere
> explaining IO, monads and functors, has anyone considered publishing
> a comprehensive book explaining those subjects?  (I am trying to
> read all the material online, but books are easier to read and don't
> require sitting in front of a computer to do so. Plus I can write in
> books :-). )

I've thought about writing extended tutorials on the relationship
between Haskell programming and category theory but there's a problem
I run into. It's tempting to make the identifications:
types<->objects, Haskell function<->arrows, suitably polymorphic
functions<->natural transformations, and so on. But the fact is, this
doesn't really work in the obvious way even though it seems like it
should at first (eg. Haskell functions aren't always total functions
in the mathematical sense and if you allow partial functions you can
do weird stuff). So either:

(1) we need some technical work to patch up the differences (and
unfortunately I don't know what the patch-up is),
(2) we restrict ourselves to certain types of Haskell function for
which the theory works or
(3) we deliberately leave things a little vague.

I usually tend to go for option (3), but that wouldn't be satisfactory
for an extended treatment.

Has anyone else given this subject much thought?
--
Dan
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Monad/Functor Book

Andrzej Jaworski
In reply to this post by Creighton Hogg-4
> Categories for the Working Mathematician a couple of months ago, and while
> it sometimes takes a bit of work it's a very good introduction.  The only
> caution I have is that if you don't have that strong of a math background,
> or hadn't done it in a few years (like myself), you may have to lookup a
lot
> of definitions in order to understand his examples.  Wikipedia usually
> provides enough of a detailed description that you can get the point.

Good lack to you but this is very bad advice. It is too much even for average
mathematician.
As a serious first read for CS guy I would recommend Categories for Types by Roy Crole.
For short introduction: Basic Category Theory for Computer Scientists by Benjamin Pierce.

The problem with learning CT lies in the large amount of mathematical intuition that is
assumed. This intuition can be build by studing topology and algebra. Learning CT without
this background is kind of a Turing test;-)

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Monad/Functor Book

Creighton Hogg-4
In reply to this post by Dan Piponi-2


On 3/27/07, Dan Piponi <[hidden email]> wrote:
On 3/27/07, [hidden email] <[hidden email]> wrote:
> Given the amount of material posted at haskell.org and elsewhere
> explaining IO, monads and functors, has anyone considered publishing
> a comprehensive book explaining those subjects?  (I am trying to
> read all the material online, but books are easier to read and don't
> require sitting in front of a computer to do so. Plus I can write in
> books :-). )

I've thought about writing extended tutorials on the relationship
between Haskell programming and category theory but there's a problem
I run into. It's tempting to make the identifications:
types<->objects, Haskell function<->arrows, suitably polymorphic
functions<->natural transformations, and so on. But the fact is, this
doesn't really work in the obvious way even though it seems like it
should at first (eg. Haskell functions aren't always total functions
in the mathematical sense and if you allow partial functions you can
do weird stuff). So either:

(1) we need some technical work to patch up the differences (and
unfortunately I don't know what the patch-up is),
(2) we restrict ourselves to certain types of Haskell function for
which the theory works or
(3) we deliberately leave things a little vague.

I usually tend to go for option (3), but that wouldn't be satisfactory
for an extended treatment.

Has anyone else given this subject much thought?

I consider myself to be distinctly in the target audience of a thorough treatment of CT & it's relationship to Haskell, so I'll throw out there that I think some superposition of options (2) and (3) would be the most satisfying.  You can handwave a little bit, but knowing *where* the naive mappings between category theoretic constructs and Haskell's system breakdown would be very nice.  Personally, one of the biggest things for me is not really having any intuition for what kind of category the Haskell type system lives in.  I mean, it looks cartesian closed because you can do currying but what more to it is there than that?



_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Monad/Functor Book

Derek Elkins
Creighton Hogg wrote:

>
>
> On 3/27/07, *Dan Piponi* <[hidden email] <mailto:[hidden email]>>
> wrote:
>
>     On 3/27/07, [hidden email] <mailto:[hidden email]>
>     <[hidden email] <mailto:[hidden email]>> wrote:
>      > Given the amount of material posted at haskell.org
>     <http://haskell.org> and elsewhere
>      > explaining IO, monads and functors, has anyone considered publishing
>      > a comprehensive book explaining those subjects?  (I am trying to
>      > read all the material online, but books are easier to read and don't
>      > require sitting in front of a computer to do so. Plus I can write in
>      > books :-). )
>
>     I've thought about writing extended tutorials on the relationship
>     between Haskell programming and category theory but there's a problem
>     I run into. It's tempting to make the identifications:
>     types<->objects, Haskell function<->arrows, suitably polymorphic
>     functions<->natural transformations, and so on. But the fact is, this
>     doesn't really work in the obvious way even though it seems like it
>     should at first (eg. Haskell functions aren't always total functions
>     in the mathematical sense and if you allow partial functions you can
>     do weird stuff). So either:
>
>     (1) we need some technical work to patch up the differences (and
>     unfortunately I don't know what the patch-up is),
>     (2) we restrict ourselves to certain types of Haskell function for
>     which the theory works or
>     (3) we deliberately leave things a little vague.
>
>     I usually tend to go for option (3), but that wouldn't be satisfactory
>     for an extended treatment.
>
>     Has anyone else given this subject much thought?
>
>
> I consider myself to be distinctly in the target audience of a thorough
> treatment of CT & it's relationship to Haskell, so I'll throw out there
> that I think some superposition of options (2) and (3) would be the most
> satisfying.  You can handwave a little bit, but knowing *where* the
> naive mappings between category theoretic constructs and Haskell's
> system breakdown would be very nice.  Personally, one of the biggest
> things for me is not really having any intuition for what kind of
> category the Haskell type system lives in.  I mean, it looks cartesian
> closed because you can do currying but what more to it is there than that?

Actually it isn't Cartesian Closed (monoidally closed though should work).

But, I more or less agree.  Either just ignore it (3), or something somewhere
between (2) and (3) would probably be best.  The kind of people that are going
to care enough about the mismatches probably already know to be wary, but make
sure you make -some- comment to the appropriate effect.  Most of the time you
are just going for intuition and (either way) precision in this aspect is
irrelevant.

A request: If you do write this, please show the CT being -used- for something
and not just mapped to/from Haskell.
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Monad/Functor Book

Andrzej Jaworski
In reply to this post by Creighton Hogg-4
Haskell borrows from CT but it is too much engineered to be a model for computational CT.
However you can study it with CT:
http://www.cs.ut.ee/~varmo/papers/thesis.pdf

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Monad/Functor Book

Claus Reinke
In reply to this post by Dan Piponi-2
> I've thought about writing extended tutorials on the relationship
> between Haskell programming and category theory

you might find this a useful reference/starting point then:

    http://citeseer.ist.psu.edu/62964.html
    An Introduction to Category Theory, Category Theory Monads,
    and Their Relationship to Functional Programming
    Jonathan M.D. Hill, Keith Clarke

it's been a long time since i read this, and i seem to recall having to fix a
few typos before things made sense, but the reference still stuck in memory:)

claus

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Monad/Functor Book

Jim Burton
In reply to this post by Dave-86
Dave-86 wrote
Given the amount of material posted at haskell.org and elsewhere
explaining IO, monads and functors, has anyone considered publishing
a comprehensive book explaining those subjects?  (I am trying to
read all the material online, but books are easier to read and don't
require sitting in front of a computer to do so. Plus I can write in
books :-). )

Thanks, Dave Feustel
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Print out the wikibook [1]? IMO it has good coverage of Monads, more detailed than any of the textbooks I've read, and leads into CT and advanced topics that aren't really covered in any of the books (partly because a  lot of it isn't Haskell 98 of course).

[1] http://en.wikibooks.org/wiki/Haskell