Either

Error Handling in Scala with Option, Try/Catch and Either

Reading Time: 3 minutes Error handling is the process of handling the possibility of failure. For example, failing to read a file and then continuing to use that bad input would clearly be problematic. Noticing and explicitly managing these errors saves the rest of the program from various pitfalls. Exceptions in Scala work the same way as in C++ or Java. When an exception occurs, say an Arithmetic Exception then the Continue Reading

explore either in cats library

Explore Either in Cats Library

Reading Time: 4 minutes Hey everyone, I’m back with another blog in which we are going to explore Either in Cats Library. For an introduction to Either Monad in Cats and comparison between Either in standard Scala Library and Cats Library, you can have a look at my previous blog i.e Either in Cats vs Either in Scala. Also, if you don’t know what is a Monad you can Continue Reading

Either in Cats vs Either in Scala

Reading Time: 4 minutes Hola amigos! Last time I discussed Monads in general and in Cats as well. In this blog, let’s have a look at one of the most known monad Either. I’ll be giving an introduction to it and also there will be a comparison between two i.e Either in Cats vs Either in Scala. What is Either? Either basically represents a value of one of two Continue Reading

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

Error Handling Using EitherT

Reading Time: 3 minutes Are you aware of Either, if yes then you must know how it’s use for error handling , but don’t you think things get messy when it is placed into effectful types such as Option or Future, a large amount of boilerplate is required to handle errors.

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