<!-- 
RSS generated by JIRA (4.4#649-r158309) at Tue May 21 16:41:58 CDT 2013

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary add field=key&field=summary to the URL of your request.
For example:
http://dev.clojure.org/jira/si/jira.issueviews:issue-xml/ALGOM-4/ALGOM-4.xml?field=key&field=summary
-->
<rss version="0.92" >
<channel>
    <title>Clojure JIRA</title>
    <link>http://dev.clojure.org/jira</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>4.4</version>
        <build-number>649</build-number>
        <build-date>25-07-2011</build-date>
    </build-info>

<item>
            <title>[ALGOM-4] algo.monad state-m fetch-val bug and efficiency issue</title>
                <link>http://dev.clojure.org/jira/browse/ALGOM-4</link>
                <project id="10072" key="ALGOM">algo.monads</project>
                        <description>&lt;p&gt;;; the bug&lt;/p&gt;

&lt;p&gt;(defn fetch-val&lt;br/&gt;
  &quot;Return a state-monad function that assumes the state to be a map and&lt;br/&gt;
   returns the value corresponding to the given key. The state is not modified.&quot;&lt;br/&gt;
  &lt;span class=&quot;error&quot;&gt;&amp;#91;key&amp;#93;&lt;/span&gt;&lt;br/&gt;
  (domonad state-m&lt;br/&gt;
    &lt;span class=&quot;error&quot;&gt;&amp;#91;s (fetch-state)&amp;#93;&lt;/span&gt;&lt;br/&gt;
    (key s))) ;; does not work for integer or string keys&lt;/p&gt;

&lt;p&gt;;; I propose replacing it with (get s key)&lt;/p&gt;

&lt;p&gt;;; the efficiency issue :&lt;br/&gt;
;;&lt;br/&gt;
;; domonad with monad parameter binds all the monad functions, &lt;br/&gt;
;; looking these up in the state-m map on each call&lt;br/&gt;
;;&lt;br/&gt;
;; solution :&lt;/p&gt;

&lt;p&gt;(defn fetch-val&lt;br/&gt;
  &quot;Return a state-monad function that assumes the state to be a map and&lt;br/&gt;
   returns the value corresponding to the given key. The state is not modified.&quot;&lt;br/&gt;
  &lt;span class=&quot;error&quot;&gt;&amp;#91;key&amp;#93;&lt;/span&gt;&lt;br/&gt;
  (fn &lt;span class=&quot;error&quot;&gt;&amp;#91;s&amp;#93;&lt;/span&gt;&lt;br/&gt;
    &lt;span class=&quot;error&quot;&gt;&amp;#91;(get s key) s&amp;#93;&lt;/span&gt;))&lt;/p&gt;


&lt;p&gt;;; - we avoid the monad map lookups&lt;br/&gt;
;; - coding style brought up to par with the rest of state-m functions&lt;/p&gt;</description>
                <environment>irrelevant</environment>
            <key id="15686">ALGOM-4</key>
            <summary>algo.monad state-m fetch-val bug and efficiency issue</summary>
                <type id="1" iconUrl="http://dev.clojure.org/jira/images/icons/bug.gif">Defect</type>
                                <priority id="4" iconUrl="http://dev.clojure.org/jira/images/icons/priority_minor.gif">Minor</priority>
                    <status id="1" iconUrl="http://dev.clojure.org/jira/images/icons/status_open.gif">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="khinsen">Konrad Hinsen</assignee>
                                <reporter username="cark">Sacha De Vos</reporter>
                        <labels>
                        <label>bug</label>
                        <label>performance</label>
                    </labels>
                <created>Sat, 8 Sep 2012 20:47:32 -0500</created>
                <updated>Sat, 8 Sep 2012 20:47:32 -0500</updated>
                                                                            <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                                                                            <customfield id="customfield_10010" key="com.pyxis.greenhopper.jira:gh-global-rank">
                <customfieldname>Global Rank</customfieldname>
                <customfieldvalues>
                    
                </customfieldvalues>
            </customfield>
                                                                                                            </customfields>
    </item>
</channel>
</rss>