Understanding Contramap

scalacontramapfunctorfp

A contramap is defined as the converse of the map. I have never been satisfied with the definition. In this post, I will explain the concept in a way that is easy to internalize.

Read more →

Scala 2 Symbols

scalasymbols

This post provides a concise overview of key symbols used in Scala 2, such as symbols for function types, function literals, import renaming, and more. It serves as a quick reference for Scala …

Read more →

A Rogue JSON Parser

jsonparserscalaquiz

Recently, someone quizzed me to write a JSON parser. Time was limited. So, I told them I might not be able to write a disciplined parser that builds an AST and creates JSON objects out of it. In the …

Read more →

Top K Frequent Items

javascalaproblem

This post explores a functional style implementation in Scala and Java to a famous interview question to find the top k frequent items in an array. Beware the functional implementation may not be …

Read more →

TimedBufferedReader in Java

javabuffered-reader

In the previous post - Why Functional Programming Matters, we explored the design of a high-throughput timed buffered reader in Scala using cats-effect. In this post, we implement the same in Java and …

Read more →