Either

Use of Either in Scala

Reading Time: 3 minutes In this blog, we are going to see the use of Either in scala. We use Options in scala but why do we want to go for Either? Either is a better approach in the respect that if something fails we can track down the reason, which in Option None case is not possible.We simply pass None but what is the reason we got None Continue Reading

monads

Back2Basics: Exception Handling – #3

Reading Time: 2 minutes In our previous blog Exception Handling – #2, we talked about how we can handle exception using Either. In this blog, we will explore further about Either, how we can elegantly handle exceptions using Either while working with Collections. We use collections when we want to perform some operations on elements. But what if something goes wrong while performing the transformation, do you have any Continue Reading

monads

Back2Basics: Exception Handling – #2

Reading Time: 3 minutes In our previous blog, we have seen how we can handle exceptions using try/catch and Try block.  In this blog, we will explore how we can handle exceptions using Either. Either, just like a Try, is also a container type which can have one value either Left or Right at a time. We can also use Option to handle exceptions but if an exception occurs returning Continue Reading