Module
Data.Variant.Internal
- Package
- purescript-variant
- Repository
- natefaubion/purescript-variant
#VariantCase Source
data VariantCase
#VariantFCase Source
data VariantFCase t0
#VariantTags Source
class VariantTags :: forall k. RowList k -> Constraint
class VariantTags rl where
Members
variantTags :: 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
#VariantMapCases Source
class VariantMapCases :: RowList Type -> Row Type -> Row Type -> Constraint
class VariantMapCases (rl :: RowList Type) (ri :: Row Type) (ro :: Row Type) | rl -> ri ro
Instances
(Cons sym a ri' ri, Cons sym b ro' ro, VariantMapCases rl ri' ro', TypeEquals k (a -> b)) => VariantMapCases (Cons sym k rl) ri ro
VariantMapCases Nil () ()
#VariantFMapCases Source
class VariantFMapCases :: RowList Type -> Row (Type -> Type) -> Row (Type -> Type) -> Type -> Type -> Constraint
class VariantFMapCases (rl :: RowList Type) (ri :: Row (Type -> Type)) (ro :: Row (Type -> Type)) (a :: Type) (b :: Type) | rl -> ri ro
Instances
(Cons sym f ri' ri, Cons sym g ro' ro, VariantFMapCases rl ri' ro' a b, TypeEquals k (f a -> g b)) => VariantFMapCases (Cons sym k rl) ri ro a b
VariantFMapCases Nil () () a b
#VariantTraverseCases Source
class VariantTraverseCases :: (Type -> Type) -> RowList Type -> Row Type -> Row Type -> Constraint
class VariantTraverseCases (m :: Type -> Type) (rl :: RowList Type) (ri :: Row Type) (ro :: Row Type) | rl -> ri ro
Instances
(Cons sym a ri' ri, Cons sym b ro' ro, VariantTraverseCases m rl ri' ro', TypeEquals k (a -> m b)) => VariantTraverseCases m (Cons sym k rl) ri ro
VariantTraverseCases m Nil () ()
#VariantFTraverseCases Source
class VariantFTraverseCases :: (Type -> Type) -> RowList Type -> Row (Type -> Type) -> Row (Type -> Type) -> Type -> Type -> Constraint
class VariantFTraverseCases (m :: Type -> Type) (rl :: RowList Type) (ri :: Row (Type -> Type)) (ro :: Row (Type -> Type)) (a :: Type) (b :: Type) | rl -> ri ro
Instances
(Cons sym f ri' ri, Cons sym g ro' ro, VariantFTraverseCases m rl ri' ro' a b, TypeEquals k (f a -> m (g b))) => VariantFTraverseCases m (Cons sym k rl) ri ro a b
VariantFTraverseCases m 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