Dependent types: formal definition and examples
Dependent types have been gaining a lot of attention among programmers. Some would say it’s “the next thing” in programming. Why is it gaining popularity? In this post, I hope to show some of the…
Dependent types have been gaining a lot of attention among programmers. Some would say it’s “the next thing” in programming. Why is it gaining popularity? In this post, I hope to show some of the…
In this post, I continue going through the famous paper “Functional Programming with Bananas, Lenses, Envelopes and Barbed Wire” by Meijer et al. They show that we can treat recursions as separate higher order functions…
In the last post we talked about using unfolds to zip and more in OCaml. In this post we write the equivalent functions in Haskell. Zip is in the standard library in Haskell. It’s actually…
This post picks up from where we left off here, where I explained anamorphisms. In the last post we looked at iterating with anamorphisms. Here we look at another example of applying unfolds: zip. Zip…
This post picks up from where we left off here, in which I explained anamorphisms. Here we look at another example of applying unfolds: iterate. Iterate Iterate is one of the most common uses of…
In this post, I continue going through the famous paper “Functional Programming with Bananas, Lenses, Envelopes and Barbed Wire” by Meijer et al. They show that we can treat recursions as separate higher order functions…
While doing my OCaml MOOC exercise I came across a trie implementation for looking up words. I find that the way OCaml treats strings is very different from the way Haskell does it. It leads…
Run Time Versus Compile Time Error Run time errors are those that happen when the program runs, as opposed to compile time errors which happen when the program compiles. In a sense, having compile time…
In the last post, I talked about catamorphisms in Haskell. Specifically, the advantages of the foldr1 or foldl1 option in Haskell. Namely, (1) not needing to specify the base case and (2) preserving polymorphisms in…
In the last post I talked about catamorphisms in OCaml. In this post I compare that with Haskell. We’ll see that Haskell gives you more options when implementing catamorphisms. You don’t need to know Haskell…