cryptol-2.8.0: Cryptol: The Language of Cryptography

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

Cryptol.Parser.Name

Description

Synopsis

- data PName
  - = UnQual !Ident
  - | Qual !ModName !Ident
  - | NewName !Pass !Int
- data Pass
  - = NoPat
  - | MonoValues
- mkUnqual :: Ident -> PName
- mkQual :: ModName -> Ident -> PName
- getModName :: PName -> Maybe ModName
- getIdent :: PName -> Ident
- isGeneratedName :: PName -> Bool

# Documentation

data PName Source #

Names that originate in the parser.

Constructors

UnQual !Ident | Unqualified names like `x`, `Foo`, or `+`.
Qual !ModName !Ident | Qualified names like `Foo::bar` or `module::!`.
NewName !Pass !Int | Fresh names generated by a pass.

#### Instances

Instances details

Eq PName Source # |
Instance details Defined in Cryptol.Parser.Name Methods (==) :: PName -> PName -> Bool Source # (/=) :: PName -> PName -> Bool Source #
Ord PName Source # |
Instance details Defined in Cryptol.Parser.Name Methods compare :: PName -> PName -> Ordering Source # (<) :: PName -> PName -> Bool Source # (<=) :: PName -> PName -> Bool Source # (>) :: PName -> PName -> Bool Source # (>=) :: PName -> PName -> Bool Source # max :: PName -> PName -> PName Source # min :: PName -> PName -> PName Source #
Show PName Source # |
Instance details Defined in Cryptol.Parser.Name Methods showsPrec :: Int -> PName -> ShowS Source # show :: PName -> String Source # showList :: [PName] -> ShowS Source #
Generic PName Source # |
Instance details Defined in Cryptol.Parser.Name Associated Types type Rep PName :: Type -> Type Source # Methods from :: PName -> Rep PName x Source # to :: Rep PName x -> PName Source #
NFData PName Source # |
Instance details Defined in Cryptol.Parser.Name Methods rnf :: PName -> () Source #
PPName PName Source # |
Instance details Defined in Cryptol.Parser.Name Methods ppNameFixity :: PName -> Maybe (Assoc, Int) Source # ppPrefixName :: PName -> Doc Source # ppInfixName :: PName -> Doc Source #
PP PName Source # |
Instance details Defined in Cryptol.Parser.Name Methods ppPrec :: Int -> PName -> Doc Source #
RemovePatterns [Decl PName] Source # |
Instance details Defined in Cryptol.Parser.NoPat Methods removePatterns :: [Decl PName] -> ([Decl PName], [Error]) Source #
RemovePatterns (Expr PName) Source # |
Instance details Defined in Cryptol.Parser.NoPat Methods removePatterns :: Expr PName -> (Expr PName, [Error]) Source #
RemovePatterns (Module PName) Source # |
Instance details Defined in Cryptol.Parser.NoPat Methods removePatterns :: Module PName -> (Module PName, [Error]) Source #
RemovePatterns (Program PName) Source # |
Instance details Defined in Cryptol.Parser.NoPat Methods removePatterns :: Program PName -> (Program PName, [Error]) Source #
BindsNames (TParam PName) Source # | Generate the naming environment for a type parameter.
Instance details Defined in Cryptol.ModuleSystem.NamingEnv Methods namingEnv :: TParam PName -> BuildNamingEnv Source #
BindsNames (Schema PName) Source # | Generate a type renaming environment from the parameters that are bound by this schema.
Instance details Defined in Cryptol.ModuleSystem.NamingEnv Methods namingEnv :: Schema PName -> BuildNamingEnv Source #
BindsNames (Module PName) Source # | The naming environment for a single module. This is the mapping from unqualified names to fully qualified names with uniques.
Instance details Defined in Cryptol.ModuleSystem.NamingEnv Methods namingEnv :: Module PName -> BuildNamingEnv Source #
BindsNames (InModule (PrimType PName)) Source # |
Instance details Defined in Cryptol.ModuleSystem.NamingEnv Methods namingEnv :: InModule (PrimType PName) -> BuildNamingEnv Source #
BindsNames (InModule (Newtype PName)) Source # |
Instance details Defined in Cryptol.ModuleSystem.NamingEnv Methods namingEnv :: InModule (Newtype PName) -> BuildNamingEnv Source #
BindsNames (InModule (Bind PName)) Source # | Introduce the name
Instance details Defined in Cryptol.ModuleSystem.NamingEnv Methods namingEnv :: InModule (Bind PName) -> BuildNamingEnv Source #
BindsNames (InModule (ParameterFun PName)) Source # |
Instance details Defined in Cryptol.ModuleSystem.NamingEnv Methods namingEnv :: InModule (ParameterFun PName) -> BuildNamingEnv Source #
BindsNames (InModule (ParameterType PName)) Source # |
Instance details Defined in Cryptol.ModuleSystem.NamingEnv Methods namingEnv :: InModule (ParameterType PName) -> BuildNamingEnv Source #
BindsNames (InModule (Decl PName)) Source # | The naming environment for a single declaration.
Instance details Defined in Cryptol.ModuleSystem.NamingEnv Methods namingEnv :: InModule (Decl PName) -> BuildNamingEnv Source #
BindsNames (InModule (TopDecl PName)) Source # |
Instance details Defined in Cryptol.ModuleSystem.NamingEnv Methods namingEnv :: InModule (TopDecl PName) -> BuildNamingEnv Source #
type Rep PName Source # |

Instance details

Defined in Cryptol.Parser.Name

type Rep PName = D1 ('MetaData "PName" "Cryptol.Parser.Name" "cryptol-2.8.0-11Z6ZaBuQbo1UTYpHYMeUg" 'False) (C1 ('MetaCons "UnQual" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Ident)) :+: (C1 ('MetaCons "Qual" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ModName) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Ident)) :+: C1 ('MetaCons "NewName" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Pass) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int))))

data Pass Source #

Passes that can generate fresh names.

Constructors

NoPat |
MonoValues |

#### Instances

Instances details

Eq Pass Source # |
Instance details Defined in Cryptol.Parser.Name Methods (==) :: Pass -> Pass -> Bool Source # (/=) :: Pass -> Pass -> Bool Source #
Ord Pass Source # |
Instance details Defined in Cryptol.Parser.Name Methods compare :: Pass -> Pass -> Ordering Source # (<) :: Pass -> Pass -> Bool Source # (<=) :: Pass -> Pass -> Bool Source # (>) :: Pass -> Pass -> Bool Source # (>=) :: Pass -> Pass -> Bool Source # max :: Pass -> Pass -> Pass Source # min :: Pass -> Pass -> Pass Source #
Show Pass Source # |
Instance details Defined in Cryptol.Parser.Name Methods showsPrec :: Int -> Pass -> ShowS Source # show :: Pass -> String Source # showList :: [Pass] -> ShowS Source #
Generic Pass Source # |
Instance details Defined in Cryptol.Parser.Name Associated Types type Rep Pass :: Type -> Type Source # Methods from :: Pass -> Rep Pass x Source # to :: Rep Pass x -> Pass Source #
NFData Pass Source # |
Instance details Defined in Cryptol.Parser.Name Methods rnf :: Pass -> () Source #
type Rep Pass Source # |
Instance details Defined in Cryptol.Parser.Name type Rep Pass = D1 ('MetaData "Pass" "Cryptol.Parser.Name" "cryptol-2.8.0-11Z6ZaBuQbo1UTYpHYMeUg" 'False) (C1 ('MetaCons "NoPat" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "MonoValues" 'PrefixI 'False) (U1 :: Type -> Type))

mkUnqual :: Ident -> PName Source #

mkQual :: ModName -> Ident -> PName Source #

getModName :: PName -> Maybe ModName Source #

getIdent :: PName -> Ident Source #

isGeneratedName :: PName -> Bool Source #