Jonathan,<div><br></div><div>Nice! Thanks. In addition to implementations, do we have more mathematical accounts? Let me expose more of my motives.</div><div><ul><li>i am interested in a first-principles notion of data. Neither lambda nor ð-calculus come with a criterion for determining which terms represent data and which programs. You can shoe-horn in such notions -- and it is clear that practical programming relies on such a separation -- but along come nice abstractions like generic programming and the boundary starts moving again. (Note, also that one of the reasons i mention ð-calculus is because when you start shipping data between processes you&#39;d like to know that this term really is data and not some nasty little program...)&nbsp;One step towards a first-principles characterization of data (as separate from program) is a first-principles characterization of containers.</li>
<ul><li>Along these lines Barry Jay&#39;s pattern-matching calculus is an intriguing step towards such a characterization. This also links up with Foldable and Traversable.</li><li>i also looked at variants of Wischik&#39;s fusion calculus in which Abramsky&#39;s proof expressions characterize the notion of shippable data. (Part of the intuition here is that shippable data really ought to have a terminating access property for access to some interior region. The linear types for proof expressions guarantee such a property for all well-typed terms.)</li>
</ul><li>There is a real tension between nominal strategies and structural strategies for accessing data. This is very stark when one starts adding notions of data to the &nbsp;ð-calculus -- which is entirely nominal in characterization. Moreover, accessing some piece of data by path is natural, obvious and programmatically extensible. Accessing something by name is fast. These two ideas come together if one&#39;s nominal technology (think Gabbay-Pitt&#39;s freshness widgetry) comes with a notion of names that have structure.*</li>
<li>Finally, i think the notion of take-out option has something to do with being able to demarcate regions. In this sense i think there is a very deep connection with &nbsp;Oleg&#39;s investigations of delimited continuations and -- forgive the leap -- Linda tuple spaces.</li>
</ul><div>As i&#39;ve tried to indicate, in much the same way that monad is a very, very general abstraction, i believe that there are suitably general abstractions that account for a broad range of phenomena and still usefully separate a notion of data from a notion of program. The category theoretic account of monad plays a very central role in exposing the generality of the abstraction (while Haskell&#39;s presentation has played a very central role in understanding the utility of such a general abstractin). A similarly axiomatic account of the separation of program from data could have applicability and utility we haven&#39;t even dreamed of yet.</div>
</div><div><br></div><div>Best wishes,</div><div><br></div><div>--greg</div><div><br></div><div>* i simply cannot resist re-counting an insight that i got from Walter Fontana, Harvard Systems Biology, when we worked together. In some sense the dividing line between alchemy and chemistry is the periodic table. Before the development of the periodic table a good deal of human investigation of material properties could be seen as falling under the rubric alchemy. After it, chemistry. If you stare at the periodic table you see that the element names do not matter. They are merely convenient ways of referring to the positional information of the table. From a position in the table you can account for and predict all kind of properties of elements (notice that all the noble gases line up on the right!). Positions in the table -- kinds of element -- can be seen as &#39;names with structure&#39;, the structure of which determines the properties of instances of said kind. i believe that a first-principles account of the separation of program and data could have as big an impact on our understanding of the properties of computation as the development of the periodic table had on our understanding of material properties.<br>
<br><div class="gmail_quote">On Mon, Nov 24, 2008 at 2:30 PM, Jonathan Cast <span dir="ltr">&lt;<a href="mailto:jonathanccast@fastmail.fm">jonathanccast@fastmail.fm</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="Ih2E3d">On Mon, 2008-11-24 at 14:06 -0800, Greg Meredith wrote:<br>
&gt; Haskellians,<br>
<br>
&gt; Some monads come with take-out options, e.g.<br>
&gt; &nbsp; &nbsp; &nbsp; * List<br>
&gt; &nbsp; &nbsp; &nbsp; * Set<br>
&gt; In the sense that if unit : A -&gt; List A is given by unit a = [a], then<br>
&gt; taking the head of a list can be used to retrieve values from inside<br>
&gt; the monad.<br>
<br>
&gt; Some monads do not come with take-out options, IO being a notorious<br>
&gt; example.<br>
<br>
&gt; Some monads, like Maybe, sit on the fence about take-out. They&#39;ll<br>
&gt; provide it when it&#39;s available.<br>
<br>
</div>It might be pointed out that List and Set are also in this region. &nbsp;In<br>
fact, Maybe is better, in this regard, since you know, if fromJust<br>
succeeds, that it will only have once value to return. &nbsp;head might find<br>
one value to return, no values, or even multiple values.<br>
<br>
A better example of a monad that always has a left inverse to return is<br>
((,) w), where w is a monoid. &nbsp;In this case,<br>
<br>
 &nbsp; &nbsp;snd . return = id :: a -&gt; a<br>
<br>
as desired (we always have the left inverses<br>
<br>
 &nbsp; &nbsp;join . return = id :: m a -&gt; m a<br>
<br>
where join a = a &gt;&gt;= id).<br>
<div class="Ih2E3d"><br>
&gt; Now, are there references for a theory of monads and take-out options?<br>
&gt; For example, it seems that all sensible notions of containers have<br>
&gt; take-out.<br>
<br>
</div>Sounds reasonable. &nbsp;Foldable gives you something:<br>
<br>
 &nbsp;foldr const undefined<br>
<br>
will pull out the last value visited by foldr, and agrees with head at [].<br>
<div class="Ih2E3d"><br>
&gt; Can we make the leap and define a container as a monad with a notion<br>
&gt; of take-out?<br>
<br>
</div>If you want. &nbsp;I&#39;d rather define a container to be Traversable; it<br>
doesn&#39;t exclude anything interesting (that I&#39;m aware of), and is mostly<br>
more powerful.<br>
<br>
&gt; Has this been done?<br>
<br>
Are you familiar at all with Foldable<br>
(<a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Data-Foldable.html#t%3AFoldable" target="_blank">http://haskell.org/ghc/docs/latest/html/libraries/base/Data-Foldable.html#t%3AFoldable</a>) and Traversable (<a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Data-Traversable.html#t%3ATraversable" target="_blank">http://haskell.org/ghc/docs/latest/html/libraries/base/Data-Traversable.html#t%3ATraversable</a>)<br>

<br>
jcc<br>
<br>
<br>
</blockquote></div><br><br clear="all"><br>-- <br>L.G. Meredith<br>Managing Partner<br>Biosimilarity LLC<br>806 55th St NE<br>Seattle, WA 98105<br><br>+1 206.650.3740<br><br><a href="http://biosimilarity.blogspot.com">http://biosimilarity.blogspot.com</a><br>

</div>