Module FlatCurry.TypeAnnotated.Files

This library defines I/O actions to read and write type-annotated FlatCurry programs.

Author: Michael Hanus

Version: December 2024

Summary of exported operations:

typeAnnotatedFlatCurryFileName :: String -> String  Deterministic 
Transforms a name of a Curry program (with or without suffix ".curry" or ".lcurry") into the name of the file containing the corresponding type-annotated FlatCurry program.
typeAnnotatedFlatCurryFilePath :: String -> IO String  Deterministic 
Gets the standard type-annotated FlatCurry file location for a given Curry module name.
readTypeAnnotatedFlatCurry :: String -> IO (AProg TypeExpr)  Non-deterministic 
I/O action which parses a Curry program and returns the corresponding type-annotated FlatCurry program.
readTypeAnnotatedFlatCurryWithParseOptions :: String -> FrontendParams -> IO (AProg TypeExpr)  Non-deterministic 
I/O action which parses a Curry program with respect to some parser options and returns the corresponding FlatCurry program.
readTypeAnnotatedFlatCurryFile :: String -> IO (AProg TypeExpr)  Non-deterministic 
Reads a type-annotated FlatCurry program from a file in .afcy format where the file name is provided as the argument.
writeTypeAnnotatedFlatCurry :: AProg TypeExpr -> IO ()  Non-deterministic 
Writes a type-annotated FlatCurry program into a file in .afcy format.
writeTypeAnnotatedFlatCurryFile :: String -> AProg TypeExpr -> IO ()  Non-deterministic 
Writes a type-annotated FlatCurry program into a file in ".afcy" format.

Exported operations:

typeAnnotatedFlatCurryFileName :: String -> String  Deterministic 

Transforms a name of a Curry program (with or without suffix ".curry" or ".lcurry") into the name of the file containing the corresponding type-annotated FlatCurry program.

typeAnnotatedFlatCurryFilePath :: String -> IO String  Deterministic 

Gets the standard type-annotated FlatCurry file location for a given Curry module name. The Curry source program must exist in the Curry load path, otherwise an error is raised.

readTypeAnnotatedFlatCurry :: String -> IO (AProg TypeExpr)  Non-deterministic 

I/O action which parses a Curry program and returns the corresponding type-annotated FlatCurry program. The argument is the module path (without suffix ".curry" or ".lcurry") and the result is a type-annotated FlatCurry term representing this program.

readTypeAnnotatedFlatCurryWithParseOptions :: String -> FrontendParams -> IO (AProg TypeExpr)  Non-deterministic 

I/O action which parses a Curry program with respect to some parser options and returns the corresponding FlatCurry program. This I/O action is used by readTypeAnnotatedFlatCurry.

Example call:
(readTypeAnnotatedFlatCurryWithParseOptions progfile options)
Parameters:
  • progfile : the program file name (without suffix ".curry")
  • options : parameters passed to the front end

readTypeAnnotatedFlatCurryFile :: String -> IO (AProg TypeExpr)  Non-deterministic 

Reads a type-annotated FlatCurry program from a file in .afcy format where the file name is provided as the argument.

writeTypeAnnotatedFlatCurry :: AProg TypeExpr -> IO ()  Non-deterministic 

Writes a type-annotated FlatCurry program into a file in .afcy format. The file is written in the standard location for intermediate files, i.e., in the typeAnnotatedFlatCurryFileName relative to the directory of the Curry source program (which must exist!).

writeTypeAnnotatedFlatCurryFile :: String -> AProg TypeExpr -> IO ()  Non-deterministic 

Writes a type-annotated FlatCurry program into a file in ".afcy" format. The first argument must be the name of the target file (with suffix .afcy).