In the beginning, there was a binary tree: struct ctree { // c for children int val; struct ctree *left; struct ctree *right; } The flow of pointers ran naturally from the root of the tree to the leaves, and it was easy as blueberry pie to walk to the children of a node. Unfortunately, […]
zip: List<A>, List<B> -> List<(A, B)> zip(Nil, Nil) = Nil zip(_, Nil) = Nil zip(Nil, _) = Nil zip(Cons(a, as), Cons(b, bs)) = Cons((a, b), zip(as, bs)) fst: (A, B) -> A fst((a, _)) = a last: List<A> -> A last(Cons(a, Nil)) = a last(Cons(a, as)) = last(as) foldl: (B, A -> B), B, List<A> […]
I'm happy to report that I'll be interning at Galois over the summer. I'm not quite sure how the name of the company passed into my consciousness, but at some point in January I decided it would be really cool to work at an all-Haskell shop, and began pestering Don Stewart (and Galois's HR) for […]