KiCS2: System Libraries

o  General libraries
o  Data structures and algorithms
o  Libraries for web applications
o  Libraries for meta-programming
o  Index to all library functions
o  Index to all library constructors

Here is the collection of libraries contained in the distribution of KiCS2. Most of these libraries have been implemented during the development of larger Curry applications. If you have suggestions for changes/improvements or if you want to contribute your own library, please contact Michael Hanus.


General libraries:

  • Prelude: This is the standard prelude, i.e., the main library which is added to every Curry program.
  • AllSolutions: This library contains a collection of functions for obtaining lists of solutions to constraints. These operations are useful to encapsulate non-deterministic operations between I/O actions in order to connects the worlds of logic and functional programming and to avoid non-determinism failures on the I/O level.
  • Assertion: This library defines the datatype and functions for the Curry module tester "currytest".
  • Char: This library contains some useful functions on characters.
  • Combinatorial: This library contains a collection of common non-deterministic and/or combinatorial operations.
  • Constraint: This library contains some useful operations for constraint programming.
  • CSV: This library supports reading/writing files in CSV (comma separated values) format that can be imported and exported by most spreadsheed and database applications.
  • Directory: This library supports the access to the directory structure of the underlying operating system.
  • Distribution: This library contains functions to obtain information concerning the current distribution of the Curry implementation, e.g., compiler version, load paths, front end.
  • FileGoodies: A collection of useful operations when dealing with files.
  • Float: A collection of operations on floating point numbers.
  • Global: This library provides functionality for global entities. A global entity has a name declared in the program. Its value can be accessed and modified by IO actions. Furthermore, global entities can be persistent so that their values are stored across different program executions.
  • GUI: This library contains definitions and functions to implement graphical user interfaces for Curry programs. It is based on Tcl/Tk and its basic ideas are described in detail here. This library is an improved and updated version of the older library Tk. The latter might not be supported in the future.
  • Integer: A collection of common operations on integer numbers.
  • IO: This library contains IO operations, like reading and writing files, that are not already contained in the prelude.
  • IOExts: This library contains some useful extensions to the IO monad, in particular, the implementation of a global state.
  • JavaScript: A library to represent JavaScript programs.
  • KeyDatabaseSQLite: This library provides a general interface for databases where each entry consists of a key and an info part and is stored in a SQLite database.
  • List: This library contains some useful operations on lists which are not contained in the standard prelude.
  • Maybe: This library contains some useful operations on the Maybe type which are not contained in the standard prelude.
  • NamedSocket: This library contains operations for network programming with sockets where sockets are addressed by symbolic names rather than numbers.
  • Parser: This library defines (functional logic) parser combinators to support a simple implementation of parsers in Curry. It is adapted from Rafael Caballero and Francisco J. Lopez-Fraguas: A Functional Logic Perspective of Parsing, Proc. FLOPS'99, Springer LNCS 1722, pp. 85-99, 1999
  • Pretty: This library provides combinators to support the definition of pretty printers for structured text.
  • Profile: This library contains limited and preliminary support for profiling. Currently, it supports the possibility to show the time and space needed to evaluate a term to its normal form.
  • PropertyFile: This library defines some functions to read and update files containing properties in the usual equational syntax.
  • Read: This library defines some functions for reading special tokens (naturals, integers, hexadecimal numbers) from strings. This library is included for backward compatibility only. You should use the library ReadNumeric which provides a better interface for these functions.
  • ReadNumeric: This library defines some functions for reading numeric tokens (naturals, integers, hexadecimal numbers) from strings and converting them to numbers.
  • ReadShowTerm: This library contains functions for converting ground data terms to strings and vice versa.
  • SetFunctions: This library contains an implementation of set functions to encapsulate nondeterministic computations. The general idea of set functions is described in this paper.
  • Socket: This library contains basic operations for network programming with sockets.
  • System: This library supports the access to parts of the system environment, like the current date and time, environment variables, system calls etc.
  • Time: This library contains definitions and functions to handle date and time information.
  • Unsafe: This library contains unsafe operations which should not be used.

Data structures and algorithms:

  • Array: An implementation of arrays with Braun Trees.
  • Dequeue: An implementation of double-ended queues supporting access at both ends in constant amortized time.
  • FiniteMap: An implementation of finite maps. A finite map is an efficient purely functional data structure to store a mapping from keys to values.
  • GraphInductive: A library for inductive graphs (port of a Haskell library by Martin Erwig). Graphs are composed and decomposed in an inductive way.
  • Random: This library provides operations for generating pseudo-random number sequences.
  • RedBlackTree: This library provides an efficient implementation of red-black trees. It serves as the base for the libraries SetRBT and TableRBT. All the operations on trees are generic, i.e., one has to provide explicit order predicates on elements.
  • SearchTree: This library defines a representation of a search space as a tree and search strategies on this tree.
  • SetRBT: This library provides an efficient implementation of sets as red-black trees. The implementation is generic in the types of elements and the set operations require an ordering predicate on elements. The library also contains a generic sort function with complexity O(n*log(n)) based on insertion into red-black trees.
  • Sort: A collection of useful functions for sorting and comparing characters, strings, and lists.
  • TableRBT: This library provides an efficient implementation of tables (i.e., finite mappings from keys to values) as red-black trees. The implementation is generic in the types of keys and values and the table operations require an ordering predicate on keys.
  • Traversal: This library supports lightweight generic traversals through tree-structured data.

Libraries for web applications:

  • CategorizedHtmlList: This library provides functions to categorize a list of entities into a HTML page with an index access (e.g., "A-Z") to these entities.
  • HTML: This library supports HTML and CGI programming, i.e., the generation of (dynamic) web pages. A detailed description of this library and its basic ideas can be found here.
  • HtmlParser: This library contains a parser for HTML documents. It does not perform any syntax checks but returns only a generic representation according to the definition of HTML documents provided in the library HTML.
  • Mail: This library contains functions for sending emails. The implementation might need to be adapted to the local environment.
  • Markdown: Library to translate markdown documents into HTML or LaTeX.
  • URL: This library contains functions related to URLs, in particular, downloading of documents accessible by a URL.
  • WUI: Library to support type-oriented construction of web user interfaces. The ideas behind the application and implementation of this library are described in paper that is available via this web page.
  • XML: Library for processing data in XML format. It contains a definition of a datatype for representing XML terms and a parser and pretty printing for converting strings into such XML terms and vice versa.
  • XmlConv: This library provides type-based combinators to construct XML converters. Arbitrary XML data can be represented as algebraic datatypes and vice versa. See here for a description of this library.

Libraries for meta-programming:

  • AbstractCurry: This library contains a definition for representing Curry programs in Curry and an I/O action to read Curry programs and transform them into this abstract representation.
  • AbstractCurryPrinter: This library contains a pretty printer for AbstractCurry programs in order to show an AbstractCurry program in standard Curry syntax.
  • CompactFlatCurry: This library 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.
  • CurryStringClassifier: This library contains a simple tool to process strings containing Curry source code in order to perform simple manipulations of source programs (e.g., adding type signatures, removing comments).
  • FlatCurry: This library supports meta-programming, i.e., the manipulation of Curry programs in Curry. For this purpose, the library contains definitions of datatypes for the representation of so-called FlatCurry programs and an I/O action to read Curry programs and transform them into this representation.
  • FlatCurryGoodies: This library provides selector functions, test and update operations as well as some useful auxiliary functions for manipulating FlatCurry data terms.
  • FlatCurryRead: This library defines operations to read a FlatCurry programs or interfaces together with all its imported modules in the current load path.
  • FlatCurryShow: This library contains functions to transform FlatCurry programs into string representations, either in a FlatCurry format or in a Curry-like syntax.
  • FlatCurryXML: This library contains functions to convert FlatCurry programs into XML terms and vice versa.
  • FlexRigid: This library provides a function to compute the rigid/flex status of a FlatCurry expression (right-hand side of a function definition).
  • PrettyAbstract: This library contains a pretty printer for AbstractCurry programs in order to show an AbstractCurry program in human-readable Curry syntax. In contrast to the library AbstractCurryPrinter, this library implements a better human-readable pretty printing of AbstractCurry programs.

Back to Homepage of KiCS2

Michael Hanus

Valid XHTML 1.0 Transitional