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

Short posts on miscellaneous topics.

See more notes here.

Feed Link to Atom feed of posts

Recent Posts

Long-form posts on mostly programming related topics.

JSON Parsing from Scratch in Haskell: Error Reporting—Part 2

  • A twenty-three minute read
  • 0 comments

In the previous post, we set out to rewrite the JSON parser we wrote in Haskell in an earlier post, to add support for error reporting. The parser was written very naively: if it failed, it returned nothing. You couldn’t tell what the failure was or where it happened. That’s OK for a toy parser but error reporting is an absolute must requirement for all good parsers. In the previous post, we finished writing the basic framework for the same. In this post, we’ll finish adding simple but useful error reporting capability to our JSON parser.

Read more

JSON Parsing from Scratch in Haskell: Error Reporting—Part 1

  • A twenty-six minute read
  • 0 comments
  • 3 🗣️ 4 🔁

In the previous post we wrote a simple but correct JSON parser in Haskell. The parser was written very naively: if it failed, it returned nothing. You couldn’t tell what the failure was or where it happened. That’s OK for a toy parser but error reporting is an absolute must requirement for all good parsers. So in this post and next post, we’ll add simple but useful error reporting capability to our JSON parser.

Read more

JSON Parsing from Scratch in Haskell

  • A forty-two minute read
  • 24 comments
  • 11 🗣️ 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

Visit the archive for seven more posts.

Recent Books

Books I've recently finished reading.

See more readings here.

Recent Activities

Activities I've recently done.

Nov 27   0:40:11 hr
Nov 26   0:30:56 hr
Nov 24   1:03:52 hr
Nov 21   0:30:55 hr
Nov 21   1:05:31 hr

See more activities here.

Some photos I've taken.

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

Elsewhere on the World-Wide Web