constrained-some-0.1.1: 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 

Instances

Instances details
Show (Somes (Show ': cs)) Source # 
Instance details

Defined in Data.Some.Constraint

Methods

showsPrec :: Int -> Somes (Show ': cs) -> ShowS #

show :: Somes (Show ': cs) -> String #

showList :: [Somes (Show ': cs)] -> ShowS #

Show (Somes cs) => Show (Somes (c ': cs)) Source # 
Instance details

Defined in Data.Some.Constraint

Methods

showsPrec :: Int -> Somes (c ': cs) -> ShowS #

show :: Somes (c ': cs) -> String #

showList :: [Somes (c ': cs)] -> ShowS #

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 cf ca = Somes1 '[cf] '[ca] Source #

Alias for Somes1 with just one Constraint.