In our last article we explored how groupBy could allow us to arrange a Matrix (represented as an Array) into its rows.

myArray :: Array (Int, Int) Double)
myArray = listArray ((0, 0), (1, 1)) [1..4]
rows = groupBy (\((a, _), _) ((b, _), _) -> a == b) (assocs…

Last time around we saw the function “intercalate”. This could take a list of lists, and produces a single list, separated by the list from the first argument. But today, we’ll take a look at a couple functions that work in reverse. …

Whenever you see a commercial for some kind of diet or exercise program, there’s one trope that the ad writers will always use, and this is the “before and after” picture. They have a picture of the person before the diet plan, or before they start working out, and typically…

As announced last week, this year we’ll be doing short form articles twice a week highlighting useful library functions. The focus area for the month of January is simple list functions. We’ll start with some simple functions that interact with booleans.

Like any other language, Haskell has operators for dealing…

James Bowen

Author of Monday Morning Haskell (http://mmhaskell.com)

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store