<story><title>Generalizing &apos;jq&apos; and Traversal Systems using optics and standard monads</title><url>https://chrispenner.ca/posts/traversal-systems</url></story><parent_chain></parent_chain><comment><author>benrbray</author><text>This is a really exciting area.  See also the Cambria project [1] and the HN discussion from yesterday [2].  See [3,4] for a great introduction to category theory for programmers--we are all indebted to Milewski &amp;#x2F; Fong &amp;#x2F; Spivak &amp;#x2F; et al. for making this topic more accessible.&lt;p&gt;[1] &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;www.inkandswitch.com&amp;#x2F;cambria.html&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;www.inkandswitch.com&amp;#x2F;cambria.html&lt;/a&gt;&lt;p&gt;[2] &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;news.ycombinator.com&amp;#x2F;item?id=24699615&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;news.ycombinator.com&amp;#x2F;item?id=24699615&lt;/a&gt;&lt;p&gt;[3] &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;bartoszmilewski.com&amp;#x2F;2014&amp;#x2F;10&amp;#x2F;28&amp;#x2F;category-theory-for-programmers-the-preface&amp;#x2F;&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;bartoszmilewski.com&amp;#x2F;2014&amp;#x2F;10&amp;#x2F;28&amp;#x2F;category-theory-for-p...&lt;/a&gt;&lt;p&gt;[4] &lt;a href=&quot;http:&amp;#x2F;&amp;#x2F;brendanfong.com&amp;#x2F;programmingcats.html&quot; rel=&quot;nofollow&quot;&gt;http:&amp;#x2F;&amp;#x2F;brendanfong.com&amp;#x2F;programmingcats.html&lt;/a&gt;</text></comment>
<story><title>Generalizing &apos;jq&apos; and Traversal Systems using optics and standard monads</title><url>https://chrispenner.ca/posts/traversal-systems</url></story><parent_chain></parent_chain><comment><author>vortico</author><text>Why do you need all this theory when you can use simple imperative languages?&lt;p&gt;&lt;pre&gt;&lt;code&gt;    for staff in company.staff:
      for pet in staff.pets:
        if pet.type == &amp;#x27;cat&amp;#x27;:
          print(pet.name + &amp;quot; belongs to &amp;quot; + staff.name)
&lt;/code&gt;&lt;/pre&gt;
I don&amp;#x27;t understand why functional languages are used at all.</text></comment>