• BLOG
  • ARCHIVE
  • GITHUB
  • RSS
  • Every Day Recursion Schemes

    Apr 13, 2019

    Recursion schemes can have quite a steep learning curve but common patterns can be used without deep understanding.

    There is a lot of excellent literature out there explaining recursion schemes but it all starts off with the fundamentals and builds up from basic concepts. An alternative way of learning is to see a real-world example and once you are comfortable using it you can see where it comes from. In this post I want to present a simple pattern that I have started seeing quite often, I think it’s reasonably easy (and useful) to start using without really knowing what’s going on underneath.

    ...more
  • Freer than Free

    Sep 23, 2018

    freer-simple is a fantastic library and I will definitely use it again. I found some gaps in the documentation that I aim to address here.

    Recently I needed to glue some terraform, nixops and ssh commands together so as soon as I realised that bash was quickly going to become unweildly I set about writing a small Haskell program. I had recently worked on a cli app that used a Free monad and found there was quite a lot of boiler plate for little benefit so I decided to use this app to find out about the current state of Freer monads in Haskell.

    ...more
  • Looking At Quality

    Aug 2, 2018

    Quality is more complicated than we often think and we would do well to dig deeper.

    In the context of software engineering what is quality? Why do we care about it? How does it help us? When we think about “quality” we usually go straight to QA or “Quality Assurance” and from there we think of testing, however testing is just one small facet of quality. In reality, we might think that quality is about preventing bugs but we can go even further back to basics; why do we care about bugs?

    ...more
  • To Batch Or Not To Batch

    Jul 15, 2018

    Measure your test pipeline before trying to improve efficiency with batching

    In projects with lots of contributors and long running tests, it seems like common sense to batch features together in order to reduce the overhead of running the long tests. In this post I try to prove whether this is a valid thing to do.

    ...more
  • Safe JSON with Haskell

    Mar 18, 2017

    Haskell Generics + Aeson + QuickCheck For The Win

    Recently I’ve been working on an HTTP API written in Haskell. One of the things that tends to be much easier and nicer in dynamic languages is dealing with JSON in these APIs, statically typed languages tend to have lots of boilerplate. Not only is this boilerplate annoying to write but it can cause small changes to the API into a big task.

    With Haskell (actually GHC) this is not the case.

    ...more
  • The REPL as a business tool

    May 14, 2016

    The REPL can save hours of pain through pairing with non-technical colleagues.

    The boundary between a business user and a developer can often be a big source of waste. Going back and forth between the user and your code to discover what data is really needed can really cause pain and waste a huge amount of time. The REPL can be used as an interactive environment to pair with a user and write the exact code required, first time.

    ...more
  • Beating Bugs With Brute Force

    Apr 27, 2016

    Improve product quality and find bugs faster by generating tests.

    For years I’ve been writing the tests for the applications I write however it turns out that computers can do a better job. Property based testing is the doorway to a more advanced world of testing that can dramatically improve quality and find bugs that would have appeared on day 1 in prod.

    ...more
  • Either monad or exceptions

    Dec 15, 2015

    The Either monad from cats is pretty cool.

    Recently I was asked to complete a small test for a job interview in the form of a Clojure program. The idea of the program was to take commands from stdin and use them to mess around with a ‘canvas’, basically a super-primitive graphics program. It occured to me that since part of this would involve parsing and validating commands and displaying any errors, it might be a good opportunity to use the Either monad and see the current state of monad libraries in Clojure.

    ...more
  • Static vs Dynamic

    Sep 9, 2014

    I have recently moved jobs and now I am using Clojure rather than Java and Scala. Before starting I had been reading up on the static vs dynamic typing argument. I enjoy all the type stuff, when you start learning Haskell and Scala there’s some really interesting things to learn and some parts of static typing can really help. Most notable for me is function signatures, I really find function signatures to be one of the best things about static typing.

    ...more
  • Consistency is not the key

    Jul 9, 2014

    Everyone’s heard it, probably everyone’s said it and on the face of it it makes sense, “We need a consistent approach”, “Consistency will make our code more maintainable”, “Consistency will make it easier for new joiners to understand the code”. These days though, when it comes to software development, I’ve learnt to question everything and I’m questioning this attitude.

    ...more
PREVIOUS

© 2015 - 2019 David Smith, unless otherwise noted.