Module ICurry.Build

Module for simpler generation of Ninja build files for ICurry

Author: Marc Andre Wittorf

Summary of exported operations:

generateFlatCurryEdges :: [ModuleDep] -> [Decl]   
Generate build edges to translate Curry to Typed FlatCurry
generateFlatCurryEdge :: [ModuleDep] -> ModuleDep -> Decl   
Generate a build edge to translate Curry to Typed FlatCurry
curryToFlatPath :: String -> String -> String   
Find the path to a Typed FlatCurry file
generateICurryEdges :: String -> [ModuleDep] -> [Decl]   
Generate build edges to translate Typed FlatCurry to ICurry
generateICurryEdge :: String -> ModuleDep -> Decl   
Generate a build edge to translate Typed FlatCurry to ICurry
generateEdges :: String -> String -> String -> Bool -> Maybe String -> String -> [ModuleDep] -> [Decl]   

Automatically generate edges for a dependency graph

generateEdges f2i tfcy icy True /path deps This generates edges for the deps dependency graph.

tfcyRule :: Decl   
Ninja rule to compile Curry to Typed FlatCurry
icyRule :: String -> Decl   
Ninja rule to compile Typed FlatCurry to ICurry

Exported operations:

generateFlatCurryEdges :: [ModuleDep] -> [Decl]   

Generate build edges to translate Curry to Typed FlatCurry

Example call:
(generateFlatCurryEdges deps)
Parameters:
  • deps : all modules with dependencies
Returns:
(build edge) ninja declarations

generateFlatCurryEdge :: [ModuleDep] -> ModuleDep -> Decl   

Generate a build edge to translate Curry to Typed FlatCurry

Example call:
(generateFlatCurryEdge allDeps dep)
Parameters:
  • allDeps : all dependencies
  • dep : a module with its dependencies
Returns:
a (build edge) ninja declaration

curryToFlatPath :: String -> String -> String   

Find the path to a Typed FlatCurry file

Example call:
(curryToFlatPath m path)
Parameters:
  • m : the module parts
  • path : the path to the curry file
Returns:
the path to the tfcy file

generateICurryEdges :: String -> [ModuleDep] -> [Decl]   

Generate build edges to translate Typed FlatCurry to ICurry

Example call:
(generateICurryEdges prefix depd)
Parameters:
  • prefix : the icy files will be placed here
  • depd : modules with their dependencies
Returns:
(build edge) ninja declarations

generateICurryEdge :: String -> ModuleDep -> Decl   

Generate a build edge to translate Typed FlatCurry to ICurry

Example call:
(generateICurryEdge prefix dep)
Parameters:
  • prefix : the icy file will be placed here
  • dep : a module with its dependencies
Returns:
a (build edge) ninja declaration

generateEdges :: String -> String -> String -> Bool -> Maybe String -> String -> [ModuleDep] -> [Decl]   

Automatically generate edges for a dependency graph

generateEdges f2i tfcy icy True /path deps This generates edges for the deps dependency graph. All files are in a module structure under /path. Each file .tfcy is translated into a .icy file by the rule f2i. As wantNeighborDep is True, Prelude.icy must be compiled before MyModule.icy can be compiled, assuming that Prelude is a dependency of MyModule. If wantNeighborDep was False, MyModule.tfcy could be translated to MyModule.icy independently from the Prelude.

Example call:
(generateEdges ruleName srcExt tgExt wantNeighborDep prefix depgraph)
Parameters:
  • ruleName : the rule to use
  • srcExt : the source file extension
  • tgExt : the target file extension
  • wantNeighborDep : are targets of dependencies required?
  • prefix : the path where the module structure is located
  • depgraph : the module dependency graph
Returns:
ninja (build edge) declarations

tfcyRule :: Decl   

Ninja rule to compile Curry to Typed FlatCurry

Returns:
the rule declaration
Further infos:
  • solution complete, i.e., able to compute all solutions

icyRule :: String -> Decl   

Ninja rule to compile Typed FlatCurry to ICurry

Returns:
the rule declaration
Further infos:
  • solution complete, i.e., able to compute all solutions