cryptol-2.3.0: Cryptol: The Language of Cryptography

Copyright(c) 2015-2016 Galois, Inc.
LicenseBSD3
Maintainercryptol@galois.com
Stabilityprovisional
Portabilityportable
Safe HaskellTrustworthy
LanguageHaskell98

Cryptol.ModuleSystem.Name

Contents

Description

 

Synopsis

Names

data NameInfo Source

Information about the binding site of the name.

Constructors

Declared !ModName

This name refers to a declaration from this module

Parameter

This name is a parameter (function or type)

cmpNameLexical :: Name -> Name -> Ordering Source

Compare two names lexically.

cmpNameDisplay :: NameDisp -> Name -> Name -> Ordering Source

Compare two names by the way they would be displayed.

ppLocName :: Name -> Doc Source

Pretty-print a name with its source location information.

Creation

mkDeclared :: ModName -> Ident -> Range -> Supply -> (Name, Supply) Source

Make a new name for a declaration.

mkParameter :: Ident -> Range -> Supply -> (Name, Supply) Source

Make a new parameter name.

Unique Supply

class Monad m => FreshM m where Source

Methods

liftSupply :: (Supply -> (a, Supply)) -> m a Source

nextUniqueM :: FreshM m => m Int Source

Retrieve the next unique from the supply.

data SupplyT m a Source

A monad for easing the use of the supply.

runSupplyT :: Monad m => Supply -> SupplyT m a -> m (a, Supply) Source

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

data PrimMap Source

A mapping from an identifier defined in some module to its real name.

Constructors

PrimMap 

lookupPrimDecl :: Ident -> PrimMap -> Name Source

It's assumed that we're looking things up that we know already exist, so this will panic if it doesn't find the name.

lookupPrimType :: Ident -> PrimMap -> Name Source

It's assumed that we're looking things up that we know already exist, so this will panic if it doesn't find the name.