I’ve said it before, but I’ll say it again. As much as we’d like to think it’s the case, our Haskell code doesn’t work just because it compiles. This is why we have test suites. But even if it passes our test suites this doesn’t mean it works as well as…
If you are using functional programming, whether using a real functional language or any language that supports first-class function, you may have already used monads at some point. Most people just didn’t know they are monads. In this…
So when we first learned about creating our own data types, we went over the idea of record syntax. The idea of record syntax is pretty simple. We want to create objects with named fields. This allows us to avoid the tedium of pattern matching on objects all the time to get…
During account signup, a web server will make an HTTP request to send an email. Not only are synchronous requests slow, but if the remote host is unresponsive, the…
I was profiling a simple loop (years ago). It was similar to:
countForever ref = forever $ modifyIORef' ref (+1)
I counted four assembly instructions.
Addition takes ~300 picoseconds, but there is…
At a certain point, our Haskell programs have to be compatible with other programs running on the web. This is especially useful given the growing usage of micro-services as an architecture. Regardless, it’s very common to be transferring data between applications on different stacks…
If you're reading this, I assume you're ready or at least thinking of taking the leap…
If you’re a programmer now, there’s one reality you’d best be getting used to. People expect you to know how to deal with big data. The kind of data that will take a while to process. The kind that will crash your program if you try to bring it all into memory at the same time. But…
In a prior post I wrote about how type class instance selection worked. To help get a sense of good type class design, I want to walk through a type class pattern and a related type class anti-pattern.