Implement with Types, Not Your Brain
This post is <i>not</i> for beginners&#x2F;non-haskellers, I don&#x27;t understand why it&#x27;s being posted here. Is this intentional or are people in the haskell community <i>this</i> tone deaf? It&#x27;s like we&#x27;re determined to prevent new people from joining.<p>Dear everyone, code like this is <i>not</i> where Haskell starts to get useful, it&#x27;s useful much earlier. I won&#x27;t reproduce it here but I <i>just</i> wrote a post with some practical code (and how haskell helped) taken from a project of mine: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=20260095" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=20260095</a>.<p>If you are using Coyoneda in your code, please do not use it to extol the virtues of Haskell, except if you&#x27;re sure your audience is expert haskellers&#x2F;mathematicians&#x2F;researchers&#x2F;others who can actually gain something from the post, or if the writing is so sublime that it has reduced the complexity to near zero.<p>Please OP, you&#x27;re actively hurting the adoption of Haskell by posting stuff like this in the wrong places&#x2F;context.<p>The author of the article (Sandy Maguire) created a library called polysemy that improved on the efficiency of using a concept called Free Monads in Haskell -- their main benefit is that they let you write functions that deal <i>only</i> in your business domains. A rough corrolary would be a dependency-injected function that <i>could not</i> do anything outside of what the dependency injected pieces do, but also allows for different dependency implementations to be mocked out entirely within the languag (i.e. <i>without</i> the XML&#x2F;annotation hell that is Spring DI magic).