Curry (programming language)

from Wikipedia, the free encyclopedia
curry
Paradigms : functional , logical , non-strict, modular
Designer: Michael Hanus, Sergio Antoy, et al.
Typing : static , strong , inferred
Important implementations : PAKCS (with Prolog code as result) KiCS2 (with Haskell code as result)
Influenced by: Haskell
Operating system : portable
curry-language.org

Curry is an experimental functional logic programming language based on Haskell . It combines elements of functional and logical programming, especially constraint programming .

It extends Haskell with the exception of overloading using type classes ; they are only included as a language extension by some implementations, for example by the Münster Curry Compiler .

Basics

There are no side effects unlike procedural, object-oriented or most other imperative languages. Therefore, the order in which subexpressions are evaluated does not matter to the value of the result. Furthermore, conceptually there are no longer any functions; they are replaced by relations with a functional character, so-called correspondences . In contrast to functions, these are not necessarily right-clear , that is, they do not have to have exactly one result for a certain input, in particular they are partial from the start. This makes it possible to use not only constructors , but also function calls for pattern matching , which do not necessarily clearly assign the variables occurring in them. This is usefully supplemented by non-deterministic needs assessment.

Strategies

Since there are no side effects, any strategies can be used in a functional logic program. To evaluate expressions, most Curry compilers use a variant of needed narrowing, which combines needs evaluation with non-deterministic search techniques. In contrast to Prolog, which uses reset procedures in search of solutions, Curry does not limit itself to any particular strategy. Rather, there are implementations by Curry, such as KiCS2 , where the user can easily select a strategy; including depth first search , breadth first search , iterative deepening or parallel search.

supporting documents

  1. Michael Hanus (ed.): Curry: A Truly Integrated Functional Logic Language .
  2. ^ Sergio Antoy and Michael Hanus: Functional Logic Programming . In: ACM (Ed.): Communications of the ACM . 53, No. 4, 2010, pp. 74-85. doi : 10.1145 / 1721654.1721675 .
  3. The Münster Curry Compiler : Source Code A mirror of an experimental branch adding type classes to the Münster Curry compiler is available at [1] . There is also a status page summarizing implemented changes and open issues.

Web links