Module

Untagged.Union

#OneOf

data OneOf :: Type -> Type -> Type

Instances

#type (|+|)

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

#InOneOf

class InOneOf a h t 

Instances

#UndefinedOr

#asOneOf

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

#fromOneOf

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

#toEither1

toEither1 :: forall a b. 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

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

#getLeft'

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

#getRight

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

#getRight'

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

#defined

defined :: forall a. a -> UndefinedOr a

#uorToMaybe

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

#maybeToUor

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

#withUor

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

#fromUndefinedOr

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

#Reducible

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

Members

Instances

Modules