ContentsIndex
Compiler.Module
Portabilityportable
Stabilitymedium
Maintaineregallego@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
type Module a b = Map a [b]
addDefinition :: Ord a => Module a b -> a -> b -> Module a b
mapModule :: (a -> b -> c) -> Module a b -> Module a c
mapModuleList :: (a -> [b] -> [c]) -> Module a b -> Module a c
moduleToList :: Module a b -> [(a, [b])]
lookupCode :: Ord a => Module a b -> a -> [b]
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 bModule to modify
-> aFunction value
-> bNew code
-> Module a bResult module
Adds code to a symbol.
mapModule
:: (a -> b -> c)Function to apply
-> Module a bInput Module
-> Module a cOutput Module
Map for modules.
mapModuleList
:: (a -> [b] -> [c])Function to apply
-> Module a bInput Module
-> Module a cOutput 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