| Either | R Documentation |
Either monad implementation.
Either monad implementation.
rhaskell::Functor -> rhaskell::Applicative -> rhaskell::Monad -> Either
new()Either$new(mValue = NULL, isRight = TRUE)
mValuevalue.
Bind function
fmap()Either$fmap(fun)
pure()Either$pure(x)
apply()Either$apply(x)
bind()Either$bind(fun)
funfunction to apply if it is a Right value
bind :: (b -> c) -> Either a b (=self) -> Either a c
Unwrap a Left value with default.
fromLeft()Either$fromLeft(def)
defdefault value
fromLeft :: a -> Either a b (=self) -> a
Unwrap a Right value with default.
fromRight()Either$fromRight(def)
defdefault value
fromRight :: b -> Either a b (=self) -> b
Unwrap an Either from Left or Right with corresponding specified functions.
either()Either$either(f, g)
ffunction to apply in case of Left value
gfunction to apply in case of Right value
either :: (a -> c) -> (b -> c) -> Either a b (=self) -> c
Unwrap Right value or call stop() on Left value.
fromRightOrStop :: Either Character b (=self) -> b
Check if a Either is of type Right.
isRight :: Either a b (=self) -> Bool
Check if a Either is of type Left.
isLeft :: Either a b (=self) -> Bool
fromRightOrStop()Either$fromRightOrStop()
clone()The objects of this class are cloneable with this method.
Either$clone(deep = FALSE)
deepWhether to make a deep clone.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.