Content deleted Content added
m Task 70: Update syntaxhighlight tags - remove use of deprecated <source> tags |
Coreydragon (talk | contribs) |
||
Line 40:
It is nearly a superset of Haskell, lacking support mostly for overloading using [[Polymorphism (computer science)#Subtyping|type classes]], which some implementations provide anyway as a language extension, such as the Münster Curry Compiler.<ref>[http://danae.uni-muenster.de/curry/ The Münster Curry Compiler]</ref>
==Foundations of
===Basic
A functional program is a set of functions defined by equations or rules. A functional computation consists of replacing subexpressions by equal (with regards to the function definitions) subexpressions until no more replacements (or reductions) are possible and a value or normal form is obtained. For instance, consider the function double defined by
Line 108:
}}</ref> proved in the 1990s that a particular narrowing strategy, ''needed narrowing'', is optimal in the sense of doing a number of reductions to get to a "normal form" corresponding to a solution that is minimal among sound and complete strategies. Needed narrowing corresponds to a lazy strategy, in contrast to the [[SLD resolution|SLD-resolution]] strategy of [[Prolog]].
===Functional
The rule defining {{Mono|last}} shown above expresses the fact that the actual argument must match the result of narrowing the expression {{Mono|ys++[e]}}. Curry can express this property also in the following more concise way:
|