|
Compiler.Module | Portability | portable | Stability | medium | Maintainer | egallego@babel.ls.fi.upm.es |
|
|
|
Description |
Last modified: 04 Oct 2004, 18:27
Manages modules compound of symbols and their code.
This module implementes the data type module,
that it is a collection of functions or predicates
and an associated list of definitions.
|
|
Synopsis |
|
|
|
Documentation |
|
type Module a b = Map a [b] |
Module type.
a is function or predicate type
b is code type
|
|
addDefinition |
:: Ord a | | => Module a b | Module to modify
| -> a | Function value
| -> b | New code
| -> Module a b | Result module
| Adds code to a symbol.
|
|
|
mapModule |
:: (a -> b -> c) | Function to apply
| -> Module a b | Input Module
| -> Module a c | Output Module
| Map for modules.
|
|
|
mapModuleList |
:: (a -> [b] -> [c]) | Function to apply
| -> Module a b | Input Module
| -> Module a c | Output Module
| Apply a function to all codes simultaneously
|
|
|
moduleToList :: Module a b -> [(a, [b])] |
Converts a module to a list
|
|
lookupCode :: Ord a => Module a b -> a -> [b] |
Returns the code associated to a symbol. If the symbol is not
defined, retuns [].
|
|
Produced by Haddock version 0.8 |