Browse files

Improve formatting

  • Loading branch information...
1 parent 5068fc0 commit c8979abb4c960d1ceaacb02b1c02b1a2c10b3776 unknown committed Jul 16, 2011
Showing with 1 addition and 68 deletions.
  1. +1 −68 README.markdown
@@ -1,5 +1,3 @@
Haskell Joinads
@@ -71,69 +69,4 @@ for arrow syntax][3] implemented by Ross Paterson.
- [5]:
-<h1>Haskell Joinads</h1>
-<p>This source repository contains the implementation of <em>joinads</em> for the Haskell language.
-The design of the extension is described in a paper [Extending Monads with Pattern Matching][1],
-which provides more details about the langauge extension and gives numerous examples.</p>
-<p>The language extension adds <code>docase</code> construct to Haskell. Similarly to the <code>do</code> notation,
-the construct can be used with any type that provides instance for a certain type class.
-In case of <code>do</code>, the type class is <code>Monad</code>. To support <code>docase</code>, type must implement a
-<code>Joinad</code> type cass that extends <code>Monad</code> with three additional operators that represent
-non-deterministic <em>choice</em> between computations, <em>parallel composition</em> of computations
-and <em>aliasing</em> of computations).</p>
-<p>The following example uses the instance for [the <code>Par</code> monad][2]. It implements a function
-that recursively processes a tree and returns <code>True</code> when the tree contains element that
-matches the specified predicate:</p>
-<pre><code>all :: (a -&gt; Bool) -&gt; Tree a -&gt; Par Bool
-all p (Leaf v) = return (p v)
-all p (Node left right) =
- docase (all p left, all p right) of
- (False, ?) -&gt; return False
- (?, False) -&gt; return False
- (allL, allR) -&gt; return (allL &amp;&amp; allR)
-<p>The <code>docase</code> syntax is similar to pattern matching using <code>case</code>, but works on monadic computations.
-The monadic computation <code>Par a</code> represents a task that can be executed (using a parallel scheduler)
-and eventually returns a value of type <code>a</code>. </p>
-<p>In the above example, the <code>docase</code> construct creates a computation that starts processing
-left and right sub-trees in parallel. When any of the sub-tasks completes and returns <code>False</code>,
-we already know that the overall result will be <code>False</code>, so we don't need to wait for the
-completion of the second task. This expressed using the <code>?</code> pattern in the first and the
-second clause. Finally, the last clause handles the case when we need to wait for both of the
-values before producing the result.</p>
-<p>The <code>docase</code> extension is currently implemented using a pre-processor that takes Haskell'98
-code with the <code>docase</code> extension and translates it into standard Haskell'98 source (it replaces
-<code>docase</code> with calls to standard functions). The pre-processor is based on the [pre-processor
-for arrow syntax][3] implemented by Ross Paterson.</p>
-<ul style="margin-left:20px">
-<li><p><strong>Preprocessor</strong> directory contains the implementation of the pre-processor. It
-can be compiled using the <code>Makefile</code> provided and then executed using
-the command: <code>joinadsp.exe Sample.jhs &gt; Sample.hs</code></p></li>
-<li><p><strong>Samples</strong> includes numerous examples that use joinads. It includes <code>Joinad</code> instance
-for the <code>Maybe</code> type and types mentioned in the paper (parsers that can be used for
-input validation, parallelsim monad used above and simple cooperative parallelism
-monad using resumptions).</p></li>
-<li><p><strong>ParMonad</strong> includes core parts of the <code>Par</code> monad that is used in the parallel programming
-samples. The implementation is extended to support speculative parallelism (see a separate
-[a blog post][2]). a complete modified implementation is available in a [separate
-<li><p><strong>Comprehensions</strong> shows several examples that use <em>generalized zip comprehensions</em>
-(or <em>parallel monad comprehensions</em>) to write similar examples as those that use
-<code>docase</code> notation. Zip comprehensions are a generalization of parallel list comprehensions
-and overlap with joinads. For more information see an article in [The Monad.Reader Issue 18][5].</p></li>
+ [5]:

0 comments on commit c8979ab

Please sign in to comment.