Module
Data.These
- Package
- purescript-these
- Repository
- purescript-contrib/purescript-these
#These Source
data These a bData type isomorphic to α ∨ β ∨ (α ∧ β) or
Either a (Either b (Tuple a b)).
Constructors
Instances
(Eq a, Eq b) => Eq (These a b)(Ord a, Ord b) => Ord (These a b)(Semigroup a, Semigroup b) => Semigroup (These a b)Functor (These a)Invariant (These a)Foldable (These a)Traversable (These a)Bifunctor TheseBifoldable TheseBitraversable These(Semigroup a) => Apply (These a)(Semigroup a) => Applicative (These a)(Semigroup a) => Bind (These a)(Semigroup a) => Monad (These a)Extend (These a)(Show a, Show b) => Show (These a b)
#thisOrBoth Source
thisOrBoth :: forall a b. a -> Maybe b -> These a b#thatOrBoth Source
thatOrBoth :: forall a b. b -> Maybe a -> These a b#maybeThese Source
maybeThese :: forall a b. Maybe a -> Maybe b -> Maybe (These a b)Takes a pair of Maybes and attempts to create a These from them.
#fromThese Source
fromThese :: forall a b. a -> b -> These a b -> Tuple a bTakes two default values and a These value. If the These value is
This or That, the value wrapped in the These value and its
corresponding default value are wrapped into a Tuple.
Otherwise, the values stored in the Both are rewrapped into a Tuple.
#theseRight Source
theseRight :: forall a b. These a b -> Maybe bReturns a b value if possible.