PAKCS: System Libraries

Here is the collection of libraries contained in the distribution of PAKCS. 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.
CLPFD
This library supports constraint programming with finite domain constraints.
CLPR
This library supports constraint programming with arithmetic constraints over real numbers.
CLPB
This library provides a Boolean constraint solver based on BDDs.
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.
Database
Library for accessing and storing data in databases. The contents of a database is represented in this library as dynamic predicates that are defined by facts than can change over time and can be persistently stored. All functions in this library distinguishes between queries that access the database and transactions that manipulates data in the database. Transactions have a monadic structure. Both queries and transactions can be executed as I/O actions. However, arbitrary I/O actions cannot be embedded in transactions. The ideas of this library are described in this paper.
Debug
This library contains some useful operation for debugging programs.
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.
Dynamic
This library supports the manipulation of dynamic predicates, i.e., predicates that are defined by facts than can change over time and can be persistently stored. The ideas of this library are described in this paper. Remark: This library has been revised to the library Database. Thus, it might not be further supported in the future.
Either
This library contains some useful operation for the Either data type.
FileGoodies
A collection of useful operations when dealing with files.
Findall
This library contains some operations for encapsulating search which were previously part of the standard prelude. Since there are alternative and better approaches the encpasulate search, e.g., set functions, these operations are now in a separate module in order to keep the standard prelude more portable.
Float
A collection of operations on floating point numbers.
Function
A collection of utility operations for function application.
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.
GlobalVariable
This library implements global variables. A global variable has a name declared in the program. Its value can be accessed and modified by IO actions. Values of global variables can contain logic variables shared with computations running in the same computation space. As a consequence, values of global variables are not kept 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.
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 (persistent predicates based on the library Database) where each entry consists of a key and an info part.
KeyDatabaseSQLite
This library provides a general interface for databases (persistent predicates based on the library Database) where each entry consists of a key and an info part. It reimplements the interface of the module KeyDatabase based on the SQLite database engine.
KeyDB
This library provides a general interface for databases (persistent predicates) where each entry consists of a key and an info part. Remark: This library has been revised to the library KeyDatabase. Thus, it might not be further supported in the future.
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
Prolog
A library to represent Prolog programs.
Ports
This library supports the development of concurrent and distributed applications in Curry by defining ports for sending and receiving messages, possibly containing logical variables. A detailed description of the idea and use of ports can be found here.
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.
Prolog
A library to represent Prolog programs.
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 a prototypical implementation of set functions to encapsulate nondeterministic computations. The general idea of set functions is described in this paper but the implementation in this library is more restricted than the general approach.
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.
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.