April 16, 2020

A quick over view of lens

You’ve completed the Data61 FP Course. You’ve gone on and finished every single exercise in the QFPL Applied FP Course. You know what you’re doing, so you join a Haskell project, and are presented with: update things thing = let thatThing = Map.lookup (thing ^. properties . identifier) things thingName = thatThing <&> view (metadata . name) thingResponsibilities = thatThing <&> view responsibilities in thing & name .~ thingName & responsibilities <>~ thingResponsibilities & age %~ (* 2) This looks nothing like the language you’ve been using! Read more

May 26, 2019

Lifting for huge gains

People tend to be given models about how a particular concept works in a particular programming language, and use that understanding as the basis for how to understand the concept in general. This makes sense in the context of a particular framework or idea which has been ported to different languages. Once you have learned something in one language, it is easy to transfer the knowledge to another language. This process reinforces a particular mental model of how things work, and makes alternative interpretations harder to comprehend. Read more

January 1, 0001

I was ruminating on Semigroups this morning. In Haskell, a Semigroup is a combination of a type and a function taking two of that type and returning a new one, where the function is associative. Let’s see if some different things are semigroups: * Int and +: (x + y) + z == x + (y + z) :heavy_check_mark: * Int and *: (x * y) * z == x * (y * z) :heavy_check_mark: * Int and /: (x / y) / z ! Read more

Powered by Hugo & Kiss.