RSSAmplifier

Blog

Learning Through Failure

aaron levin

aaronlevin.caRSS feed ↗15 posts

Latest posts

100 Awesome Folkways LPs

Back in 2005 I had just dropped out of graduate school and returned to Edmonton, Alberta. I was waiting for the semester to start so I could begin my journey as a mathematician. I’m indebted to my friend Christopher Bateman (co-author of In Fine Style ) who told me that there was a collection of Folkways Records at the University of Alberta. An entire collection?! Wow! The only other…

Extensible Effects in the van Laarhoven Free Monad

Edit: you can find this code on Hackage at free-vl . Algebraic effects seem to be a sort of holy grail in functional programming. What I mean when I say “algebraic effect” here is: treating any effect like a value or type in your program, while also having some simple operations (an algebra) to combine effects. What does this look like practically? The two languages that come to mind are Idris and…

Reasoning about Errors in Free Monads and Their Interpreters

Free Monads are a powerful abstraction for modeling operations in your program. While there are many articles about free monads, there are relatively few about using free monads. At my current work we have a large Free Monad that abstracts various actions one might do against data in our system. We also have three interpreters: a pure interpreter for unit testing, a psql-backend interpreter for…

Flexibility With Referential Data Using Type Families

The problem : you are writing the backend of an e-commerce site. Your Order data type references a Customer and a list of Product s. Do you represent the list of Product s as a list of product ids? Or do you use fully realized Product s? When rendering an invoice, you may need customer data. But for data analysis, you may only need uuids . How do we encode all this in a flexible and safe manner?…

FizzBuzz - Continuation Passing Style

For some reason I’ve been thinking about Continuation Passing Style a lot lately. I was reading some old code and realized it could have been simplified had it been done in a continuation monad . Did I really understand continuation passing style? When thinking about simple and unnecessary uses of CPS, FizzBuzz came to mind. FizzBuzz doesn’t really lend itself well to continuation…

Using Data.Proxy to Encode Types in your JSON Strings

yo dawg, I heard you like strings in your types so I put a type in your string so you could type check your strings while you stringify your types - Proxy “XZibit” The saying goes that one should encode as many invariants in the type system as possible . This way bad programs don’t type check, thereby affording you hours (previously spent writing unit tests) to meander in the…

Data Families Make Types and Free Monads More Librarious

At the end of my post Type Families Make Life and Free Monads Simpler I conjectured whether it would be possible to write a “CRUD” library around the Free CrudF monad. The exact meaning of a library in this context is somewhat nuanced. What libraries look like when you’re doing type-level programming wasn’t clear to me initially. After learning and working with dependent…

Type Families Make Life and Free Monads Simpler

After watching Ollie Charles’ talk on Strongly Typed Publish/Subscribe over Websocks via Singleton Types , I felt very inspired to try some type-level programming in Haskell. Along the way I stumbled across a really handy design pattern I thought I would share. Recently I’ve been working with another person on creating a client for the Shopify API in Haskell. Being there are a few…

Running the Nix package manager within a Docker Container

I love Nix . I’ve been running NixOS for the past few weeks and it’s been a great experience. However, I started a new job recently and have been thinking about our deployment pipeline and how we will manage build and run-time environments. Finding the boundary between Nix and Docker in this area has been consuming me for the past few weeks. I want to maximize the human element. I want…

Reducing Irreducibility: Towards Intuitive Reducibility

Irreducible operators are very important in Mathematics. For the case of Directed Graphs, the adjacency matrix is irreducible if and only if the graph is strongly connected . Unfortunately, the canonical definition of irreducible matrices has bothered me for years. If you search for reducible on Wolfram , Wikipedia , or Planet Math you will get one of two definitions: Definition 1: An n x n matrix…

Dynamic Typing: A Local Minimum for Code Comprehension

I believe the most important value in a programming language is not performance, libraries, ecosystems, or tooling. While these are crucial to their adoption and success, a feature often overlooked is code comprehension . By this I mean: how easy is it for someone to read code and comprehend what it’s doing within this language. This line of reasoning has lead me to believe that pure,…

Sane Keyboardin' with XMonad + Arch on a Mac

I wanted to accomplish something very simple with my keyboard mappings: Caps Lock is mapped to mod4 Command is mapped to Ctrl Unfortunately, the lack of idempotency when using xmodmap makes for dangerous keyboardin’. Using setxkbmap is much safer, and if you really mangle your settings you can always setxkbmap -option to clear your settings. This allows me to use my thumb for control on the…

The Banana Republic of NXNE

On Friday I sat on a panel titled Why NXNE Sucks? This was a NXNE initiative aimed at providing a space for members from the local arts community to air their grievances about NXNE . As an attempted coup d'état to quash negative sentiment and puzzle panellists, they abolished their 45-day radius clause minutes before the panel started. My thesis on NXNE’s state of the union was simple: all…

Want to Fix MySpace? Buy Bandcamp

I was thinking about MySpace yesterday and what I would do if I was given the opportunity to rejuvenate it (as a thought experiment). It’s easy to point out the failings in an idea, but nontrivial to actually fix one. So, here is my idea: Buy Bandcamp . Don’t replace it. Continue running it as it is. Now, for every Bandcamp user, MySpace exists as a social layer (with music powered by…

hello

I’m going to try to reboot this for the fifth time. I’m finally honing in on using tumblr as my main authoring tool (with markdown support). Just testing out the code blocks here: forkLife :: IO Human -> IO ThreadId And now for an inline style. Thanks for your patience.