hackage-security-0.6.3.2: Hackage security library

Safe Haskell | None
Language | Haskell2010

Hackage.Security.Util.Some

Contents

- Equality
- Serialization
- Pretty-printing
- Type checking

Description

Hiding existentials

Synopsis

- data Some (f :: Type -> Type) = Some (f a)
- data DictEq a where
  - DictEq :: forall a. Eq a => DictEq a
- class SomeEq (f :: Type -> Type) where
  - someEq :: DictEq (f a)
- data DictShow a where
  - DictShow :: forall a. Show a => DictShow a
- class SomeShow (f :: Type -> Type) where
  - someShow :: DictShow (f a)
- data DictPretty a where
  - DictPretty :: forall a. Pretty a => DictPretty a
- class SomePretty (f :: Type -> Type) where
  - somePretty :: DictPretty (f a)
- typecheckSome :: forall (f :: Type -> Type). Typed f => Some f -> Some (TypeOf f) -> Bool

# Documentation

data Some (f :: Type -> Type) Source #

Constructors

Some (f a) |

#### Instances

Instances details

ReportSchemaErrors m => FromJSON m (Some Key) Source # |
Instance details Defined in Hackage.Security.Key Methods fromJSON :: JSValue -> m (Some Key) Source #
ReportSchemaErrors m => FromJSON m (Some KeyType) Source # |
Instance details Defined in Hackage.Security.Key Methods fromJSON :: JSValue -> m (Some KeyType) Source #
ReportSchemaErrors m => FromJSON m (Some PublicKey) Source # |
Instance details Defined in Hackage.Security.Key Methods fromJSON :: JSValue -> m (Some PublicKey) Source #
Monad m => ToJSON m (Some Key) Source # |
Instance details Defined in Hackage.Security.Key Methods toJSON :: Some Key -> m JSValue Source #
Monad m => ToJSON m (Some KeyType) Source # |
Instance details Defined in Hackage.Security.Key Methods toJSON :: Some KeyType -> m JSValue Source #
Monad m => ToJSON m (Some PublicKey) Source # |
Instance details Defined in Hackage.Security.Key Methods toJSON :: Some PublicKey -> m JSValue Source #
SomeShow f => Show (Some f) Source # |
Instance details Defined in Hackage.Security.Util.Some Methods showsPrec :: Int -> Some f -> ShowS Source # show :: Some f -> String Source # showList :: [Some f] -> ShowS Source #
(Typed f, SomeEq f) => Eq (Some f) Source # |
Instance details Defined in Hackage.Security.Util.Some Methods (==) :: Some f -> Some f -> Bool Source # (/=) :: Some f -> Some f -> Bool Source #
SomePretty f => Pretty (Some f) Source # |
Instance details Defined in Hackage.Security.Util.Some Methods pretty :: Some f -> String Source #

## Equality

data DictEq a where Source #

Constructors

DictEq :: forall a. Eq a => DictEq a |

class SomeEq (f :: Type -> Type) where Source #

Type `f` satisfies `SomeEq f` if `f a` satisfies `Eq` independent of `a`

Methods

someEq :: DictEq (f a) Source #

#### Instances

Instances details

SomeEq Key Source # |
Instance details Defined in Hackage.Security.Key Methods someEq :: DictEq (Key a) Source #
SomeEq KeyType Source # |
Instance details Defined in Hackage.Security.Key Methods someEq :: DictEq (KeyType a) Source #
SomeEq PrivateKey Source # |
Instance details Defined in Hackage.Security.Key Methods someEq :: DictEq (PrivateKey a) Source #
SomeEq PublicKey Source # |
Instance details Defined in Hackage.Security.Key Methods someEq :: DictEq (PublicKey a) Source #

## Serialization

data DictShow a where Source #

Constructors

DictShow :: forall a. Show a => DictShow a |

class SomeShow (f :: Type -> Type) where Source #

Type `f` satisfies `SomeShow f` if `f a` satisfies `Show` independent of `a`

Methods

someShow :: DictShow (f a) Source #

#### Instances

Instances details

SomeShow Key Source # |
Instance details Defined in Hackage.Security.Key Methods someShow :: DictShow (Key a) Source #
SomeShow KeyType Source # |
Instance details Defined in Hackage.Security.Key Methods someShow :: DictShow (KeyType a) Source #
SomeShow PrivateKey Source # |
Instance details Defined in Hackage.Security.Key Methods someShow :: DictShow (PrivateKey a) Source #
SomeShow PublicKey Source # |
Instance details Defined in Hackage.Security.Key Methods someShow :: DictShow (PublicKey a) Source #
SomeShow IndexFile Source # |
Instance details Defined in Hackage.Security.TUF.Layout.Index Methods someShow :: DictShow (IndexFile a) Source #

## Pretty-printing

data DictPretty a where Source #

Constructors

DictPretty :: forall a. Pretty a => DictPretty a |

class SomePretty (f :: Type -> Type) where Source #

Type `f` satisfies `SomeShow f` if `f a` satisfies `Show` independent of `a`

Methods

somePretty :: DictPretty (f a) Source #

#### Instances

Instances details

SomePretty IndexFile Source # |
Instance details Defined in Hackage.Security.TUF.Layout.Index Methods somePretty :: DictPretty (IndexFile a) Source #

## Type checking

typecheckSome :: forall (f :: Type -> Type). Typed f => Some f -> Some (TypeOf f) -> Bool Source #