Module
Data.Variant.Internal
- Package
- variant
- Repository
- natefaubion/purescript-variant
#VariantCase Source
data VariantCase :: Type
#VariantFCase Source
data VariantFCase :: Type -> Type
#VariantTags Source
class VariantTags :: forall k. RowList k -> Constraint
class VariantTags rl where
Members
variantTags :: forall proxy. proxy rl -> List String
Instances
VariantTags Nil
(VariantTags rs, IsSymbol sym) => VariantTags (Cons sym a rs)
#Contractable Source
class Contractable :: forall k. Row k -> Row k -> Constraint
class Contractable gt lt where
Members
contractWith :: forall proxy1 proxy2 f a. Alternative f => proxy1 gt -> proxy2 lt -> String -> a -> f a
Instances
(RowToList lt ltl, Union lt a gt, VariantTags ltl) => Contractable gt lt
#VariantMatchCases Source
class VariantMatchCases :: RowList Type -> Row Type -> Type -> Constraint
class VariantMatchCases rl vo b | rl -> vo b
Instances
(VariantMatchCases rl vo' b, Cons sym a vo' vo, TypeEquals k (a -> b)) => VariantMatchCases (Cons sym k rl) vo b
VariantMatchCases Nil () b
#VariantFMatchCases Source
class VariantFMatchCases :: RowList Type -> Row (Type -> Type) -> Type -> Type -> Constraint
class VariantFMatchCases rl vo a b | rl -> vo a b
Instances
(VariantFMatchCases rl vo' a b, Cons sym f vo' vo, TypeEquals k (f a -> b)) => VariantFMatchCases (Cons sym k rl) vo a b
VariantFMatchCases Nil () a b
#lookupEq Source
lookupEq :: List String -> List (VariantCase -> VariantCase -> Boolean) -> VariantRep VariantCase -> VariantRep VariantCase -> Boolean
#lookupOrd Source
lookupOrd :: List String -> List (VariantCase -> VariantCase -> Ordering) -> VariantRep VariantCase -> VariantRep VariantCase -> Ordering
#lookupPred Source
lookupPred :: forall a. VariantRep a -> List String -> List (BoundedDict a) -> List (BoundedEnumDict a) -> Maybe (VariantRep a)
#lookupSucc Source
lookupSucc :: forall a. VariantRep a -> List String -> List (BoundedDict a) -> List (BoundedEnumDict a) -> Maybe (VariantRep a)
#lookupCardinality Source
lookupCardinality :: forall a. List (BoundedEnumDict a) -> Int
#lookupFromEnum Source
lookupFromEnum :: forall a. VariantRep a -> List String -> List (BoundedEnumDict a) -> Int
#lookupToEnum Source
lookupToEnum :: forall a. Int -> List String -> List (BoundedEnumDict a) -> Maybe (VariantRep a)
#BoundedDict Source
type BoundedDict a = { bottom :: a, top :: a }
#impossible Source
impossible :: forall a. String -> a