<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>Andreas Herrmann</title>
    <link href="http://aherrmann.github.io/atom.xml" rel="self" />
    <link href="http://aherrmann.github.io" />
    <id>http://aherrmann.github.io/atom.xml</id>
    <author>
        <name>Andreas Herrmann</name>
        <email>andreash87@gmx.ch</email>
    </author>
    <updated>2016-05-28T00:00:00Z</updated>
    <entry>
    <title>Mutual Recursion in Final Encoding</title>
    <link href="http://aherrmann.github.io/programming/2016/05/28/mutual-recursion-in-final-encoding" />
    <id>http://aherrmann.github.io/programming/2016/05/28/mutual-recursion-in-final-encoding</id>
    <published>2016-05-28T00:00:00Z</published>
    <updated>2016-05-28T00:00:00Z</updated>
    <summary type="html"><![CDATA[<p>Not long ago I was in­tro­duced to <em>final en­coding</em> of <a href="https://wiki.haskell.org/Embedded_domain_specific_language">em­bedded do­main spe­cific lan­guages (ED­SLs)</a> in Haskell thanks to a <a href="http://www.codewars.com/kata/5424e3bc430ca2e577000048">coding puzzle</a> over at <a href="www.codewars.com">Code­Wars</a>. While solving that puzzle I started won­dering whether it was pos­sible to de­fine mu­tu­ally re­cur­sive func­tions in an em­bedded lan­guage in final en­cod­ing. In this ar­ticle we will see that it is in­deed pos­sible and de­velop a generic and type-safe im­ple­men­ta­tion.</p>
]]></summary>
</entry>
<entry>
    <title>Unpacking Tuples in C++14</title>
    <link href="http://aherrmann.github.io/programming/2016/02/28/unpacking-tuples-in-cpp14" />
    <id>http://aherrmann.github.io/programming/2016/02/28/unpacking-tuples-in-cpp14</id>
    <published>2016-02-28T00:00:00Z</published>
    <updated>2016-02-28T00:00:00Z</updated>
    <summary type="html"><![CDATA[<p>C++11 in­tro­duced tu­ples to the C++ stan­dard li­brary. As the <a href="http://en.cppreference.com/w/cpp/utility/tuple">doc­u­men­ta­tion</a> says they offer a <em>fixed-size col­lec­tion of het­ero­ge­neous values</em>. Un­for­tu­nately, tu­ples can be a little bit tricky to deal with in a generic fash­ion. The C++14 stan­dard in­tro­duced a few fea­tures that greatly re­duce the nec­es­sary boil­er­plate. In this post I will dis­cuss how to deal with tu­ples with very com­pact code.</p>
]]></summary>
</entry>
<entry>
    <title>Jekyll Style URLs with Hakyll</title>
    <link href="http://aherrmann.github.io/programming/2016/01/31/jekyll-style-urls-with-hakyll" />
    <id>http://aherrmann.github.io/programming/2016/01/31/jekyll-style-urls-with-hakyll</id>
    <published>2016-01-31T00:00:00Z</published>
    <updated>2016-01-31T00:00:00Z</updated>
    <summary type="html"><![CDATA[<p>Re­cently, I switched from <a href="https://jekyllrb.com/">Jekyll</a> to <a href="https://jaspervdj.be/hakyll/">Hakyll</a> for the gen­er­a­tion of this Blog. In this ar­ticle I want to talk about Hakyll’s routing mech­a­nism and how to get it to gen­erate the same URLs as Jekyll so that all the old links to your posts keep work­ing.</p>
<p>If you want to follow along you can find the source code <a href="https://github.com/aherrmann/jekyll_style_urls_with_hakyll_examples">here</a>. Step through the com­mits in the repos­i­tory to see the steps pre­sented in this ar­ticle ap­plied one after the other.</p>
]]></summary>
</entry>
<entry>
    <title>Resource Management in Haskell</title>
    <link href="http://aherrmann.github.io/programming/2016/01/04/resource-management-in-haskell" />
    <id>http://aherrmann.github.io/programming/2016/01/04/resource-management-in-haskell</id>
    <published>2016-01-04T00:00:00Z</published>
    <updated>2016-01-04T00:00:00Z</updated>
    <summary type="html"><![CDATA[<p>This is a post about Haskell. How­ever, I would like to point out, that I am not a pro­fes­sional Haskell pro­gram­mer. I have never had the op­por­tu­nity to use it for pro­duc­tion. How­ever, I do enjoy using Haskell for side-pro­jects. So, if you find that I made any mis­take, please leave a com­ment.</p>
<p>I do most of my everyday pro­gram­ming in C++ or Python and this will be re­flected in this ar­ti­cle. I will dis­cuss re­source man­age­ment in Haskell from the per­spec­tive of a C++ pro­gram­mer.</p>
]]></summary>
</entry>
<entry>
    <title>Type Erasure with Merged Concepts</title>
    <link href="http://aherrmann.github.io/programming/2014/10/19/type-erasure-with-merged-concepts" />
    <id>http://aherrmann.github.io/programming/2014/10/19/type-erasure-with-merged-concepts</id>
    <published>2014-10-19T00:00:00Z</published>
    <updated>2014-10-19T00:00:00Z</updated>
    <summary type="html"><![CDATA[<p>Two days ago, I watched a very in­ter­esting talk by Zach Laine: <a href="https://www.youtube.com/watch?v=0I0FD3N5cgM">Prag­matic Type Era­sure: Solving OOP Prob­lems with an El­e­gant De­sign Pat­tern</a>. The ques­tion that Zach Laine ad­dresses is how to pro­vide poly­mor­phic in­ter­faces while, at the same time, ad­hering to value se­man­tics. I do also rec­om­mend the fol­lowing talk by Sean Par­ent, which gives a great in­tro­duc­tion into the con­cept and the ben­e­fits of type-era­sure, and value se­man­tics: <a href="https://www.youtube.com/watch?v=bIhUE5uUFOA">In­her­i­tance Is The Base Class of Evil</a></p>
<p>This post is mo­ti­vated by a ques­tion that came up on <a href="http://www.reddit.com/r/cpp/comments/2jb295/cppcon_2014_pragmatic_type_erasure_solving_oop/clceg2c">Reddit</a>. Namely, how can we merge mul­tiple type-erased in­ter­faces into one single in­ter­face. A sim­ilar ques­tion is also asked in the end of the first talk: How to apply type era­sure to types with over­lap­ping in­ter­faces? The speak­er’s an­swer is to simply re­peat the common parts. I think there has to be a better way. So, in this post I am going to ex­plore how to merge type-erased in­ter­faces. But first, let’s quickly re­vise type-era­sure.</p>
]]></summary>
</entry>

</feed>
