| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Data.Exists
Contents
Description
Data types and type classes for working with existentially quantified
values. In the event that Quantified Class Constraints ever land in GHC,
this package will be considered obsolete. The benefit that most of the
typeclasses in this module provide is that they help populate the instances
of Exists.
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
- 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 ReadForall f where
- class EnumForall f where
- class BoundedForall f where
- class SemigroupForall f where
- class SemigroupForall f => MonoidForall f where
- class HashableForall f where
- class PathPieceForall f where
- class FromJSONForall f where
- class FromJSONExists f where
- class ToJSONForall 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 FromJSONKeyFunctionForall f
- = FromJSONKeyTextParserForall !(forall a. Sing a -> Text -> Parser (f a))
- | FromJSONKeyValueForall !(forall a. Sing a -> Value -> Parser (f a))
- class ToJSONKeyForall f where
- class FromJSONKeyExists f where
- class FromJSONKeyForall f where
- class StorableForall (f :: k -> Type) where
- class EqForall2 f where
- class EqForallPoly2 f where
- class ShowForall2 f where
- type family Sing = (r :: k -> Type) | r -> k
- data SingList :: [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 ToJSONSing k where
- class FromJSONSing k where
- class ToSing (f :: k -> Type) where
- showsForall :: ShowForall f => f a -> ShowS
- showForall :: ShowForall f => f a -> String
- 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
- parseJSONMapForallKey :: forall f a v. (FromJSONKeyForall f, OrdForall f) => (Value -> Parser v) -> Sing a -> Value -> Parser (Map (f a) v)
- weakenEquality :: WitnessedEquality a b -> Bool
- weakenOrdering :: WitnessedOrdering a b -> Ordering
- 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
| BoundedForall f => Bounded (Exists f) Source # | |
| EnumForall f => Enum (Exists f) Source # | |
| EqForallPoly f => Eq (Exists f) Source # | |
| OrdForallPoly f => Ord (Exists f) Source # | |
Defined in Data.Exists | |
| ReadForall 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) # | |
| PathPieceForall 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 # | |
data Exists3 (f :: k -> j -> l -> Type) Source #
Hide three type parameters.
Constructors
| Exists3 !(f a b c) |
data Some (f :: k -> Type) Source #
Instances
| (EqForall f, EqSing k) => Eq (Some f) Source # | |
| (ToJSONForall f, ToJSONSing k) => ToJSON (Some f) Source # | |
Defined in Data.Exists | |
| (FromJSONForall f, FromJSONSing k) => FromJSON (Some f) Source # | |
data DependentPair (f :: k -> Type) (g :: k -> Type) Source #
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 |
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 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 # | |
class EqForeach f where Source #
Variant of EqForall that requires a pi-quantified type.
Minimal complete definition
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 #
class ShowForall f where Source #
Minimal complete definition
Methods
showsPrecForall :: Int -> f a -> ShowS Source #
Instances
| ShowForall (Proxy :: 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
class ReadForall f where Source #
Minimal complete definition
Methods
readPrecForall :: ReadPrec (Exists f) Source #
Instances
| ReadForall (Proxy :: k -> *) Source # | |
Defined in Data.Exists | |
class EnumForall f where Source #
Minimal complete definition
class BoundedForall f where Source #
Minimal complete definition
class SemigroupForall f where Source #
Minimal complete definition
Methods
sappendForall :: f a -> f a -> f a Source #
Instances
| SemigroupForall (Proxy :: k -> *) Source # | |
Defined in Data.Exists | |
| SemigroupForall f => SemigroupForall (Rec f :: [k] -> Type) Source # | |
Defined in Topaz.Types | |
class SemigroupForall f => MonoidForall f where Source #
Minimal complete definition
Methods
memptyForall :: Sing a -> f a Source #
Instances
| MonoidForall f => MonoidForall (Rec f :: [k] -> Type) Source # | |
Defined in Topaz.Types Methods memptyForall :: 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 PathPieceForall f where Source #
Minimal complete definition
Methods
fromPathPieceForall :: Text -> Maybe (Exists f) Source #
toPathPieceForall :: f a -> Text Source #
class FromJSONForall f where Source #
Minimal complete definition
Instances
| (FromJSON1 f, FromJSONForall g) => FromJSONForall (Compose f g :: k -> *) Source # | |
Defined in Data.Exists | |
| FromJSONForall f => FromJSONForall (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 # | |
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 FromJSONKeyFunctionForall f Source #
Constructors
| FromJSONKeyTextParserForall !(forall a. Sing a -> Text -> Parser (f a)) | |
| FromJSONKeyValueForall !(forall a. Sing a -> Value -> Parser (f a)) |
class FromJSONKeyExists f where Source #
Minimal complete definition
Methods
fromJSONKeyExists :: FromJSONKeyFunction (Exists f) Source #
class StorableForall (f :: k -> Type) where Source #
Minimal complete definition
Methods
peekForall :: Sing a -> Ptr (f a) -> IO (f a) Source #
pokeForall :: Ptr (f a) -> f a -> IO () Source #
sizeOfFunctorForall :: f a -> Int Source #
sizeOfForall :: forall (a :: k). Proxy f -> Sing a -> Int Source #
Instances
| StorableForall f => StorableForall (Rec f :: [k] -> Type) Source # | |
Higher Rank Classes
class EqForallPoly2 f where Source #
Minimal complete definition
Methods
eqForallPoly2 :: f a b -> f c d -> Bool Source #
class ShowForall2 f where Source #
Minimal complete definition
Methods
showsPrecForall2 :: Int -> f a b -> ShowS Source #
More Type Classes
data SingList :: [k] -> Type where Source #
Constructors
| SingListNil :: SingList '[] | |
| SingListCons :: Sing r -> SingList rs -> SingList (r ': rs) |
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 ToJSONSing k where Source #
Minimal complete definition
Methods
toJSONSing :: forall (a :: k). Sing a -> Value Source #
class FromJSONSing k where Source #
Minimal complete definition
Functions
Show
showsForall :: ShowForall f => f a -> ShowS Source #
showForall :: ShowForall f => f a -> String 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 #
parseJSONMapForallKey :: forall f a v. (FromJSONKeyForall f, OrdForall f) => (Value -> Parser v) -> Sing a -> Value -> Parser (Map (f a) v) Source #
Weakening
weakenEquality :: WitnessedEquality a b -> Bool Source #
weakenOrdering :: WitnessedOrdering a b -> Ordering Source #