cryptol-2.4.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 | Haskell98

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

# 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

Eq PName Source # |
Methods (==) :: PName -> PName -> Bool # (/=) :: PName -> PName -> Bool #
Ord PName Source # |
Methods compare :: PName -> PName -> Ordering # (<) :: PName -> PName -> Bool # (<=) :: PName -> PName -> Bool # (>) :: PName -> PName -> Bool # (>=) :: PName -> PName -> Bool # max :: PName -> PName -> PName # min :: PName -> PName -> PName #
Show PName Source # |
Methods showsPrec :: Int -> PName -> ShowS # show :: PName -> String # showList :: [PName] -> ShowS #
Generic PName Source # |
Associated Types type Rep PName :: * -> * # Methods from :: PName -> Rep PName x # to :: Rep PName x -> PName #
NFData PName Source # |
Methods rnf :: PName -> () #
PPName PName Source # |
Methods ppNameFixity :: PName -> Maybe (Assoc, Int) Source # ppPrefixName :: PName -> Doc Source # ppInfixName :: PName -> Doc Source #
PP PName Source # |
Methods ppPrec :: Int -> PName -> Doc Source #
RemovePatterns [Decl PName] Source # |
Methods removePatterns :: [Decl PName] -> ([Decl PName], [Error]) Source #
RemovePatterns (Expr PName) Source # |
Methods removePatterns :: Expr PName -> (Expr PName, [Error]) Source #
RemovePatterns (Module PName) Source # |
Methods removePatterns :: Module PName -> (Module PName, [Error]) Source #
RemovePatterns (Program PName) Source # |
Methods removePatterns :: Program PName -> (Program PName, [Error]) Source #
BindsNames (TParam PName) Source # | Generate the naming environment for a type parameter.
Methods namingEnv :: TParam PName -> BuildNamingEnv Source #
BindsNames (Schema PName) Source # | Generate a type renaming environment from the parameters that are bound by this schema.
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.
Methods namingEnv :: Module PName -> BuildNamingEnv Source #
BindsNames (InModule (Newtype PName)) Source # |
Methods namingEnv :: InModule (Newtype PName) -> BuildNamingEnv Source #
BindsNames (InModule (Bind PName)) Source # | Introduce the name
Methods namingEnv :: InModule (Bind PName) -> BuildNamingEnv Source #
BindsNames (InModule (Decl PName)) Source # | The naming environment for a single declaration.
Methods namingEnv :: InModule (Decl PName) -> BuildNamingEnv Source #
BindsNames (InModule (TopDecl PName)) Source # |
Methods namingEnv :: InModule (TopDecl PName) -> BuildNamingEnv Source #
type Rep PName Source # |

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

data Pass Source #

Passes that can generate fresh names.

Constructors

NoPat |
MonoValues |

Instances

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

mkUnqual :: Ident -> PName Source #

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

getModName :: PName -> Maybe ModName Source #

getIdent :: PName -> Ident Source #