I have an object of type Either String (Either String Int)
. I would like to collapse it to an object of type Either String Int
.
Is there a provided function for this in PureScript?
It is the same as Haskell:
import Prelude
import Data.Either
let a = Left "a" :: Either String (Either String Int)
let b = Right (Left "b") :: Either String (Either String Int)
let c = Right (Right 123) :: Either String (Either String Int)
join a -- Left "a"
join b -- Left "b"
join c -- Right 123
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With