Monoid & MonoidK

In continuation to previous post. There is no documentation for MonoidK (Monoid for higher Kinds) on the cats site, hence let me try explaining it. Though Monoid first. Monoid `Monoid[T]` technically is a Semigroup with an `empty`/`Identity` function. i.e. There are two main properties: Associativity…

Scala World

Well I am back from Scala World. The most awesome scala conference of its keep! Not only were there awesome speakers: Paul Phillips (you have to admit, its not that easy finding Paul give scala talks now), Runar Bjarnason (found his talk to be the…

Happy Types

I had prepared this month’s monthly newsletter on generics in Java for my team. It may not be the one ring, but might help you gaining a step, to become the one ring in `Generics` in Java (In case if you are not already). It…

Cats

Cats is a simple and concise functional programming library for Scala. It appeals to me for its compactness and simpler class hierarchy. I have no formal education in category theory. But I am a student of theoretical Mathematics and have studied Abstract Algebra. Though I…

Type-information of generic type for a Parametrized class

Sometimes you feel that your code is world-class and deserves to be shared. There is one such class I have written for a personal project and find it to be extremely useful. You can view it here. Its called `CaptureType` This class obtains the type…

Parallel Streams!!

I am always skeptical of using parallel streams in Java8. For simple reason: You do not have control to decide the pool responsible for executing tasks. By default, common ForkJoinPool executes it. So in short when you do: The common pool executes it. And you…

Constraint Argument to Multiple Types

A lot of times while writing quick scripts (where I haven’t thought through well), I wish the compiler would be a bit lenient to allow any argument of different types. Like this: Duck typing looks well. But its too lenient for me. I dont like…

Hack Puzzle – 1

I have been thinking for quite some-time to build a puzzle. I think I have built an awesome one and hope everyone finds it awesome to hack You can download the jar from here. Aim: Make the program terminate gracefully Terminate gracegully: Implies that the program should…

Replace View Bounds

Well the scala community has decided to deprecate view bounds in Scala. I suspect it might have to do with brevity. Full discussion can be viewed here Well looks like most of the view bounds (<%) can be converted to context bounds. Lets see different strategies that…

Asynchronous Distributed Key-Value DB

I have developed a simple-beta version of an synchronous distributed key-value database. It is simple and quite robust and I plan to make it not so-simple and open to other languages (apart from JVM based ones) in the future :). You can download it and start…