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

JSON Parsing from Scratch in Haskell

  • A forty-two minute read
  • 10 🗣️ 20 🔁

JSON is probably the most used standard file format for storing and transmitting data on the internet in recent times. Though it was historically derived from JavaScript, it is a programming language independent format and is now supported by almost all languages. JSON has a simple syntax specification with only four scalar data types and two composite data types. So, writing a parser for JSON is a great exercise for learning the basics of parsing. Let’s write one from scratch in Haskell.

Read more

Notes for ‘Thinking with Types: Type-level Programming in Haskell’, Chapters 1–5

  • A eighteen minute read
  • 4 🗣️ 9 🔁

Haskell—with its powerful type system—has a great support for type-level programming and it has gotten much better in the recent times with the new releases of the GHC compiler. But type-level programming remains a daunting topic even with seasoned haskellers. Thinking with Types: Type-level Programming in Haskell by Sandy Maguire is a book which attempts to fix that. I’ve taken some notes to summarize my understanding of the same.

Read more

Mechanically Deriving Binary Tree Iterators with Continuation Defunctionalization

  • A twenty-eight minute read
  • 2 🗣️ 1 🔁

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

Visit the archive for five more posts.

Recent Books

See more readings here.

Recent Activities

Sep 24   0:47:10 hr
Sep 22   0:39:49 hr
Sep 21   0:57:52 hr
Sep 17   0:43:39 hr
Sep 16   0:48:26 hr

See more activities here.

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

Elsewhere on the World-Wide Web