Copyright | (c) Justin Le 2018 |
---|---|
License | BSD3 |
Maintainer | justin@jle.im |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
A type family for "containers", intended for allowing lifting of
predicates on k
to be predicates on containers f k
.
Synopsis
- type family Elem (f :: Type -> Type) :: f k -> k -> Type
- type In (f :: Type -> Type) (as :: f k) = ElemSym1 f as
- class Universe (f :: Type -> Type) where
- idecideAny :: forall k (p :: k ~> Type) (as :: f k). (forall a. Elem f as a -> Sing a -> Decision (p @@ a)) -> Sing as -> Decision (Any f p @@ as)
- idecideAll :: forall k (p :: k ~> Type) (as :: f k). (forall a. Elem f as a -> Sing a -> Decision (p @@ a)) -> Sing as -> Decision (All f p @@ as)
- igenAllA :: forall k (p :: k ~> Type) (as :: f k) h. Applicative h => (forall a. Elem f as a -> Sing a -> h (p @@ a)) -> Sing as -> h (All f p @@ as)
- data Index :: [k] -> k -> Type where
- data IJust :: Maybe k -> k -> Type where
- data IRight :: Either j k -> k -> Type where
- data NEIndex :: NonEmpty k -> k -> Type where
- data ISnd :: (j, k) -> k -> Type where
- data IProxy :: Proxy k -> k -> Type
- data IIdentity :: Identity k -> k -> Type where
- data CompElem :: (f :.: g) k -> k -> Type where
- data SumElem :: (f :+: g) k -> k -> Type where
- data All f :: Predicate k -> Predicate (f k)
- newtype WitAll f p (as :: f k) = WitAll {}
- type NotAll f p = (Not (All f p) :: Predicate (f k))
- data Any f :: Predicate k -> Predicate (f k)
- data WitAny f :: (k ~> Type) -> f k -> Type where
- type None f p = (Not (Any f p) :: Predicate (f k))
- type Null f = (None f Evident :: Predicate (f k))
- type NotNull f = (Any f Evident :: Predicate (f k))
- type IsJust = (NotNull Maybe :: Predicate (Maybe k))
- type IsNothing = (Null Maybe :: Predicate (Maybe k))
- type IsRight = (NotNull (Either j) :: Predicate (Either j k))
- type IsLeft = (Null (Either j) :: Predicate (Either j k))
- decideAny :: forall f k (p :: k ~> Type). Universe f => Decide p -> Decide (Any f p)
- decideAll :: forall f k (p :: k ~> Type). Universe f => Decide p -> Decide (All f p)
- genAllA :: forall f k (p :: k ~> Type) (as :: f k) h. (Universe f, Applicative h) => (forall a. Sing a -> h (p @@ a)) -> Sing as -> h (All f p @@ as)
- genAll :: forall f k (p :: k ~> Type). Universe f => Prove p -> Prove (All f p)
- igenAll :: forall f k (p :: k ~> Type) (as :: f k). Universe f => (forall a. Elem f as a -> Sing a -> p @@ a) -> Sing as -> All f p @@ as
- foldMapUni :: forall f k (as :: f k) m. (Universe f, Monoid m) => (forall (a :: k). Sing a -> m) -> Sing as -> m
- ifoldMapUni :: forall f k (as :: f k) m. (Universe f, Monoid m) => (forall a. Elem f as a -> Sing a -> m) -> Sing as -> m
- index :: forall f as a. Universe f => Elem f as a -> Sing as -> Sing a
- pickElem :: forall f k (as :: f k) a. (Universe f, SingI as, SingI a, SDecide k) => Decision (Elem f as a)
- data family Sing (a :: k) :: Type
- data (f :.: g) a = Comp {
- getComp :: f (g a)
- sGetComp :: Sing a -> Sing (GetComp a)
- type family GetComp c where ...
- allComp :: (All f (All g p) @@ as) -> All (f :.: g) p @@ Comp as
- compAll :: (All (f :.: g) p @@ Comp as) -> All f (All g p) @@ as
- anyComp :: (Any f (Any g p) @@ as) -> Any (f :.: g) p @@ Comp as
- compAny :: (Any (f :.: g) p @@ Comp as) -> Any f (Any g p) @@ as
- data (f :+: g) a
- anySumL :: (Any f p @@ as) -> Any (f :+: g) p @@ InL as
- anySumR :: (Any g p @@ bs) -> Any (f :+: g) p @@ InR bs
- sumLAny :: (Any (f :+: g) p @@ InL as) -> Any f p @@ as
- sumRAny :: (Any (f :+: g) p @@ InR bs) -> Any g p @@ bs
- allSumL :: (All f p @@ as) -> All (f :+: g) p @@ InL as
- allSumR :: (All g p @@ bs) -> All (f :+: g) p @@ InR bs
- sumLAll :: (All (f :+: g) p @@ InL as) -> All f p @@ as
- sumRAll :: (All (f :+: g) p @@ InR bs) -> All g p @@ bs
- data ElemSym0 (f :: Type -> Type) :: f k ~> (k ~> Type)
- data ElemSym1 (f :: Type -> Type) :: f k -> k ~> Type
- type ElemSym2 (f :: Type -> Type) (as :: f k) (a :: k) = Elem f as a
- data GetCompSym0 :: (f :.: g) k ~> f (g k)
- type GetCompSym1 a = GetComp a
Universe
type family Elem (f :: Type -> Type) :: f k -> k -> Type Source #
A witness for membership of a given item in a type-level collection
Instances
type Elem [] Source # | |
Defined in Data.Type.Universe | |
type Elem Maybe Source # | |
type Elem NonEmpty Source # | |
type Elem Identity Source # | |
type Elem (Either j) Source # | |
type Elem ((,) j) Source # | |
Defined in Data.Type.Universe | |
type Elem (Proxy :: Type -> Type) Source # | |
type Elem (f :+: g) Source # | |
type Elem (f :.: g) Source # | |
type In (f :: Type -> Type) (as :: f k) = ElemSym1 f as Source #
is a predicate that a given input In
f asa
is a member of
collection as
.
class Universe (f :: Type -> Type) where Source #
Typeclass for a type-level container that you can quantify or lift type-level predicates over.
:: forall (p :: k ~> Type) (as :: f k). (forall a. Elem f as a -> Sing a -> Decision (p @@ a)) | predicate on value |
-> Sing as -> Decision (Any f p @@ as) | predicate on collection |
:: forall (p :: k ~> Type) (as :: f k). (forall a. Elem f as a -> Sing a -> Decision (p @@ a)) | predicate on value |
-> Sing as -> Decision (All f p @@ as) | predicate on collection |
Instances
Universe [] Source # | |
Defined in Data.Type.Universe idecideAny :: (forall (a :: k). Elem [] as a -> Sing a -> Decision (p @@ a)) -> Sing as -> Decision (Any [] p @@ as) Source # idecideAll :: (forall (a :: k). Elem [] as a -> Sing a -> Decision (p @@ a)) -> Sing as -> Decision (All [] p @@ as) Source # igenAllA :: Applicative h => (forall (a :: k). Elem [] as a -> Sing a -> h (p @@ a)) -> Sing as -> h (All [] p @@ as) Source # | |
Universe Maybe Source # | |
Defined in Data.Type.Universe idecideAny :: (forall (a :: k). Elem Maybe as a -> Sing a -> Decision (p @@ a)) -> Sing as -> Decision (Any Maybe p @@ as) Source # idecideAll :: (forall (a :: k). Elem Maybe as a -> Sing a -> Decision (p @@ a)) -> Sing as -> Decision (All Maybe p @@ as) Source # igenAllA :: Applicative h => (forall (a :: k). Elem Maybe as a -> Sing a -> h (p @@ a)) -> Sing as -> h (All Maybe p @@ as) Source # | |
Universe Identity Source # | The single-pointed universe. Note that this instance is really only usable in singletons-2.5 and higher (so GHC 8.6). |
Defined in Data.Type.Universe idecideAny :: (forall (a :: k). Elem Identity as a -> Sing a -> Decision (p @@ a)) -> Sing as -> Decision (Any Identity p @@ as) Source # idecideAll :: (forall (a :: k). Elem Identity as a -> Sing a -> Decision (p @@ a)) -> Sing as -> Decision (All Identity p @@ as) Source # igenAllA :: Applicative h => (forall (a :: k). Elem Identity as a -> Sing a -> h (p @@ a)) -> Sing as -> h (All Identity p @@ as) Source # | |
Universe NonEmpty Source # | |
Defined in Data.Type.Universe idecideAny :: (forall (a :: k). Elem NonEmpty as a -> Sing a -> Decision (p @@ a)) -> Sing as -> Decision (Any NonEmpty p @@ as) Source # idecideAll :: (forall (a :: k). Elem NonEmpty as a -> Sing a -> Decision (p @@ a)) -> Sing as -> Decision (All NonEmpty p @@ as) Source # igenAllA :: Applicative h => (forall (a :: k). Elem NonEmpty as a -> Sing a -> h (p @@ a)) -> Sing as -> h (All NonEmpty p @@ as) Source # | |
Universe (Either j) Source # | |
Defined in Data.Type.Universe idecideAny :: (forall (a :: k). Elem (Either j) as a -> Sing a -> Decision (p @@ a)) -> Sing as -> Decision (Any (Either j) p @@ as) Source # idecideAll :: (forall (a :: k). Elem (Either j) as a -> Sing a -> Decision (p @@ a)) -> Sing as -> Decision (All (Either j) p @@ as) Source # igenAllA :: Applicative h => (forall (a :: k). Elem (Either j) as a -> Sing a -> h (p @@ a)) -> Sing as -> h (All (Either j) p @@ as) Source # | |
Universe ((,) j) Source # | |
Defined in Data.Type.Universe idecideAny :: (forall (a :: k). Elem ((,) j) as a -> Sing a -> Decision (p @@ a)) -> Sing as -> Decision (Any ((,) j) p @@ as) Source # idecideAll :: (forall (a :: k). Elem ((,) j) as a -> Sing a -> Decision (p @@ a)) -> Sing as -> Decision (All ((,) j) p @@ as) Source # igenAllA :: Applicative h => (forall (a :: k). Elem ((,) j) as a -> Sing a -> h (p @@ a)) -> Sing as -> h (All ((,) j) p @@ as) Source # | |
Universe (Proxy :: Type -> Type) Source # | The null universe |
Defined in Data.Type.Universe idecideAny :: (forall (a :: k). Elem Proxy as a -> Sing a -> Decision (p @@ a)) -> Sing as -> Decision (Any Proxy p @@ as) Source # idecideAll :: (forall (a :: k). Elem Proxy as a -> Sing a -> Decision (p @@ a)) -> Sing as -> Decision (All Proxy p @@ as) Source # igenAllA :: Applicative h => (forall (a :: k). Elem Proxy as a -> Sing a -> h (p @@ a)) -> Sing as -> h (All Proxy p @@ as) Source # | |
(Universe f, Universe g) => Universe (f :+: g) Source # | |
Defined in Data.Type.Universe idecideAny :: (forall (a :: k). Elem (f :+: g) as a -> Sing a -> Decision (p @@ a)) -> Sing as -> Decision (Any (f :+: g) p @@ as) Source # idecideAll :: (forall (a :: k). Elem (f :+: g) as a -> Sing a -> Decision (p @@ a)) -> Sing as -> Decision (All (f :+: g) p @@ as) Source # igenAllA :: Applicative h => (forall (a :: k). Elem (f :+: g) as a -> Sing a -> h (p @@ a)) -> Sing as -> h (All (f :+: g) p @@ as) Source # | |
(Universe f, Universe g) => Universe (f :.: g) Source # | |
Defined in Data.Type.Universe idecideAny :: (forall (a :: k). Elem (f :.: g) as a -> Sing a -> Decision (p @@ a)) -> Sing as -> Decision (Any (f :.: g) p @@ as) Source # idecideAll :: (forall (a :: k). Elem (f :.: g) as a -> Sing a -> Decision (p @@ a)) -> Sing as -> Decision (All (f :.: g) p @@ as) Source # igenAllA :: Applicative h => (forall (a :: k). Elem (f :.: g) as a -> Sing a -> h (p @@ a)) -> Sing as -> h (All (f :.: g) p @@ as) Source # |
Instances
data Index :: [k] -> k -> Type where Source #
Witness an item in a type-level list by providing its index.
data NEIndex :: NonEmpty k -> k -> Type where Source #
Witness an item in a type-level NonEmpty
by either indicating that
it is the "head", or by providing an index in the "tail".
data ISnd :: (j, k) -> k -> Type where Source #
Trivially witness an item in the second field of a type-level tuple.
data IProxy :: Proxy k -> k -> Type Source #
There are no items of type a
in a
.Proxy
a
Since: 0.1.3.0
data IIdentity :: Identity k -> k -> Type where Source #
Trivially witness the item held in an Identity
.
Since: 0.1.3.0
data CompElem :: (f :.: g) k -> k -> Type where Source #
A pair of indices allows you to index into a nested structure.
Since: 0.1.2.0
data SumElem :: (f :+: g) k -> k -> Type where Source #
Index into a disjoint union by providing an index into one of the two possible options.
Since: 0.1.3.0
Predicates
data All f :: Predicate k -> Predicate (f k) Source #
An
is a predicate testing a collection All
f pas :: f a
for the
fact that all items in as
satisfy p
. Represents the "forall"
quantifier over a given universe.
This is mostly useful for its Decidable
, Provable
, and TFunctor
instances, which lets you lift predicates on p
to predicates on
.All
f p
Instances
Universe f => TFunctor (All f :: Predicate k1 -> TyFun (f k1) Type -> Type) Source # | |
Universe f => DFunctor (All f :: Predicate k1 -> TyFun (f k1) Type -> Type) Source # | |
(Universe f, Provable p) => Provable (All f p :: TyFun (f k) Type -> Type) Source # | |
(Universe f, Decidable p) => Decidable (All f p :: TyFun (f k) Type -> Type) Source # | |
AutoAll f p as => Auto (All f p :: TyFun (f k) Type -> Type) (as :: f k) Source # | Since: 0.1.2.0 |
type Apply (All f p :: TyFun (f k) Type -> Type) (as :: f k) Source # | |
newtype WitAll f p (as :: f k) Source #
A
is a witness that the predicate WitAll
p asp a
is true for all
items a
in the type-level collection as
.
type NotAll f p = (Not (All f p) :: Predicate (f k)) Source #
A
is a predicate on a collection NotAll
f pas
that at least one
a
in as
does not satisfy predicate p
.
data Any f :: Predicate k -> Predicate (f k) Source #
An
is a predicate testing a collection Any
f pas :: f a
for the
fact that at least one item in as
satisfies p
. Represents the
"exists" quantifier over a given universe.
This is mostly useful for its Decidable
and TFunctor
instances,
which lets you lift predicates on p
to predicates on
.Any
f p
Instances
data WitAny f :: (k ~> Type) -> f k -> Type where Source #
A
is a witness that, for at least one item WitAny
p asa
in the
type-level collection as
, the predicate p a
is true.
type None f p = (Not (Any f p) :: Predicate (f k)) Source #
A
is a predicate on a collection None
f pas
that no a
in as
satisfies predicate p
.
type Null f = (None f Evident :: Predicate (f k)) Source #
Predicate that a given as :: f k
is empty and has no items in it.
type NotNull f = (Any f Evident :: Predicate (f k)) Source #
Predicate that a given as :: f k
is not empty, and has at least one
item in it.
Specialized
Decisions and manipulations
:: forall (p :: k ~> Type). Universe f | |
=> Decide p | predicate on value |
-> Decide (Any f p) | predicate on collection |
Lifts a predicate p
on an individual a
into a predicate that on
a collection as
that is true if and only if any item in as
satisfies the original predicate.
That is, it turns a predicate of kind k ~> Type
into a predicate
of kind f k ~> Type
.
Essentially tests existential quantification.
:: forall (p :: k ~> Type). Universe f | |
=> Decide p | predicate on value |
-> Decide (All f p) | predicate on collection |
Lifts a predicate p
on an individual a
into a predicate that on
a collection as
that is true if and only if all items in as
satisfies the original predicate.
That is, it turns a predicate of kind k ~> Type
into a predicate
of kind f k ~> Type
.
Essentially tests universal quantification.
:: forall (p :: k ~> Type) (as :: f k). (Universe f, Applicative h) | |
=> (forall a. Sing a -> h (p @@ a)) | predicate on value in context |
-> Sing as -> h (All f p @@ as) | predicate on collection in context |
If p a
is true for all values a
in as
under some
(Applicative) context h
, then you can create an
under
that Applicative context All
p ash
.
Can be useful with Identity
(which is basically unwrapping and
wrapping All
), or with Maybe
(which can express predicates that
are either provably true or not provably false).
In practice, this can be used to iterate and traverse and sequence
actions over all "items" in as
.
foldMapUni :: forall f k (as :: f k) m. (Universe f, Monoid m) => (forall (a :: k). Sing a -> m) -> Sing as -> m Source #
A foldMap
over all items in a collection.
ifoldMapUni :: forall f k (as :: f k) m. (Universe f, Monoid m) => (forall a. Elem f as a -> Sing a -> m) -> Sing as -> m Source #
foldMapUni
but with access to the index.
Extract the item from the container witnessed by the Elem
pickElem :: forall f k (as :: f k) a. (Universe f, SingI as, SingI a, SDecide k) => Decision (Elem f as a) Source #
Automatically generate a witness for a member, if possible
Universe Combination
data family Sing (a :: k) :: Type #
The singleton kind-indexed data family.
Instances
Provable (Evident :: Predicate k1) Source # | |
Decidable (Evident :: Predicate k1) Source # | |
SingI a => Auto (Evident :: Predicate k) (a :: k) Source # | |
Provable (Not (Impossible :: Predicate k1) :: TyFun k1 Type -> Type) Source # | |
Defined in Data.Type.Predicate | |
SingI a => Auto (Not (Impossible :: Predicate k) :: TyFun k Type -> Type) (a :: k) Source # | Since: 0.1.2.0 |
Defined in Data.Type.Predicate.Auto | |
Provable ((p &&& Not p) ==> (Impossible :: Predicate k1) :: TyFun k1 Type -> Type) Source # | Since: 0.1.3.0 |
Defined in Data.Type.Predicate.Logic | |
Provable ((Impossible :: Predicate k1) ==> p :: TyFun k1 Type -> Type) Source # | |
Defined in Data.Type.Predicate.Logic | |
Decidable ((Impossible :: Predicate k1) ==> p :: TyFun k1 Type -> Type) Source # | |
Defined in Data.Type.Predicate.Logic | |
SingI a => Auto (IsJust :: Predicate (Maybe k)) (Just a :: Maybe k) Source # | Since: 0.1.2.0 |
SingI a => Auto (NotNull Identity :: Predicate (Identity k)) (Identity a :: Identity k) Source # | |
SingI a => Auto (NotNull [] :: Predicate [k]) (a ': as :: [k]) Source # | Since: 0.1.2.0 |
SingI a => Auto (NotNull NonEmpty :: Predicate (NonEmpty k)) (a :| as :: NonEmpty k) Source # | Since: 0.1.2.0 |
Provable p => Provable ((NotNull f :: Predicate (f k)) ==> Any f p :: TyFun (f k) Type -> Type) Source # | |
Provable (Found (InP f :: ParamPred (f v) v) ==> (NotNull f :: Predicate (f v)) :: TyFun (f v) Type -> Type) Source # | |
Provable ((NotNull f :: Predicate (f k)) ==> Found (InP f :: ParamPred (f k) k) :: TyFun (f k) Type -> Type) Source # | |
(Universe f, Provable p) => Decidable ((NotNull f :: Predicate (f k)) ==> Any f p :: TyFun (f k) Type -> Type) Source # | |
Decidable (Found (InP f :: ParamPred (f v) v) ==> (NotNull f :: Predicate (f v)) :: TyFun (f v) Type -> Type) Source # | |
Decidable ((NotNull f :: Predicate (f k)) ==> Found (InP f :: ParamPred (f k) k) :: TyFun (f k) Type -> Type) Source # | |
SingI a => Auto (IsRight :: Predicate (Either j k)) (Right a :: Either j k) Source # | Since: 0.1.2.0 |
SingI a => Auto (NotNull ((,) j) :: Predicate (j, k)) ((,) w a :: (j, k)) Source # | Since: 0.1.2.0 |
Auto (NotNull g :: Predicate (g k)) bs => Auto (NotNull (f :+: g) :: Predicate ((f :+: g) k)) (InR bs :: (f :+: g) k) Source # | |
Auto (NotNull f :: Predicate (f k)) as => Auto (NotNull (f :+: g) :: Predicate ((f :+: g) k)) (InL as :: (f :+: g) k) Source # | |
data Sing (a :: Bool) | |
data Sing (a :: Ordering) | |
data Sing (n :: Nat) | |
data Sing (n :: Symbol) | |
Defined in Data.Singletons.TypeLits.Internal | |
data Sing (a :: ()) | |
Defined in Data.Singletons.Prelude.Instances | |
data Sing (a :: Void) | |
Defined in Data.Singletons.Prelude.Instances | |
data Sing (a :: All) | |
data Sing (a :: Any) | |
data Sing (b :: [a]) | |
data Sing (b :: Maybe a) | |
data Sing (b :: Min a) | |
data Sing (b :: Max a) | |
data Sing (b :: First a) | |
data Sing (b :: Last a) | |
data Sing (a :: WrappedMonoid m) | |
Defined in Data.Singletons.Prelude.Semigroup.Internal data Sing (a :: WrappedMonoid m) where
| |
data Sing (b :: Option a) | |
data Sing (b :: Identity a) | |
data Sing (b :: First a) | |
data Sing (b :: Last a) | |
data Sing (b :: Dual a) | |
data Sing (b :: Sum a) | |
data Sing (b :: Product a) | |
data Sing (b :: Down a) | |
data Sing (b :: NonEmpty a) | |
data Sing (b :: Endo a) | |
data Sing (b :: MaxInternal a) | |
Defined in Data.Singletons.Prelude.Foldable data Sing (b :: MaxInternal a) where
| |
data Sing (b :: MinInternal a) | |
Defined in Data.Singletons.Prelude.Foldable data Sing (b :: MinInternal a) where
| |
data Sing (c :: Either a b) | |
data Sing (c :: (a, b)) | |
data Sing (c :: Arg a b) | |
data Sing (f :: k1 ~> k2) | |
data Sing (b :: StateL s a) | |
data Sing (b :: StateR s a) | |
data Sing (d :: (a, b, c)) | |
data Sing (c :: Const a b) | |
data Sing (e :: (a, b, c, d)) | |
data Sing (k :: (f :+: g) a) Source # | |
Defined in Data.Type.Universe | |
data Sing (f :: (a, b, c, d, e)) | |
data Sing (k :: (f :.: g) a) Source # | |
data Sing (g :: (a, b, c, d, e, f)) | |
Defined in Data.Singletons.Prelude.Instances | |
data Sing (h :: (a, b, c, d, e, f, g)) | |
Defined in Data.Singletons.Prelude.Instances |
Universe Composition
Compose two Functors. Is the same as Compose
and :.:
, except with a singleton and meant to be used at
the type level. Will be redundant if either of the above gets brought
into the singletons library.
Note that because this is a higher-kinded data constructor, there is no
SingKind
instance; if you need fromSing
and toSing
, try going
through Comp
and getComp
and SComp
and sGetComp
.
Note that Identity
acts as an identity.
Since: 0.1.2.0
Instances
AutoAll f (All g p) ass => AutoAll (f :.: g) (p :: Predicate a) (Comp ass :: (f :.: g) a) Source # | |
(Functor f, Functor g) => Functor (f :.: g) Source # | |
(Foldable f, Foldable g) => Foldable (f :.: g) Source # | |
Defined in Data.Type.Universe fold :: Monoid m => (f :.: g) m -> m # foldMap :: Monoid m => (a -> m) -> (f :.: g) a -> m # foldr :: (a -> b -> b) -> b -> (f :.: g) a -> b # foldr' :: (a -> b -> b) -> b -> (f :.: g) a -> b # foldl :: (b -> a -> b) -> b -> (f :.: g) a -> b # foldl' :: (b -> a -> b) -> b -> (f :.: g) a -> b # foldr1 :: (a -> a -> a) -> (f :.: g) a -> a # foldl1 :: (a -> a -> a) -> (f :.: g) a -> a # toList :: (f :.: g) a -> [a] # length :: (f :.: g) a -> Int # elem :: Eq a => a -> (f :.: g) a -> Bool # maximum :: Ord a => (f :.: g) a -> a # minimum :: Ord a => (f :.: g) a -> a # | |
(Traversable f, Traversable g) => Traversable (f :.: g) Source # | |
Defined in Data.Type.Universe | |
(Universe f, Universe g) => Universe (f :.: g) Source # | |
Defined in Data.Type.Universe idecideAny :: (forall (a :: k). Elem (f :.: g) as a -> Sing a -> Decision (p @@ a)) -> Sing as -> Decision (Any (f :.: g) p @@ as) Source # idecideAll :: (forall (a :: k). Elem (f :.: g) as a -> Sing a -> Decision (p @@ a)) -> Sing as -> Decision (All (f :.: g) p @@ as) Source # igenAllA :: Applicative h => (forall (a :: k). Elem (f :.: g) as a -> Sing a -> h (p @@ a)) -> Sing as -> h (All (f :.: g) p @@ as) Source # | |
Eq (f (g a)) => Eq ((f :.: g) a) Source # | |
Ord (f (g a)) => Ord ((f :.: g) a) Source # | |
Defined in Data.Type.Universe | |
Show (f (g a)) => Show ((f :.: g) a) Source # | |
Generic ((f :.: g) a) Source # | |
SingI ass => SingI (Comp ass :: (f :.: g) a) Source # | |
Defined in Data.Type.Universe | |
type Elem (f :.: g) Source # | |
type Apply (GetCompSym0 :: TyFun ((f :.: g) k3) (f (g k3)) -> Type) (Comp ass :: (f :.: g) k3) Source # | |
Defined in Data.Type.Universe | |
type Rep ((f :.: g) a) Source # | |
Defined in Data.Type.Universe | |
data Sing (k :: (f :.: g) a) Source # | |
Universe Disjunction
Disjoint union of two Functors. Is the same as Sum
and :+:
, except with a singleton and meant to be used at
the type level. Will be redundant if either of the above gets brought
into the singletons library.
Note that because this is a higher-kinded data constructor, there is no
SingKind
instance; if you need fromSing
and toSing
, consider
manually pattern matching.
Note that Proxy
acts as an identity.
Since: 0.1.3.0
Instances
AutoAll g p bs => AutoAll (f :+: g) (p :: Predicate a) (InR bs :: (f :+: g) a) Source # | |
AutoAll f p as => AutoAll (f :+: g) (p :: Predicate a) (InL as :: (f :+: g) a) Source # | |
AutoElem g bs b => AutoElem (f :+: g) (InR bs :: (f :+: g) k) (b :: k) Source # | |
AutoElem f as a => AutoElem (f :+: g) (InL as :: (f :+: g) k) (a :: k) Source # | |
(Functor f, Functor g) => Functor (f :+: g) Source # | |
(Foldable f, Foldable g) => Foldable (f :+: g) Source # | |
Defined in Data.Type.Universe fold :: Monoid m => (f :+: g) m -> m # foldMap :: Monoid m => (a -> m) -> (f :+: g) a -> m # foldr :: (a -> b -> b) -> b -> (f :+: g) a -> b # foldr' :: (a -> b -> b) -> b -> (f :+: g) a -> b # foldl :: (b -> a -> b) -> b -> (f :+: g) a -> b # foldl' :: (b -> a -> b) -> b -> (f :+: g) a -> b # foldr1 :: (a -> a -> a) -> (f :+: g) a -> a # foldl1 :: (a -> a -> a) -> (f :+: g) a -> a # toList :: (f :+: g) a -> [a] # length :: (f :+: g) a -> Int # elem :: Eq a => a -> (f :+: g) a -> Bool # maximum :: Ord a => (f :+: g) a -> a # minimum :: Ord a => (f :+: g) a -> a # | |
(Traversable f, Traversable g) => Traversable (f :+: g) Source # | |
Defined in Data.Type.Universe | |
(Universe f, Universe g) => Universe (f :+: g) Source # | |
Defined in Data.Type.Universe idecideAny :: (forall (a :: k). Elem (f :+: g) as a -> Sing a -> Decision (p @@ a)) -> Sing as -> Decision (Any (f :+: g) p @@ as) Source # idecideAll :: (forall (a :: k). Elem (f :+: g) as a -> Sing a -> Decision (p @@ a)) -> Sing as -> Decision (All (f :+: g) p @@ as) Source # igenAllA :: Applicative h => (forall (a :: k). Elem (f :+: g) as a -> Sing a -> h (p @@ a)) -> Sing as -> h (All (f :+: g) p @@ as) Source # | |
(Eq (f a), Eq (g a)) => Eq ((f :+: g) a) Source # | |
(Ord (f a), Ord (g a)) => Ord ((f :+: g) a) Source # | |
Defined in Data.Type.Universe | |
(Show (f a), Show (g a)) => Show ((f :+: g) a) Source # | |
Generic ((f :+: g) a) Source # | |
Auto (NotNull g :: Predicate (g k)) bs => Auto (NotNull (f :+: g) :: Predicate ((f :+: g) k)) (InR bs :: (f :+: g) k) Source # | |
Auto (NotNull f :: Predicate (f k)) as => Auto (NotNull (f :+: g) :: Predicate ((f :+: g) k)) (InL as :: (f :+: g) k) Source # | |
type Elem (f :+: g) Source # | |
type Rep ((f :+: g) a) Source # | |
Defined in Data.Type.Universe type Rep ((f :+: g) a) = D1 (MetaData ":+:" "Data.Type.Universe" "decidable-0.1.4.0-L069M6H8crv32lYIvdPsSi" False) (C1 (MetaCons "InL" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (f a))) :+: C1 (MetaCons "InR" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (g a)))) | |
data Sing (k :: (f :+: g) a) Source # | |
Defined in Data.Type.Universe |
Defunctionalization symbols
data ElemSym1 (f :: Type -> Type) :: f k -> k ~> Type Source #
Instances
AutoElem f as a => Auto (In f as :: TyFun k Type -> Type) (a :: k) Source # | |
Provable (Found (InP f :: ParamPred (f v) v) ==> (NotNull f :: Predicate (f v)) :: TyFun (f v) Type -> Type) Source # | |
Provable ((NotNull f :: Predicate (f k)) ==> Found (InP f :: ParamPred (f k) k) :: TyFun (f k) Type -> Type) Source # | |
Decidable (Found (InP f :: ParamPred (f v) v) ==> (NotNull f :: Predicate (f v)) :: TyFun (f v) Type -> Type) Source # | |
Decidable ((NotNull f :: Predicate (f k)) ==> Found (InP f :: ParamPred (f k) k) :: TyFun (f k) Type -> Type) Source # | |
Universe f => Decidable (Found (InP f :: ParamPred (f v) v) :: TyFun (f v) Type -> Type) Source # | |
type Apply (ElemSym1 f as :: TyFun k Type -> Type) (a :: k) Source # | |
data GetCompSym0 :: (f :.: g) k ~> f (g k) Source #
type GetCompSym1 a = GetComp a Source #