Hackage.Security.Util.Some

hackage-security-0.6.2.6: 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) #

Constructors

Some (f a) |

#### Instances

Instances details

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

## Equality

data DictEq a where #

Constructors

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

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

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

Methods

someEq :: DictEq (f a) #

#### Instances

Instances details

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

## Serialization

data DictShow a where #

Constructors

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

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

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

Methods

someShow :: DictShow (f a) #

#### Instances

Instances details

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

## Pretty-printing

data DictPretty a where #

Constructors

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

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

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

Methods

somePretty :: DictPretty (f a) #

#### Instances

Instances details

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

## Type checking

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