Hackage.Security.Util.Some

hackage-security-0.5.2.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 = Some (f a)
- data DictEq a where
  - DictEq :: Eq a => DictEq a
- class SomeEq f where
- data DictShow a where
  - DictShow :: Show a => DictShow a
- class SomeShow f where
- data DictPretty a where
  - DictPretty :: Pretty a => DictPretty a
- class SomePretty f where
- typecheckSome :: Typed f => Some f -> Some (TypeOf f) -> Bool

# Documentation

data Some f #

Constructors

Some (f a) |

Instances

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

## Equality

data DictEq a where #

Constructors

DictEq :: Eq a => DictEq a |

class SomeEq f where #

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

Minimal complete definition

someEq

Methods

someEq :: DictEq (f a) #

Instances

SomeEq KeyType # |
Methods someEq :: DictEq (KeyType a) #
SomeEq PrivateKey # |
Methods someEq :: DictEq (PrivateKey a) #
SomeEq PublicKey # |
Methods someEq :: DictEq (PublicKey a) #
SomeEq Key # |
Methods someEq :: DictEq (Key a) #

## Serialization

data DictShow a where #

Constructors

DictShow :: Show a => DictShow a |

class SomeShow f where #

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

Minimal complete definition

someShow

Methods

someShow :: DictShow (f a) #

Instances

SomeShow KeyType # |
Methods someShow :: DictShow (KeyType a) #
SomeShow PrivateKey # |
Methods someShow :: DictShow (PrivateKey a) #
SomeShow PublicKey # |
Methods someShow :: DictShow (PublicKey a) #
SomeShow Key # |
Methods someShow :: DictShow (Key a) #
SomeShow IndexFile # |
Methods someShow :: DictShow (IndexFile a) #

## Pretty-printing

data DictPretty a where #

Constructors

DictPretty :: Pretty a => DictPretty a |

class SomePretty f where #

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

Minimal complete definition

somePretty

Methods

somePretty :: DictPretty (f a) #

Instances

SomePretty IndexFile # |
Methods somePretty :: DictPretty (IndexFile a) #

## Type checking

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