Top "Either" questions

Either is a type used in functional languages such as Haskell and Scala to represent a value that is one of two parametrized types.

Getting Value of Either

Besides using match, is there an Option-like way to getOrElse the actual content of the Right or Left value? scala&…

scala either
Using Either to process failures in Scala code

Option monad is a great expressive way to deal with something-or-nothing things in Scala. But what if one needs to …

scala functional-programming either
Scala Either map Right or return Left

Is it possible to handle Either in similar way to Option? In Option, I have a getOrElse function, in Either …

scala either
Convert Option to Either in Scala

Suppose I need to convert Option[Int] to Either[String, Int] in Scala. I'd like to do it like this: …

scala type-conversion option either
Throwing exceptions in Scala, what is the "official rule"

I'm following the Scala course on Coursera. I've started to read the Scala book of Odersky as well. What I …

scala exception try-catch either
Using Eithers with Scala "for" syntax

As I understand it, Scala "for" syntax is extremely similar to Haskell's monadic "do" syntax. In Scala, "for" syntax is …

scala monads typeclass for-comprehension either
how do I process returned Either

if a scala function is def A(): Either[Exception, ArrayBuffer[Int]] = { ... } what should be the right way to process the …

scala either
Best way to turn a Lists of Eithers into an Either of Lists?

I have some code like the below, where I have a list of Eithers, and I want to turn it …

scala either
How to extract Left or Right easily from Either type in Dart (Dartz)

I am looking to extract a value easily from a method that return a type Either<Exception, Object>. …

unit-testing flutter dart either
How map only left value from scala Either?

Consider a code: val some: OneCaseClass Either TwoCaseClass = ??? val r = some.left.map(_.toString) Why is r Serializable with Product …

scala either