Re: [Haskell-beginners] Re: [Haskell-cafe] The problem with Monads...

2009-01-14 Thread Peter Verswyvelen

 I have written a reference manual for the basic Haskell monad functions, A
 Tour of the Haskell Monad functions. It contains a lot of examples. You can
 find it at:
  http://members.chello.nl/hjgtuyl/tourdemonad.html


Wow! I like these examples. I'm a pragmatist, and although Haskell gave me
the most intense joy I ever experienced with programming (and also
frustrations ;-), I find it extremely difficult to learn it from research
papers.

But these small examples are exactly what I need, because my brain will
easier recognize a pattern match with the specific examples, than with the
abstract explanation (and I was pretty good at abstract algebra, but that's
20 years ago, and I filled these 2 decades with lots and lots of imperative
and OO hacking ;-).

I wish every function in every module in the documentation had an examples
link next to the source link, or a link to examples on the wiki or
something.

I guess the smart computer scientists here will tell me that I need to lift
my brain to learn to recognize abstract patterns, but I'm afraid this is not
something that is given to all of us, certainly not in the short term. But I
still want to enjoy Haskell, so keep the short examples coming :)



 As far as I know, there is no reference guide for advanced monads, like the
 Reader, Writer and State monads.

 --
 Regards,
 Henk-Jan van Tuyl


 --
 http://functor.bamikanarie.com
 http://Van.Tuyl.eu/
 --



 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] The problem with Monads...

2009-01-13 Thread Jonathan Cast
On Tue, 2009-01-13 at 12:56 -0200, Rafael Gustavo da Cunha Pereira Pinto
wrote:
 
 Last night I was thinking on what makes monads so hard to take, and
 came to a conclusion: the lack of a guided tour on the implemented
 monads.

...

 Inspired by the paper Functional Programming with Overloading and
 Higher-Order Polymorphism,
 Mark P Jones
 (http://web.cecs.pdx.edu/~mpj/pubs/springschool.html)
   Advanced School of Functional Programming, 1995.
 
 SO WHAT?

So have you read Jones' paper?  Or do you have a *concrete* explanation
of how it differs from your desired `guided tour'?

jcc


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] The problem with Monads...

2009-01-13 Thread Rafael Gustavo da Cunha Pereira Pinto
Yes, I've read it twice, and it is a nice explanation that yes, the reader
monad is an application and is a monad. How do I use it? Why not the
function itself? How would the plumbing work in a real world example?

BTW, the article is really great as an brief introduction to monad
transformers. For the whole concept of monads, my all time favorite is The
Haskell Programmer's Guide to the IO Monad by Stefan Klinger.

Chapters 14 to 19 of Real World Haskell also have a good introduction on
the usage of the monads, but it lacks other monads, like the RWS or the
Continuation...

See, that is my point. The mathematical concept of monads is very palatable.
The idea that monads are either patterns or structures to hide computations
in sequence is also very easy to see. But how do we use them?
Why should I use a Writer monad when I can use a (a,w) tuple?



On Tue, Jan 13, 2009 at 13:51, Jonathan Cast jonathancc...@fastmail.fmwrote:

 On Tue, 2009-01-13 at 12:56 -0200, Rafael Gustavo da Cunha Pereira Pinto
 wrote:
 
  Last night I was thinking on what makes monads so hard to take, and
  came to a conclusion: the lack of a guided tour on the implemented
  monads.

 ...

  Inspired by the paper Functional Programming with Overloading and
  Higher-Order Polymorphism,
  Mark P Jones
  (http://web.cecs.pdx.edu/~mpj/pubs/springschool.htmlhttp://web.cecs.pdx.edu/%7Empj/pubs/springschool.html
 )
Advanced School of Functional Programming, 1995.
 
  SO WHAT?

 So have you read Jones' paper?  Or do you have a *concrete* explanation
 of how it differs from your desired `guided tour'?

 jcc





-- 
Rafael Gustavo da Cunha Pereira Pinto
Electronic Engineer, MSc.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


RE: [Haskell-cafe] The problem with Monads...

2009-01-13 Thread Sittampalam, Ganesh
Jonathan Cast wrote:
 On Tue, 2009-01-13 at 12:56 -0200, Rafael Gustavo da Cunha Pereira
 Pinto wrote:

 Inspired by the paper Functional Programming with Overloading and
 Higher-Order Polymorphism, Mark P Jones
 (http://web.cecs.pdx.edu/~mpj/pubs/springschool.html)
   Advanced School of Functional Programming, 1995.
 
 SO WHAT?
 
 So have you read Jones' paper?  Or do you have a *concrete*
 explanation of how it differs from your desired `guided tour'? 

To give a specific example, a few weeks ago I wanted an explanation of
the 'pass' function and couldn't find it in that paper.

Ganesh

==
Please access the attached hyperlink for an important electronic communications 
disclaimer: 

http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
==

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


RE: [Haskell-cafe] The problem with Monads...

2009-01-13 Thread Derek Elkins
On Tue, 2009-01-13 at 16:22 +, Sittampalam, Ganesh wrote:
 Jonathan Cast wrote:
  On Tue, 2009-01-13 at 12:56 -0200, Rafael Gustavo da Cunha Pereira
  Pinto wrote:
 
  Inspired by the paper Functional Programming with Overloading and
  Higher-Order Polymorphism, Mark P Jones
  (http://web.cecs.pdx.edu/~mpj/pubs/springschool.html)
Advanced School of Functional Programming, 1995.
  
  SO WHAT?
  
  So have you read Jones' paper?  Or do you have a *concrete*
  explanation of how it differs from your desired `guided tour'? 
 
 To give a specific example, a few weeks ago I wanted an explanation of
 the 'pass' function and couldn't find it in that paper.
 
 Ganesh

Several years ago I documented all the (basic) monads in the mtl on the
(old) wiki.
http://web.archive.org/web/20030927210146/haskell.org/hawiki/MonadTemplateLibrary
In particular,
http://web.archive.org/web/20030907203223/haskell.org/hawiki/MonadWriter


To respond to the essential point of Rafael's initial claim, Wadler's
papers The Essence of Functional Programming and/or Monads for
Functional Programming have exactly what he wants.  These are the
papers that I recommend to anyone who is learning about monads.
http://homepages.inf.ed.ac.uk/wadler/topics/monads.html

Please, we do not need the 101st monad tutorial when there was an
adequate one made almost two decades ago.  While I'm not saying that
this is the case here, I suspect that many people don't read those
papers because 1) they haven't heard of them and 2) they are papers
and thus couldn't possibly be readable and understandable (which also
partially causes (1) as people just don't think to look for papers at
all.)

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] The problem with Monads...

2009-01-13 Thread Rafael Gustavo da Cunha Pereira Pinto
I didn't knew Wadler's papers (I save all papers I read into a external USB
HD, so I can read them later!), and at a first glance it is really good.


Then again, instead of creating another monad tutorial, what about a
Haskell monads reference guide, and some worked examples?

Some of this work could even be attached to the library documentation.

Regards

Rafael


On Tue, Jan 13, 2009 at 15:27, Derek Elkins derek.a.elk...@gmail.comwrote:

 On Tue, 2009-01-13 at 16:22 +, Sittampalam, Ganesh wrote:
  Jonathan Cast wrote:
   On Tue, 2009-01-13 at 12:56 -0200, Rafael Gustavo da Cunha Pereira
   Pinto wrote:
  
   Inspired by the paper Functional Programming with Overloading and
   Higher-Order Polymorphism, Mark P Jones
   (http://web.cecs.pdx.edu/~mpj/pubs/springschool.htmlhttp://web.cecs.pdx.edu/%7Empj/pubs/springschool.html
 )
 Advanced School of Functional Programming, 1995.
  
   SO WHAT?
  
   So have you read Jones' paper?  Or do you have a *concrete*
   explanation of how it differs from your desired `guided tour'?
 
  To give a specific example, a few weeks ago I wanted an explanation of
  the 'pass' function and couldn't find it in that paper.
 
  Ganesh

 Several years ago I documented all the (basic) monads in the mtl on the
 (old) wiki.

 http://web.archive.org/web/20030927210146/haskell.org/hawiki/MonadTemplateLibrary
 In particular,
 http://web.archive.org/web/20030907203223/haskell.org/hawiki/MonadWriter


 To respond to the essential point of Rafael's initial claim, Wadler's
 papers The Essence of Functional Programming and/or Monads for
 Functional Programming have exactly what he wants.  These are the
 papers that I recommend to anyone who is learning about monads.
 http://homepages.inf.ed.ac.uk/wadler/topics/monads.html

 Please, we do not need the 101st monad tutorial when there was an
 adequate one made almost two decades ago.  While I'm not saying that
 this is the case here, I suspect that many people don't read those
 papers because 1) they haven't heard of them and 2) they are papers
 and thus couldn't possibly be readable and understandable (which also
 partially causes (1) as people just don't think to look for papers at
 all.)




-- 
Rafael Gustavo da Cunha Pereira Pinto
Electronic Engineer, MSc.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-beginners] Re: [Haskell-cafe] The problem with Monads...

2009-01-13 Thread Henk-Jan van Tuyl
On Tue, 13 Jan 2009 19:35:57 +0100, Rafael Gustavo da Cunha Pereira Pinto  
rafaelgcpp.li...@gmail.com wrote:


I didn't knew Wadler's papers (I save all papers I read into a external  
USB

HD, so I can read them later!), and at a first glance it is really good.


Then again, instead of creating another monad tutorial, what about a
Haskell monads reference guide, and some worked examples?

Some of this work could even be attached to the library documentation.

Regards

Rafael



I have written a reference manual for the basic Haskell monad functions,  
A Tour of the Haskell Monad functions. It contains a lot of examples.  
You can find it at:

  http://members.chello.nl/hjgtuyl/tourdemonad.html

As far as I know, there is no reference guide for advanced monads, like  
the Reader, Writer and State monads.


--
Regards,
Henk-Jan van Tuyl


--
http://functor.bamikanarie.com
http://Van.Tuyl.eu/
--


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe