Copyright | (c) 2015-2016 Galois Inc. |
---|---|
License | BSD3 |
Maintainer | cryptol@galois.com |
Stability | provisional |
Portability | portable |
Safe Haskell | Trustworthy |
Language | Haskell2010 |
Synopsis
- data Name
- data NameInfo
- data NameSource
- nameUnique :: Name -> Int
- nameIdent :: Name -> Ident
- nameInfo :: Name -> NameInfo
- nameLoc :: Name -> Range
- nameFixity :: Name -> Maybe Fixity
- asPrim :: Name -> Maybe Ident
- cmpNameLexical :: Name -> Name -> Ordering
- cmpNameDisplay :: NameDisp -> Name -> Name -> Ordering
- ppLocName :: Name -> Doc
- mkDeclared :: ModName -> NameSource -> Ident -> Maybe Fixity -> Range -> Supply -> (Name, Supply)
- mkParameter :: Ident -> Range -> Supply -> (Name, Supply)
- toParamInstName :: Name -> Name
- asParamName :: Name -> Name
- paramModRecParam :: Name
- class Monad m => FreshM m where
- nextUniqueM :: FreshM m => m Int
- data SupplyT m a
- runSupplyT :: Monad m => Supply -> SupplyT m a -> m (a, Supply)
- data Supply
- emptySupply :: Supply
- nextUnique :: Supply -> (Int, Supply)
- data PrimMap = PrimMap {}
- lookupPrimDecl :: Ident -> PrimMap -> Name
- lookupPrimType :: Ident -> PrimMap -> Name
Names
Instances
Information about the binding site of the name.
Declared !ModName !NameSource | This name refers to a declaration from this module |
Parameter | This name is a parameter (function or type) |
Instances
Eq NameInfo Source # | |
Show NameInfo Source # | |
Generic NameInfo Source # | |
NFData NameInfo Source # | |
Defined in Cryptol.ModuleSystem.Name | |
type Rep NameInfo Source # | |
Defined in Cryptol.ModuleSystem.Name type Rep NameInfo = D1 (MetaData "NameInfo" "Cryptol.ModuleSystem.Name" "cryptol-2.6.0-24w5HMDd2znGLrodkM4xJM" False) (C1 (MetaCons "Declared" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 ModName) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 NameSource)) :+: C1 (MetaCons "Parameter" PrefixI False) (U1 :: * -> *)) |
data NameSource Source #
Instances
Eq NameSource Source # | |
Defined in Cryptol.ModuleSystem.Name (==) :: NameSource -> NameSource -> Bool # (/=) :: NameSource -> NameSource -> Bool # | |
Show NameSource Source # | |
Defined in Cryptol.ModuleSystem.Name showsPrec :: Int -> NameSource -> ShowS # show :: NameSource -> String # showList :: [NameSource] -> ShowS # | |
Generic NameSource Source # | |
Defined in Cryptol.ModuleSystem.Name type Rep NameSource :: * -> * # from :: NameSource -> Rep NameSource x # to :: Rep NameSource x -> NameSource # | |
NFData NameSource Source # | |
Defined in Cryptol.ModuleSystem.Name rnf :: NameSource -> () # | |
type Rep NameSource Source # | |
nameUnique :: Name -> Int Source #
cmpNameDisplay :: NameDisp -> Name -> Name -> Ordering Source #
Compare two names by the way they would be displayed.
Creation
mkDeclared :: ModName -> NameSource -> Ident -> Maybe Fixity -> Range -> Supply -> (Name, Supply) Source #
Make a new name for a declaration.
toParamInstName :: Name -> Name Source #
asParamName :: Name -> Name Source #
Unique Supply
class Monad m => FreshM m where Source #
liftSupply :: (Supply -> (a, Supply)) -> m a Source #
Instances
FreshM RenameM Source # | |
Defined in Cryptol.ModuleSystem.Renamer | |
FreshM InferM Source # | |
Defined in Cryptol.TypeCheck.Monad | |
FreshM REPL Source # | |
Defined in Cryptol.REPL.Monad | |
Monad m => FreshM (SupplyT m) Source # | |
Defined in Cryptol.ModuleSystem.Name | |
Monad m => FreshM (ModuleT m) Source # | |
Defined in Cryptol.ModuleSystem.Monad | |
FreshM m => FreshM (ReaderT i m) Source # | |
Defined in Cryptol.ModuleSystem.Name | |
(Monoid i, FreshM m) => FreshM (WriterT i m) Source # | |
Defined in Cryptol.ModuleSystem.Name | |
FreshM m => FreshM (StateT i m) Source # | |
Defined in Cryptol.ModuleSystem.Name | |
FreshM m => FreshM (ExceptionT i m) Source # | |
Defined in Cryptol.ModuleSystem.Name liftSupply :: (Supply -> (a, Supply)) -> ExceptionT i m a Source # |
nextUniqueM :: FreshM m => m Int Source #
Retrieve the next unique from the supply.
A monad for easing the use of the supply.
Instances
MonadT SupplyT Source # | |
Defined in Cryptol.ModuleSystem.Name | |
Monad m => Monad (SupplyT m) Source # | |
Monad m => Functor (SupplyT m) Source # | |
MonadFix m => MonadFix (SupplyT m) Source # | |
Defined in Cryptol.ModuleSystem.Name | |
Monad m => Applicative (SupplyT m) Source # | |
Monad m => FreshM (SupplyT m) Source # | |
Defined in Cryptol.ModuleSystem.Name | |
BaseM m n => BaseM (SupplyT m) n Source # | |
Defined in Cryptol.ModuleSystem.Name | |
RunM m (a, Supply) r => RunM (SupplyT m) a (Supply -> r) Source # | |
Defined in Cryptol.ModuleSystem.Name |
emptySupply :: Supply Source #
This should only be used once at library initialization, and threaded through the rest of the session. The supply is started at 0x1000 to leave us plenty of room for names that the compiler needs to know about (wired-in constants).
PrimMap
A mapping from an identifier defined in some module to its real name.
Instances
Show PrimMap Source # | |
Generic PrimMap Source # | |
NFData PrimMap Source # | |
Defined in Cryptol.ModuleSystem.Name | |
type Rep PrimMap Source # | |
Defined in Cryptol.ModuleSystem.Name type Rep PrimMap = D1 (MetaData "PrimMap" "Cryptol.ModuleSystem.Name" "cryptol-2.6.0-24w5HMDd2znGLrodkM4xJM" False) (C1 (MetaCons "PrimMap" PrefixI True) (S1 (MetaSel (Just "primDecls") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Map Ident Name)) :*: S1 (MetaSel (Just "primTypes") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Map Ident Name)))) |