Module

Untagged.Union

Package
purescript-untagged-union
Repository
jvliwanag/purescript-untagged-union

#OneOf Source

data OneOf :: Type -> Type -> Type

Instances

#type (|+|) Source

Operator alias for Untagged.Union.OneOf (right-associative / precedence 7)

#InOneOf Source

class InOneOf a h t 

Instances

#UndefinedOr Source

#asOneOf Source

asOneOf :: forall t h a. Castable a (OneOf h t) => a -> OneOf h t

#fromOneOf Source

fromOneOf :: forall a t h. InOneOf a h t => HasRuntimeType a => OneOf h t -> Maybe a

#toEither1 Source

toEither1 :: forall b a. HasRuntimeType a => OneOf a b -> Either a b

Unwraps a single layer of OneOf to an Either Note that for some x :: a |+| b. If the value x has a runtime value that can be read as either types a and b, then toEither1 x will return Left.

Example: toEither1 (asOneOf 3.0 :: Int |+| Number) == Left 3

#getLeft Source

getLeft :: forall b a. HasRuntimeType a => OneOf a b -> Maybe a

#getLeft' Source

getLeft' :: forall b a. HasRuntimeType b => OneOf a b -> Maybe a

#getRight Source

getRight :: forall b a. HasRuntimeType b => OneOf a b -> Maybe b

#getRight' Source

getRight' :: forall b a. HasRuntimeType a => OneOf a b -> Maybe b

#defined Source

defined :: forall a. a -> UndefinedOr a

#uorToMaybe Source

uorToMaybe :: forall a. UndefinedOr a -> Maybe a

#maybeToUor Source

maybeToUor :: forall a. Maybe a -> UndefinedOr a

#withUor Source

withUor :: forall b a. (a -> b) -> UndefinedOr a -> UndefinedOr b

#fromUndefinedOr Source

fromUndefinedOr :: forall a. a -> UndefinedOr a -> a

#Reducible Source

class Reducible f i o | i -> f o, f o -> i where

Members

Instances