This module contains functions to reduce the size of FlatCurry programs
by combining the main module and all imports into a single program
that contains only the functions directly or indirectly called from
a set of main functions.
Author: Michael Hanus, Carsten Heine
Version: June 2009
| Exported names: |
Datatypes:
Option
| RequiredSpec
Constructors:
Exports
| Import
| InitFuncs
| Main
| Required
| Verbose
Functions:
alwaysRequired
| computeCompactFlatCurry
| defaultRequired
| generateCompactFlatCurryFile
| requires
| Summary of exported functions: |
|
||
|
||
|
||
|
||
|
| Imported modules: |
| Exported datatypes: |
Options to guide the compactification process.
Constructors:
:: Option
Verbose - for more output
:: String -> Option
Main - optimize for one main (unqualified!) function supplied here
:: Option
Exports - optimize w.r.t. the exported functions of the module only
:: [(String,String)] -> Option
InitFuncs - optimize w.r.t. given list of initially required functions
:: [RequiredSpec] -> Option
Required - list of functions that are implicitly required and, thus,
should not be deleted if the corresponding module
is imported
:: String -> Option
Import - module that should always be imported
(useful in combination with option InitFuncs)
Data type to specify requirements of functions.
Constructors:
| Exported functions: |
:: (String,String) -> (String,String) -> RequiredSpec
(fun `requires` reqfun) specifies that the use of the function "fun" implies the application of function "reqfun".
:: (String,String) -> RequiredSpec
(alwaysRequired fun) specifies that the function "fun" should be always present if the corresponding module is loaded.
:: [RequiredSpec]
Functions that are implicitly required in a FlatCurry program (since they might be generated by external functions like "==" or "=:=" on the fly).
:: [Option] -> String -> String -> IO ()
Computes a single FlatCurry program containing all functions potentially called from a set of main functions and writes it into a FlatCurry file. This is done by merging all imported FlatCurry modules and removing the imported functions that are definitely not used.
Example call: (generateCompactFlatCurryFile options progname target)
options
- list of options
progname
- name of the Curry program that should be compacted
target
- name of the target file where the compact program is saved
:: [Option] -> String -> IO Prog
Computes a single FlatCurry program containing all functions potentially called from a set of main functions. This is done by merging all imported FlatCurry modules (these are loaded demand-driven so that modules that contains no potentially called functions are not loaded) and removing the imported functions that are definitely not used.
Example call: (computeCompactFlatCurry options progname)
options
- list of options
progname
- name of the Curry program that should be compacted