Code Example and Haskell Patterns

Hi, Hackage is a sizable repository of Haskell code; makes me wonder if there is a way to use it more effectively for pedagogical purposes. For example, I really would like to study State monad, monad transformers, applicative, arrows etc. in action--i.e., in the context of a real application rather than small toy examples commonly found in tutorials. If there isn't such a source, can someone point me to an application whose implementation you would consider being a paragon for said concepts? Best, Ali

ali.razavi:
Hi,
Hackage is a sizable repository of Haskell code; makes me wonder if there is a way to use it more effectively for pedagogical purposes. For example, I really would like to study State monad, monad transformers, applicative, arrows etc. in action--i.e., in the context of a real application rather than small toy examples commonly found in tutorials. If there isn't such a source, can someone point me to an application whose implementation you would consider being a paragon for said concepts?
xmonad uses monad transformers in a canonical fashion, IMO. For applicatives, some of the parser combinator libraries, like cereal, provide good use. You can follow the reverse dependencies to find packages that use things you're interested in: http://bifunctor.homelinux.net/~roel/cgi-bin/hackage-scripts/revdeps/arrows-... -- Don

Hello I suspect you will have to choose single examples for each of the patterns/ abstractions you are interested in. Doaitse Swierstra's library UU.Parsing is the originator or the Applicative style. Its latest incarnation is the library uu-parsinglib. There is extensive technical report detailing it: http://www.cs.uu.nl/research/techreps/repo/CS-2008/2008-044.pdf http://hackage.haskell.org/package/uu-parsinglib

On 7/8/10 21:36, Stephen Tetley wrote:
Hello
I suspect you will have to choose single examples for each of the patterns/ abstractions you are interested in.
Doaitse Swierstra's library UU.Parsing is the originator or the Applicative style. Its latest incarnation is the library uu-parsinglib.
Applicative style has several contributors: * AFAIK, Niklas Röjemo first came up with the names for the operators (as the haddock for Control.Applicative says) * It was used heavily, popularised and expanded by (among others) Doaitse Swierstra * Conor McBride and Ross Paterson recognised the pattern could be applied to things other than parsers (Correct me if I'm wrong!) Martijn.

Hi Martijn I think you are right there - the tech report I linked to does credit the interface to Niklas Röjemo, so I shouldn't have used the word "originator" (as you suggested "popularised" would have been better). Unfortunately the thesis doesn't seem available on the web so I can't see how much of the applicative style it introduced. Best wishes Stephen

I think you are right there - the tech report I linked to does credit the interface to Niklas Röjemo, so I shouldn't have used the word "originator" (as you suggested "popularised" would have been better). Unfortunately the thesis doesn't seem available on the web so I can't see how much of the applicative style it introduced.
Although the whole thesis is not online, some of the papers contained in it are. This one, although it appears to be on a different topic, does have a brief introduction to Röjemo's parser combinators in section 4. He calls them monadic, even though the style is very obviously what we would now call applicative. http://reference.kfupm.edu.sa/content/h/i/highlights_from_nhc____a_space_eff... Röjemo's source code for an entire parser for Haskell (only slightly modified for newer versions of the language) is still available online too, in the source code of nhc98. http://darcs.haskell.org/york-compiler98 Regards, Malcolm
participants (5)
-
Ali Razavi
-
Don Stewart
-
Malcolm Wallace
-
Martijn van Steenbergen
-
Stephen Tetley