Module ICurry.Compiler

Author
Michael Hanus
Version
July 2021

This module contains a simple compiler from FlatCurry to ICurry programs.

To do in future work:

  • compile also imported modules depending on their date
  • remove declarations/assignments of unused variables in ICurry code

Exported Functions


icCompile :: ICOptions -> String -> IO IProg  Non-deterministic 

Generates an ICurry program by reading a FlatCurry program and compiling it to ICurry.


flatCurry2ICurry :: ICOptions -> Prog -> IO IProg  Non-deterministic 

Translates a FlatCurry program into an ICurry program. It also reads the imported modules in order to access their data and function declarations.


flatCurry2ICurryWithProgs :: ICOptions -> [Prog] -> Prog -> IO IProg  Non-deterministic 

Translates a FlatCurry program into an ICurry program where some FlatCurry interfaces are provided. It also reads the interfaces of imported modules, if not already provided, in order to access their data and function declarations.


flatCurry2ICurryWithProgsAndOptions :: ICOptions -> [Prog] -> Prog -> IO (ICOptions, IProg)  Non-deterministic 

Translates a FlatCurry program into an ICurry program where some FlatCurry interfaces are provided. It also reads the interfaces of imported modules, if not already provided, in order to access their data and function declarations. The ICOptions after processing the program (containing the constructor and function maps required for the translation) are also returned.