Safe Haskell | None |
---|---|
Language | Haskell2010 |
Data types and type classes for working with existentially quantified
values. When Quantified Class Constraints land in GHC 8.6,
the BarForall
classes will be considered obsolete. When Dependent
Haskell lands, the BarForeach
classes will also be obsolete.
The benefit that most of the typeclasses in this module provide is
that they help populate the instances of Exists
and Rec
.
Synopsis
- data Exists (f :: k -> Type) = Exists !(f a)
- data Exists2 (f :: k -> j -> Type) = Exists2 !(f a b)
- data Exists3 (f :: k -> j -> l -> Type) = Exists3 !(f a b c)
- data Some (f :: k -> Type) = Some !(Sing a) !(f a)
- data DependentPair (f :: k -> Type) (g :: k -> Type) = DependentPair (f a) (g a)
- data WitnessedEquality (a :: k) (b :: k) where
- data WitnessedOrdering (a :: k) (b :: k) where
- newtype ApplyForall f a = ApplyForall {
- getApplyForall :: f a
- newtype ApplyForeach f a = ApplyForeach {
- getApplyForeach :: f a
- newtype ApplyLifted f a = ApplyLifted {
- getApplyLifted :: f a
- class EqForall f where
- class EqForall f => EqForallPoly f where
- class EqForeach f where
- class EqForall f => OrdForall f where
- class (OrdForall f, EqForallPoly f) => OrdForallPoly f where
- class EqForeach f => OrdForeach f where
- class ShowForall f where
- class ShowForeach f where
- class ReadExists f where
- class EnumForall f where
- class EnumExists f where
- class BoundedExists f where
- class SemigroupForall f where
- class SemigroupForeach f where
- class SemigroupForall f => MonoidForall f where
- class SemigroupForeach f => MonoidForeach f where
- class HashableForall f where
- class HashableForeach f where
- class PathPieceExists f where
- class FromJSONForeach f where
- class FromJSONExists f where
- class ToJSONForall f where
- class ToJSONForeach f where
- data ToJSONKeyFunctionForall f
- = ToJSONKeyTextForall !(forall a. f a -> Text) !(forall a. f a -> Encoding' Text)
- | ToJSONKeyValueForall !(forall a. f a -> Value) !(forall a. f a -> Encoding)
- data FromJSONKeyFunctionForeach f
- = FromJSONKeyTextParserForeach !(forall a. Sing a -> Text -> Parser (f a))
- | FromJSONKeyValueForeach !(forall a. Sing a -> Value -> Parser (f a))
- class ToJSONKeyForall f where
- class ToJSONKeyForeach f where
- class FromJSONKeyExists f where
- class FromJSONKeyForeach f where
- class StorableForeach (f :: k -> Type) where
- class StorableForall (f :: k -> Type) where
- class PrimForall (f :: k -> Type) where
- class BinaryExists (f :: k -> Type) where
- class BinaryForeach (f :: k -> Type) where
- class EqForall2 f where
- class EqForallPoly2 (f :: k -> j -> Type) where
- class ShowForall2 f where
- class ShowForeach2 f where
- class BinaryExists2 (f :: k -> j -> Type) where
- type family Sing = (r :: k -> Type) | r -> k
- data SingList :: forall (k :: Type). [k] -> Type where
- SingListNil :: SingList '[]
- SingListCons :: Sing r -> SingList rs -> SingList (r ': rs)
- data SingMaybe :: Maybe k -> Type where
- SingMaybeJust :: Sing a -> SingMaybe (Just a)
- SingMaybeNothing :: SingMaybe Nothing
- class Reify a where
- class Unreify k where
- class EqSing k where
- class EqSing k => OrdSing k where
- class ShowSing k where
- class ToJSONSing k where
- class FromJSONSing k where
- class ToSing (f :: k -> Type) where
- class SingKind k where
- showsForall :: ShowForall f => f a -> ShowS
- showsForeach :: ShowForeach f => Sing a -> f a -> ShowS
- showForall :: ShowForall f => f a -> String
- showListForall :: ShowForall f => [f a] -> ShowS
- showListForeach :: ShowForeach f => Sing a -> [f a] -> ShowS
- showsForall2 :: ShowForall2 f => f a b -> ShowS
- showForall2 :: ShowForall2 f => f a b -> String
- defaultEqForallPoly :: (TestEquality f, EqForall f) => f a -> f b -> WitnessedEquality a b
- defaultCompareForallPoly :: (TestEquality f, OrdForall f) => f a -> f b -> Ordering
- parseJSONMapForeachKey :: forall k (f :: k -> Type) (a :: k) v. (FromJSONKeyForeach f, OrdForeach f, Unreify k) => (Value -> Parser v) -> Sing a -> Value -> Parser (Map (f a) v)
- toJSONMapForeachKey :: (ToJSONKeyForeach f, ToJSONForeach v) => Sing a -> Map (f a) (v a) -> Value
- weakenEquality :: WitnessedEquality a b -> Bool
- weakenOrdering :: WitnessedOrdering a b -> Ordering
- strengthenEquality :: Bool -> WitnessedEquality a a
- strengthenOrdering :: Ordering -> WitnessedOrdering a a
- strengthenUnequalOrdering :: Ordering -> WitnessedOrdering a b
- unreifyList :: forall (as :: [k]) b. Unreify k => SingList as -> (Reify as => b) -> b
Data Types
data Exists (f :: k -> Type) Source #
Hide a type parameter.
Exists !(f a) |
Instances
BoundedExists f => Bounded (Exists f) Source # | |
EnumExists f => Enum (Exists f) Source # | |
EqForallPoly f => Eq (Exists f) Source # | |
OrdForallPoly f => Ord (Exists f) Source # | |
Defined in Data.Exists | |
ReadExists f => Read (Exists f) Source # | |
ShowForall f => Show (Exists f) Source # | |
HashableForall f => Hashable (Exists f) Source # | |
Defined in Data.Exists | |
ToJSONForall f => ToJSON (Exists f) Source # | |
Defined in Data.Exists | |
(ToJSONKeyForall f, ToJSONForall f) => ToJSONKey (Exists f) Source # | |
Defined in Data.Exists toJSONKey :: ToJSONKeyFunction (Exists f) # toJSONKeyList :: ToJSONKeyFunction [Exists f] # | |
FromJSONExists f => FromJSON (Exists f) Source # | |
(FromJSONKeyExists f, FromJSONExists f) => FromJSONKey (Exists f) Source # | |
Defined in Data.Exists fromJSONKey :: FromJSONKeyFunction (Exists f) # | |
BinaryExists f => Binary (Exists f) Source # | |
PathPieceExists f => PathPiece (Exists f) Source # | |
Defined in Data.Exists fromPathPiece :: Text -> Maybe (Exists f) # toPathPiece :: Exists f -> Text # |
data Exists2 (f :: k -> j -> Type) Source #
Hide two type parameters.
Exists2 !(f a b) |
Instances
EqForallPoly2 f => Eq (Exists2 f) Source # | |
ShowForall2 f => Show (Exists2 f) Source # | |
BinaryExists2 f => Binary (Exists2 f) Source # | |
data Some (f :: k -> Type) Source #
A dependent pair in which the first element is a singleton.
Instances
(EqForeach f, EqSing k) => Eq (Some f) Source # | |
(OrdForeach f, OrdSing k) => Ord (Some f) Source # | |
(ShowForeach f, ShowSing k) => Show (Some f) Source # | |
(ToJSONForeach f, ToJSONSing k) => ToJSON (Some f) Source # | |
Defined in Data.Exists | |
(FromJSONForeach f, FromJSONSing k) => FromJSON (Some f) Source # | |
data DependentPair (f :: k -> Type) (g :: k -> Type) Source #
A pair in which the type of the second element can only be discovered by looking at the first element. The type instance does not enforce this, but all of its typeclass instances make this assumption.
DependentPair (f a) (g a) |
Instances
(EqForallPoly f, ToSing f, EqForeach g) => Eq (DependentPair f g) Source # | |
Defined in Data.Exists (==) :: DependentPair f g -> DependentPair f g -> Bool # (/=) :: DependentPair f g -> DependentPair f g -> Bool # | |
(OrdForallPoly f, ToSing f, OrdForeach g) => Ord (DependentPair f g) Source # | |
Defined in Data.Exists compare :: DependentPair f g -> DependentPair f g -> Ordering # (<) :: DependentPair f g -> DependentPair f g -> Bool # (<=) :: DependentPair f g -> DependentPair f g -> Bool # (>) :: DependentPair f g -> DependentPair f g -> Bool # (>=) :: DependentPair f g -> DependentPair f g -> Bool # max :: DependentPair f g -> DependentPair f g -> DependentPair f g # min :: DependentPair f g -> DependentPair f g -> DependentPair f g # | |
(ShowForall f, ToSing f, ShowForeach g) => Show (DependentPair f g) Source # | |
Defined in Data.Exists showsPrec :: Int -> DependentPair f g -> ShowS # show :: DependentPair f g -> String # showList :: [DependentPair f g] -> ShowS # |
data WitnessedEquality (a :: k) (b :: k) where Source #
data WitnessedOrdering (a :: k) (b :: k) where Source #
newtype ApplyForall f a Source #
ApplyForall | |
|
Instances
MonoidForall f => MonoidForall (ApplyForall f :: k -> *) Source # | |
Defined in Data.Exists emptyForall :: ApplyForall f a Source # | |
SemigroupForall f => SemigroupForall (ApplyForall f :: k -> *) Source # | |
Defined in Data.Exists appendForall :: ApplyForall f a -> ApplyForall f a -> ApplyForall f a Source # | |
ShowForall f => Show (ApplyForall f a) Source # | |
Defined in Data.Exists showsPrec :: Int -> ApplyForall f a -> ShowS # show :: ApplyForall f a -> String # showList :: [ApplyForall f a] -> ShowS # | |
SemigroupForall f => Semigroup (ApplyForall f a) Source # | |
Defined in Data.Exists (<>) :: ApplyForall f a -> ApplyForall f a -> ApplyForall f a # sconcat :: NonEmpty (ApplyForall f a) -> ApplyForall f a # stimes :: Integral b => b -> ApplyForall f a -> ApplyForall f a # | |
MonoidForall f => Monoid (ApplyForall f a) Source # | |
Defined in Data.Exists mempty :: ApplyForall f a # mappend :: ApplyForall f a -> ApplyForall f a -> ApplyForall f a # mconcat :: [ApplyForall f a] -> ApplyForall f a # |
newtype ApplyForeach f a Source #
This is useful for recovering an instance of a typeclass when we have the pi-quantified variant and a singleton in scope.
ApplyForeach | |
|
Instances
newtype ApplyLifted f a Source #
ApplyLifted | |
|
Instances
Type Classes
class EqForall f where Source #
Instances
EqForall (Proxy :: k -> *) Source # | |
Eq a => EqForall (Const a :: k -> *) Source # | |
EqForall ((:~:) a :: k -> *) Source # | |
EqHetero h => EqForall (HFix h :: k -> *) Source # | |
(EqForall f, EqForall g) => EqForall (Sum f g :: k -> *) Source # | |
(EqForall f, EqForall g) => EqForall (Product f g :: k -> *) Source # | |
(Eq1 f, EqForall g) => EqForall (Compose f g :: k -> *) Source # | |
EqForall (SingList :: [k] -> Type) Source # | |
EqForall f => EqForall (Rec f :: [k] -> Type) Source # | |
class EqForall f => EqForallPoly f where Source #
eqForallPoly :: f a -> f b -> WitnessedEquality a b Source #
eqForallPoly :: TestEquality f => f a -> f b -> WitnessedEquality a b Source #
Instances
(EqForallPoly f, EqForallPoly g) => EqForallPoly (Product f g :: k -> *) Source # | |
Defined in Data.Exists eqForallPoly :: Product f g a -> Product f g b -> WitnessedEquality a b Source # | |
EqSing k => EqForallPoly (SingList :: [k] -> Type) Source # | |
Defined in Data.Exists eqForallPoly :: SingList a -> SingList b -> WitnessedEquality a b Source # | |
EqForallPoly f => EqForallPoly (Rec f :: [k] -> Type) Source # | |
Defined in Topaz.Types eqForallPoly :: Rec f a -> Rec f b -> WitnessedEquality a b Source # |
class EqForeach f where Source #
Variant of EqForall
that requires a pi-quantified type.
class EqForall f => OrdForall f where Source #
compareForall :: f a -> f a -> Ordering Source #
Instances
OrdForall (Proxy :: k -> *) Source # | |
Defined in Data.Exists | |
Ord a => OrdForall (Const a :: k -> *) Source # | |
Defined in Data.Exists | |
(OrdForall f, OrdForall g) => OrdForall (Sum f g :: k -> *) Source # | |
Defined in Data.Exists | |
(OrdForall f, OrdForall g) => OrdForall (Product f g :: k -> *) Source # | |
Defined in Data.Exists | |
OrdForall f => OrdForall (Rec f :: [k] -> Type) Source # | |
Defined in Topaz.Types |
class (OrdForall f, EqForallPoly f) => OrdForallPoly f where Source #
compareForallPoly :: f a -> f b -> WitnessedOrdering a b Source #
Instances
(OrdForallPoly f, OrdForallPoly g) => OrdForallPoly (Product f g :: k -> *) Source # | |
Defined in Data.Exists compareForallPoly :: Product f g a -> Product f g b -> WitnessedOrdering a b Source # |
class EqForeach f => OrdForeach f where Source #
Variant of OrdForall
that requires a pi-quantified type.
compareForeach :: Sing a -> f a -> f a -> Ordering Source #
Instances
OrdForeach f => OrdForeach (ApplyForeach f :: k -> *) Source # | |
Defined in Data.Exists compareForeach :: Sing a -> ApplyForeach f a -> ApplyForeach f a -> Ordering Source # | |
OrdForeach f => OrdForeach (Rec f :: [k] -> Type) Source # | |
Defined in Topaz.Types |
class ShowForall f where Source #
showsPrecForall :: Int -> f a -> ShowS Source #
Instances
ShowForall (Proxy :: k -> *) Source # | |
Defined in Data.Exists | |
Show a => ShowForall (Const a :: k -> *) Source # | |
Defined in Data.Exists | |
(ShowForall f, ShowForall g) => ShowForall (Product f g :: k -> *) Source # | |
Defined in Data.Exists | |
(Show1 f, ShowForall g) => ShowForall (Compose f g :: k -> *) Source # | |
Defined in Data.Exists | |
ShowForall f => ShowForall (Rec f :: [k] -> Type) Source # | |
Defined in Topaz.Types |
class ShowForeach f where Source #
Instances
(Show1 f, ShowForeach g) => ShowForeach (Compose f g :: k -> *) Source # | |
Defined in Data.Exists | |
ShowForeach f => ShowForeach (Rec f :: [k] -> Type) Source # | |
Defined in Topaz.Types |
class ReadExists f where Source #
readPrecExists :: ReadPrec (Exists f) Source #
Instances
ReadExists (Proxy :: k -> *) Source # | |
Defined in Data.Exists |
class EnumForall f where Source #
toEnumForall :: Int -> f a Source #
fromEnumForall :: f a -> Int Source #
class EnumExists f where Source #
toEnumExists :: Int -> Exists f Source #
fromEnumExists :: Exists f -> Int Source #
class BoundedExists f where Source #
minBoundExists :: Exists f Source #
maxBoundExists :: Exists f Source #
class SemigroupForall f where Source #
appendForall :: f a -> f a -> f a Source #
Instances
SemigroupForall (Proxy :: k -> *) Source # | |
Defined in Data.Exists | |
Semigroup a => SemigroupForall (Const a :: k -> *) Source # | |
Defined in Data.Exists | |
SemigroupForall f => SemigroupForall (ApplyForall f :: k -> *) Source # | |
Defined in Data.Exists appendForall :: ApplyForall f a -> ApplyForall f a -> ApplyForall f a Source # | |
(Semigroup1 f, SemigroupForall g) => SemigroupForall (Compose f g :: k -> *) Source # | |
Defined in Data.Exists | |
SemigroupForall f => SemigroupForall (Rec f :: [k] -> Type) Source # | |
Defined in Topaz.Types |
class SemigroupForeach f where Source #
appendForeach :: Sing a -> f a -> f a -> f a Source #
Instances
SemigroupForeach f => SemigroupForeach (ApplyForeach f :: k -> *) Source # | |
Defined in Data.Exists appendForeach :: Sing a -> ApplyForeach f a -> ApplyForeach f a -> ApplyForeach f a Source # | |
(Semigroup1 f, SemigroupForeach g) => SemigroupForeach (Compose f g :: k -> *) Source # | |
Defined in Data.Exists | |
SemigroupForeach f => SemigroupForeach (Rec f :: [k] -> Type) Source # | |
Defined in Topaz.Types |
class SemigroupForall f => MonoidForall f where Source #
emptyForall :: f a Source #
Instances
Monoid a => MonoidForall (Const a :: k -> *) Source # | |
Defined in Data.Exists emptyForall :: Const a a0 Source # | |
MonoidForall f => MonoidForall (ApplyForall f :: k -> *) Source # | |
Defined in Data.Exists emptyForall :: ApplyForall f a Source # |
class SemigroupForeach f => MonoidForeach f where Source #
emptyForeach :: Sing a -> f a Source #
Instances
MonoidForeach f => MonoidForeach (ApplyForeach f :: k -> *) Source # | |
Defined in Data.Exists emptyForeach :: Sing a -> ApplyForeach f a Source # | |
MonoidForeach f => MonoidForeach (Rec f :: [k] -> Type) Source # | |
Defined in Topaz.Types emptyForeach :: Sing a -> Rec f a Source # |
class HashableForall f where Source #
hashWithSaltForall :: Int -> f a -> Int Source #
Instances
Hashable a => HashableForall (Const a :: k -> *) Source # | |
Defined in Data.Exists | |
HashableForall f => HashableForall (Rec f :: [k] -> Type) Source # | |
Defined in Topaz.Types |
class HashableForeach f where Source #
class PathPieceExists f where Source #
class FromJSONForeach f where Source #
Instances
FromJSON a => FromJSONForeach (Const a :: k -> *) Source # | |
Defined in Data.Exists | |
FromJSONForeach f => FromJSONForeach (ApplyForeach f :: k -> *) Source # | |
Defined in Data.Exists parseJSONForeach :: Sing a -> Value -> Parser (ApplyForeach f a) Source # | |
(FromJSON1 f, FromJSONForeach g) => FromJSONForeach (Compose f g :: k -> *) Source # | |
Defined in Data.Exists | |
FromJSONForeach f => FromJSONForeach (Rec f :: [k] -> Type) Source # | |
Defined in Topaz.Types |
class FromJSONExists f where Source #
Instances
FromJSONExists f => FromJSONExists (Rec f :: [k] -> Type) Source # | |
Defined in Topaz.Types |
class ToJSONForall f where Source #
toJSONForall :: f a -> Value Source #
Instances
(ToJSON1 f, ToJSONForall g) => ToJSONForall (Compose f g :: k -> *) Source # | |
Defined in Data.Exists toJSONForall :: Compose f g a -> Value Source # | |
ToJSONForall f => ToJSONForall (Rec f :: [k] -> Type) Source # | |
Defined in Topaz.Types toJSONForall :: Rec f a -> Value Source # |
class ToJSONForeach f where Source #
toJSONForeach :: Sing a -> f a -> Value Source #
Instances
ToJSONForeach f => ToJSONForeach (ApplyForeach f :: k -> *) Source # | |
Defined in Data.Exists toJSONForeach :: Sing a -> ApplyForeach f a -> Value Source # | |
(ToJSON1 f, ToJSONForeach g) => ToJSONForeach (Compose f g :: k -> *) Source # | |
Defined in Data.Exists |
data ToJSONKeyFunctionForall f Source #
ToJSONKeyTextForall !(forall a. f a -> Text) !(forall a. f a -> Encoding' Text) | |
ToJSONKeyValueForall !(forall a. f a -> Value) !(forall a. f a -> Encoding) |
data FromJSONKeyFunctionForeach f Source #
FromJSONKeyTextParserForeach !(forall a. Sing a -> Text -> Parser (f a)) | |
FromJSONKeyValueForeach !(forall a. Sing a -> Value -> Parser (f a)) |
class ToJSONKeyForall f where Source #
class ToJSONKeyForeach f where Source #
Instances
ToJSONKeyForeach f => ToJSONKeyForeach (ApplyForeach f :: k -> *) Source # | |
Defined in Data.Exists |
class FromJSONKeyExists f where Source #
class FromJSONKeyForeach f where Source #
Instances
FromJSONKeyForeach f => FromJSONKeyForeach (ApplyForeach f :: k -> *) Source # | |
Defined in Data.Exists |
class StorableForeach (f :: k -> Type) where Source #
peekForeach :: Sing a -> Ptr (f a) -> IO (f a) Source #
pokeForeach :: Sing a -> Ptr (f a) -> f a -> IO () Source #
sizeOfForeach :: forall (a :: k). Proxy f -> Sing a -> Int Source #
Instances
StorableForeach f => StorableForeach (Rec f :: [k] -> Type) Source # | |
class StorableForall (f :: k -> Type) where Source #
This is like StorableForall
except that the type constructor
must ignore its argument (for purposes of representation).
peekForall :: Ptr (f a) -> IO (f a) Source #
pokeForall :: Ptr (f a) -> f a -> IO () Source #
sizeOfForall :: Proxy f -> Int Source #
class PrimForall (f :: k -> Type) where Source #
Be careful with this typeclass. It is more unsafe than Prim
.
With writeByteArray#
and readByteArray#
, one can implement
unsafeCoerce
.
sizeOfForall#, alignmentForall#, indexByteArrayForall#, readByteArrayForall#, writeByteArrayForall#, setByteArrayForall#, indexOffAddrForall#, readOffAddrForall#, writeOffAddrForall#, setOffAddrForall#
sizeOfForall# :: Proxy# f -> Int# Source #
alignmentForall# :: Proxy# f -> Int# Source #
indexByteArrayForall# :: ByteArray# -> Int# -> f a Source #
readByteArrayForall# :: MutableByteArray# s -> Int# -> State# s -> (#State# s, f a#) Source #
writeByteArrayForall# :: MutableByteArray# s -> Int# -> f a -> State# s -> State# s Source #
setByteArrayForall# :: MutableByteArray# s -> Int# -> Int# -> f a -> State# s -> State# s Source #
indexOffAddrForall# :: Addr# -> Int# -> f a Source #
readOffAddrForall# :: Addr# -> Int# -> State# s -> (#State# s, f a#) Source #
writeOffAddrForall# :: Addr# -> Int# -> f a -> State# s -> State# s Source #
setOffAddrForall# :: Addr# -> Int# -> Int# -> f a -> State# s -> State# s Source #
class BinaryExists (f :: k -> Type) where Source #
class BinaryForeach (f :: k -> Type) where Source #
putForeach :: Sing a -> f a -> Put Source #
getForeach :: Sing a -> Get (f a) Source #
Instances
(Binary1 f, BinaryForeach g) => BinaryForeach (Compose f g :: k -> *) Source # | |
Defined in Data.Exists | |
BinaryForeach f => BinaryForeach (Rec f :: [k] -> Type) Source # | |
Defined in Topaz.Types |
Higher Rank Classes
class EqForallPoly2 (f :: k -> j -> Type) where Source #
eqForallPoly2 :: forall (a :: k) (b :: j) (c :: k) (d :: j). f a b -> f c d -> WitnessedEquality '(a, b) '(c, d) Source #
class ShowForall2 f where Source #
showsPrecForall2 :: Int -> f a b -> ShowS Source #
class ShowForeach2 f where Source #
class BinaryExists2 (f :: k -> j -> Type) where Source #
putExists2 :: Exists2 f -> Put Source #
getExists2 :: Get (Exists2 f) Source #
More Type Classes
data SingList :: forall (k :: Type). [k] -> Type where Source #
SingListNil :: SingList '[] | |
SingListCons :: Sing r -> SingList rs -> SingList (r ': rs) |
Instances
(SingKind k, Binary k) => BinaryExists (SingList :: [k] -> Type) Source # | |
EqSing k => EqForallPoly (SingList :: [k] -> Type) Source # | |
Defined in Data.Exists eqForallPoly :: SingList a -> SingList b -> WitnessedEquality a b Source # | |
EqForall (SingList :: [k] -> Type) Source # | |
ShowSing k => Show (SingList xs) Source # | |
data SingMaybe :: Maybe k -> Type where Source #
SingMaybeJust :: Sing a -> SingMaybe (Just a) | |
SingMaybeNothing :: SingMaybe Nothing |
Sing Type Classes
class EqSing k => OrdSing k where Source #
compareSing :: forall (a :: k) (b :: k). Sing a -> Sing b -> WitnessedOrdering a b Source #
class FromJSONSing k where Source #
class SingKind k where Source #
The two functions must form an isomorphism.
demoteSing :: Sing (a :: k) -> k Source #
Instances
SingKind k => SingKind [k] Source # | |
Defined in Data.Exists demoteSing :: Sing a -> [k] Source # promoteSing :: [k] -> Exists Sing Source # |
Functions
Show
showsForall :: ShowForall f => f a -> ShowS Source #
showsForeach :: ShowForeach f => Sing a -> f a -> ShowS Source #
showForall :: ShowForall f => f a -> String Source #
showListForall :: ShowForall f => [f a] -> ShowS Source #
showListForeach :: ShowForeach f => Sing a -> [f a] -> ShowS Source #
showsForall2 :: ShowForall2 f => f a b -> ShowS Source #
showForall2 :: ShowForall2 f => f a b -> String Source #
Defaulting
defaultEqForallPoly :: (TestEquality f, EqForall f) => f a -> f b -> WitnessedEquality a b Source #
defaultCompareForallPoly :: (TestEquality f, OrdForall f) => f a -> f b -> Ordering Source #
parseJSONMapForeachKey :: forall k (f :: k -> Type) (a :: k) v. (FromJSONKeyForeach f, OrdForeach f, Unreify k) => (Value -> Parser v) -> Sing a -> Value -> Parser (Map (f a) v) Source #
Parse a Map
whose key type is higher-kinded. This only creates a valid Map
if the OrdForeach
instance agrees with the Ord
instance.
toJSONMapForeachKey :: (ToJSONKeyForeach f, ToJSONForeach v) => Sing a -> Map (f a) (v a) -> Value Source #
Weakening
weakenEquality :: WitnessedEquality a b -> Bool Source #
weakenOrdering :: WitnessedOrdering a b -> Ordering Source #
strengthenEquality :: Bool -> WitnessedEquality a a Source #
strengthenOrdering :: Ordering -> WitnessedOrdering a a Source #
Given that we already know two types are equal, promote an Ordering
.
strengthenUnequalOrdering :: Ordering -> WitnessedOrdering a b Source #
Given that we already know two types to be unequal, promote an Ordering
.
The argument should not be EQ
.