Copyright | (c) 2015-2016 Galois, Inc. |
---|---|
License | BSD3 |
Maintainer | cryptol@galois.com |
Stability | provisional |
Portability | portable |
Safe Haskell | Trustworthy |
Language | Haskell98 |
- data Name
- data NameInfo
- nameUnique :: Name -> Int
- nameIdent :: Name -> Ident
- nameInfo :: Name -> NameInfo
- nameLoc :: Name -> Range
- asPrim :: Name -> Maybe Ident
- cmpNameLexical :: Name -> Name -> Ordering
- cmpNameDisplay :: NameDisp -> Name -> Name -> Ordering
- ppLocName :: Name -> Doc
- mkDeclared :: ModName -> Ident -> Range -> Supply -> (Name, Supply)
- mkParameter :: Ident -> Range -> Supply -> (Name, Supply)
- class Monad m => FreshM m where
- liftSupply :: (Supply -> (a, Supply)) -> m a
- nextUniqueM :: FreshM m => m Int
- data SupplyT m a
- runSupplyT :: Monad m => Supply -> SupplyT m a -> m (a, Supply)
- data SupplyM a
- runSupplyM :: Supply -> SupplyM a -> (a, Supply)
- data Supply
- emptySupply :: Supply
- nextUnique :: Supply -> (Int, Supply)
- data PrimMap = PrimMap {}
- lookupPrimDecl :: Ident -> PrimMap -> Name
- lookupPrimType :: Ident -> PrimMap -> Name
Names
Information about the binding site of the name.
nameUnique :: Name -> Int Source
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.
Creation
mkDeclared :: ModName -> Ident -> Range -> Supply -> (Name, Supply) Source
Make a new name for a declaration.
Unique Supply
class Monad m => FreshM m where Source
liftSupply :: (Supply -> (a, Supply)) -> m a Source
FreshM SupplyM Source | |
FreshM InferM Source | |
FreshM REPL Source | |
Monad m => FreshM (SupplyT m) Source | |
Monad m => FreshM (ModuleT m) Source | |
FreshM m => FreshM (ReaderT i m) Source | |
(Monoid i, FreshM m) => FreshM (WriterT i m) Source | |
FreshM m => FreshM (StateT i m) Source | |
FreshM m => FreshM (ExceptionT i m) Source |
nextUniqueM :: FreshM m => m Int Source
Retrieve the next unique from the supply.
A monad for easing the use of the supply.
MonadT SupplyT Source | |
Monad m => Monad (SupplyT m) Source | |
Monad m => Functor (SupplyT m) Source | |
MonadFix m => MonadFix (SupplyT m) Source | |
Monad m => Applicative (SupplyT m) Source | |
Monad m => FreshM (SupplyT m) Source | |
BaseM m n => BaseM (SupplyT m) n Source | |
RunM m (a, Supply) r => RunM (SupplyT m) a (Supply -> r) Source |
runSupplyM :: Supply -> SupplyM a -> (a, 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).
nextUnique :: Supply -> (Int, Supply) Source
PrimMap
A mapping from an identifier defined in some module to its real name.
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.