Safe Haskell | None |
---|---|
Language | Haskell2010 |
Data.Exists
Contents
Description
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.
Constructors
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 | |
FromJSONExists f => FromJSON (Exists f) Source # | |
(FromJSONKeyExists f, FromJSONExists f) => FromJSONKey (Exists f) Source # | |
Defined in Data.Exists Methods fromJSONKey :: FromJSONKeyFunction (Exists f) # | |
BinaryExists f => Binary (Exists f) Source # | |
PathPieceExists f => PathPiece (Exists f) Source # | |
Defined in Data.Exists |
data Exists2 (f :: k -> j -> Type) Source #
Hide two type parameters.
Constructors
Exists2 !(f a b) |
Instances
EqForallPoly2 f => Eq (Exists2 f) Source # | |
ShowForall2 f => Show (Exists2 f) Source # | |
BinaryExists2 f => Binary (Exists2 f) Source # | |
data Exists3 (f :: k -> j -> l -> Type) Source #
Hide three type parameters.
Constructors
Exists3 !(f a b c) |
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.
Constructors
DependentPair (f a) (g a) |
Instances
(EqForallPoly f, ToSing f, EqForeach g) => Eq (DependentPair f g) Source # | |
Defined in Data.Exists Methods (==) :: 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 Methods 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 Methods showsPrec :: Int -> DependentPair f g -> ShowS # show :: DependentPair f g -> String # showList :: [DependentPair f g] -> ShowS # |
data WitnessedEquality (a :: k) (b :: k) where Source #
Constructors
WitnessedEqualityEqual :: WitnessedEquality a a | |
WitnessedEqualityUnequal :: WitnessedEquality a b |
data WitnessedOrdering (a :: k) (b :: k) where Source #
Constructors
WitnessedOrderingLT :: WitnessedOrdering a b | |
WitnessedOrderingEQ :: WitnessedOrdering a a | |
WitnessedOrderingGT :: WitnessedOrdering a b |
newtype ApplyForall f a Source #
Constructors
ApplyForall | |
Fields
|
Instances
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.
Constructors
ApplyForeach | |
Fields
|
Instances
newtype ApplyLifted f a Source #
Constructors
ApplyLifted | |
Fields
|
Instances
Type Classes
class EqForall f where Source #
Minimal complete definition
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 #
Methods
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 Methods eqForallPoly :: Product f g a -> Product f g b -> WitnessedEquality a b Source # | |
EqSing k => EqForallPoly (SingList :: [k] -> Type) Source # | |
Defined in Data.Exists Methods eqForallPoly :: SingList a -> SingList b -> WitnessedEquality a b Source # | |
EqForallPoly f => EqForallPoly (Rec f :: [k] -> Type) Source # | |
Defined in Topaz.Types Methods 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.
Minimal complete definition
Instances
EqForeach f => EqForeach (ApplyForeach f :: k -> *) Source # | |
Defined in Data.Exists Methods eqForeach :: Sing a -> ApplyForeach f a -> ApplyForeach f a -> Bool Source # | |
(Eq1 f, EqForeach g) => EqForeach (Compose f g :: k -> *) Source # | |
EqForeach f => EqForeach (Rec f :: [k] -> Type) Source # | |
class EqForall f => OrdForall f where Source #
Minimal complete definition
Methods
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 #
Minimal complete definition
Methods
compareForallPoly :: f a -> f b -> WitnessedOrdering a b Source #
Instances
(OrdForallPoly f, OrdForallPoly g) => OrdForallPoly (Product f g :: k -> *) Source # | |
Defined in Data.Exists Methods 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.
Minimal complete definition
Methods
compareForeach :: Sing a -> f a -> f a -> Ordering Source #
Instances
OrdForeach f => OrdForeach (ApplyForeach f :: k -> *) Source # | |
Defined in Data.Exists Methods 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 #
Minimal complete definition
Methods
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 #
Minimal complete definition
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 #
Minimal complete definition
Methods
readPrecExists :: ReadPrec (Exists f) Source #
Instances
ReadExists (Proxy :: k -> *) Source # | |
Defined in Data.Exists |
class EnumForall f where Source #
Minimal complete definition
class EnumExists f where Source #
Minimal complete definition
class BoundedExists f where Source #
Minimal complete definition
class SemigroupForall f where Source #
Minimal complete definition
Methods
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 Methods 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 #
Minimal complete definition
Methods
appendForeach :: Sing a -> f a -> f a -> f a Source #
Instances
SemigroupForeach f => SemigroupForeach (ApplyForeach f :: k -> *) Source # | |
Defined in Data.Exists Methods 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 #
Minimal complete definition
Methods
emptyForall :: f a Source #
Instances
Monoid a => MonoidForall (Const a :: k -> *) Source # | |
Defined in Data.Exists Methods emptyForall :: Const a a0 Source # | |
MonoidForall f => MonoidForall (ApplyForall f :: k -> *) Source # | |
Defined in Data.Exists Methods emptyForall :: ApplyForall f a Source # |
class SemigroupForeach f => MonoidForeach f where Source #
Minimal complete definition
Methods
emptyForeach :: Sing a -> f a Source #
Instances
MonoidForeach f => MonoidForeach (ApplyForeach f :: k -> *) Source # | |
Defined in Data.Exists Methods emptyForeach :: Sing a -> ApplyForeach f a Source # | |
MonoidForeach f => MonoidForeach (Rec f :: [k] -> Type) Source # | |
Defined in Topaz.Types Methods emptyForeach :: Sing a -> Rec f a Source # |
class HashableForall f where Source #
Minimal complete definition
Methods
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 #
Minimal complete definition
class PathPieceExists f where Source #
Minimal complete definition
class FromJSONForeach f where Source #
Minimal complete definition
Instances
FromJSON a => FromJSONForeach (Const a :: k -> *) Source # | |
Defined in Data.Exists | |
FromJSONForeach f => FromJSONForeach (ApplyForeach f :: k -> *) Source # | |
Defined in Data.Exists Methods 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 #
Minimal complete definition
Instances
FromJSONExists f => FromJSONExists (Rec f :: [k] -> Type) Source # | |
Defined in Topaz.Types |
class ToJSONForall f where Source #
Minimal complete definition
Methods
toJSONForall :: f a -> Value Source #
Instances
(ToJSON1 f, ToJSONForall g) => ToJSONForall (Compose f g :: k -> *) Source # | |
Defined in Data.Exists Methods toJSONForall :: Compose f g a -> Value Source # | |
ToJSONForall f => ToJSONForall (Rec f :: [k] -> Type) Source # | |
Defined in Topaz.Types Methods toJSONForall :: Rec f a -> Value Source # |
class ToJSONForeach f where Source #
Minimal complete definition
Methods
toJSONForeach :: Sing a -> f a -> Value Source #
Instances
ToJSONForeach f => ToJSONForeach (ApplyForeach f :: k -> *) Source # | |
Defined in Data.Exists Methods 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 #
Constructors
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 #
Constructors
FromJSONKeyTextParserForeach !(forall a. Sing a -> Text -> Parser (f a)) | |
FromJSONKeyValueForeach !(forall a. Sing a -> Value -> Parser (f a)) |
class ToJSONKeyForeach f where Source #
Minimal complete definition
Methods
toJSONKeyForeach :: ToJSONKeyFunctionForall (Product Sing f) Source #
Instances
ToJSONKeyForeach f => ToJSONKeyForeach (ApplyForeach f :: k -> *) Source # | |
Defined in Data.Exists Methods toJSONKeyForeach :: ToJSONKeyFunctionForall (Product Sing (ApplyForeach f)) Source # |
class FromJSONKeyExists f where Source #
Minimal complete definition
Methods
fromJSONKeyExists :: FromJSONKeyFunction (Exists f) Source #
class FromJSONKeyForeach f where Source #
Minimal complete definition
Methods
Instances
FromJSONKeyForeach f => FromJSONKeyForeach (ApplyForeach f :: k -> *) Source # | |
Defined in Data.Exists Methods fromJSONKeyForeach :: FromJSONKeyFunctionForeach (ApplyForeach f) Source # |
class StorableForeach (f :: k -> Type) where Source #
Minimal complete definition
Methods
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).
Minimal complete definition
Methods
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
.
Minimal complete definition
sizeOfForall#, alignmentForall#, indexByteArrayForall#, readByteArrayForall#, writeByteArrayForall#, setByteArrayForall#, indexOffAddrForall#, readOffAddrForall#, writeOffAddrForall#, setOffAddrForall#
Methods
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 #
Minimal complete definition
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 #
Minimal complete definition
Methods
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 #
Minimal complete definition
Methods
showsPrecForall2 :: Int -> f a b -> ShowS Source #
class ShowForeach2 f where Source #
Minimal complete definition
class BinaryExists2 (f :: k -> j -> Type) where Source #
Minimal complete definition
More Type Classes
data SingList :: forall (k :: Type). [k] -> Type where Source #
Constructors
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 Methods 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 #
Constructors
SingMaybeJust :: Sing a -> SingMaybe (Just a) | |
SingMaybeNothing :: SingMaybe Nothing |
Minimal complete definition
Sing Type Classes
Minimal complete definition
class EqSing k => OrdSing k where Source #
Minimal complete definition
Methods
compareSing :: forall (a :: k) (b :: k). Sing a -> Sing b -> WitnessedOrdering a b Source #
class ToJSONSing k where Source #
Minimal complete definition
Methods
toJSONSing :: forall (a :: k). Sing a -> Value Source #
class FromJSONSing k where Source #
Minimal complete definition
class SingKind k where Source #
The two functions must form an isomorphism.
Minimal complete definition
Methods
demoteSing :: Sing (a :: k) -> k Source #
Instances
SingKind k => SingKind [k] Source # | |
Defined in Data.Exists |
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
.