| 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.
- data Exists f = Exists !(f a)
- data Exists2 f = Exists2 !(f a b)
- data Exists3 f = Exists3 !(f a b c)
- data Some f = Some !(Sing a) !(f a)
- class EqForall f where
- class EqForall f => EqForallPoly f where
- class EqForall f => OrdForall f where
- class (OrdForall f, EqForallPoly f) => OrdForallPoly f where
- class ShowForall 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 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 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 -> Bool
- 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)
- unreifyList :: forall as b. Unreify k => SingList as -> (Reify as => b) -> b
Data Types
Hide a type parameter.
Constructors
| Exists !(f a) |
Instances
| BoundedForall k f => Bounded (Exists k f) Source # | |
| EnumForall k f => Enum (Exists k f) Source # | |
| EqForallPoly k f => Eq (Exists k f) Source # | |
| OrdForallPoly k f => Ord (Exists k f) Source # | |
| ReadForall k f => Read (Exists k f) Source # | |
| ShowForall k f => Show (Exists k f) Source # | |
| HashableForall k f => Hashable (Exists k f) Source # | |
| FromJSONExists k f => FromJSON (Exists k f) Source # | |
| (FromJSONKeyExists k f, FromJSONExists k f) => FromJSONKey (Exists k f) Source # | |
| ToJSONForall k f => ToJSON (Exists k f) Source # | |
| (ToJSONKeyForall k f, ToJSONForall k f) => ToJSONKey (Exists k f) Source # | |
| PathPieceForall k f => PathPiece (Exists k f) Source # | |
Constructors
| Exists2 !(f a b) |
Instances
| EqForallPoly2 j k f => Eq (Exists2 j k f) Source # | |
| ShowForall2 j k f => Show (Exists2 j k f) Source # | |
Instances
| (EqForall k2 f, EqSing k2) => Eq (Some k2 f) Source # | |
| (FromJSONForall k2 f, FromJSONSing k2) => FromJSON (Some k2 f) Source # | |
| (ToJSONForall k2 f, ToJSONSing k2) => ToJSON (Some k2 f) Source # | |
Type Classes
class EqForall f where Source #
Minimal complete definition
Instances
| EqForall k (Proxy k) Source # | |
| Eq a => EqForall k (Const k a) Source # | |
| EqForall k ((:~:) k a) Source # | |
| EqHetero k k h => EqForall k (HFix k h) Source # | |
| (EqForall k f, EqForall k g) => EqForall k (Sum k f g) Source # | |
| (EqForall k f, EqForall k g) => EqForall k (Product k f g) Source # | |
| (Eq1 f, EqForall k g) => EqForall k (Compose k * f g) Source # | |
| EqForall k f => EqForall [k] (Rec k f) Source # | |
class EqForall f => EqForallPoly f where Source #
Methods
eqForallPoly :: f a -> f b -> Bool Source #
eqForallPoly :: TestEquality f => f a -> f b -> Bool Source #
Instances
| Eq a => EqForallPoly k (Const k a) Source # | |
| (EqForallPoly k f, EqForallPoly k g) => EqForallPoly k (Product k f g) Source # | |
| (Eq1 f, EqForallPoly k g) => EqForallPoly k (Compose k * f g) Source # | |
class EqForall f => OrdForall f where Source #
Minimal complete definition
Methods
compareForall :: f a -> f a -> Ordering Source #
class (OrdForall f, EqForallPoly f) => OrdForallPoly f where Source #
Methods
compareForallPoly :: f a -> f b -> Ordering Source #
compareForallPoly :: TestEquality f => f a -> f b -> Ordering Source #
Instances
| Ord a => OrdForallPoly k (Const k a) Source # | |
| (OrdForallPoly k f, OrdForallPoly k g) => OrdForallPoly k (Product k f g) Source # | |
class ShowForall f where Source #
Minimal complete definition
Methods
showsPrecForall :: Int -> f a -> ShowS Source #
Instances
| ShowForall k (Proxy k) Source # | |
| (ShowForall k f, ShowForall k g) => ShowForall k (Product k f g) Source # | |
| (Show1 f, ShowForall k g) => ShowForall k (Compose k * f g) Source # | |
| ShowForall k f => ShowForall [k] (Rec k f) Source # | |
class ReadForall f where Source #
Minimal complete definition
Methods
readPrecForall :: ReadPrec (Exists f) Source #
Instances
| ReadForall k (Proxy k) Source # | |
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 k (Proxy k) Source # | |
| SemigroupForall k f => SemigroupForall [k] (Rec k f) Source # | |
class SemigroupForall f => MonoidForall f where Source #
Minimal complete definition
Methods
memptyForall :: Sing a -> f a Source #
Instances
| MonoidForall k f => MonoidForall [k] (Rec k f) Source # | |
class HashableForall f where Source #
Minimal complete definition
Methods
hashWithSaltForall :: Int -> f a -> Int Source #
Instances
| Hashable a => HashableForall k (Const k a) Source # | |
| HashableForall k f => HashableForall [k] (Rec k f) Source # | |
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 k g) => FromJSONForall k (Compose k * f g) Source # | |
| FromJSONForall k f => FromJSONForall [k] (Rec k f) Source # | |
class FromJSONExists f where Source #
Minimal complete definition
Instances
| FromJSONExists k f => FromJSONExists [k] (Rec k f) Source # | |
class ToJSONForall f where Source #
Minimal complete definition
Methods
toJSONForall :: f a -> Value Source #
Instances
| (ToJSON1 f, ToJSONForall k g) => ToJSONForall k (Compose k * f g) Source # | |
| ToJSONForall k f => ToJSONForall [k] (Rec k f) 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 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 #
Instances
| StorableForall k f => StorableForall [k] (Rec k f) 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. Sing a -> Value Source #
class FromJSONSing k where Source #
Minimal complete definition
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 -> Bool 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 #