<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Hello,</div><div><br></div><div>Here is the latest Caml Weekly News, for the week of July 15 to 22, 2008.</div><div><br></div><div>As I will be moving from Italy to France next week, there&nbsp;</div><div>will not be a CWN. I will try the week after that if I have internet access.&nbsp;</div><div>Good vacations to all!</div><div><br></div><div>1) Profiling ocaml using gprof</div><div>2) ocaml-bitstring 1.9.6 (formerly known as ocaml-bitmatch)</div><div>3) Position</div><div>4) "OCaml Developers" group just created on LinkedIn</div><div>5) NW Functional Programming Interest Group</div><div>6) Name of currently executing function</div><div>7) Commercial Users of Functional Programming Workshop Call for Participation</div><div>8) Understanding monads</div><div><br></div><div>========================================================================</div><div>1) Profiling ocaml using gprof</div><div>Archive: &lt;<a href="http://groups.google.com/group/fa.caml/browse_thread/thread/ba9fa49cb9b5e82a#">http://groups.google.com/group/fa.caml/browse_thread/thread/ba9fa49cb9b5e82a#</a>></div><div>------------------------------------------------------------------------</div><div>** Arthur Chan asked and Richard Jones answered:</div><div><br></div><div>> Is gprof better for profiling ocaml than ocaml's own profilers?</div><div><br></div><div>They are slightly different. &nbsp;I use 'gprof' all the time because I</div><div>tend to only use natively compiled executables. &nbsp;'gprof' is the</div><div>ordinary GNU profiling tool that tells you which function is being run</div><div>most often and some limited information about the call path into that</div><div>function. &nbsp;It's pretty useful for simple profiling where you're</div><div>looking for obvious problems.</div><div><br></div><div>'ocamlprof' is a bit different. &nbsp;Last time I used it [which was a few</div><div>years ago, so maybe it's different now], it only worked on bytecode.</div><div>It outputs your original code with annotations telling you how often</div><div>each expression was run. &nbsp;So this isn't time taken (each expression</div><div>can take a different amount of time to execute, and this time isn't</div><div>shown), but how often a particular path through the code is taken.</div><div><br></div><div>> How would you go about figuring out that that particular function stub is</div><div>> string concat?</div><div>>&nbsp;</div><div>> 'camlPervasives__$5e_136'.</div><div><br></div><div>In 'gprof' there's a simple name mangling used to map OCaml function</div><div>names to assembler symbols. &nbsp;Once you understand it, you'll find it</div><div>easy to follow. &nbsp;First of all note that OCaml function names aren't</div><div>unique, eg in the following code:</div><div><br></div><div>&nbsp;let f () = printf "this is the first f()\n"</div><div>&nbsp;let f () = printf "this is the second f()\n"; f () ;;</div><div><br></div><div>&nbsp;f ()</div><div><br></div><div>The assembler symbol is:</div><div><br></div><div>&nbsp;"caml" ^ Modulename ^ "__" ^ functionname ^ "_" ^ uniquenumber</div><div><br></div><div>'uniquenumber' is just a counter added to function names by the</div><div>compiler to make sure that functions which have the same name will</div><div>have different symbols.</div><div><br></div><div>So when I compiled the code above in a file called 'test.ml' (hence a</div><div>module called Test), in my case I ended up with two symbols called:</div><div><br></div><div>&nbsp;camlTest__f_77</div><div>&nbsp;camlTest__f_78</div><div><br></div><div>where '77' and '78' are arbitrary. &nbsp;You can check this by looking at</div><div>the assembler output from the compiler (ocamlopt -S).</div><div><br></div><div>If a function name contains an operator symbol (eg. (^) ) then a $xx</div><div>hex code is used.</div><div><br></div><div>I guess in theory one could write an OCaml symbol filter, similar to</div><div>c++filt [&lt;<a href="http://sourceware.org/binutils/docs/binutils/c_002b_002bfilt.html">http://sourceware.org/binutils/docs/binutils/c_002b_002bfilt.html</a>>]</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span></div><div>========================================================================</div><div>2) ocaml-bitstring 1.9.6 (formerly known as ocaml-bitmatch)</div><div>Archive: &lt;<a href="http://groups.google.com/group/fa.caml/browse_thread/thread/641efb4722fe4afb#">http://groups.google.com/group/fa.caml/browse_thread/thread/641efb4722fe4afb#</a>></div><div>------------------------------------------------------------------------</div><div>** Richard Jones announced:</div><div><br></div><div>I'm please to announce version 1.9.6 of ocaml-bitstring (formerly</div><div>known as ocaml-bitmatch). &nbsp;The home page has changed again, so please</div><div>update any bookmarks or links to point to the new home page here:</div><div><br></div><div>&nbsp;&lt;<a href="http://code.google.com/p/bitstring/">http://code.google.com/p/bitstring/</a>></div><div><br></div><div>Version 1.9.6 features 'check()', 'bind()' and 'save_offset_to()'</div><div>qualifiers which give you much greater control over the matching</div><div>process. &nbsp;For example:</div><div><br></div><div>&nbsp;bitmatch packet with</div><div>&nbsp;| { len &nbsp;: 16 &nbsp;: check (len > 0), bind (len*8);</div><div>&nbsp;&nbsp; &nbsp; data : len : string;</div><div>&nbsp;&nbsp; &nbsp; crc &nbsp;: 32 &nbsp;: check (crc_ok data crc), save_offset_to (crc_offset)</div><div>&nbsp;&nbsp; } -></div><div>&nbsp;&nbsp; printf "length of data (in bits) = %d\n" len;</div><div>&nbsp;&nbsp; printf "offset of CRC in packet (in bits) = %d\n" crc_offset</div><div><br></div><div>&nbsp;| { _ } -> printf "bad packet\n"</div><div><br></div><div>We have also fixed some bugs, clarified the licensing everywhere (for</div><div>Debian), and improved the META file.</div><div><br></div><div>A troublesome company sent my employer a Cease and Desist notice,</div><div>claiming that their trademark on the word "BitMatch" for "Computer</div><div>software for comparing and analyzing computer software"[sic] covered</div><div>ocaml-bitmatch. &nbsp;No such thing is true, but because of the time and</div><div>expense of dealing with the legal process we have decided to rename</div><div>ocaml-bitmatch to ocaml-bitstring for their benefit (still very</div><div>time-consuming). &nbsp;As a result, we are gradually moving the old</div><div>website, wiki etc. to the new home page above, and some internals will</div><div>change (code will be backwards-compatible, but you may need to make</div><div>some changes to build scripts). &nbsp;Thanks to Sylvain Le Gall for</div><div>offering hosting.</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span></div><div>========================================================================</div><div>3) Position</div><div>Archive: &lt;<a href="http://groups.google.com/group/fa.caml/browse_thread/thread/36ae678aea07e38d#">http://groups.google.com/group/fa.caml/browse_thread/thread/36ae678aea07e38d#</a>></div><div>------------------------------------------------------------------------</div><div>** Ihsan Ecemis announced:</div><div><br></div><div>We are a fast-paced, VC-funded, Boston-based startup currently building our</div><div>flagship product targeted at the scientific community. We need a few sharp</div><div>minds to help us.</div><div><br></div><div>We are using OCaml in our core simulation technology. We are looking for</div><div>someone who is mathematically minded, has fun with his work, takes pride in</div><div>its quality, and learns quickly.</div><div><br></div><div>If facing the challenges of building cutting-edge technologies is your idea of</div><div>a good time, then you are going to love working with us. We are solving hard</div><div>problems and having a lot of fun doing it. Join us.</div><div><br></div><div>Qualifications</div><div>* 3+ years of experience in functional programming, preferably in OCaml</div><div>* Strong CS fundamentals</div><div><br></div><div>The best candidates will have experience with:</div><div>* Dealing with a large code base, complex data structures, and intricate</div><div>&nbsp;&nbsp;control loops</div><div>* Scalability and performance issues</div><div>* Simulations of complex systems</div><div>* Conducting research on basic algorithms, mathematics, agent-based models</div><div><br></div><div>Instructions</div><div>To apply for this position, submit your resume to <a href="mailto:jobs@plectix.com">jobs@plectix.com</a>.</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span></div><div>========================================================================</div><div>4) "OCaml Developers" group just created on LinkedIn</div><div>Archive: &lt;<a href="http://upsilon.cc/~zack/blog/posts/2008/07/ocaml_linkedin_group/">http://upsilon.cc/~zack/blog/posts/2008/07/ocaml_linkedin_group/</a>></div><div>------------------------------------------------------------------------</div><div>** Stefano Zacchiroli announced:</div><div><br></div><div>In case you are in the LinkedIn professional network, you might be interested</div><div>in knowing that I've just created an OCaml group there:</div><div>&lt;<a href="http://www.linkedin.com/groupInvitation?groupID=144434&amp;sharedKey=57B54C413FE2">http://www.linkedin.com/groupInvitation?groupID=144434&amp;sharedKey=57B54C413FE2</a>>.</div><div>It is called OCaml Developers and it is intended to provide yet another way</div><div>for the community of OCaml programmers to advertise themselves to the</div><div>professional world.</div><div><br></div><div>I was surprised by the fact there were no professional group related to OCaml</div><div>there, and that's why I created one. The only group I found mentioning OCaml</div><div>was a very narrow one about the usage of functional programming for financial</div><div>purposes, probably all Jane St employees are members</div><div><br></div><div>Feel free to join the new group. Also, if you want to spare the duty of</div><div>checking/accepting new people into the group drop me a line, you will be more</div><div>than welcome!</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span></div><div>========================================================================</div><div>5) NW Functional Programming Interest Group</div><div>Archive: &lt;<a href="http://groups.google.com/group/fa.caml/browse_thread/thread/e095762001b66bc6/c92942667fe4d502">http://groups.google.com/group/fa.caml/browse_thread/thread/e095762001b66bc6/c92942667fe4d502</a>></div><div>------------------------------------------------------------------------</div><div>** Greg Meredith announced:</div><div><br></div><div>This is just a friendly reminder to Northwest functionally minded folks that</div><div>this month's meeting is to be held</div><div><br></div><div>The Seattle Public Library</div><div>5009 Roosevelt Way N.E.</div><div>Seattle, WA 98105</div><div>206-684-4063</div><div><br></div><div>from 18.30 - 19:45 on July 23rd.&nbsp;</div><div><br></div><div>We'll be getting a demo of a scala-lift-based application that compiles a</div><div>graphical rendition of functional expressions into expressions in a functional</div><div>language.</div><div><br></div><div>Hope to see you there.</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span></div><div>========================================================================</div><div>6) Name of currently executing function</div><div>Archive: &lt;<a href="http://groups.google.com/group/fa.caml/browse_thread/thread/25c9706b89196140#">http://groups.google.com/group/fa.caml/browse_thread/thread/25c9706b89196140#</a>></div><div>------------------------------------------------------------------------</div><div>** Continuing the thread from last week, Dave Benjamin announced:</div><div><br></div><div>Thanks again for your help, blue storm. I condensed this technique into a</div><div>simple example for PLEAC, which I just committed here:</div><div><br></div><div>&lt;<a href="http://pleac.cvs.sourceforge.net/pleac/pleac/pleac/pleac_ocaml.data?r1=1.151&amp;r2=1.152">http://pleac.cvs.sourceforge.net/pleac/pleac/pleac/pleac_ocaml.data?r1=1.151&amp;r2=1.152</a>></div><div><br></div><div>It allows you to write this:</div><div><br></div><div>(* An example named function. *)</div><div>let test_function () =</div><div>&nbsp;let str = "Hello, world!" in</div><div>&nbsp;let num = 42 in</div><div>&nbsp;LOG "str=\"%s\", num=%d" str num;</div><div>&nbsp;print_endline "test complete"</div><div><br></div><div>(* Some code to run at the toplevel. *)</div><div>let () =</div><div>&nbsp;LOG "not in a function";</div><div>&nbsp;test_function ()</div><div><br></div><div>And get the following output:</div><div><br></div><div>&lt;toplevel>[main.ml]: not in a function</div><div>test_function[main.ml]: str="Hello, world!", num=42</div><div>test complete</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span></div><div>========================================================================</div><div>7) Commercial Users of Functional Programming Workshop Call for Participation</div><div>Archive: &lt;<a href="http://groups.google.com/group/fa.caml/browse_thread/thread/65a5babd008f588e#">http://groups.google.com/group/fa.caml/browse_thread/thread/65a5babd008f588e#</a>></div><div>------------------------------------------------------------------------</div><div>** Jim Grundy announced:</div><div><br></div><div>&nbsp;&nbsp; &nbsp; &nbsp;Commercial Users of Functional Programming Workshop (CUFP) 2008</div><div><br></div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Functional Programming As a Means, Not an End</div><div><br></div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Call for Participation</div><div><br></div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Sponsored by SIGPLAN</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Co-located with ICFP 2008</div><div>&nbsp;&nbsp; &nbsp;__________________________________________________________________</div><div><br></div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 26 September 2008</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Victoria, Canada</div><div><br></div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Registration opens in late July through</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;<a href="http://www.icfpconference.org/icfp2008/">http://www.icfpconference.org/icfp2008/</a>></div><div>&nbsp;&nbsp; &nbsp;__________________________________________________________________</div><div><br></div><div>&nbsp;&nbsp;Functional languages have been under academic development for over 25</div><div>&nbsp;&nbsp;years, and remain fertile ground for programming language research.</div><div>&nbsp;&nbsp;Recently, however, developers in industrial, governmental, and open</div><div>&nbsp;&nbsp;source projects have begun to use functional programming successfully</div><div>&nbsp;&nbsp;in practical applications. In these settings, functional programming</div><div>&nbsp;&nbsp;has often provided dramatic leverage, including whole new ways of</div><div>&nbsp;&nbsp;thinking about the original problem.</div><div><br></div><div>&nbsp;&nbsp;The goal of the CUFP workshop is to act as a voice for these users of</div><div>&nbsp;&nbsp;functional programming. The workshop supports the increasing</div><div>&nbsp;&nbsp;viability of functional programming in the commercial, governmental,</div><div>&nbsp;&nbsp;and open-source space by providing a forum for professionals to share</div><div>&nbsp;&nbsp;their experiences and ideas, whether those ideas are related to</div><div>&nbsp;&nbsp;business, management, or engineering. The workshop is also designed</div><div>&nbsp;&nbsp;to enable the formation and reinforcement of relationships that</div><div>&nbsp;&nbsp;further the commercial use of functional programming. Providing user</div><div>&nbsp;&nbsp;feedback to language designers and implementors is not a primary goal</div><div>&nbsp;&nbsp;of the workshop, though it will be welcome if it occurs.</div><div><br></div><div>Program</div><div><br></div><div>&nbsp;&nbsp;CUFP 2008 will last a full day and feature a discussion session and</div><div>&nbsp;&nbsp;the following presentations:</div><div><br></div><div>&nbsp;&nbsp;Don Syme (Microsoft)</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; Invited Presentation: Why Microsoft is Investing in Functional</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; Programming</div><div><br></div><div>&nbsp;&nbsp;David Balaban (Amgen)</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; Minimizing the Immune Response to Functional Programming at</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; Amgen</div><div><br></div><div>&nbsp;&nbsp;Francesco Cesarini (Erlang Training and Consulting)</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; The Mobile Messaging Gateway, from Idea to Prototype to Launch</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; in 12 months</div><div><br></div><div>&nbsp;&nbsp;Jake Donham (Skydeck)</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; From OCaml to Javascript at Skydeck</div><div><br></div><div>&nbsp;&nbsp;Nick Gerakines (Yahoo)</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; Developing Erlang at Yahoo</div><div><br></div><div>&nbsp;&nbsp;Tom Hawkins (Eaton Corporation)</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; Controlling Hybrid Vehicles with Haskell</div><div><br></div><div>&nbsp;&nbsp;Bob Ippolito (Mochimedia)</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; Ad Serving with Erlang</div><div><br></div><div>&nbsp;&nbsp;Anil Madhavapeddy (Citrix)</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; Xen and the art of OCaml</div><div><br></div><div>&nbsp;&nbsp;Howard Mansell (Credit Suisse)</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; Quantitative Finance in F#</div><div><br></div><div>&nbsp;&nbsp;Jeff Polakow (Deutsche Bank)</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; Is Haskell ready for everyday computing?</div><div><br></div><div>&nbsp;&nbsp;David Pollak (Lift web framework)</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; Buy a Feature: an adventure in immutability and Actors</div><div><br></div><div>&nbsp;&nbsp;Gregory Wright (Antiope)</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; Functions to Junctions: Ultra Low Power Chip Design With Some</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; Help From Haskell</div><div><br></div><div>&nbsp;&nbsp;There will be no published proceedings, as the meeting is intended to</div><div>&nbsp;&nbsp;be more a discussion forum than a technical interchange.</div><div><br></div><div>&nbsp;&nbsp;See &lt;<a href="http://cufp.galois.com">http://cufp.galois.com</a>> for more information, including</div><div>&nbsp;&nbsp;presentation abstracts and the most recent schedule information.</div><div><br></div><div>Program Committee</div><div><br></div><div>&nbsp;&nbsp; &nbsp;* Lennart Augustsson &lt;lennart(dot)augustsson(at)gmail(dot)com></div><div>&nbsp;&nbsp; &nbsp;* Matthias Blume &lt;blume(at)tti-c(dot)org></div><div>&nbsp;&nbsp; &nbsp;* Adam Granicz &lt;granicz(dot)adam(at)intellifactory(dot)com></div><div>&nbsp;&nbsp; &nbsp;* Jim Grundy(co-chair)&lt;jim(dot)d(dot)grundy(at)intel(dot)com></div><div>&nbsp;&nbsp; &nbsp;* Andy Martin &lt;akmartin(at)us(dot)ibm(dot)com></div><div>&nbsp;&nbsp; &nbsp;* Yaron Minsky &lt;yminsky(at)janestcapital(dot)com></div><div>&nbsp;&nbsp; &nbsp;* Simon Peyton Jones(co-chair)&lt;simonpj(at)microsoft(dot)com></div><div>&nbsp;&nbsp; &nbsp;* Ulf Wiger &lt;ulf(dot)wiger(at)ericsson(dot)com></div><div><br></div><div>&nbsp;&nbsp;This will be the fifth CUFP; see CUFP 2004 CUFP 2005, CUFP 2006, and</div><div>&nbsp;&nbsp;CUFP 2007 for information about the earlier meetings, including</div><div>&nbsp;&nbsp;reports from attendees and video of the most recent talks.</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span></div><div>========================================================================</div><div>8) Understanding monads</div><div>Archive: &lt;<a href="http://groups.google.com/group/fa.caml/browse_thread/thread/03e42ce999db1dd3#">http://groups.google.com/group/fa.caml/browse_thread/thread/03e42ce999db1dd3#</a>></div><div>------------------------------------------------------------------------</div><div>** Paolo Donadeo asked and Till Crueger answered:</div><div><br></div><div>> I like functional programming, but monads [1] must be too little to be</div><div>> grabbed by my mind. This time the interest in monads was aroused by</div><div>> the interesting article of David Teller, Arnaud Spiwack and Till</div><div>> Varoquaux [2] about the error monad, but for using the library they</div><div>> wrote I need at least some knowledge about monads and the do-notation.</div><div><br></div><div>it might take a while, but it's worth the effort... It took me some time</div><div>to get the concept as well. Don't worry it doesn't have to do with your IQ.</div><div><br></div><div>> I ask you all: can anyone make me a practical example, something</div><div>> involving strings, files, the network, an image or sound processing</div><div>> algorithm, something vaguely real? Not abstract mathematical</div><div>> structures, beautiful algebraic properties and general statements,</div><div>> please: the net is full of such tutorials, especially Haskell fan</div><div>> sites ;-)</div><div><br></div><div>hmm, very informaly speaking, monads allow you to "wrap up" some other</div><div>value, or a set of those... Then of course there are lot's of way's to</div><div>wrap something up, so this is really abstract.</div><div><br></div><div>One good thing that helped me a lot, was to implement the monads myself in</div><div>OCaml, even though i hadn't understood them fully at that time. Try for</div><div>example to build your own I/O Monad and it will start to get more clearly</div><div>how it works.</div><div><br></div><div>> [1] &lt;<a href="http://en.wikipedia.org/wiki/Monad_(symbol)">http://en.wikipedia.org/wiki/Monad_(symbol)</a>></div><div><br></div><div>I suggest this one instead as a good starting point:</div><div>&lt;<a href="http://en.wikipedia.org/wiki/Monads_in_functional_programming">http://en.wikipedia.org/wiki/Monads_in_functional_programming</a>></div><div><br></div><div>> [2] &lt;<a href="http://www.univ-orleans.fr/lifo/Members/David.Teller/publications/ml2008.pdf">http://www.univ-orleans.fr/lifo/Members/David.Teller/publications/ml2008.pdf</a>></div><div><span class="Apple-tab-span" style="white-space:pre">                        </span></div><div>** Fabrice Marchant then said:</div><div><br></div><div>> I suggest this one instead as a good starting point:</div><div>> &lt;<a href="http://en.wikipedia.org/wiki/Monads_in_functional_programming">http://en.wikipedia.org/wiki/Monads_in_functional_programming</a>></div><div><br></div><div>Among the links appearing at the bottom of this document, this non</div><div>theoretical-one appears the coolest to understand for me. The "pure function</div><div>debugging" example allows simple OCaml experimentions :</div><div><br></div><div>&lt;<a href="http://sigfpe.blogspot.com/2006/08/you-could-have-invented-monads-and.html">http://sigfpe.blogspot.com/2006/08/you-could-have-invented-monads-and.html</a>></div><div><span class="Apple-tab-span" style="white-space:pre">                        </span></div><div>** Gabriel Kerneis answered the original question:</div><div><br></div><div>Xavier Leroy's lesson on monads [1] will certainly be too abstract for</div><div>you, but the accompanying Caml code [2] might help you to grasp the</div><div>concept. You will find there a lot of example of useful monads. You should</div><div>have read some tutorial before, though, not to get lost.</div><div><br></div><div>Another very concrete example is Lwt [3], a cooperative thread library</div><div>written in monadic style. Don't hesitate to follow the link, it's a</div><div>documentation targeted at programmers, without categorical issues and so</div><div>on. You will need to read a more general tutorial on monads then, to get</div><div>the general idea, but it could be a good starting point to "bind" and</div><div>"return" operators.</div><div><br></div><div>[1] &lt;<a href="http://gallium.inria.fr/~xleroy/mpri/progfunc/monads.2up.pdf">http://gallium.inria.fr/~xleroy/mpri/progfunc/monads.2up.pdf</a>></div><div>[2] &lt;<a href="http://gallium.inria.fr/~xleroy/mpri/progfunc/monads.ml">http://gallium.inria.fr/~xleroy/mpri/progfunc/monads.ml</a>></div><div>[3] &lt;<a href="http://ocsigen.org/lwt">http://ocsigen.org/lwt</a>></div><div><span class="Apple-tab-span" style="white-space:pre">                        </span></div><div>========================================================================</div><div>Using folding to read the cwn in vim 6+</div><div>------------------------------------------------------------------------</div><div>Here is a quick trick to help you read this CWN if you are viewing it using</div><div>vim (version 6 or greater).</div><div><br></div><div>:set foldmethod=expr</div><div>:set foldexpr=getline(v:lnum)=~'^=\\{78}$'?'&lt;1':1</div><div>zM</div><div>If you know of a better way, please let me know.</div><div><br></div><div>========================================================================</div><div>Old cwn</div><div>------------------------------------------------------------------------</div><div><br></div><div>If you happen to miss a CWN, you can send me a message</div><div>(<a href="mailto:alan.schmitt@polytechnique.org">alan.schmitt@polytechnique.org</a>) and I'll mail it to you, or go take a look at</div><div>the archive (&lt;<a href="http://alan.petitepomme.net/cwn/">http://alan.petitepomme.net/cwn/</a>>) or the RSS feed of the</div><div>archives (&lt;<a href="http://alan.petitepomme.net/cwn/cwn.rss">http://alan.petitepomme.net/cwn/cwn.rss</a>>). If you also wish</div><div>to receive it every week by mail, you may subscribe online at</div><div>&lt;<a href="http://lists.idyll.org/listinfo/caml-news-weekly/">http://lists.idyll.org/listinfo/caml-news-weekly/</a>> .</div><div><br></div><div>========================================================================</div><div class="AppleMailSignature" id="E12A09DE-ADCF-40D6-B7D4-306ED5CADD30"> <div><br class="khtml-block-placeholder"></div><div>--&nbsp;</div><div>Alan Schmitt &lt;<a href="http://alan.petitepomme.net/">http://alan.petitepomme.net/</a>></div><div><br class="khtml-block-placeholder"></div><div>The hacker: someone who figured things out and made something cool happen.</div><div>&nbsp;.O.</div><div>&nbsp;..O</div><div>&nbsp;OOO</div><br class="Apple-interchange-newline"> </div><br></body></html>