Library for converting ground terms to strings and vice versa.
Author: Michael Hanus
Version: April 2005
| Exported names: |
Functions:
readQTerm
| readQTermFile
| readQTermListFile
| readsQTerm
| readsTerm
| readsUnqualifiedTerm
| readTerm
| readUnqualifiedTerm
| showQTerm
| showTerm
| writeQTermFile
| writeQTermListFile
| Summary of exported functions: |
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
| Imported modules: |
| Exported datatypes: |
| Exported functions: |
:: a -> String
Transforms a ground(!) term into a string representation
in standard prefix notation.
Thus, showTerm suspends until its argument is ground.
This function is similar to the prelude function show
but can read the string back with readUnqualifiedTerm
(provided that the constructor names are unique without the module
qualifier).
:: a -> String
Transforms a ground(!) term into a string representation
in standard prefix notation.
Thus, showTerm suspends until its argument is ground.
Note that this function differs from the prelude function show
since it prefixes constructors with their module name
in order to read them back with readQTerm.
:: [String] -> String -> [(a,String)]
Transform a string containing a term in standard prefix notation without module qualifiers into the corresponding data term. The first argument is a non-empty list of module qualifiers that are tried to prefix the constructor in the string in order to get the qualified constructors (that must be defined in the current program!). In case of a successful parse, the result is a one element list containing a pair of the data term and the remaining unparsed string.
:: [String] -> String -> a
Transforms a string containing a term in standard prefix notation
without module qualifiers into the corresponding data term.
The first argument is a non-empty list of module qualifiers that are tried to
prefix the constructor in the string in order to get the qualified constructors
(that must be defined in the current program!).
Example: readUnqualifiedTerm ["Prelude"] "Just 3"
evaluates to (Just 3)
:: String -> [(a,String)]
For backward compatibility. Should not be used since their use can be problematic in case of constructors with identical names in different modules.
:: String -> a
For backward compatibility. Should not be used since their use can be problematic in case of constructors with identical names in different modules.
:: String -> [(a,String)]
Transforms a string containing a term in standard prefix notation with qualified constructor names into the corresponding data term. In case of a successful parse, the result is a one element list containing a pair of the data term and the remaining unparsed string.
:: String -> a
Transforms a string containing a term in standard prefix notation with qualified constructor names into the corresponding data term.
:: String -> IO a
Reads a file containing a string representation of a term in standard prefix notation and returns the corresponding data term.
:: String -> IO [a]
Reads a file containing lines with string representations of terms of the same type and returns the corresponding list of data terms.
:: String -> a -> IO ()
Writes a ground term into a file in standard prefix notation.
Example call: (writeQTermFile filename term)
filename
- The name of the file to be written.
term
- The term to be written to the file as a string.
:: String -> [a] -> IO ()
Writes a list of ground terms into a file. Each term is written into a separate line which might be useful to modify the file with a standard text editor.
Example call: (writeQTermListFile filename terms)
filename
- The name of the file to be written.
terms
- The list of terms to be written to the file.