Hi there!

I am Abhinav Sarkar. I'm a software engineer currently living in Bangalore, India. When not making software, I read books, play drums, take photos and ride my bike.

While you're here, you can read my blog posts, my notes, learn about me and this website, or look at my projects, the books I've read, the photos I've taken, and the recent activities I've done.


Feed Link to Atom feed of posts

Recent Notes

See more notes here.


Feed Link to Atom feed of posts

Recent Posts

Mechanically Deriving Binary Tree Iterators with Continuation Defunctionalization

  • A twenty-two minute read
  • 0 comments

Binary tree is the simplest of tree data structures. It is a tree in which each node has at most two children. A tree traversal is a process of visiting each node in the tree, exactly once. There are multiple ways of traversing a binary tree in depth-first fashion with each traversal resulting in a different enumeration of the tree elements. These tree traversals are defined as simple recursive functions. But what if we want to write Java-style iterators for them? Is there a way to mechanically derive these iterators from the traversal functions? Let’s find out.

Read more

Fast Sudoku Solver in Haskell #3: Picking the Right Data Structures

  • A thirty-four minute read
  • 8 comments

In the previous part in this series of posts, we optimized the simple Sudoku solver by implementing a new strategy to prune cells, and were able to achieve a speedup of almost 200x. Afterwards, we profiled the solution and found that there were bottlenecks in the program, leading to a slowdown. In this post, we are going to follow the profiler and use the right Data Structures to improve the solution further and make it faster.

Read more


Visit the archive for three more posts.


Like the posts? Subscribe below to get future posts by email.