cryptol-2.4.0: Cryptol: The Language of Cryptography

Copyright | (c) 2013-2016 Galois Inc.
License | BSD3
Maintainer | cryptol@galois.com
Stability | provisional
Portability | portable
Safe Haskell | Safe
Language | Haskell98

Cryptol.ModuleSystem.Interface

Description

Synopsis

- data Iface = Iface {
  - ifModName :: !ModName
  - ifPublic :: IfaceDecls
  - ifPrivate :: IfaceDecls
  }
- data IfaceDecls = IfaceDecls {
  - ifTySyns :: Map Name IfaceTySyn
  - ifNewtypes :: Map Name IfaceNewtype
  - ifDecls :: Map Name IfaceDecl
  }
- type IfaceTySyn = TySyn
- ifTySynName :: TySyn -> Name
- type IfaceNewtype = Newtype
- data IfaceDecl = IfaceDecl {
  - ifDeclName :: !Name
  - ifDeclSig :: Schema
  - ifDeclPragmas :: [Pragma]
  - ifDeclInfix :: Bool
  - ifDeclFixity :: Maybe Fixity
  - ifDeclDoc :: Maybe String
  }
- mkIfaceDecl :: Decl -> IfaceDecl
- genIface :: Module -> Iface
- ifacePrimMap :: Iface -> PrimMap

# Documentation

data Iface Source #

The resulting interface generated by a module that has been typechecked.

Constructors

Iface |

Fields

- ifModName :: !ModName
- ifPublic :: IfaceDecls
- ifPrivate :: IfaceDecls

Instances

Show Iface Source # |
Methods showsPrec :: Int -> Iface -> ShowS # show :: Iface -> String # showList :: [Iface] -> ShowS #
Generic Iface Source # |
Associated Types type Rep Iface :: * -> * # Methods from :: Iface -> Rep Iface x # to :: Rep Iface x -> Iface #
NFData Iface Source # |
Methods rnf :: Iface -> () #
type Rep Iface Source # |

type Rep Iface = D1 (MetaData "Iface" "Cryptol.ModuleSystem.Interface" "cryptol-2.4.0-CN28BMG3PUFD1lr9WvB1U9" False) (C1 (MetaCons "Iface" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "ifModName") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 ModName)) ((:*:) (S1 (MetaSel (Just Symbol "ifPublic") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 IfaceDecls)) (S1 (MetaSel (Just Symbol "ifPrivate") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 IfaceDecls)))))

data IfaceDecls Source #

Constructors

IfaceDecls |

Fields

- ifTySyns :: Map Name IfaceTySyn
- ifNewtypes :: Map Name IfaceNewtype
- ifDecls :: Map Name IfaceDecl

Instances

Show IfaceDecls Source # |
Methods showsPrec :: Int -> IfaceDecls -> ShowS # show :: IfaceDecls -> String # showList :: [IfaceDecls] -> ShowS #
Generic IfaceDecls Source # |
Associated Types type Rep IfaceDecls :: * -> * # Methods from :: IfaceDecls -> Rep IfaceDecls x # to :: Rep IfaceDecls x -> IfaceDecls #
Monoid IfaceDecls Source # |
Methods mempty :: IfaceDecls # mappend :: IfaceDecls -> IfaceDecls -> IfaceDecls # mconcat :: [IfaceDecls] -> IfaceDecls #
NFData IfaceDecls Source # |
Methods rnf :: IfaceDecls -> () #
type Rep IfaceDecls Source # |

type Rep IfaceDecls = D1 (MetaData "IfaceDecls" "Cryptol.ModuleSystem.Interface" "cryptol-2.4.0-CN28BMG3PUFD1lr9WvB1U9" False) (C1 (MetaCons "IfaceDecls" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "ifTySyns") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Map Name IfaceTySyn))) ((:*:) (S1 (MetaSel (Just Symbol "ifNewtypes") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Map Name IfaceNewtype))) (S1 (MetaSel (Just Symbol "ifDecls") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Map Name IfaceDecl))))))

type IfaceTySyn = TySyn Source #

ifTySynName :: TySyn -> Name Source #

type IfaceNewtype = Newtype Source #

data IfaceDecl Source #

Constructors

IfaceDecl |

Fields

- ifDeclName :: !Name
- ifDeclSig :: Schema
- ifDeclPragmas :: [Pragma]
- ifDeclInfix :: Bool
- ifDeclFixity :: Maybe Fixity
- ifDeclDoc :: Maybe String

Instances

Show IfaceDecl Source # |
Methods showsPrec :: Int -> IfaceDecl -> ShowS # show :: IfaceDecl -> String # showList :: [IfaceDecl] -> ShowS #
Generic IfaceDecl Source # |
Associated Types type Rep IfaceDecl :: * -> * # Methods from :: IfaceDecl -> Rep IfaceDecl x # to :: Rep IfaceDecl x -> IfaceDecl #
NFData IfaceDecl Source # |
Methods rnf :: IfaceDecl -> () #
type Rep IfaceDecl Source # |

type Rep IfaceDecl = D1 (MetaData "IfaceDecl" "Cryptol.ModuleSystem.Interface" "cryptol-2.4.0-CN28BMG3PUFD1lr9WvB1U9" False) (C1 (MetaCons "IfaceDecl" PrefixI True) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "ifDeclName") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Name)) ((:*:) (S1 (MetaSel (Just Symbol "ifDeclSig") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Schema)) (S1 (MetaSel (Just Symbol "ifDeclPragmas") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Pragma])))) ((:*:) (S1 (MetaSel (Just Symbol "ifDeclInfix") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool)) ((:*:) (S1 (MetaSel (Just Symbol "ifDeclFixity") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Fixity))) (S1 (MetaSel (Just Symbol "ifDeclDoc") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe String)))))))

mkIfaceDecl :: Decl -> IfaceDecl Source #

genIface :: Module -> Iface Source #

Generate an Iface from a typechecked module.

ifacePrimMap :: Iface -> PrimMap Source #

Produce a PrimMap from an interface.

NOTE: the map will expose both public and private names.