Skip to content

Instantly share code, notes, and snippets.

View alexandergunnarson's full-sized avatar

Alex Gunnarson alexandergunnarson

View GitHub Profile
@alexandergunnarson
alexandergunnarson / immutable_trie.cljc
Created June 1, 2016 01:18
An immutable trie idea
(ns alexandergunnarson.immutable-trie)
(defrecord TrieNode
[val complete? a b c d e f g h i j k l m n o p q r s t u v w x y z])
(defn node
([val] (node val false))
([val complete?]
(TrieNode. val complete?
nil nil nil nil nil
(ns quantum.lambda-calculus)
(defmacro λ [arg ret] `(fn [~arg] ~ret))
(def ^{:doc "Whatever function `f` you pass in, called on itself (composed) `n` times."}
NUM (λ n (λ f (λ x ((apply comp (repeat n f)) x)))))
(def I (λ x x)) ; `identity`
(def K (λ x (λ y x))) ; `firsta`
### Keybase proof
I hereby claim:
* I am alexandergunnarson on github.
* I am agunnarson (https://keybase.io/agunnarson) on keybase.
* I have a public key ASCvCVZJHmaDqh7ru9Iu93H0RRjSJL3iMqwtQQZKVYecQgo
To claim this, I am signing this object: