constrained-some-0.1.0.0: Existential type that can be constrained
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Some.Constraint

Synopsis

Documentation

type family AllC cs k :: Constraint where ... Source #

AllC ensures that a list of Constraints is applied to a poly-kinded Type k.

Equations

AllC '[] k = () 
AllC (c ': cs) k = (c k, AllC cs k) 

data Somes cs where Source #

Existential with Constraints.

Example

Expand
someShowableOrd :: Somes '[Show, Ord]
someShowableOrd = Somes (mempty :: [Double])

Constructors

Some :: forall (cs :: [Type -> Constraint]) (a :: Type). AllC cs a => a -> Somes cs 

type Some c = Somes '[c] Source #

Alias for Somes with just one Constraint.

data Somes1 csf csa where Source #

Existential for containers with Constraints.

Example

Expand
someNumFunctor :: Somes1 '[Functor] '[Num]
someNumFunctor = Somes1 $ [1, 2, 3 :: Int]

Constructors

Some1 :: forall k (csf :: [(k -> Type) -> Constraint]) (csa :: [k -> Constraint]) (f :: k -> Type) (a :: k). (AllC csf f, AllC csa a) => f a -> Somes1 csf csa 

type Some1 ca cf = Somes1 '[ca] '[cf] Source #

Alias for Somes1 with just one Constraint.