Skip to content

Commit

Permalink
improve the intro
Browse files Browse the repository at this point in the history
  • Loading branch information
thma committed Jul 29, 2023
1 parent aeb92b3 commit 2d8cb5d
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 40 deletions.
16 changes: 6 additions & 10 deletions docs/atom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,12 @@
<p><a href="https://github.com/thma/clean-architecture-with-functions/"><img src="https://thma.github.io/img/forkme.png" height="20" ></a></p>
<h2 id="interesting-design-challenges-in-seemingly-simple-programs">Interesting design challenges in seemingly simple programs</h2>
<p>The other day I was writing a Haskell program with quite a limited scope:</p>
<ul>
<li>retrieving data from a REST API</li>
<li>storing the data in CSV files.</li>
</ul>
<p>The task at hand sounded simple enough to just start coding without too much upfront thinking.
This blog post is about the process of discovering the shortcomings of my initial design and how I improved them by some simple refactorings.
As all the interesting stuff happened in the API access, I’ll focus on that part of the code.</p>
<p>In order to allow you to experiment with the code yourself, I’m not using the proprietary API of my original project but rather a publicly available REST API (https://openlibrary.org/developers/api) in this blog post.</p>
<h2 id="the-initial-design">The initial design</h2>
<p>The other day I wrote a simple Haskell program that retrieves data from a REST API and processes it.
The task at hand sounded simple enough to just start coding without too much upfront thinking.</p>
<p>This blog post is about how I discovered the shortcomings of my original design and how I improved it with some simple refactorings.
Since everything interesting happens in the API access, I will focus on this part of the code.</p>
<p>In order to allow you to experiment with the code yourself, I’m not using the proprietary API of my original project but rather a publicly available REST API (<a href="https://openlibrary.org/developers/api">OpenLibrary</a>).</p>
<h2 id="the-original-design">The original design</h2>
<p>So without further ado, let’s start with the domain data types:</p>
<div class="sourceCode" id="cb1"><pre class="sourceCode haskell"><code class="sourceCode haskell"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="kw">data</span> <span class="dt">Book</span> <span class="ot">=</span> <span class="dt">Book</span></span>
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a> {<span class="ot"> bkTitle ::</span> <span class="dt">String</span>,</span>
Expand Down
16 changes: 6 additions & 10 deletions docs/posts/2023-07-29-clean-architecture-revisited.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,12 @@ <h1>Clean Architecture Revisited</h1>

<p><a href="https://github.com/thma/clean-architecture-with-functions/"><img src="https://thma.github.io/img/forkme.png" height="20"></a></p>
<h2 id="interesting-design-challenges-in-seemingly-simple-programs">Interesting design challenges in seemingly simple programs</h2>
<p>The other day I was writing a Haskell program with quite a limited scope:</p>
<ul>
<li>retrieving data from a REST API</li>
<li>storing the data in CSV files.</li>
</ul>
<p>The task at hand sounded simple enough to just start coding without too much upfront thinking.
This blog post is about the process of discovering the shortcomings of my initial design and how I improved them by some simple refactorings.
As all the interesting stuff happened in the API access, I’ll focus on that part of the code.</p>
<p>In order to allow you to experiment with the code yourself, I’m not using the proprietary API of my original project but rather a publicly available REST API (https://openlibrary.org/developers/api) in this blog post.</p>
<h2 id="the-initial-design">The initial design</h2>
<p>The other day I wrote a simple Haskell program that retrieves data from a REST API and processes it.
The task at hand sounded simple enough to just start coding without too much upfront thinking.</p>
<p>This blog post is about how I discovered the shortcomings of my original design and how I improved it with some simple refactorings.
Since everything interesting happens in the API access, I will focus on this part of the code.</p>
<p>In order to allow you to experiment with the code yourself, I’m not using the proprietary API of my original project but rather a publicly available REST API (<a href="https://openlibrary.org/developers/api">OpenLibrary</a>).</p>
<h2 id="the-original-design">The original design</h2>
<p>So without further ado, let’s start with the domain data types:</p>
<div class="sourceCode" id="cb1"><pre class="sourceCode haskell"><code class="sourceCode haskell"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="kw">data</span> <span class="dt">Book</span> <span class="ot">=</span> <span class="dt">Book</span></span>
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a> {<span class="ot"> bkTitle ::</span> <span class="dt">String</span>,</span>
Expand Down
16 changes: 6 additions & 10 deletions docs/rss.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,12 @@
<p><a href="https://github.com/thma/clean-architecture-with-functions/"><img src="https://thma.github.io/img/forkme.png" height="20" ></a></p>
<h2 id="interesting-design-challenges-in-seemingly-simple-programs">Interesting design challenges in seemingly simple programs</h2>
<p>The other day I was writing a Haskell program with quite a limited scope:</p>
<ul>
<li>retrieving data from a REST API</li>
<li>storing the data in CSV files.</li>
</ul>
<p>The task at hand sounded simple enough to just start coding without too much upfront thinking.
This blog post is about the process of discovering the shortcomings of my initial design and how I improved them by some simple refactorings.
As all the interesting stuff happened in the API access, I’ll focus on that part of the code.</p>
<p>In order to allow you to experiment with the code yourself, I’m not using the proprietary API of my original project but rather a publicly available REST API (https://openlibrary.org/developers/api) in this blog post.</p>
<h2 id="the-initial-design">The initial design</h2>
<p>The other day I wrote a simple Haskell program that retrieves data from a REST API and processes it.
The task at hand sounded simple enough to just start coding without too much upfront thinking.</p>
<p>This blog post is about how I discovered the shortcomings of my original design and how I improved it with some simple refactorings.
Since everything interesting happens in the API access, I will focus on this part of the code.</p>
<p>In order to allow you to experiment with the code yourself, I’m not using the proprietary API of my original project but rather a publicly available REST API (<a href="https://openlibrary.org/developers/api">OpenLibrary</a>).</p>
<h2 id="the-original-design">The original design</h2>
<p>So without further ado, let’s start with the domain data types:</p>
<div class="sourceCode" id="cb1"><pre class="sourceCode haskell"><code class="sourceCode haskell"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="kw">data</span> <span class="dt">Book</span> <span class="ot">=</span> <span class="dt">Book</span></span>
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a> {<span class="ot"> bkTitle ::</span> <span class="dt">String</span>,</span>
Expand Down
17 changes: 7 additions & 10 deletions posts/2023-07-29-clean-architecture-revisited.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Clean Architecture Revisited
author: Thomas Mahler
tags: haskell, clean architecture, domain driven design, functional programming, decoupling, dependency injection, higher order functions
tags: haskell, clean architecture, domain driven design, functional programming, decoupling, dependency injection, higher order functions, patterns, refactoring, unit testing
---


Expand All @@ -10,18 +10,15 @@ tags: haskell, clean architecture, domain driven design, functional programming,

## Interesting design challenges in seemingly simple programs

The other day I was writing a Haskell program with quite a limited scope:

- retrieving data from a REST API
- storing the data in CSV files.

The other day I wrote a simple Haskell program that retrieves data from a REST API and processes it.
The task at hand sounded simple enough to just start coding without too much upfront thinking.
This blog post is about the process of discovering the shortcomings of my initial design and how I improved them by some simple refactorings.
As all the interesting stuff happened in the API access, I'll focus on that part of the code.

In order to allow you to experiment with the code yourself, I'm not using the proprietary API of my original project but rather a publicly available REST API (https://openlibrary.org/developers/api) in this blog post.
This blog post is about how I discovered the shortcomings of my original design and how I improved it with some simple refactorings.
Since everything interesting happens in the API access, I will focus on this part of the code.

In order to allow you to experiment with the code yourself, I'm not using the proprietary API of my original project but rather a publicly available REST API ([OpenLibrary](https://openlibrary.org/developers/api)).

## The initial design
## The original design

So without further ado, let's start with the domain data types:

Expand Down

0 comments on commit 2d8cb5d

Please sign in to comment.