| 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
- eqForallPoly :: f a -> f b -> WitnessedEquality a b
- class EqForeach f where
- class EqForall f => OrdForall f where
- compareForall :: f a -> f a -> Ordering
- class (OrdForall f, EqForallPoly f) => OrdForallPoly f where
- compareForallPoly :: f a -> f b -> WitnessedOrdering a b
- class EqForeach f => OrdForeach f where
- compareForeach :: Sing a -> f a -> f a -> Ordering
- class ShowForall f where
- showsPrecForall :: Int -> f a -> ShowS
- class ShowForeach f where
- showsPrecForeach :: Sing a -> Int -> f a -> ShowS
- class ReadExists f where
- readPrecExists :: ReadPrec (Exists f)
- class EnumForall f where
- toEnumForall :: Int -> f a
- fromEnumForall :: f a -> Int
- class EnumExists f where
- toEnumExists :: Int -> Exists f
- fromEnumExists :: Exists f -> Int
- class BoundedExists f where
- minBoundExists :: Exists f
- maxBoundExists :: Exists f
- class SemigroupForall f where
- appendForall :: f a -> f a -> f a
- class SemigroupForeach f where
- appendForeach :: Sing a -> f a -> f a -> f a
- class SemigroupForall f => MonoidForall f where
- emptyForall :: f a
- class SemigroupForeach f => MonoidForeach f where
- emptyForeach :: Sing a -> f a
- class HashableForall f where
- hashWithSaltForall :: Int -> f a -> Int
- class HashableForeach f where
- hashWithSaltForeach :: Sing a -> Int -> f a -> Int
- class PathPieceExists f where
- fromPathPieceForall :: Text -> Maybe (Exists f)
- toPathPieceForall :: Exists f -> Text
- class FromJSONForall f where
- parseJSONForall :: Sing a -> Value -> Parser (f a)
- class FromJSONForeach f where
- parseJSONForeach :: Sing a -> Value -> Parser (f a)
- class FromJSONExists f where
- parseJSONExists :: Value -> Parser (Exists f)
- class ToJSONForall f where
- toJSONForall :: f a -> Value
- class ToJSONForeach f where
- toJSONForeach :: Sing a -> f a -> Value
- 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
- peekForeach :: Sing a -> Ptr (f a) -> IO (f a)
- pokeForeach :: Sing a -> Ptr (f a) -> f a -> IO ()
- sizeOfForeach :: forall (a :: k). Proxy f -> Sing a -> Int
- class StorableForall (f :: k -> Type) where
- peekForall :: Ptr (f a) -> IO (f a)
- pokeForall :: Ptr (f a) -> f a -> IO ()
- sizeOfForall :: Proxy f -> Int
- class PrimForall (f :: k -> Type) where
- sizeOfForall# :: Proxy# f -> Int#
- alignmentForall# :: Proxy# f -> Int#
- indexByteArrayForall# :: ByteArray# -> Int# -> f a
- readByteArrayForall# :: MutableByteArray# s -> Int# -> State# s -> (#State# s, f a#)
- writeByteArrayForall# :: MutableByteArray# s -> Int# -> f a -> State# s -> State# s
- setByteArrayForall# :: MutableByteArray# s -> Int# -> Int# -> f a -> State# s -> State# s
- indexOffAddrForall# :: Addr# -> Int# -> f a
- readOffAddrForall# :: Addr# -> Int# -> State# s -> (#State# s, f a#)
- writeOffAddrForall# :: Addr# -> Int# -> f a -> State# s -> State# s
- setOffAddrForall# :: Addr# -> Int# -> Int# -> f a -> State# s -> State# s
- class BinaryExists (f :: k -> Type) where
- class BinaryForeach (f :: k -> Type) where
- putForeach :: Sing a -> f a -> Put
- getForeach :: Sing a -> Get (f a)
- class EqForall2 f where
- class EqForallPoly2 (f :: k -> j -> Type) where
- eqForallPoly2 :: forall (a :: k) (b :: j) (c :: k) (d :: j). f a b -> f c d -> WitnessedEquality '(a, b) '(c, d)
- class ShowForall2 f where
- showsPrecForall2 :: Int -> f a b -> ShowS
- class ShowForeach2 f where
- showsPrecForeach2 :: Sing a -> Sing b -> Int -> f a b -> ShowS
- class BinaryExists2 (f :: k -> j -> Type) where
- putExists2 :: Exists2 f -> Put
- getExists2 :: Get (Exists2 f)
- 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
- compareSing :: forall (a :: k) (b :: k). Sing a -> Sing b -> WitnessedOrdering a b
- class ShowSing k where
- showsPrecSing :: forall (a :: k). Int -> Sing a -> ShowS
- class ToJSONSing k where
- toJSONSing :: forall (a :: k). Sing a -> Value
- class FromJSONSing k where
- class ToSing (f :: k -> Type) where
- class SingKind k where
- demoteSing :: Sing (a :: k) -> k
- promoteSing :: k -> Exists (Sing :: k -> Type)
- 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 #
Instances
| EqForall (Proxy :: k -> Type) Source # | |
| Eq a => EqForall (Const a :: k -> Type) Source # | |
| EqForall ((:~:) a :: k -> Type) Source # | |
| EqHetero h => EqForall (HFix h :: k -> Type) Source # | |
| (EqForall f, EqForall g) => EqForall (Sum f g :: k -> Type) Source # | |
| (EqForall f, EqForall g) => EqForall (Product f g :: k -> Type) Source # | |
| (Eq1 f, EqForall g) => EqForall (Compose f g :: k -> Type) Source # | |
| EqForall (SingList :: [k] -> Type) Source # | |
| EqForall f => EqForall (Rec f :: [k] -> Type) Source # | |
class EqForall f => EqForallPoly f where Source #
Minimal complete definition
Nothing
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 -> Type) 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.
Instances
| EqForeach f => EqForeach (ApplyForeach f :: k -> Type) 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 -> Type) Source # | |
| EqForeach f => EqForeach (Rec f :: [k] -> Type) Source # | |
class EqForall f => OrdForall f where Source #
Methods
compareForall :: f a -> f a -> Ordering Source #
Instances
| OrdForall (Proxy :: k -> Type) Source # | |
Defined in Data.Exists | |
| Ord a => OrdForall (Const a :: k -> Type) Source # | |
Defined in Data.Exists | |
| (OrdForall f, OrdForall g) => OrdForall (Sum f g :: k -> Type) Source # | |
Defined in Data.Exists | |
| (OrdForall f, OrdForall g) => OrdForall (Product f g :: k -> Type) 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 #
Methods
compareForallPoly :: f a -> f b -> WitnessedOrdering a b Source #
Instances
| (OrdForallPoly f, OrdForallPoly g) => OrdForallPoly (Product f g :: k -> Type) 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.
Methods
compareForeach :: Sing a -> f a -> f a -> Ordering Source #
Instances
| OrdForeach f => OrdForeach (ApplyForeach f :: k -> Type) Source # | |
Defined in Data.Exists Methods compareForeach :: Sing a -> ApplyForeach f a -> ApplyForeach f a -> Ordering Source # | |
| (Ord1 f, OrdForeach g) => OrdForeach (Compose f g :: k -> Type) Source # | |
Defined in Data.Exists | |
| OrdForeach f => OrdForeach (Rec f :: [k] -> Type) Source # | |
Defined in Topaz.Types | |
class ShowForall f where Source #
Methods
showsPrecForall :: Int -> f a -> ShowS Source #
Instances
| ShowForall (Proxy :: k -> Type) Source # | |
Defined in Data.Exists | |
| Show a => ShowForall (Const a :: k -> Type) Source # | |
Defined in Data.Exists | |
| (ShowForall f, ShowForall g) => ShowForall (Product f g :: k -> Type) Source # | |
Defined in Data.Exists | |
| (Show1 f, ShowForall g) => ShowForall (Compose f g :: k -> Type) 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 -> Type) Source # | |
Defined in Data.Exists | |
| ShowForeach f => ShowForeach (Rec f :: [k] -> Type) Source # | |
Defined in Topaz.Types | |
class ReadExists f where Source #
Methods
readPrecExists :: ReadPrec (Exists f) Source #
Instances
| ReadExists (Proxy :: k -> Type) Source # | |
Defined in Data.Exists | |
class EnumForall f where Source #
class EnumExists f where Source #
class BoundedExists f where Source #
class SemigroupForall f where Source #
Methods
appendForall :: f a -> f a -> f a Source #
Instances
| SemigroupForall (Proxy :: k -> Type) Source # | |
Defined in Data.Exists | |
| Semigroup a => SemigroupForall (Const a :: k -> Type) Source # | |
Defined in Data.Exists | |
| SemigroupForall f => SemigroupForall (ApplyForall f :: k -> Type) 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 -> Type) Source # | |
Defined in Data.Exists | |
| SemigroupForall f => SemigroupForall (Rec f :: [k] -> Type) Source # | |
Defined in Topaz.Types | |
class SemigroupForeach f where Source #
Methods
appendForeach :: Sing a -> f a -> f a -> f a Source #
Instances
| SemigroupForeach f => SemigroupForeach (ApplyForeach f :: k -> Type) 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 -> Type) Source # | |
Defined in Data.Exists | |
| SemigroupForeach f => SemigroupForeach (Rec f :: [k] -> Type) Source # | |
Defined in Topaz.Types | |
class SemigroupForall f => MonoidForall f where Source #
Methods
emptyForall :: f a Source #
Instances
| Monoid a => MonoidForall (Const a :: k -> Type) Source # | |
Defined in Data.Exists Methods emptyForall :: Const a a0 Source # | |
| MonoidForall f => MonoidForall (ApplyForall f :: k -> Type) Source # | |
Defined in Data.Exists Methods emptyForall :: ApplyForall f a Source # | |
class SemigroupForeach f => MonoidForeach f where Source #
Methods
emptyForeach :: Sing a -> f a Source #
Instances
| MonoidForeach f => MonoidForeach (ApplyForeach f :: k -> Type) 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 #
Methods
hashWithSaltForall :: Int -> f a -> Int Source #
Instances
| Hashable a => HashableForall (Const a :: k -> Type) 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 FromJSONForall f where Source #
Instances
| (FromJSON1 f, FromJSONForall g) => FromJSONForall (Compose f g :: k -> Type) Source # | |
Defined in Data.Exists | |
class FromJSONForeach f where Source #
Instances
| FromJSON a => FromJSONForeach (Const a :: k -> Type) Source # | |
Defined in Data.Exists | |
| FromJSONForeach f => FromJSONForeach (ApplyForeach f :: k -> Type) Source # | |
Defined in Data.Exists Methods parseJSONForeach :: Sing a -> Value -> Parser (ApplyForeach f a) Source # | |
| (FromJSON1 f, FromJSONForeach g) => FromJSONForeach (Compose f g :: k -> Type) 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 #
Methods
toJSONForall :: f a -> Value Source #
Instances
| (ToJSON1 f, ToJSONForall g) => ToJSONForall (Compose f g :: k -> Type) 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 #
Methods
toJSONForeach :: Sing a -> f a -> Value Source #
Instances
| ToJSON a => ToJSONForeach (Const a :: k -> Type) Source # | |
Defined in Data.Exists | |
| ToJSONForeach f => ToJSONForeach (ApplyForeach f :: k -> Type) Source # | |
Defined in Data.Exists Methods toJSONForeach :: Sing a -> ApplyForeach f a -> Value Source # | |
| (ToJSON1 f, ToJSONForeach g) => ToJSONForeach (Compose f g :: k -> Type) 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 ToJSONKeyForall f where Source #
Methods
class ToJSONKeyForeach f where Source #
Methods
toJSONKeyForeach :: ToJSONKeyFunctionForall (Product Sing f) Source #
Instances
| ToJSONKeyForeach f => ToJSONKeyForeach (ApplyForeach f :: k -> Type) Source # | |
Defined in Data.Exists Methods toJSONKeyForeach :: ToJSONKeyFunctionForall (Product Sing (ApplyForeach f)) Source # | |
class FromJSONKeyExists f where Source #
Methods
fromJSONKeyExists :: FromJSONKeyFunction (Exists f) Source #
class FromJSONKeyForeach f where Source #
Methods
Instances
| FromJSONKeyForeach f => FromJSONKeyForeach (ApplyForeach f :: k -> Type) Source # | |
Defined in Data.Exists Methods fromJSONKeyForeach :: FromJSONKeyFunctionForeach (ApplyForeach f) Source # | |
class StorableForeach (f :: k -> Type) where Source #
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).
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.
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 #
Instances
| (Binary1 f, BinaryForeach g) => BinaryForeach (Compose f g :: k -> Type) 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 #
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 #
Methods
showsPrecForall2 :: Int -> f a b -> ShowS Source #
class ShowForeach2 f where Source #
class BinaryExists2 (f :: k -> j -> Type) where Source #
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 |
Sing Type Classes
class EqSing k => OrdSing k where Source #
Methods
compareSing :: forall (a :: k) (b :: k). Sing a -> Sing b -> WitnessedOrdering a b Source #
class ToJSONSing k where Source #
Methods
toJSONSing :: forall (a :: k). Sing a -> Value Source #
class FromJSONSing k where Source #
class SingKind k where Source #
The two functions must form an isomorphism.
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.