From 660fda5cc56b47888fdada38c41ea55b93b905af Mon Sep 17 00:00:00 2001 From: Mark Seemann Date: Mon, 19 Feb 2024 13:57:30 +0100 Subject: [PATCH] Prepare article for publication --- ...24-02-05-statically-and-dynamically-typed-scripts.html | 4 ++-- ...tracting-data-from-a-small-csv-file-with-haskell.html} | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) rename _posts/{2024-02-02-extracting-data-from-a-small-csv-file-with-haskell.html => 2024-02-19-extracting-data-from-a-small-csv-file-with-haskell.html} (94%) diff --git a/_posts/2024-02-05-statically-and-dynamically-typed-scripts.html b/_posts/2024-02-05-statically-and-dynamically-typed-scripts.html index 59e3e5ba..b8d91f48 100644 --- a/_posts/2024-02-05-statically-and-dynamically-typed-scripts.html +++ b/_posts/2024-02-05-statically-and-dynamically-typed-scripts.html @@ -85,7 +85,7 @@

As outlined above, I originally wrote a Haskell script to answer the questions, and only months later returned to the problem to give it a go in Python. When reading my detailed walkthroughs, keep in mind that I have 8-9 years of Haskell experience, and that I tend to 'think in Haskell', while I have only about a year of experience with Python. I don't consider myself proficient with Python, so the competition is rigged from the outset.

@@ -107,6 +107,6 @@

One point I'd like to make, however, is that there's nothing inherently better about a dynamically typed language when it comes to ad-hoc scripting. Languages with strong type inference work well, too.

- Next: Extracting data from a small CSV file with Haskell. + Next: Extracting data from a small CSV file with Haskell.

\ No newline at end of file diff --git a/_posts/2024-02-02-extracting-data-from-a-small-csv-file-with-haskell.html b/_posts/2024-02-19-extracting-data-from-a-small-csv-file-with-haskell.html similarity index 94% rename from _posts/2024-02-02-extracting-data-from-a-small-csv-file-with-haskell.html rename to _posts/2024-02-19-extracting-data-from-a-small-csv-file-with-haskell.html index dd47e33c..9631b25c 100644 --- a/_posts/2024-02-02-extracting-data-from-a-small-csv-file-with-haskell.html +++ b/_posts/2024-02-19-extracting-data-from-a-small-csv-file-with-haskell.html @@ -2,7 +2,7 @@ layout: post title: "Extracting data from a small CSV file with Haskell" description: "Statically typed languages are also good for ad-hoc scripting." -date: 2024-02-02 12:49 UTC +date: 2024-02-19 12:57 UTC tags: [Haskell] image: "/content/binary/difference-pmf-plot.png" image_alt: "Bar chart of the differences PMF." @@ -14,7 +14,7 @@ {{ page.description }}

- This article is part of a short series of articles that compares ad-hoc scripting in Haskell with solving the same problem in Python. The introductory article describes the problem to be solved, so here I'll jump straight into the Haskell code. In the next article I'll give a similar walkthrough of my Python script. + This article is part of a short series of articles that compares ad-hoc scripting in Haskell with solving the same problem in Python. The introductory article describes the problem to be solved, so here I'll jump straight into the Haskell code. In the next article I'll give a similar walkthrough of my Python script.

Getting started # @@ -52,7 +52,7 @@

38

- Looks good, but reading a text file is hardly the difficult part. The first obstacle, surprisingly, is to split comma-separated values into individual parts. For some reason that I've never understood, the Haskell base library doesn't even include something as basic as String.Split from .NET. I could probably hack together a function that does that, but on the other hand, it's available in the split package; that explains the Data.List.Split import. It's just such a bit of a bother that one has to pull in another package just to do that. + Looks good, but reading a text file is hardly the difficult part. The first obstacle, surprisingly, is to split comma-separated values into individual parts. For some reason that I've never understood, the Haskell base library doesn't even include something as basic as String.Split from .NET. I could probably hack together a function that does that, but on the other hand, it's available in the split package; that explains the Data.List.Split import. It's just a bit of a bother that one has to pull in another package only to do that.

Grades # @@ -78,7 +78,7 @@

This lists all 38 expected grades found in the data file.

- In the introduction article I spent some time explaining how languages with strong type inference don't need type declarations. This makes iterative development easier, because you can fiddle with an expression until it does what you'd like it to do. When you change an expression, often the inferred type changes as well, but there's no programmer overhead involved with that. The compiler figures that out for you. + In the introduction article I spent some time explaining how languages with strong type inference don't need type declarations. This makes iterative development easier, because you can fiddle with an expression until it does what you'd like it to do. When you change an expression, often the inferred type changes as well, but there's no programmer overhead involved with that. The compiler figures that out for you.

Even so, the above grade function does have a type annotation. How does that gel with what I just wrote?