<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>JP Embedded Solutions</title>
	<atom:link href="http://jpembeddedsolutions.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://jpembeddedsolutions.wordpress.com</link>
	<description></description>
	<lastBuildDate>Sat, 21 Jan 2012 19:14:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='jpembeddedsolutions.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/0c40c1fddec51266d4fccfba0bf7b39e?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>JP Embedded Solutions</title>
		<link>http://jpembeddedsolutions.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://jpembeddedsolutions.wordpress.com/osd.xml" title="JP Embedded Solutions" />
	<atom:link rel='hub' href='http://jpembeddedsolutions.wordpress.com/?pushpress=hub'/>
		<item>
		<title>What is a monad?</title>
		<link>http://jpembeddedsolutions.wordpress.com/2011/11/17/what-is-a-monad/</link>
		<comments>http://jpembeddedsolutions.wordpress.com/2011/11/17/what-is-a-monad/#comments</comments>
		<pubDate>Thu, 17 Nov 2011 22:03:03 +0000</pubDate>
		<dc:creator>Julian Porter</dc:creator>
				<category><![CDATA[Functional Programming]]></category>
		<category><![CDATA[Haskell]]></category>
		<category><![CDATA[additive monad]]></category>
		<category><![CDATA[Functional programming]]></category>
		<category><![CDATA[Languages]]></category>
		<category><![CDATA[MaybeT]]></category>
		<category><![CDATA[Monad]]></category>
		<category><![CDATA[Monad Transformer]]></category>
		<category><![CDATA[MonadPlus]]></category>
		<category><![CDATA[Monoid]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Real World Haskell]]></category>

		<guid isPermaLink="false">http://jpembeddedsolutions.wordpress.com/?p=163</guid>
		<description><![CDATA[Monads and monad transformers have a wholly undeserved reputation for being somewhat fearful and hard to understand. Unfortunately, even the best books on Haskell tend to further this reputation by choosing to introduce monads by giving a couple of examples, then stating the monad laws and running away very fast, and the treatment of monad transformers, even [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jpembeddedsolutions.wordpress.com&amp;blog=21775404&amp;post=163&amp;subd=jpembeddedsolutions&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div>
<p><a href="http://commons.wikipedia.org/wiki/File:Haskell-Logo.svg"><img class="zemanta-img-inserted zemanta-img-configured  alignleft" style="margin:5px;" src="http://upload.wikimedia.org/wikipedia/commons/thumb/1/1c/Haskell-Logo.svg/300px-Haskell-Logo.svg.png" alt="" width="180" height="127" /></a></p>
<p style="text-align:justify;">Monads and <a title="Monad transformer" href="http://en.wikipedia.org/wiki/Monad_transformer" rel="wikipedia">monad transformers</a> have a wholly undeserved reputation for being somewhat fearful and hard to understand. Unfortunately, even the best books on <a class="zem_slink" title="Haskell (programming language)" href="http://haskell.org" rel="homepage">Haskell</a> tend to further this reputation by choosing to introduce monads by giving a couple of examples, then stating the <a class="zem_slink" title="Monad (functional programming)" href="http://en.wikipedia.org/wiki/Monad_%28functional_programming%29" rel="wikipedia">monad laws</a> and running away very fast, and the treatment of monad transformers, even in the otherwise excellent <em><a href="http://book.realworldhaskell.org/read/" target="_blank">Real World Haskell</a></em>, is unclear at best.</p>
<p style="text-align:justify;">As I said, this reputation is undeserved. In this paper I will attempt to give a general motivation for monads as machines which carry around information not all of which is visible at any time, and for which there is a defined recipe to, given two old machines, make a new one</p>
<div class="mceTemp"></div>
<p style="text-align:justify;">. I then move on to do the same for the closely related topics of monoids, additive monads (<em>MonadPlus</em> in Haskell) and finally monad transformers.</p>
<p style="text-align:justify;">For each of these types I give motivation, an explanation of why the monad laws etc are the way they are, and examples, generally simple ones.  The section on monad transformers is more complex than the rest: I demonstrate a completely general way in which given two monads <em>m</em> and <em>t</em> then <em>Trans t m a </em>:= <em>m (t a)</em> is a <a class="zem_slink" title="Monad (music)" href="http://en.wikipedia.org/wiki/Monad_%28music%29" rel="wikipedia">monad</a>, and <em>Trans t</em> is a monad transformer.  I then show that the classical <em>MaybeT</em> monad transformer is an instance of this construction.  As far as I am aware, this is not written down anywhere easily accessible, so this is a useful contribution not only to pedagogy, but to the general theory of monad transformers.</p>
<p style="text-align:justify;">So here it is:</p>
<ul>
<li><a href="http://jpembeddedsolutions.files.wordpress.com/2011/11/monads.pdf" target="_blank">What is a monad?</a> (PDF file)</li>
</ul>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jpembeddedsolutions.wordpress.com/163/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jpembeddedsolutions.wordpress.com/163/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jpembeddedsolutions.wordpress.com/163/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jpembeddedsolutions.wordpress.com/163/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jpembeddedsolutions.wordpress.com/163/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jpembeddedsolutions.wordpress.com/163/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jpembeddedsolutions.wordpress.com/163/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jpembeddedsolutions.wordpress.com/163/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jpembeddedsolutions.wordpress.com/163/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jpembeddedsolutions.wordpress.com/163/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jpembeddedsolutions.wordpress.com/163/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jpembeddedsolutions.wordpress.com/163/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jpembeddedsolutions.wordpress.com/163/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jpembeddedsolutions.wordpress.com/163/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jpembeddedsolutions.wordpress.com&amp;blog=21775404&amp;post=163&amp;subd=jpembeddedsolutions&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jpembeddedsolutions.wordpress.com/2011/11/17/what-is-a-monad/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b55aba7856cfdcaff62973e6444b8235?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jdstmporter</media:title>
		</media:content>

		<media:content url="http://upload.wikimedia.org/wikipedia/commons/thumb/1/1c/Haskell-Logo.svg/300px-Haskell-Logo.svg.png" medium="image" />
	</item>
		<item>
		<title>Combining Lists, Monads &amp; Applicative Functors</title>
		<link>http://jpembeddedsolutions.wordpress.com/2011/11/10/combining-lists-monads-applicative-functors/</link>
		<comments>http://jpembeddedsolutions.wordpress.com/2011/11/10/combining-lists-monads-applicative-functors/#comments</comments>
		<pubDate>Thu, 10 Nov 2011 19:16:29 +0000</pubDate>
		<dc:creator>Julian Porter</dc:creator>
				<category><![CDATA[Functional Programming]]></category>
		<category><![CDATA[Haskell]]></category>
		<category><![CDATA[Languages]]></category>
		<category><![CDATA[Applicative Functor]]></category>
		<category><![CDATA[liftA]]></category>
		<category><![CDATA[liftM]]></category>
		<category><![CDATA[List]]></category>
		<category><![CDATA[mapA]]></category>
		<category><![CDATA[MapM]]></category>
		<category><![CDATA[MapM2]]></category>
		<category><![CDATA[Monad]]></category>

		<guid isPermaLink="false">http://jpembeddedsolutions.wordpress.com/?p=156</guid>
		<description><![CDATA[This is an updated version of a previous post called Combining Haskell lists with monads. This version includes discussion of how the purely monadic approach taken in that paper can be extended to applicative functors and other such things. A common problem Say I am writing some code in Haskell, and I have a value [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jpembeddedsolutions.wordpress.com&amp;blog=21775404&amp;post=156&amp;subd=jpembeddedsolutions&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:center;"><span style="color:#333399;">This is an updated version of a previous post called <em><a title="Combining Haskell lists with monads" href="http://jpembeddedsolutions.wordpress.com/2011/07/24/combining-haskell-lists-with-monads/">Combining Haskell lists with monads</a></em>. This version includes discussion of how the purely monadic approach taken in that paper can be extended to applicative functors and other such things.</span></p>
<h2 style="text-align:justify;">A common problem</h2>
<p style="text-align:justify;">Say I am writing some code in Haskell, and I have a value of type <code>a</code> and a list of type <code>[b] </code> that I want to convert into a list of type <code>[(a,b)]</code> where every entry is one of the pair of the a value and one of the values from the list. So I want a function:</p>
<pre>pairThem :: a -&gt; [b] -&gt; [(a,b)]</pre>
<p style="text-align:justify;"><em></em>the &#8216;obvious&#8217; solution is one of</p>
<pre>pairThem x ys = map (\y -&gt; (x,y)) ys</pre>
<p style="text-align:justify;">or</p>
<pre>pairThem x ys = zip (repeat x) ys</pre>
<p style="text-align:justify;">Simple enough, but they&#8217;re hard to generalise, the use of a lambda to do something so simple is rather ugly, and using infinite lists on such a problem seems rather excessive, I feel.</p>
<p style="text-align:justify;">What I&#8217;m going to do here is take a detour via monad which helps motivate the concept of an applicative functor, which is not always well-explained, giving an elementary explanation for where they come from and why. So I&#8217;ll discuss monads, then applicative functors, always bearing in mind the example of the list, which is an instance of each.</p>
<h2 style="text-align:justify;">Using a monad</h2>
<p style="text-align:justify;">It&#8217;s more illuminating to remember that lists form a monad. If we look for a monadic solution we see beyond the surface problem of manipulating lists and can get an insight into what&#8217;s really going on, as well as seeing just how powerful monads can be. So the natural function with the right signature is</p>
<pre>pairThem x ys = liftM2 (,) [x] ys</pre>
<p style="text-align:justify;">But <code>[x] = return x</code> in the list monad, so in fact we could write this as</p>
<pre>pairThem :: (Monad m) =&gt; a -&gt; m b -&gt; m (a,b)
pairThem x ys = liftM2 (,) (return x) ys</pre>
<p style="text-align:justify;">This works (see the illustration) but the point is that we&#8217;re not doing anything list-specific any more. This is a piece of extremely generic monadic code for pairing two monad values to get a monadic tuple value. One of the main goals in writing Haskell code is to make your code as generic as possible. Here I&#8217;ve gone from writing code which insists that I use lists to code that requires only a monad. This must be a good thing.</p>
<h3 style="text-align:justify;">Why does it work?</h3>
<p style="text-align:justify;"><code>liftM2</code> is usually defined as</p>
<pre>liftM2 :: (Monad m) =&gt; (a -&gt; b -&gt; c) -&gt; m a -&gt; m b -&gt; m c
liftM2 f mx my = do
  x &lt;- mx
  y &lt;- my
  return $ f x y</pre>
<p style="text-align:justify;">which can be rewritten in a more functional way as</p>
<pre>liftM2 f mx my = mx &gt;&gt;= (\x -&gt; my &gt;&gt;= (\y -&gt; return (f x y)))</pre>
<p style="text-align:justify;">(it&#8217;s a good exercise to see why these are equivalent). So when <code>m = []</code> and <code>f = (,)</code> let&#8217;s take this apart. First :</p>
<pre>(\x -&gt; my &gt;&gt;= (\y -&gt; return (f x y)) = (\x -&gt; concatMap (\y -&gt; [(x,y)]) my)</pre>
<p style="text-align:justify;">and so</p>
<pre>liftM2 (,) mx my = mx &gt;&gt;= (\x -&gt; (\y -&gt; concatMap [(x,y)]) my)
                 = concatMap (\x -&gt; (\y -&gt; concatMap [(x,y)]) my) mx</pre>
<p style="text-align:justify;">which, when <code>mx = [x]</code>, reduces to</p>
<pre>liftM2 (,) [x] my = concatMap (\y -&gt; [(x,y)]) my = map (\y -&gt; (x,y)) my</pre>
<p style="text-align:justify;">which is where we started.</p>
<h3 style="text-align:justify;">Generalisations</h3>
<p style="text-align:justify;">We can see immediately that in fact the function</p>
<pre>cartesian :: (Monad m) =&gt; m a -&gt; m b -&gt; m (a,b)
cartesian = liftM2 (,)</pre>
<p style="text-align:justify;">will, when applied to lists, produce their Cartesian product (all pairs with one value in the pair from each list). You would normally be taught to do that with a list comprehension</p>
<pre>[(x,y) | x &lt;- xs, y &lt;- ys]</pre>
<p style="text-align:justify;">So the moral is, monads can do an awful lot that you might not expect, and much complex list manipulation can be made into simple monadic operations if you look at it the right way. And, as well as genericity, simplicity has to be our goal: mistakes are far easier in complex code.</p>
<h2>Applicative Functors</h2>
<h3>Functors</h3>
<p style="text-align:justify;">We&#8217;re used to the idea of the Functor type. If <code>a</code> is a type and <code>f</code> is a parameterised type, then <code>f</code> is a functor if there is an operation</p>
<pre>fmap :: (a -&gt; b) -&gt; f a -&gt; f b</pre>
<p style="text-align:justify;">that lifts a function from bare types into a function between the <code>f</code> types that they parameterise. So if <code>f = []</code> then <code>fmap = map</code>. If <code>f</code> is a monad then <code>f = liftM</code>. To see that these two definitions are consistent observe that</p>
<pre>liftM f = (\ x -&gt; do
  a &lt;- x
  return $ f a</pre>
<p style="text-align:justify;">or, in the list monad,</p>
<pre>liftM f $ x = x &gt;&gt;= (return f)
            = concatMap (return f) x
            = map f x</pre>
<h3>Applicative Functors</h3>
<p style="text-align:justify;">Now, functions are types too, so if <code>f</code> is a functor, I can quite easily form the type</p>
<pre>f (a -&gt; b)</pre>
<p style="text-align:justify;">For example this could be a list of functions. Now what would I do with a list of functions <code>a -&gt; b</code>? Obviously, I could apply them to something in <code>a</code> to get a list of type <code>[b]</code>, or I could apply them to a list <code>[a]</code> to get a list <code>[b]</code>. Let&#8217;s take these in reverse order.</p>
<h4>Mapping a list to a new list</h4>
<p style="text-align:justify;">I want something like:</p>
<pre>apply :: (Functor f) =&gt; f (a -&gt; b) -&gt; f a -&gt; f b</pre>
<p style="text-align:justify;">Let&#8217;s take this apart. On lists I have to do this</p>
<pre>apply gs xs = concatMap (\ g -&gt; map g xs) gs</pre>
<p style="text-align:justify;">So I have to unwrap the list of functions <code>fs</code> to get at the individual functions within it, apply them individually to the data list <code>xs</code> and then concatenate the results.</p>
<p style="text-align:justify;">More generally, I need a function something like:</p>
<pre>(&lt;*&gt;) :: (Functor f) =&gt; f (a -&gt; b) -&gt; f a -&gt; f b</pre>
<p>such that</p>
<pre>apply = (&lt;*&gt;)</pre>
<p style="text-align:justify;">Clearly therefore we must have</p>
<pre>gs &lt;*&gt; xs = concatMap (\ g -&gt; map g xs) gs
          = gs &gt;&gt;= (\g -&gt; concatMap (return . g) xs)
          = gs &gt;&gt;= (\g -&gt; xs &gt;&gt;= (return . g))
          = gs `ap` xs</pre>
<h4>Mapping a list to a new list</h4>
<p>Now we want to do</p>
<pre>apply :: f (a -&gt; b) -&gt; a -&gt; f b</pre>
<p style="text-align:justify;">we already have <code>&lt;*&gt;</code>, so if we had a function</p>
<pre>pure  :: (Functor f) =&gt; a -&gt; f a</pre>
<p style="text-align:justify;">then we could take</p>
<pre>apply f x = f &lt;*&gt; (pure x)</pre>
<p style="text-align:justify;">On lists we clearly have</p>
<pre>pure x = [x]
       = return x</pre>
<h4>Defining the type</h4>
<p style="text-align:justify;">We have defined operations:</p>
<pre>pure  :: (Functor f) =&gt; a -&gt; f a
(&lt;*&gt;) :: (Functor f) =&gt; f (a -&gt; b) -&gt; f a -&gt; f b</pre>
<p style="text-align:justify;">A Functor with these two operations is called an <strong>Applicative Functor</strong>. In general, any monad can be made into an applicative functor by taking</p>
<pre>pure = return
&lt;*&gt;  = ap</pre>
<p style="text-align:justify;">just as we showed for lists above.</p>
<p style="text-align:justify;">Let us take stock. In general, if we have a functor <code>f</code> and a function</p>
<pre>g :: a -&gt; b</pre>
<p>Then we can form</p>
<pre>fmap . g : f a -&gt; f b</pre>
<p style="text-align:justify;">However, there is a much richer class of &#8216;functions&#8217; related to <code>f</code>, i.e. objects like</p>
<pre>h :: f (a -&gt; b)</pre>
<p style="text-align:justify;">So if we take <code>f = []</code> then <code>fmap</code> allows us to lift single functions to the monad, but applying <em>lists</em> of functions requires more machinery than just <code>fmap</code>. Similarly in the <code>State</code> monad then we can form</p>
<pre>liftM g :: State s a -&gt; State s b</pre>
<p style="text-align:justify;">which evaluates the monad and changes its value, but leaves the state alone. However there is a wider class of transformation</p>
<pre>h :: State s (a -&gt; b)</pre>
<p style="text-align:justify;">which combines a transformation of the value with a transformation of the state.</p>
<p style="text-align:justify;">Now, I can do this in any monad with <code>ap</code>. The strength of applicative functors lies in the fact that they allow this extra richness in transformations without demanding the full structure of a monad.</p>
<h4>A mathematical analogy</h4>
<p style="text-align:justify;">For those accustomed to simple algebra, here is an analogy. Say have a functor <img src='http://s0.wp.com/latex.php?latex=%5Cmathfrak%7BF%7D&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='&#92;mathfrak{F}' title='&#92;mathfrak{F}' class='latex' /> that takes rings to rank 2 free modules over those rings. So if <img src='http://s0.wp.com/latex.php?latex=f%3AA%5Crightarrow+B&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='f:A&#92;rightarrow B' title='f:A&#92;rightarrow B' class='latex' /> then <img src='http://s0.wp.com/latex.php?latex=%5Cmathfrak%7BF%7Df&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='&#92;mathfrak{F}f' title='&#92;mathfrak{F}f' class='latex' /> is the natural map</p>
<p><img src='http://s0.wp.com/latex.php?latex=%28x%2Cy%29%5Cmapsto+%28f+x%2Cf+y%29&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='(x,y)&#92;mapsto (f x,f y)' title='(x,y)&#92;mapsto (f x,f y)' class='latex' /></p>
<p style="text-align:justify;">This is precisely what <code>fmap</code> would do under the circumstances.</p>
<p style="text-align:justify;">However, the full space of morphisms <img src='http://s0.wp.com/latex.php?latex=%5Cmathfrak%7BF%7DA%5Crightarrow%5Cmathfrak%7BF%7DB&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='&#92;mathfrak{F}A&#92;rightarrow&#92;mathfrak{F}B' title='&#92;mathfrak{F}A&#92;rightarrow&#92;mathfrak{F}B' class='latex' /> should allow the first and second components of a morphism to differ, so we want morphisms like</p>
<p><img src='http://s0.wp.com/latex.php?latex=%28x%2Cy%29%5Cmapsto+%28f+x%2Cg+y%29&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='(x,y)&#92;mapsto (f x,g y)' title='(x,y)&#92;mapsto (f x,g y)' class='latex' /></p>
<p>And hence, very naturally, a map</p>
<p><img src='http://s0.wp.com/latex.php?latex=%5Cmathfrak%7BF%7D%5Ctext%7BMor%7D%28A%2CB%29%5Crightarrow%5Ctext%7BMor%7D%28%5Cmathfrak%7BF%7DA%2C%5Cmathfrak%7BF%7DB%29&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='&#92;mathfrak{F}&#92;text{Mor}(A,B)&#92;rightarrow&#92;text{Mor}(&#92;mathfrak{F}A,&#92;mathfrak{F}B)' title='&#92;mathfrak{F}&#92;text{Mor}(A,B)&#92;rightarrow&#92;text{Mor}(&#92;mathfrak{F}A,&#92;mathfrak{F}B)' class='latex' /></p>
<p style="text-align:justify;">This is precisely what an applicative functor gives us.</p>
<h3>Applying this to the problem</h3>
<p style="text-align:justify;">So, say <code>f</code> is an applicative functor. Clearly we have equivalents of <code>liftM</code> and <code>liftM2</code>:</p>
<pre>liftA  :: (Applicative f) =&gt; (a -&gt; b) -&gt; f a -&gt; f b
liftA g x = (pure g) &lt;*&gt; x

liftA2 :: (Applicative f) =&gt; (a -&gt; b -&gt; c) -&gt; f a -&gt; f b -&gt; f c
liftA2 g x y = ((pure g) &lt;*&gt; x) &lt;*&gt;  y</pre>
<p style="text-align:justify;">If <code>f</code> is a monad then</p>
<pre>liftA g x = (pure g) &lt;*&gt;  x
          = (return g) `ap` x
          = (return g) &gt;&gt;= (\g' -&gt; x &gt;&gt;= (\x' -&gt; (return . g') x))
          = x &gt;&gt;= (\x' -&gt; (return . g) x)
          = liftM g x

liftA2 g x y = ((pure g) &lt;*&gt;  x) &lt;*&gt;  y
             = (liftA g x) &lt;*&gt;  y
             = (liftM g x) `ap` y
             = (liftM g x) &gt;&gt;= (\g' -&gt; y &gt;&gt;= (return . g'))
             = x &gt;&gt;= (\x' -&gt; (return . g) x) &gt;&gt;=
                     (\g' -&gt; y &gt;&gt;= (\y' -&gt; (return . g') y'))
             = x &gt;&gt;= (\x' -&gt; y &gt;&gt;= (\y -&gt; return (g x y)))
             = liftM2 x y</pre>
<p style="text-align:justify;">So, in conclusion we can generalise our functions above still further to</p>
<pre>pairThem :: (Applicative f) =&gt; a -&gt; f b -&gt; f (a,b)
pairThem x ys = liftA2 (,) (pure x) &lt;*&gt; ys

cartesian :: (Applicative f) =&gt; f a -&gt; f b -&gt; f (a,b)
cartesian = liftA2 (,)</pre>
<p style="text-align:justify;">this, it turns out, is the most general way of expressing the operations we started from.</p>
<h2>Conclusion</h2>
<p style="text-align:justify;">So, what we have seen is first that it can always be worth looking for Monads, Functors and Applicative Functors lurking in apparently innocent problems, as they provide an extremely elegant way of reducing code to the most simple and minimal form.</p>
<p style="text-align:justify;">In addition, I have used this to motivate the class of Applicative Functor, which is a Functor <code>f</code> that lets me take a value of type <code>f (a -&gt; b)</code> and apply it to a value of type <code>f a</code> to get a <code>f b</code>, which is the natural generalisation of applying <code>map</code> across a list of functions. So Functors generalise applying a function to a list with <code>map</code>; Applicative Functors generalise using <code>concatMap</code> to apply a list of functions to a a list of values.</p>
<p style="text-align:justify;">The point of all this is as follows: if <code>f</code> is a parameterised type, then there is every chance that functions <code>f a -&gt; f b</code> are much richer than just <code>a -&gt; b</code>, and so the functorial operator <code>fmap</code> only gives access to part of this structure. The way we access this wider structure is by understanding <code>f (a -&gt; b)</code> and then using an applicative functor to transform this into functions <code>f a -&gt; f b</code>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jpembeddedsolutions.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jpembeddedsolutions.wordpress.com/156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jpembeddedsolutions.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jpembeddedsolutions.wordpress.com/156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jpembeddedsolutions.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jpembeddedsolutions.wordpress.com/156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jpembeddedsolutions.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jpembeddedsolutions.wordpress.com/156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jpembeddedsolutions.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jpembeddedsolutions.wordpress.com/156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jpembeddedsolutions.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jpembeddedsolutions.wordpress.com/156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jpembeddedsolutions.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jpembeddedsolutions.wordpress.com/156/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jpembeddedsolutions.wordpress.com&amp;blog=21775404&amp;post=156&amp;subd=jpembeddedsolutions&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jpembeddedsolutions.wordpress.com/2011/11/10/combining-lists-monads-applicative-functors/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b55aba7856cfdcaff62973e6444b8235?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jdstmporter</media:title>
		</media:content>
	</item>
		<item>
		<title>A datastore is a monad transformer</title>
		<link>http://jpembeddedsolutions.wordpress.com/2011/10/31/a-datastore-is-a-monad-transformer/</link>
		<comments>http://jpembeddedsolutions.wordpress.com/2011/10/31/a-datastore-is-a-monad-transformer/#comments</comments>
		<pubDate>Mon, 31 Oct 2011 22:55:12 +0000</pubDate>
		<dc:creator>Julian Porter</dc:creator>
				<category><![CDATA[Functional Programming]]></category>
		<category><![CDATA[Haskell]]></category>
		<category><![CDATA[additive monad]]></category>
		<category><![CDATA[Functional programming]]></category>
		<category><![CDATA[Monad]]></category>
		<category><![CDATA[monad plus]]></category>
		<category><![CDATA[Monad Transformer]]></category>
		<category><![CDATA[storage]]></category>

		<guid isPermaLink="false">http://jpembeddedsolutions.wordpress.com/?p=150</guid>
		<description><![CDATA[In the paper attached to my last post, I proved that any data store is a monad.  Then I proved that if the data was a monoid (so it has a zero and addition) then the store is a monoid too.  And then I asserted that if the data is a monad, then so is the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jpembeddedsolutions.wordpress.com&amp;blog=21775404&amp;post=150&amp;subd=jpembeddedsolutions&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:justify;">In the paper attached to my <a title="Distributed storage in Haskell" href="http://jpembeddedsolutions.wordpress.com/2011/10/30/distributed-storage-in-haskell/">last post</a>, I proved that any data store is a monad.  Then I proved that if the data was a <a class="zem_slink" title="Monoid" href="http://en.wikipedia.org/wiki/Monoid" rel="wikipedia">monoid</a> (so it has a zero and addition) then the store is a monoid too.  And then I asserted that if the data is a monad, then so is the store.  And said I wasn&#8217;t going to prove it.</p>
<p style="text-align:justify;">Well, it didn&#8217;t fit in that paper, but I thought it was worth writing down.  So, without further ado, I have written a very short note that:</p>
<ol>
<li>Describes how any data store can be made into a general <a class="zem_slink" title="Monad transformer" href="http://en.wikipedia.org/wiki/Monad_transformer" rel="wikipedia">monad transformer</a></li>
<li>Shows how, in the case of the trivial monad, this reduces to the simple storage monad described in the other post</li>
<li>Shows that if the underlying data is an additive monad, then so is the data store (which is basically just saying that it&#8217;s a monoid with &gt;&gt;=).</li>
</ol>
<p>And here it is: <a href="http://jpembeddedsolutions.files.wordpress.com/2011/10/storagemonad.pdf" target="_blank">note on storage as a monad transformer</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jpembeddedsolutions.wordpress.com/150/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jpembeddedsolutions.wordpress.com/150/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jpembeddedsolutions.wordpress.com/150/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jpembeddedsolutions.wordpress.com/150/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jpembeddedsolutions.wordpress.com/150/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jpembeddedsolutions.wordpress.com/150/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jpembeddedsolutions.wordpress.com/150/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jpembeddedsolutions.wordpress.com/150/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jpembeddedsolutions.wordpress.com/150/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jpembeddedsolutions.wordpress.com/150/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jpembeddedsolutions.wordpress.com/150/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jpembeddedsolutions.wordpress.com/150/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jpembeddedsolutions.wordpress.com/150/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jpembeddedsolutions.wordpress.com/150/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jpembeddedsolutions.wordpress.com&amp;blog=21775404&amp;post=150&amp;subd=jpembeddedsolutions&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jpembeddedsolutions.wordpress.com/2011/10/31/a-datastore-is-a-monad-transformer/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b55aba7856cfdcaff62973e6444b8235?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jdstmporter</media:title>
		</media:content>
	</item>
		<item>
		<title>Distributed storage in Haskell</title>
		<link>http://jpembeddedsolutions.wordpress.com/2011/10/30/distributed-storage-in-haskell/</link>
		<comments>http://jpembeddedsolutions.wordpress.com/2011/10/30/distributed-storage-in-haskell/#comments</comments>
		<pubDate>Sun, 30 Oct 2011 19:45:16 +0000</pubDate>
		<dc:creator>Julian Porter</dc:creator>
				<category><![CDATA[Functional Programming]]></category>
		<category><![CDATA[Haskell]]></category>
		<category><![CDATA[MapReduce]]></category>
		<category><![CDATA[CloudHaskell]]></category>
		<category><![CDATA[distributed]]></category>
		<category><![CDATA[distributed computing]]></category>
		<category><![CDATA[Functional programming]]></category>
		<category><![CDATA[storage]]></category>

		<guid isPermaLink="false">http://jpembeddedsolutions.wordpress.com/?p=145</guid>
		<description><![CDATA[As a part of my general programme of developing  a distributed monadic MapReduce implementation in Haskell (as described here), I have been working slowly on the distributed infrastructure required to do this, using CloudHaskell.  I have now succeeded in producing a very general proof-of-concept for distributed storage. This introduces some interesting challenges, as we want [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jpembeddedsolutions.wordpress.com&amp;blog=21775404&amp;post=145&amp;subd=jpembeddedsolutions&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:justify;">As a part of my general programme of developing  a distributed monadic MapReduce implementation in Haskell (as described <a title="MapReduce in Haskell" href="http://jpembeddedsolutions.wordpress.com/mapreduce-in-haskell/">here</a>), I have been working slowly on the distributed infrastructure required to do this, using <a href="http://research.microsoft.com/en-us/um/people/simonpj/papers/parallel/" target="_blank">CloudHaskell</a>.  I have now succeeded in producing a very general proof-of-concept for distributed storage.</p>
<p style="text-align:justify;">This introduces some interesting challenges, as we want the type of the data held in the service to change between rounds of processing, which may cause problems within Haskell&#8217;s strict type system.  I have found a very simple way around this which is simultaneously a strong enabler for storage services backed by (say) a database engine.</p>
<p style="text-align:justify;">So, I have written a description of how this was done (together with some interesting general observations about the properties of data stores) and made the code available via GIT:</p>
<ul>
<li>The paper <a href="http://jpembeddedsolutions.files.wordpress.com/2011/10/storage.pdf" target="_blank">Distributed Storage with CloudHaskell</a></li>
<li>The GIT repository: <a href="http://github.com/Julianporter/Distributed-Haskell" target="_blank">git://github.com/Julianporter/Distributed-Haskell.git</a></li>
</ul>
<p style="text-align:justify;">The paper discusses the type-related problem with message passing between distributed Haskell components at some length, to make it clear why we have to pass messages consisting of concrete types.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jpembeddedsolutions.wordpress.com/145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jpembeddedsolutions.wordpress.com/145/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jpembeddedsolutions.wordpress.com/145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jpembeddedsolutions.wordpress.com/145/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jpembeddedsolutions.wordpress.com/145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jpembeddedsolutions.wordpress.com/145/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jpembeddedsolutions.wordpress.com/145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jpembeddedsolutions.wordpress.com/145/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jpembeddedsolutions.wordpress.com/145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jpembeddedsolutions.wordpress.com/145/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jpembeddedsolutions.wordpress.com/145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jpembeddedsolutions.wordpress.com/145/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jpembeddedsolutions.wordpress.com/145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jpembeddedsolutions.wordpress.com/145/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jpembeddedsolutions.wordpress.com&amp;blog=21775404&amp;post=145&amp;subd=jpembeddedsolutions&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jpembeddedsolutions.wordpress.com/2011/10/30/distributed-storage-in-haskell/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b55aba7856cfdcaff62973e6444b8235?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jdstmporter</media:title>
		</media:content>
	</item>
		<item>
		<title>Installing Debian on a SPARC ULTRA 10</title>
		<link>http://jpembeddedsolutions.wordpress.com/2011/10/27/installing-debian-on-a-sparc-ultra-10/</link>
		<comments>http://jpembeddedsolutions.wordpress.com/2011/10/27/installing-debian-on-a-sparc-ultra-10/#comments</comments>
		<pubDate>Thu, 27 Oct 2011 16:21:06 +0000</pubDate>
		<dc:creator>Julian Porter</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Advanced Packaging Tool]]></category>
		<category><![CDATA[Booting]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Distributions]]></category>
		<category><![CDATA[GNOME]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Operating system]]></category>
		<category><![CDATA[SPARC]]></category>
		<category><![CDATA[SPARC ULTRA]]></category>

		<guid isPermaLink="false">http://jpembeddedsolutions.wordpress.com/?p=138</guid>
		<description><![CDATA[Introduction I have an old SPARC ULTRA 10  lying around, and I thought to myself that as it wasn&#8217;t doing anything, and as there was a Debian distribution for SPARC, I&#8217;d give it a go.  After all, installing Debian on Intel boxes was easy, wasn&#8217;t it?  Eight hours later I can affirm that no, it is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jpembeddedsolutions.wordpress.com&amp;blog=21775404&amp;post=138&amp;subd=jpembeddedsolutions&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h1>Introduction</h1>
<div class="zemanta-img zemanta-action-dragged">
<p><a href="http://commons.wikipedia.org/wiki/File:Debian-OpenLogo.svg"><img class="zemanta-img-configured alignleft" style="border-color:black;border-style:solid;border-width:5px;margin:5px;" title="Debian OpenLogo" src="http://upload.wikimedia.org/wikipedia/commons/thumb/4/4a/Debian-OpenLogo.svg/109px-Debian-OpenLogo.svg.png" alt="Debian OpenLogo" width="109" height="144" /></a></p>
</div>
<div class="zemanta-img zemanta-action-dragged">
<p><a href="http://commons.wikipedia.org/wiki/File:Ic-photo-Sun--STP1030BGA-143--%28Ultra_SPARC-CPU%29.jpg"><img class="zemanta-img-configured alignright" style="margin:5px;" title="IC photo" src="http://upload.wikimedia.org/wikipedia/commons/thumb/a/a6/Ic-photo-Sun--STP1030BGA-143--%28Ultra_SPARC-CPU%29.jpg/300px-Ic-photo-Sun--STP1030BGA-143--%28Ultra_SPARC-CPU%29.jpg" alt="IC photo" width="146" height="144" /></a></p>
</div>
<p style="text-align:justify;">I have an old <a class="zem_slink" title="SPARC" href="http://en.wikipedia.org/wiki/SPARC" rel="wikipedia">SPARC ULTRA 10</a>  lying around, and I thought to myself that as it wasn&#8217;t doing anything, and as there was a <a class="zem_slink" title="Debian" href="http://www.debian.org/" rel="homepage">Debian</a> distribution for SPARC, I&#8217;d give it a go.  After all, installing Debian on Intel boxes was easy, wasn&#8217;t it?  Eight hours later I can affirm that no, it is not easy at all.  In fact, there are any number of pitfalls along the way for the unwary, and just following the instructions Debian give you will lead to staring at a blank screen wondering what went wrong.   All this information is somewhere in the internet, but it&#8217;s not even remotely in the same place. So, in the interest of all you people who might want to try to run Debian on a SPARC, here are my tips for successful installation.  Not that I promise they&#8217;ll work, but they might at least help . . .</p>
<h1 style="text-align:justify;">The installation</h1>
<h2>Boot media</h2>
<p style="text-align:justify;">I decided to go for a network install CD, which is 140 MB, and sets up the core system, downloading everything else.  So here comes problem number one.  The official Debian SPARC network install image is <a href="http://www.debian.org/CD/netinst/" target="_blank">here</a>, but you don&#8217;t want that, because it crashes half way through trying to boot the kernel.  You want the <em>testing</em> version of the image, which you download here:</p>
<ul>
<li><a href="http://cdimage.debian.org/cdimage/daily-builds/daily/arch-latest/sparc/iso-cd/debian-testing-sparc-netinst.iso" target="_blank">http://cdimage.debian.org/cdimage/daily-builds/daily/arch-latest/sparc/iso-cd/debian-testing-sparc-netinst.iso</a></li>
</ul>
<h2>Boot parameters</h2>
<p style="text-align:justify;">Okay, so now you can do</p>
<pre>boot cdrom</pre>
<p style="text-align:justify;">to get to the kernel boot prompt.  You might think the obvious thing to do would be just to press enter to go for the default boot.  And if you try that then things go swimmingly right up to the point where the Debian installer  tries to install DHCP, at which point it finds the package doesn&#8217;t have a valid PKI signature, and it asks you what to do about it.  Unfortunately, it asks you via the serial port.  So, you could connect up a terminal emulator to the serial port, or you could do this: when you are asked to select a boot type, enter:</p>
<pre>expert debian-installer/allow_unauthenticated=true</pre>
<h2>Selecting a kernel</h2>
<p>I chose<span style="color:#000080;"> linux-image-3.0.0-1-sparc64</span> out of the available options.  It seemed sensible to have the most up-to-date alternative.</p>
<h2>Selecting packages</h2>
<p style="text-align:justify;">Now everything will go fine right up to the point where the base system s installed and you have to decide which of the major software packages to install.  Things like <em>web server</em> and <em>graphical user interface</em>.  Whatever you do, do <strong>not</strong> select any of the groups.  If you do, then it will install all of them and then, just as it&#8217;s processing the last one, the installer will crash.  Just go with the pre-selected set of utilities, press go, and after a wait, you should end up with a basic text-based Debian system.</p>
<p style="text-align:justify;">I say should: it depends on your choice of network mirror.  Bizarrely, slow mirrors seem to work better.  So if it crashes the first time, try another mirror.  However, in that case the safest option is to skip this step entirely, and jump straight to installing the boot-loader.</p>
<h1 style="text-align:justify;">The software selection</h1>
<p style="text-align:justify;">Now is the time to work out what you actually want running on your SPARC.  the <a class="zem_slink" title="GNOME" href="http://www.gnome.org/" rel="homepage">GNOME desktop environment</a> does slow the thing down tremendously, so if you want to use the machine primarily as a server, I recommend just installing the packages you want with <span style="color:#000080;">aptitude</span>.  However <span style="color:#ff0000;"><strong>BEWARE</strong></span>:.  If you try to install too many packages at once, <span style="color:#000080;">aptitude</span> will crash.  So just install a few at a time.  Alternatively, install as much as possible from the command line with <span style="color:#000080;"><a class="zem_slink" title="Advanced Packaging Tool" href="http://wiki.debian.org/Apt" rel="homepage">apt-get</a><span style="color:#000000;"> (running as root)</span></span>.</p>
<p style="text-align:justify;">This naturally means installing GNOME is a positive minefield.  If you must do it, invoke the following:</p>
<pre style="text-align:justify;">apt-get install xorg gdm gnome gnome-desktop</pre>
<p style="text-align:justify;">That <em>should</em> work.  If it crashes, reboot, then do</p>
<pre style="text-align:justify;">dpkg --configure -a</pre>
<p style="text-align:justify;">and then re-run the <span style="color:#000080;">apt-get</span>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jpembeddedsolutions.wordpress.com/138/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jpembeddedsolutions.wordpress.com/138/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jpembeddedsolutions.wordpress.com/138/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jpembeddedsolutions.wordpress.com/138/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jpembeddedsolutions.wordpress.com/138/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jpembeddedsolutions.wordpress.com/138/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jpembeddedsolutions.wordpress.com/138/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jpembeddedsolutions.wordpress.com/138/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jpembeddedsolutions.wordpress.com/138/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jpembeddedsolutions.wordpress.com/138/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jpembeddedsolutions.wordpress.com/138/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jpembeddedsolutions.wordpress.com/138/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jpembeddedsolutions.wordpress.com/138/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jpembeddedsolutions.wordpress.com/138/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jpembeddedsolutions.wordpress.com&amp;blog=21775404&amp;post=138&amp;subd=jpembeddedsolutions&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jpembeddedsolutions.wordpress.com/2011/10/27/installing-debian-on-a-sparc-ultra-10/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b55aba7856cfdcaff62973e6444b8235?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jdstmporter</media:title>
		</media:content>

		<media:content url="http://upload.wikimedia.org/wikipedia/commons/thumb/4/4a/Debian-OpenLogo.svg/109px-Debian-OpenLogo.svg.png" medium="image">
			<media:title type="html">Debian OpenLogo</media:title>
		</media:content>

		<media:content url="http://upload.wikimedia.org/wikipedia/commons/thumb/a/a6/Ic-photo-Sun--STP1030BGA-143--%28Ultra_SPARC-CPU%29.jpg/300px-Ic-photo-Sun--STP1030BGA-143--%28Ultra_SPARC-CPU%29.jpg" medium="image">
			<media:title type="html">IC photo</media:title>
		</media:content>
	</item>
		<item>
		<title>MapReduce as a monad transformer</title>
		<link>http://jpembeddedsolutions.wordpress.com/2011/10/16/mapreduce-as-a-monad-transformer/</link>
		<comments>http://jpembeddedsolutions.wordpress.com/2011/10/16/mapreduce-as-a-monad-transformer/#comments</comments>
		<pubDate>Sun, 16 Oct 2011 14:07:36 +0000</pubDate>
		<dc:creator>Julian Porter</dc:creator>
				<category><![CDATA[Functional Programming]]></category>
		<category><![CDATA[Haskell]]></category>
		<category><![CDATA[MapReduce]]></category>
		<category><![CDATA[State Monad]]></category>
		<category><![CDATA[Monad]]></category>
		<category><![CDATA[Monad Transformer]]></category>
		<category><![CDATA[Cloud Haskell]]></category>

		<guid isPermaLink="false">http://jpembeddedsolutions.wordpress.com/?p=117</guid>
		<description><![CDATA[Current status A while ago, I wrote a piece describing a simple way of implementing MapReduce as a Monad in Haskell.  As part of my further research I&#8217;ve discovered that in fact MapReduce is very naturally a Monad Transformer.  This means that given any monadic type m one can associate to it a MapReduce type [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jpembeddedsolutions.wordpress.com&amp;blog=21775404&amp;post=117&amp;subd=jpembeddedsolutions&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h1>Current status</h1>
<p style="text-align:justify;">A while ago, I wrote a piece describing a simple way of implementing <a href="http://en.wikipedia.org/wiki/MapReduce" target="_blank">MapReduce</a> as a <a href="http://en.wikipedia.org/wiki/Monad_(functional_programming)" target="_blank">Monad</a> in <a class="zem_slink" title="Haskell (programming language)" href="http://haskell.org" rel="homepage">Haskell</a>.  As part of my further research I&#8217;ve discovered that in fact MapReduce is very naturally a Monad Transformer.  This means that given any <span class="zem_slink">monadic type</span> <em>m</em> one can associate to it a MapReduce type <em>MapReduceT m</em>.  If <em>m</em> is an Additive Monad, then so is <em>MapReduceT m</em>.</p>
<p style="text-align:justify;">This is theoretically interesting, as well as providing a nice pedagogical introduction to <a class="zem_slink" title="Monad transformer" href="http://en.wikipedia.org/wiki/Monad_transformer" rel="wikipedia">Monad Transformers</a> and <a href="http://en.wikipedia.org/wiki/Monad_(functional_programming)#Monadic_zero" target="_blank">Additive Monads</a>.  Furthermore, I have proved that the Haskell <a href="http://en.wikipedia.org/wiki/Monad_(functional_programming)#State_monads" target="_blank"><em>State</em> Monad</a> is in fact the MapReduce type associated to the (rather trivial) monad of maps.  I&#8217;ve written this up in a short paper, and would welcome comments and, to be honest, suggestions as to anywhere I could try to publish it.</p>
<h1 style="text-align:justify;">Next steps</h1>
<p style="text-align:justify;">I&#8217;m working (slowly) on a distributed version of this framework based on <a href="http://research.microsoft.com/en-us/um/people/simonpj/papers/parallel/" target="_blank">CloudHaskell</a>, at the moment limiting myself to the original, simple MapReduce monad.  So far I have distributed storage working, so when I get the time, it should not take much more effort.  If anyone is interested in joining in with this research programme, I&#8217;d be very happy to share the work.</p>
<h1 style="text-align:justify;">References</h1>
<p>Here are the relevant papers:</p>
<ol>
<li><a href="http://media.jpembeddedsolutions.com/pdf/mapreduce.pdf" target="_blank">Map Reduce as a Monad</a>: the original paper, published in The Monad Reader</li>
<li><a href="http://media.jpembeddedsolutions.com/pdf/mrmonad.pdf" target="_blank">The MapReduce type of a Monad</a>: the new paper describing <em>MapReduceT</em> and the relation to the <em>State</em> monad</li>
</ol>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jpembeddedsolutions.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jpembeddedsolutions.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jpembeddedsolutions.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jpembeddedsolutions.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jpembeddedsolutions.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jpembeddedsolutions.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jpembeddedsolutions.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jpembeddedsolutions.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jpembeddedsolutions.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jpembeddedsolutions.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jpembeddedsolutions.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jpembeddedsolutions.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jpembeddedsolutions.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jpembeddedsolutions.wordpress.com/117/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jpembeddedsolutions.wordpress.com&amp;blog=21775404&amp;post=117&amp;subd=jpembeddedsolutions&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jpembeddedsolutions.wordpress.com/2011/10/16/mapreduce-as-a-monad-transformer/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b55aba7856cfdcaff62973e6444b8235?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jdstmporter</media:title>
		</media:content>
	</item>
		<item>
		<title>Approaches to the service catalogue</title>
		<link>http://jpembeddedsolutions.wordpress.com/2011/10/10/approaches-to-the-service-catalogue/</link>
		<comments>http://jpembeddedsolutions.wordpress.com/2011/10/10/approaches-to-the-service-catalogue/#comments</comments>
		<pubDate>Mon, 10 Oct 2011 21:15:04 +0000</pubDate>
		<dc:creator>Julian Porter</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Delivery Management]]></category>
		<category><![CDATA[Agile]]></category>
		<category><![CDATA[agile delivery]]></category>
		<category><![CDATA[architecture]]></category>
		<category><![CDATA[extreme programming]]></category>
		<category><![CDATA[layered design]]></category>
		<category><![CDATA[RUP]]></category>
		<category><![CDATA[service based architecture]]></category>
		<category><![CDATA[XP]]></category>

		<guid isPermaLink="false">http://jpembeddedsolutions.wordpress.com/?p=113</guid>
		<description><![CDATA[Introduction One of the major problems facing IT providers is that of how we can be both quicker and cheaper.  Quicker in the sense that we need to be able to respond to new requirements from our customers in a timely way.  Cheaper in the sense that we urgently need to reduce whole-life support costs [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jpembeddedsolutions.wordpress.com&amp;blog=21775404&amp;post=113&amp;subd=jpembeddedsolutions&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h2>Introduction</h2>
<p style="text-align:justify;">One of the major problems facing IT providers is that of how we can be both quicker and cheaper.  Quicker in the sense that we need to be able to respond to new requirements from our customers in a timely way.  Cheaper in the sense that we urgently need to reduce whole-life support costs of our systems (Gartner estimate that 80% of the total cost of ownership of any IT system comes from life-time support: thus only 20% constitutes the only aspect of cost that we traditionally concern ourselves with).</p>
<p style="text-align:justify;">
It seems that we can actually solve both of these problems at once, the magic bullet in this case being the concept of <strong>service catalogue</strong>.  The argument goes that if we have a service catalogue of standard offerings to our customers, then we are quicker because most of the time we can meet requirements by something off the catalogue, which we know how to do, so (assuming, always that we have adopted those other magic bullets of <strong>capacity management<em> </em></strong>and <strong>capacity planning</strong>) meeting them should be just a matter of cranking the handle.  Similarly, we are cheaper because if we only support systems based on the catalogue, then we reduce the diversity of the install base, and so make it cheaper to support.</p>
<p style="text-align:justify;">
This argument is all very well as far as it goes, but unfortunately, as I will show below, it doesn’t go far enough, and in fact, if the service catalogue is implemented in the rather naïve way indicated above, then it will not do all we want of it; this is not to say that all those who have cried ‘the service catalogue is the answer’ are deluded, but simply that, as is the nature of magic bullets, the concept needs considerable refinement before it can be made to live up to its promise.</p>
<p style="text-align:justify;">
This note carries out the initial stage in that refinement, showing how what I will call a <strong>layered service catalogue</strong> can, by joining customer requirement management to a structured design process, go some way to making the potential benefits of reduced time to market (TTM) and total cost of ownership (TCO) realisable.  The method I will adopt is to analyse the naïve service catalogue view, to understand its benefits and disbenefits.  Then I will examine two antithetical approaches to maintaining the catalogue.  As it will turn out that the benefits and disbenefits of these two approaches are complementary, I will then perform the Hegelian two-step to arrive at a synthesis: the <strong>layered service catalogue</strong>.</p>
<p style="text-align:justify;">
Note that, for simplicity, I will discuss things from the point of view of an IT organisation offering services to its customers.  Of course, my discussion is entirely general, and so it can apply equally well to any delivery-based organisation.</p>
<h2> The naïve service catalogue</h2>
<h3>Description</h3>
<p style="text-align:justify;">This approach is very much as outlined as above, but I will put it more formally.  We have a catalogue of the services that it offers to its customers.  These are well-defined shrink-wrapped offerings, meaning that all design, etc work has been done and they basically consist of a blueprint from which a working copy of the service being offered can be built.</p>
<p style="text-align:justify;">
When a customer approaches us with a requirement, appropriate staff work with them to determine which offering from the catalogue is best suited to their needs.  Engineering staff can then be tasked with making an instance of that offering available for the customer (this may involve procurement, or simply reuse of existing capacity: for the purposes of my argument the question of where and the capacity is found is unimportant).</p>
<h3>Benefits</h3>
<p style="text-align:justify;">TTM is indeed reduced, because all that we ever do is to take a canned solution and put it out on the machine-room floor.  All the nasty, time-consuming, risky requirement analysis, system engineering, scope creep, testing, etc that takes up so much time is relegated to … <em>somewhere else</em><strong>.</strong></p>
<p style="text-align:justify;">
Similarly, TCO is reduced, for us at least, in that now instead of having a huge number of specially designed systems, each lovingly tailored to meet a specific requirement, now all it has to support is serried ranks of clones of the systems on the catalogue.  This reduces the diversity of the systems to be supported, making it possible to manage the IT infrastructure not as many separate systems (as at present) but as a largely unified estate of capacity, reducing ongoing support costs.  Thus, life-cycle support is reduced <em>provided that the catalogue does not get too large</em>.</p>
<h3>Disbenefits</h3>
<p style="text-align:justify;">Now consider the disbenefits.  As hinted in the comment above about TTM, this approach works perfectly provided customers never ask for anything new.  Unfortunately, this is just what they do all the time; the business does not stand still, so it is entirely unrealistic to assume that we can guess in advance what its customers will want from it in the next eighteen months.</p>
<p style="text-align:justify;">
What can we do to get around this?  Not much, to be honest.  We could use what I will call the <strong>yah-boo-sucks</strong> model, and tell our customers that we don’t care if they want something new: they’re not getting it.  That would be easy to do, and probably even fun, but it would not, perhaps, be very corporate-minded of us.  More practically, there are two antithetical approaches in common use today, which I will call the <strong>grand vision of the future</strong> and the <strong>vertical stovepipe</strong>.  Though neither is suitable on its own, it turns out that a dialectical synthesis of the two results in the required magic bullet.</p>
<h2>Thesis: grand vision of the future</h2>
<p style="text-align:justify;">Here a bunch of clever people get together and try to design the shape of the enterprise <em>n</em> years ahead; generally they do this by coming up with an <strong>architecture</strong> for the enterprise, which defines precisely what services everybody should offer to their customers.  By appropriate crystal-ball gazing, the clever people hope to make the architecture sufficiently general that it will last <em>n </em>years.</p>
<p style="text-align:justify;">
There are three major problems here.  First, as we know too well, crystal-ball gazing is not a very effective way of predicting the future, so we can be sure that the day after our shiny new architecture is approved and set in stone, some annoying customer will come up with a requirement that we didn’t think of, that it can’t meet.</p>
<p style="text-align:justify;">
Second, and following from this, if the architecture is really general enough to predict <em>n</em> years ahead, it is most likely to be so general that it is of no use in actually trying to define the services on the catalogue.</p>
<p style="text-align:justify;">
Third, this has been tried many times, not always with significant success.</p>
<p style="text-align:justify;">
Thus, this approach does little to deal with the actual problem of unpredictable requirements, and turns out to be little more than a very fancy equivalent to the yah-boo-sucks model.  However, it does score significantly in terms of TCO: if this approach can be made to work at all then reduced diversity in the install base can be designed in from the start.  This means that we support only a limited range of technologies implementing a limited number of pre-defined services, and so support cost, and hence TCO is reduced.</p>
<h2>Antithesis: the vertical stovepipe</h2>
<p style="text-align:justify;">Here, we get a new requirement that can’t be serviced from<strong> </strong>the catalogue and responds with the traditional cry of ‘we need a project!’<a title="" href="#_ftn1">[1]</a>  A project (or other similar delivery vehicle) is initiated, and it carries out a complete stand-alone requirements capture – design – test – build – TTO cycle, producing a system tailored to the requirement, which is then added to the catalogue.</p>
<p style="text-align:justify;">
This is not actually too bad, in that it provides a relatively economical way to get new designs onto the catalogue.  In terms of TTM, requirements that need a new project take longer than straightforward off-the-shelf service requests, but at least the customer will know that in advance, and by virtue of having (hopefully) agreed that they need something new, not something already on the catalogue, they will be aware that they will expect to wait longer to get it, and they will be able to monitor progress.  In other words, they carry out the classic schedule versus quality trade-off.</p>
<p style="text-align:justify;">
The problems start when I look at the TCO implications.  If the vertical stovepipe is adopted naively (I will show below how it can be adapted to get around this, so bear with me for now) then as it designs the new system <em>from scratch</em> there is no mechanism in place to force it to make use of <em>pre-existing components</em>, and so the size and diversity of the catalogue increases, meaning that over time we have to support more and more diverse systems, so TCO increases.</p>
<h2>Synthesis: the layered service catalogue</h2>
<p style="text-align:justify;">An architecture helps to reduce TCO, but is fundamentally unrealistic if it forces us to lock down the catalogue for however long.  Vertical stovepipes avoid lock down, but have a disastrous effect on TCO.  Somehow the two need to be joined together.</p>
<p style="text-align:justify;">
Let’s start by thinking about the process followed by the vertical stovepipe.  Basically it does the entire design waterfall: it starts from a requirement, then it designs a system: starting from a conceptual design, then adding on more detail, then choosing technologies to use, then designing components, then integrating them.</p>
<p style="text-align:justify;">
However, why does it have to do all of this?  Why can’t it reuse work already done before to design other similar systems?  For example, say I have been asked to produce a web service that has to meet all kinds of special security requirements that none of my existing web services are able to handle.  Do I really need to start again from scratch?  Isn’t there quite a lot I can reuse from my existing designs?</p>
<h3>Layers</h3>
<p style="text-align:justify;">Say, therefore that we have defined a set of standard points along the path from requirement to completely designed system (where these points are doesn’t matter for now; of course, if a standard process like RUP were being used then obvious points would be at the end of each of the four major phases).  Say that whenever we design a new service offering for the catalogue, the standard design process forces the designers to document their design at each of these points and then enter it into a managed <strong>layered service catalogue</strong>.</p>
<p style="text-align:justify;">
This means that the catalogue consists of a number of designs, each belonging to a specific <strong>layer</strong>, which corresponds to designs at one of the standard points, and hence to designs existing at a precisely defined level of abstraction, so the higher (i.e. more abstract) the layer a design is in, the more easy it is to extend it to add new capabilities.</p>
<p style="text-align:justify;">
Below the top layer, each design has a specific <strong>parent</strong>, which is the design in the layer above from which it was derived.  Designs in the top (most abstract) layer derive from a corporate architecture defined by the business, which describes what the business proposes its portfolio should look like.</p>
<p style="text-align:justify;">
The bottom (most concrete) layer of the catalogue corresponds to deployable systems, so it is equivalent to the naïve service catalogue.  It is the <em>catalogue of things that exist today</em>.</p>
<h3>Using the layers</h3>
<p style="text-align:justify;">Now say I have received a request from a customer for a particular requirement that can’t be met by one of my existing bottom layer designs.  I need to kick off a project (or whatever) to design and produce a system to meet the requirement.  What is new is that now I don’t tell the project (or whatever) design authority to go away and come up with a design.  Instead, she, and I look for something in the layered catalogue that can be used as a basis for meeting the requirement; in other words, instead of starting from scratch, she uses pre-existing designs in the layered catalogue to minimise the amount of new work she has to do (If she has to start from scratch, right at the top layer, then she has to base it on the corporate architecture; she would, of course, have to persuade me that the benefit to the business outweighed the obvious impact on TCO of doing so).</p>
<p style="text-align:justify;">
This carries obvious benefit: if the design authority increases reuse then we get to reduce risk, TTM (by not wasting time reinventing the wheel) <em>and TCO<strong> </strong></em>because new systems will most likely be based on partial designs for existing systems, and so will be close to them, hence reducing diversity.  As all designs will be fully documented, we will have a good understanding of what it has to support.  Also, <em>if we take care to include business criteria as well as technical criteria when deciding how much and what to reuse, we can trade-off quality against TCO</em>.</p>
<p style="text-align:justify;">
What’s more, this approach gives me an architecture for free; what is the compendium of service designs (existing at various levels of abstraction) within the layered catalogue, but an <strong>architecture</strong>?<a title="" href="#_ftn2">[2]</a>  Thus, it appears that this approach (particularly if supplemented by a structured design methodology that encourages good design practices, e.g. RUP, XP) gives another magic bullet: <strong>working strategically by thinking tactically</strong>.  If we follow it consistently, the result will be a consistent strategic architecture that evolves to meet changing business requirements.</p>
<p style="text-align:justify;">
Thus, I suggest that the following process can be adopted for using a layered service catalogue to meet a new requirement:</p>
<ul>
<li style="text-align:justify;">Always start at the bottom layer of the catalogue (services ready for implementation, capacity on demand).</li>
<li style="text-align:justify;">When dealing with a new requirement, search in each layer, starting from the bottom, for the design best able to meet the requirement; if none can be found proceed to the next layer up.</li>
<li style="text-align:justify;">At each point where the decision is made to proceed to a higher layer, a business decision must be made to trade off quality against impact on TCO of expanding the catalogue; as this impact increases the higher the layer you start from (as higher layers are more generic, and hence starting from them increases diversity in the lower layers) the more stringent this decision process should be.</li>
<li style="text-align:justify;">Once a suitable design has been located and an estimate of TCO impact and TTM have been received and approved, authorise a project (or whatever) to implement the requirement <em>starting from that design.</em></li>
<li style="text-align:justify;">Add all new designs (at each standard point passed) to the layered design catalogue in the appropriate layer.</li>
<li style="text-align:justify;">As the project progresses, place a decision point at the stage at which its design process hits one of the standard points: this is a good time to re-evaluate the projected TTM and TCO impact, and for us to determine whether to authorise continuing work.</li>
</ul>
<h2>What’s next?</h2>
<p style="text-align:justify;">I started off this note by expressing suspicion of magic bullets, and so, as I seem (mixing my metaphors horribly) to have pulled several rabbits out of hats in the course of my argument, it’s worthwhile to note places where more work is needed:</p>
<ul>
<li style="text-align:justify;">The ‘standard points’ in the design process need to be defined with sufficient precision that design authorities will know what they have to document and when.</li>
<li style="text-align:justify;">Following on from this, a standard design process is needed; this must be fully documented, with specifications of the standard points, documentation standards, etc.  This is particularly important, as the magic bullet of ‘working strategically by thinking tactically’ is crucially dependent on this process (for example, it must strongly encourage SDAs to design with reusability in mind).</li>
<li style="text-align:justify;">The process must be sufficiently rigorously defined and policed to prevent the natural tendency for design authorities to attempt to blur the distinction between the layers.<a title="" href="#_ftn3">[3]</a></li>
<li style="text-align:justify;">We need to join up design processes across the business.</li>
<li>We need to work out whether ‘we need a project’ is really a suitable response to any new requirement that involves more risk than crossing the road.  A more nuanced, perhaps contract-based, approach may be preferable, particularly as customers will generally be entirely uninterested in <em>how</em> we deliver their requirement, provided that it does, and that they can measure its success in so doing.</li>
<li>We need an approach to risk analysis suited to thinking in terms of TCO rather than (as in classic PRINCE 2) pure delivery cost.</li>
</ul>
<div>
<hr align="left" size="1" width="33%" />
<div>
<p><a title="" href="#_ftnref1">[1]</a> Or its younger cousin, ‘we need a managed solution!’</p>
</div>
<div>
<p style="text-align:justify;"><a title="" href="#_ftnref2">[2]</a> In fact, the layered catalogue could be said to be a library of design patterns on which I have imposed some additional structure (the layering, and the parent-child relationship between designs).  The key <em>difference</em> is that I have placed the layered catalogue in the context of a rigorous process which uses business criteria to drive the selection of a design (pattern), and not (as is more traditional) a techie’s passing whim.</p>
</div>
<div>
<p style="text-align:justify;"><a title="" href="#_ftnref3">[3]</a> For example, the process could be articulated as a series of phases, each corresponding to the progression from a parent design to a child in the next layer down; e.g. RUP.</p>
</div>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jpembeddedsolutions.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jpembeddedsolutions.wordpress.com/113/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jpembeddedsolutions.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jpembeddedsolutions.wordpress.com/113/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jpembeddedsolutions.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jpembeddedsolutions.wordpress.com/113/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jpembeddedsolutions.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jpembeddedsolutions.wordpress.com/113/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jpembeddedsolutions.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jpembeddedsolutions.wordpress.com/113/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jpembeddedsolutions.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jpembeddedsolutions.wordpress.com/113/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jpembeddedsolutions.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jpembeddedsolutions.wordpress.com/113/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jpembeddedsolutions.wordpress.com&amp;blog=21775404&amp;post=113&amp;subd=jpembeddedsolutions&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jpembeddedsolutions.wordpress.com/2011/10/10/approaches-to-the-service-catalogue/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b55aba7856cfdcaff62973e6444b8235?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jdstmporter</media:title>
		</media:content>
	</item>
		<item>
		<title>Combining Haskell lists with monads</title>
		<link>http://jpembeddedsolutions.wordpress.com/2011/07/24/combining-haskell-lists-with-monads/</link>
		<comments>http://jpembeddedsolutions.wordpress.com/2011/07/24/combining-haskell-lists-with-monads/#comments</comments>
		<pubDate>Sun, 24 Jul 2011 15:09:31 +0000</pubDate>
		<dc:creator>Julian Porter</dc:creator>
				<category><![CDATA[Functional Programming]]></category>
		<category><![CDATA[Haskell]]></category>
		<category><![CDATA[Techniques]]></category>
		<category><![CDATA[liftM2]]></category>
		<category><![CDATA[list comprehensions]]></category>
		<category><![CDATA[list monad]]></category>
		<category><![CDATA[lists]]></category>
		<category><![CDATA[monads]]></category>

		<guid isPermaLink="false">http://jpembeddedsolutions.wordpress.com/?p=99</guid>
		<description><![CDATA[A common problem Say I am writing some code in Haskell, and I have a value of type a and a list of type [b] that I want to convert into a list of type [(a,b)] where every entry is one of the pair of the a value and one of the values from the list. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jpembeddedsolutions.wordpress.com&amp;blog=21775404&amp;post=99&amp;subd=jpembeddedsolutions&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h2 style="text-align:justify;">A common problem</h2>
<p style="text-align:justify;">Say I am writing some code in Haskell, and I have a value of type <code>a</code> and a list of type <code>[b] </code> that I want to convert into a list of type <code>[(a,b)]</code> where every entry is one of the pair of the a value and one of the values from the list. So I want a function:</p>
<p style="text-align:justify;"><code style="text-align:justify;">pairThem :: a -&gt; [b] -&gt; [(a,b)]</code></p>
<p style="text-align:justify;"><em></em>the &#8216;obvious&#8217; solution is one of</p>
<p style="text-align:justify;"><code>pairThem x ys = map (\y -&gt; (x,y)) my</code></p>
<p style="text-align:justify;">or</p>
<p style="text-align:justify;"><code>pairThem x ys = zip (repeat x) ys </code></p>
<p style="text-align:justify;">Simple enough, but they&#8217;re hard to generalise, the use of a lambda to do something so simple is rather ugly, and using infinite lists on such a problem seems rather excessive, I feel.</p>
<h2 style="text-align:justify;">Using a monad</h2>
<p style="text-align:justify;">It&#8217;s more illuminating to remember that lists form a monad.  If we look for a monadic solution we see beyond the surface problem of manipulating lists and can get an insight into what&#8217;s really going on, as well as seeing just how powerful monads can be.  So  the natural function with the right signature is</p>
<p style="text-align:justify;"><code>pairThem x ys = liftM2 (,) [x] ys</code></p>
<p style="text-align:justify;">But  <code>[x] = return x</code>  in the list monad, so in fact we could write this as</p>
<p style="text-align:justify;"><code>pairThem :: (Monad m) =&gt; a -&gt; m b -&gt; m (a,b)</code><br />
<code>pairThem x ys = liftM2 (,) (return x) ys</code></p>
<p style="text-align:justify;">This works (see the illustration) but the point is that we&#8217;re not doing anything list-specific any more.  This is a piece of extremely generic monadic code for pairing two monad values to get a monadic tuple value.  One of the main goals in writing Haskell code is to make your code as generic as possible.  Here I&#8217;ve gone from writing code which insists that I use lists to code that requires only a monad.  This must be a good thing.</p>
<div class="mceTemp mceIEcenter" style="text-align:justify;">
<dl class="wp-caption aligncenter">
<dt class="wp-caption-dt"><a href="http://jpembeddedsolutions.files.wordpress.com/2011/07/ghci.png"><img class="size-full wp-image-100 " title="ghci" src="http://jpembeddedsolutions.files.wordpress.com/2011/07/ghci.png?w=406&#038;h=303" alt="ghci session" width="406" height="303" /></a></dt>
<dd class="wp-caption-dd">GHCI session illustrating use of liftM2</dd>
</dl>
</div>
<h2 style="text-align:justify;">Why does it work?</h2>
<p style="text-align:justify;"><code>liftM2</code> is usually defined as</p>
<p style="text-align:justify;"><code>liftM2 :: (a -&gt; b -&gt; c) -&gt; m a -&gt; m b -&gt; m c<br />
liftM2 f mx my =<br />
do<br />
x &lt;- mx<br />
y &lt;- my<br />
return (f x y)</code></p>
<p style="text-align:justify;">which can be rewritten in a more functional way as</p>
<p style="text-align:justify;"><code>liftM2 f mx my = mx &gt;&gt;= (\x -&gt; my &gt;&gt;= (\y -&gt; return (f x y)))</code></p>
<p style="text-align:justify;">(it&#8217;s a good exercise to see why these are equivalent).  So when <code>m = []</code> and <code>f = (,)</code> let&#8217;s take this apart. First :</p>
<p style="text-align:justify;"><code>(\x -&gt; my &gt;&gt;= return (\y -&gt; f x)) = (\x -&gt; concatMap (\y -&gt; [(x,y)]) my)</code></p>
<p style="text-align:justify;">and so</p>
<p style="text-align:justify;"><code>liftM2 (,) mx my = mx &gt;&gt;= (\x -&gt; (\y -&gt; concatMap [(x,y)]) my) </code></p>
<p style="text-align:justify;"><code>                 = concatMap (\x -&gt; (\y -&gt; concatMap [(x,y)]) my) mx</code></p>
<p style="text-align:justify;">which, when <code>mx = [x]</code>, reduces to</p>
<p style="text-align:justify;"><code>liftM2 (,) [x] my = concatMap (\y -&gt; [(x,y)]) my</code></p>
<p style="text-align:justify;"><code>                  = map (\y -&gt; (x,y)) my</code></p>
<p style="text-align:justify;">which is where we started.</p>
<h2 style="text-align:justify;">Generalisations</h2>
<p style="text-align:justify;">We can see immediately that in fact the function</p>
<p style="text-align:justify;"><code>cartesian :: (Monad m) =&gt; m a -&gt; m b -&gt; m (a,b)</code></p>
<p style="text-align:justify;"><code>cartesian = liftM2 (,)</code></p>
<p style="text-align:justify;">will, when applied to lists, produce their Cartesian product (all pairs with one value in the pair from each list).  You would normally be taught to do that with a list comprehension</p>
<p style="text-align:justify;"><code>[(x,y) | x &lt;- xs, y &lt;- ys]</code></p>
<p style="text-align:justify;">So the moral is, monads can do an awful lot that you might not expect, and much complex list manipulation can be made into simple monadic operations if you look at it the right way. And, as well as genericity, simplicity has to be our goal: mistakes are far easier in complex code.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jpembeddedsolutions.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jpembeddedsolutions.wordpress.com/99/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jpembeddedsolutions.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jpembeddedsolutions.wordpress.com/99/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jpembeddedsolutions.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jpembeddedsolutions.wordpress.com/99/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jpembeddedsolutions.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jpembeddedsolutions.wordpress.com/99/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jpembeddedsolutions.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jpembeddedsolutions.wordpress.com/99/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jpembeddedsolutions.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jpembeddedsolutions.wordpress.com/99/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jpembeddedsolutions.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jpembeddedsolutions.wordpress.com/99/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jpembeddedsolutions.wordpress.com&amp;blog=21775404&amp;post=99&amp;subd=jpembeddedsolutions&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jpembeddedsolutions.wordpress.com/2011/07/24/combining-haskell-lists-with-monads/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b55aba7856cfdcaff62973e6444b8235?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jdstmporter</media:title>
		</media:content>

		<media:content url="http://jpembeddedsolutions.files.wordpress.com/2011/07/ghci.png" medium="image">
			<media:title type="html">ghci</media:title>
		</media:content>
	</item>
		<item>
		<title>Steps towards Haskell in the cloud</title>
		<link>http://jpembeddedsolutions.wordpress.com/2011/05/09/steps-towards-haskell-in-the-cloud/</link>
		<comments>http://jpembeddedsolutions.wordpress.com/2011/05/09/steps-towards-haskell-in-the-cloud/#comments</comments>
		<pubDate>Mon, 09 May 2011 15:11:01 +0000</pubDate>
		<dc:creator>Julian Porter</dc:creator>
				<category><![CDATA[Functional Programming]]></category>
		<category><![CDATA[Haskell]]></category>
		<category><![CDATA[MapReduce]]></category>
		<category><![CDATA[CloudHaskell]]></category>
		<category><![CDATA[Distributed Haskell]]></category>
		<category><![CDATA[Distributed Storage]]></category>

		<guid isPermaLink="false">http://jpembeddedsolutions.wordpress.com/?p=77</guid>
		<description><![CDATA[Introduction I have a considerable interest in the use of massively parallel cloud systems for handling hard problems, but unfortunately they currently rely on extremely complex infrastructure that is quite intrusive when it comes to writing applications.  My intention is, and has been, to find a simple framework that can be used to provide cloud [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jpembeddedsolutions.wordpress.com&amp;blog=21775404&amp;post=77&amp;subd=jpembeddedsolutions&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h2>Introduction</h2>
<p>I have a considerable interest in the use of massively parallel cloud systems for handling hard problems, but unfortunately they currently rely on extremely complex infrastructure that is quite intrusive when it comes to writing applications.  My intention is, and has been, to find a simple framework that can be used to provide cloud computing capability for Haskell applications while remaining simple and lightweight.</p>
<p>I have discussed elsewhere my initial implementation of <a title="Implementing MapReduce in Haskell" href="http://jpembeddedsolutions.wordpress.com/2011/04/02/mapreduce/">MapReduce as a monadic operation</a> that works in parallel processes on a single machine.  Here I take the first steps towards analysing what else is needed to turn this into a working cloud based system.</p>
<h2>The basics</h2>
<p>As I showed in my paper on MapReduce, nearly all massively parallel algorithms are some kind of version of the basic scatter-gather approach.  This works as follows:</p>
<p><pre class="brush: csharp;">
foreach processing step
    divide data into chunks
    give chunks to processing units
    processing units transform data
    gather results from processing units
    concatenate to form next step's data
</pre></p>
<p>It&#8217;s useful to reformulate this from the processing unit&#8217;s point of view, so we get:</p>
<p><pre class="brush: csharp;">
foreach processing step
    request chunk of data
    while chunk allocated
        get chunk
        transform chunk
        set transformed chunk
        request chunk of data
</pre></p>
<p>This makes it clear that scatter-gather requires two basic distributed services.</p>
<h2>The services</h2>
<h3>The datastore</h3>
<p>First we need a simple <strong>central datastore</strong> that:</p>
<ol>
<li>Accepts chunks and concatenates them together to form a complete dataset</li>
<li>Can return the complete dataset when asked to</li>
</ol>
<p>This service is, of course, little more than a mildly intelligent front end on a database table.</p>
<p>Note that in standard MapReduce, the partitioning of data into chunks is performed by the central datastore.  In view of our desire to run <em>generalised</em> MapReduce, we have to send the entire dataset to all processing nodes.  In fact, if this is handled sensibly (e.g. via IP multicast) then there is no difference in network loading at all.</p>
<h3>The broker</h3>
<p>Next we need a <strong>broker</strong>, whose job is simply to wait for processing nodes to ask for chunks to be assigned to them, and either to do so or to inform them that the step is finished and they should proceed to the next step.  So the broker has to:</p>
<ol>
<li>Keep a track on how many processing nodes there are</li>
<li>Decide how many chunks to divide each step into</li>
<li>Wait for nodes to request chunks and hand them off one by one</li>
<li>Decide when the step is completed</li>
</ol>
<p>There is also a processing node component to the broker, which in each step accepts the processing function, asks for a chunk and waits for a response.  If a chunk is forthcoming, it gets the data, applies the function, puts back the result and asks for another chunk.  If none is forthcoming it goes on to the next step, accepting a new processing function and proceeding as before.</p>
<p>This structure suggests that in fact what we have here is some kind of distributed monad or related structure. Indeed, as it is clearly stateful, it is more or less inevitable that it should be.</p>
<h2>The next step</h2>
<p>I have made some observations about implementation, noting that the datastore is a glorified database table, and the broker could be a kind of monad. In my next piece I will follow up on this, and discuss (at a high level) some aspects of how exactly the services could be built.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jpembeddedsolutions.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jpembeddedsolutions.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jpembeddedsolutions.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jpembeddedsolutions.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jpembeddedsolutions.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jpembeddedsolutions.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jpembeddedsolutions.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jpembeddedsolutions.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jpembeddedsolutions.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jpembeddedsolutions.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jpembeddedsolutions.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jpembeddedsolutions.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jpembeddedsolutions.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jpembeddedsolutions.wordpress.com/77/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jpembeddedsolutions.wordpress.com&amp;blog=21775404&amp;post=77&amp;subd=jpembeddedsolutions&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jpembeddedsolutions.wordpress.com/2011/05/09/steps-towards-haskell-in-the-cloud/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b55aba7856cfdcaff62973e6444b8235?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jdstmporter</media:title>
		</media:content>
	</item>
		<item>
		<title>Measuring quality</title>
		<link>http://jpembeddedsolutions.wordpress.com/2011/04/05/measuring-quality/</link>
		<comments>http://jpembeddedsolutions.wordpress.com/2011/04/05/measuring-quality/#comments</comments>
		<pubDate>Tue, 05 Apr 2011 12:10:55 +0000</pubDate>
		<dc:creator>Julian Porter</dc:creator>
				<category><![CDATA[Delivery Management]]></category>
		<category><![CDATA[Metrics]]></category>
		<category><![CDATA[Quality measurement]]></category>
		<category><![CDATA[Requirement Specification]]></category>
		<category><![CDATA[Risk]]></category>

		<guid isPermaLink="false">http://jpembeddedsolutions.wordpress.com/?p=68</guid>
		<description><![CDATA[When I was working on IT strategy, something that always interested me was metrics: how were we to get objective measures of how well an IT business was doing.  It turns out that this is surprisingly hard to do.  Hardest of all criteria to measure was quality, the one that should have been the simplest. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jpembeddedsolutions.wordpress.com&amp;blog=21775404&amp;post=68&amp;subd=jpembeddedsolutions&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>When I was working on IT strategy, something that always interested me was metrics: how were we to get objective measures of how well an IT business was doing.  It turns out that this is surprisingly hard to do.  Hardest of all criteria to measure was quality, the one that should have been the simplest.</p>
<p>It turns out that this is basically because nobody has a clue what quality means, and so people go between the extremes of customer satisfaction surveys (totally subjective) and immensely complex requirement to product linkage measures (objective in themselves, but entirely subjective when it comes to deciding what the requirements actually were).  None of these are very satisfactory.</p>
<p>So, I had a think, and I realised that there is one unifying feature that both customer and supplier can agree on: risk.  What happens in any procurement is that the customer had a risk, and they pay the supplier to mitigate it.  So why not measure quality in terms of the amount of risk mitigated?</p>
<p>This is very easy to understand, but there&#8217;s something else.  If the customer gives the supplier a 473 page requirement document, they are basically saying &#8216;we want the solution to look like this&#8217;.  If they specify the risk they are facing, the supplier is free to provide the most effective mitigation <em>whatever it may be</em>.  It may well be that the best solution is not technical at all, but a process change.</p>
<p>So: simple, precise, enabling.  All good things.  I&#8217;ve put up a draft paper, on which I would be very glad to receive comments.</p>
<ul>
<li><a title="An approach to measuring quality" href="http://jpembeddedsolutions.wordpress.com/an-approach-to-measuring-quality/">Draft paper on measuring quality</a></li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jpembeddedsolutions.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jpembeddedsolutions.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jpembeddedsolutions.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jpembeddedsolutions.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jpembeddedsolutions.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jpembeddedsolutions.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jpembeddedsolutions.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jpembeddedsolutions.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jpembeddedsolutions.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jpembeddedsolutions.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jpembeddedsolutions.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jpembeddedsolutions.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jpembeddedsolutions.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jpembeddedsolutions.wordpress.com/68/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jpembeddedsolutions.wordpress.com&amp;blog=21775404&amp;post=68&amp;subd=jpembeddedsolutions&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jpembeddedsolutions.wordpress.com/2011/04/05/measuring-quality/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b55aba7856cfdcaff62973e6444b8235?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jdstmporter</media:title>
		</media:content>
	</item>
	</channel>
</rss>
