Consistent vocabulary in control flow

 — 

Mainstream programming languages provide various constructs for control flow: conditionals, loops, exceptions, etc. Many of these can be modeled using the general functor concept. In this post I'm going to show you how.

In most programming languages defining a function (or a method, subroutine, procedure, etc.) is simple. Using this …

Category: tech Tags:

Concurrency without magic

 — 

Summary: I argue that using a library is the best design pattern. The Haskell ecosystem offers powerful tools for writing concurrent programs.

In a previous post I demonstrated some of Haskell's features to write concurrent programs. I developed a simulated search engine which looked like this:

search30 :: SearchQuery -> IO ()
search30 …
Category: tech Tags:

Build systems à la carte

 — 

Today I went to the talk "Build systems à la carte" of Andrey Mokhov. He presented the results of the identically named paper from last year authored by himself and his co-authors. The following links point to the paper and its related resources:

Category: tech Tags:

Exploring parser combinators

 — 

This is an experience report of playing with Megaparsec, a parser combinator library in Haskell.

Parser combinators

The first time I saw a code snippet using the Parsec library I was truly amazed: a parser of Comma-Separated Values(CSV) reads:

csvFile = line `endBy` eol
line = cell `sepBy` (char ',')
cell = quotedCell …
Category: tech Tags:

Load balancer

 — 

In this post we are going to write a simple load balancer in Haskell. The design is based on that presented in Rob Pike's Concurrency Is Not Parallelism talk (starting around 22 minutes). If you are not familiar with this presentation I highly recommend watching it before reading on. Pike …

Category: tech Tags:

Think paper

 — 

Thinking using a computer is hard. First, a computer is full of distractions, but let's say we can eliminate those. Second, using the conventional input such as mouse and a keyboard, anything more complex than a character or a mouse click is difficult to communicate to the computer. Where's the …

Category: tech Tags:

Minimum Coin Exchange

 — 

In this post I solve the Minimum Coin Exchange problem programmatically using Haskell. I will compare the performance of the naive implementation to that using dynamic programming.

The problem

The minimum coin exchange problem is generally asked: if we want to make change for \(N\) cents, and we have infinite …

Category: tech Tags:

Knowing Algorithms

 — 

The other day I got a question from a colleague: Do you know an algorithm for this problem of ... details...details? The exact the problem description is not important. It was a well defined problem which totally made sense. I felt that there must be an algorithm for it, but …

Category: tech Tags:

Concurrency Patterns

 — 

In this post I'm replicating in Haskell some of the examples from the talk Go Concurrency Patterns by Rob Pike. In the talk Pike explains how Go's built-in concurrency primitives can help writing concurrent code. I was curious to see how the presented examples would look in Haskell, a language …

Category: tech Tags:

Morat-Fribourg 2017

 — 

Egyéni csúcs! Idén sikerült a 2012-es időnél fél perccel gyorsabbat futni. Valószínű, hogy a versenytáv kicsit változott, hiszen a 2012-es tempó gyorsabb volt, mint az idei. Ez a lényegen nem változtat: jól esik a versenyzés! És alább szokás szerint az eddigi időeredmények:

2017: 17,450 km 1:17.13,6 …
Category: blog Tags:

© David Wagner 2016

Powered by Pelican