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.
AllSolutions
This module 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.
AnsiCodes
Library for formatted output on terminals
Assertion
This module defines the datatype and operations for the Curry module tester "currytest".
CLP.FD
Library for finite domain constraint solving.
CLPFD
Library for finite domain constraint solving.
The general structure of a specification of an FD problem is as follows:
CLPR
Library for constraint programming with arithmetic constraints over reals.
CSV
Library for reading/writing files in CSV format. Files in CSV (comma separated values) format can be imported and exported by most spreadsheed and database applications.
Char
Library with some useful functions on characters.
Combinatorial
A collection of common non-deterministic and/or combinatorial operations. Many operations are intended to operate on sets. The representation of these sets is not hidden; rather sets are represented as lists. Ideally these lists contains no duplicate elements and the order of their elements cannot be observed. In practice, these conditions are not enforced.
Debug
This library contains some useful operation for debugging programs.
Directory
Library for accessing the directory structure of the underlying operating system.
Distribution
This module contains functions to obtain information concerning the current distribution of the Curry implementation, e.g., compiler version, load paths, front end.
Either
Library with some useful operations for the Either
data type.
ErrorState
A combination of Error and state monad like ErrorT State
in Haskell.
FileGoodies
A collection of useful operations when dealing with files.
FilePath
This library is a direct port of the Haskell library System.FilePath of Neil Mitchell.
Findall
Library with some operations for encapsulating search.
Note that some of these operations are not fully declarative,
i.e., the results depend on the order of evaluation and program rules.
There are newer and better approaches the encpasulate search,
in particular, set functions (see module SetFunctions
),
which should be used.
Float
A collection of operations on floating point numbers.
Format
The library provides some operations to format values of basic
data types with arbitrary flags similarly to the printf
statement of C.
Function
This module provides some utility functions for function application.
FunctionInversion
This module provides some utility functions for inverting functions.
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 in this paper
GetOpt
This Module is a modified version of the Module System.Console.GetOpt by Sven Panne from the ghc-base package it has been adapted for Curry by Bjoern Peemoeller
Global
Library for handling 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 declared as persistent so that their values are stored across different program executions.
GlobalVariable
Library for handling global variables. A global variable has a name declared in the program. Its value (a data term possibly containing free variables) can be accessed and modified by IO actions.
IO
Library for IO operations like reading and writing files that are not already contained in the prelude.
IOExts
Library with some useful extensions to the IO monad.
Integer
A collection of common operations on integer numbers.
Most operations make no assumption on the precision of integers.
Operation bitNot
is necessarily an exception.
List
Library with some useful operations on lists.
Maybe
Library with some useful functions on the Maybe
datatype.
NamedSocket
Library to support network programming with sockets that are addressed
by symbolic names. In contrast to raw sockets (see library
Socket
), this library uses the Curry Port Name Server
to provide sockets that are addressed by symbolic names
rather than numbers.
Nat
Library defining natural numbers in Peano representation and some operations on this representation.
Parser
Library with functional logic parser combinators.
PlProfileData
Library to access profile data of the Prolog system
Ports
Library for distributed programming with ports. This paper contains a description of the basic ideas behind this library.
Prelude
The standard prelude of Curry. All top-level functions defined in this module are always available in any Curry program.
Pretty
This library provides pretty printing combinators.
The interface is that of
Daan Leijen's library
linear-time, bounded implementation
by Olaf Chitil.
Note that the implementation of fill
and fillBreak
is not linear-time bounded
Support of ANSI escape codes for formatting and colorisation of documents
in text terminals (see https://en.wikipedia.org/wiki/ANSIescapecode)
Profile
Preliminary library to support profiling.
PropertyFile
A library to read and update files containing properties in the usual
equational syntax, i.e., a property is defined by a line of the form
prop=value
where prop
starts with a letter.
All other lines (e.g., blank lines or lines starting with #
are
considered as comment lines and are ignored.
Read
Library with some functions for reading special tokens.
ReadNumeric
Library with some functions for reading and converting numeric tokens.
ReadShowTerm
Library for converting ground terms to strings and vice versa.
RegExp
A library to defined and match regular expressions. This library is used to translated integrated code in the form of POSIX extended regular expressions into Curry programs.
SetFunctions
This module contains an implementation of set functions. The general idea of set functions is described in:
ShowS
This library provides a type and combinators for show functions using functional lists.
Socket
Library to support network programming with sockets.
In standard applications, the server side uses the operations
listenOn
and socketAccept
to provide some service
on a socket, and the client side uses the operation
connectToSocket
to request a service.
State
This library provides an implementation of the state monad.
System
Library to access parts of the system environment.
Test.Contract
This library defines some auxiliaries to check contracts based on specifications or pre- and postconditions provided in a Curry module. The interface might probably change with the further development of the contract implementation.
Test.EasyCheck
EasyCheck is a library for automated, property-based testing of Curry programs. The ideas behind EasyCheck are described in this paper. The CurryCheck tool automatically executes tests defined with this library. CurryCheck supports the definition of unit tests (also for I/O operations) and property tests parameterized over some arguments. CurryCheck is described in more detail in this paper.
Test.EasyCheckExec
EasyCheck is a library for automated, property-based testing of Curry programs. The ideas behind EasyCheck are described in this paper. This module implements the operations to actually execute the tests.
Test.Prop
This module defines the interface of properties that can be checked with the CurryCheck tool, an automatic property-based test tool based on the EasyCheck library. The ideas behind EasyCheck are described in this paper. CurryCheck automatically tests properties defined with this library. CurryCheck supports the definition of unit tests (also for I/O operations) and property tests parameterized over some arguments. CurryCheck is described in more detail in this paper.
Time
Library for handling date and time information.
Unsafe
Library containing unsafe operations. These operations should be carefully used (e.g., for testing or debugging). These operations should not be used in application programs!
Array
Implementation of Arrays with Braun Trees. Conceptually, Braun trees are always infinite. Consequently, there is no test on emptiness.
Dequeue
An implementation of double-ended queues supporting access at both ends in constant amortized time.
FiniteMap
A finite map is an efficient purely functional data structure
to store a mapping from keys to values.
In order to store the mapping efficiently, an irreflexive(!) order predicate
has to be given, i.e., the order predicate le
should not satisfy
(le x x)
for some key x
.
Random
Library for pseudo-random number generation in Curry.
RedBlackTree
Library with an implementation of red-black trees:
Serves as the base for both TableRBT and SetRBT
All the operations on trees are generic, i.e., one has to provide
two explicit order predicates ("lessThan
" and "eq
"below)
on elements.
SCC
Computing strongly connected components
SearchTree
This library defines a representation of a search space as a tree and various search strategies on this tree. This module implements strong encapsulation as discussed in the JFLP'04 paper.
SearchTreeGenerators
This library implements some operations to generate search trees for various data types.
SearchTreeTraversal
Implements additional traversals on search trees.
SetRBT
Library with an implementation of sets as red-black trees.
Sort
A collection of useful functions for sorting and comparing characters, strings, and lists.
TableRBT
Library with an implementation of tables as red-black trees:
A table is a finite mapping from keys to values.
All the operations on tables are generic, i.e., one has to provide
an explicit order predicate ("cmp
" below) on elements.
Each inner node in the red-black tree contains a key-value association.
Traversal
Library to support lightweight generic traversals through tree-structured data. See here for a description of the library.
ValueSequence
This library defines a data structure for sequence of values.
It is used in search trees (module SearchTree
) as well as in
set functions (module SetFunctions
).
Using sequence of values (rather than standard lists of values)
is necessary to get the behavior of set functions
w.r.t. finite failures right, as described in the paper
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.
Database.CDBI.Connection
This module defines basis data types and functions for accessing database systems using SQL. Currently, only SQLite3 is supported, but this is easy to extend. It also provides execution of SQL-Queries with types. Allowed datatypes for these queries are defined and the conversion to standard SQL-Queries is provided.
Database.CDBI.Criteria
This module provides datatypes, constructor functions and translation functions to specify SQL criteria including options(group-by, having, order-by)
Database.CDBI.Description
This module contains basic datatypes and operations to represent
a relational data model in a type-safe manner. This representation is
used by the library Database.CDBI.ER
to provide type safety
when working with relational databases.
The tool erd2cdbi
generates from an entity-relationship model
a Curry program that represents all entities and relationships
by the use of this module.
Database.CDBI.ER
This is the main CDBI-module. It provides datatypes and functions to do Database-Queries working with Entities (ER-Model)
Database.CDBI.QueryTypes
This module contains datatype declarations, constructor functions selectors and translation functions for complex select queries in particular for those selecting (1 to 5) single columns.
Database.ERD
This module contains the definition of data types to represent entity/relationship diagrams and an I/O operation to read them from a term file.
Dynamic
Library for dynamic predicates. This paper contains a description of the basic ideas behind this library.
KeyDB
This module provides a general interface for databases (persistent predicates) where each entry consists of a key and an info part. The key is an integer and the info is arbitrary. All functions are parameterized with a dynamic predicate that takes an integer key as a first parameter.
KeyDatabase
This module provides a general interface for databases (persistent predicates) where each entry consists of a key and an info part. The key is an integer and the info is arbitrary. All functions are parameterized with a dynamic predicate that takes an integer key as a first parameter.
KeyDatabaseSQLite
This module provides a general interface for databases (persistent predicates) where each entry consists of a key and an info part. The key is an integer and the info is arbitrary. All functions are parameterized with a dynamic predicate that takes an integer key as a first parameter.
HTML
Library for HTML and CGI programming. This paper contains a description of the basic ideas behind this library.
XML
Library for processing XML data.
XmlConv
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.
AbstractCurry.Build
This library provides some useful operations to write programs that generate AbstractCurry programs in a more compact and readable way.
AbstractCurry.Files
This library defines various I/O actions to read Curry programs and transform them into the AbstractCurry representation and to write AbstractCurry files.
AbstractCurry.Pretty
Pretty-printing of AbstractCurry.
AbstractCurry.Select
This library provides some useful operations to select components in AbstractCurry programs, i.e., it provides a collection of selector functions for AbstractCurry.
AbstractCurry.Transform
This library provides transformation and update operations
on AbstractCurry programs.
Since the transformations are defined recursively on structured types,
they are useful to construct specific transformations on AbstractCurry
programs.
In particular, this library contains the transformation
renameCurryModule
to rename an AbstractCurry module.
AbstractCurry.Types
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.
FlatCurry.Compact
This module 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.
FlatCurry.Files
This library supports meta-programming, i.e., the manipulation of Curry programs in Curry. This library defines I/O actions
FlatCurry.FlexRigid
This library provides a function to compute the rigid/flex status of a FlatCurry expression (right-hand side of a function definition).
FlatCurry.Goodies
This library provides selector functions, test and update operations as well as some useful auxiliary functions for FlatCurry data terms. Most of the provided functions are based on general transformation functions that replace constructors with user-defined functions. For recursive datatypes the transformations are defined inductively over the term structure. This is quite usual for transformations on FlatCurry terms, so the provided functions can be used to implement specific transformations without having to explicitly state the recursion. Essentially, the tedious part of such transformations - descend in fairly complex term structures - is abstracted away, which hopefully makes the code more clear and brief.
FlatCurry.Pretty
This library provides pretty-printers for FlatCurry modules and all substructures (e.g., expressions).
FlatCurry.Read
This library defines operations to read a FlatCurry programs or interfaces together with all its imported modules in the current load path.
FlatCurry.Show
This library contains operations to transform FlatCurry programs into string representations, either in a FlatCurry format or in a Curry-like syntax.
FlatCurry.Types
This library supports meta-programming, i.e., the manipulation of Curry programs in Curry. For this purpose, the library contains definitions of data types for the representation of so-called FlatCurry programs.
FlatCurry.XML
This library contains functions to convert FlatCurry programs into corresponding XML expressions and vice versa. This can be used to store Curry programs in a way independent of a Curry system or to use a Curry system, like PAKCS, as back end by other functional logic programming systems.
Operation is deterministic, i.e., defined by exclusive rules and depend only on deterministic operations | ||
Operation might be non-deterministic, i.e., it is defined by overlapping rules or depend on non-deterministic operations |