Akh - Monad Transformers for Javascript

Akh is a small Javascript library of monad transformers and structures. This post briefly covers why monad transformers are useful in Javascript, and offers a very high level look at the monad transformer Akh offers and their interface. Why Monad Transformers are Useful in Javascript Even in untyped, non-functional language…

Khepri Slice Unpacks

Khepri V0.22 adds slice unpacks for unpacking a range of values to an array. Here I briefly cover slice unpacks. You can find the Khepri language documentation here. Rational Functions that take an arbitrary number of arguments are common in Javascript, but writing such variadic function is fairly confusing…

Hash Array Mapped Tries in Javascript

The hash array mapped trie (HAMT) is a hash trie storage optimization that uses less space and performs better than a regular hash trie. Building on my coverage of a Javascript hash trie, I overview hash array mapped tries and cover a basic Javascript HAMT implementation. The example code is…

Khepri Fat Arrows

I overview and criticize the semantics of Javascript's this keyword. Then I quickly overview the ECMAScript 6 and Coffee Script solution to the this problem, before detailing Khepri's fat arrow syntax. Khepri fat arrows make this binding explicit and also can unpack the this object. Javascript The Javascript this keyword…

Declarative Environments

The ECMAScript5.1 interpreter I have detailed so far is little more than a calculator. Now, using the state monad and references, we will add basic support for environments to the interpreter. I overview ECMAScript 5.1 environments before discussing Atum's declarative environment implementation. This covers a lot of code…

Persistent Hash Tries in Javavascript

The hash trie is a persistent map data structure with good lookup and update performance. I overview hash tries and cover a basic Javascript hash trie implementation. The example code is written in Khepri and taken from the hashtrie library. Hashtrie is based on Clojure's PersistentHashMap. Overview Hash tries are…