Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Curry (programming language)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Functional patterns=== 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: <syntaxhighlight lang="haskell"> last (ys++[e]) = e </syntaxhighlight> Haskell does not allow such a declaration since the pattern in the left-hand side contains a defined function ({{Mono|++}}). Such a pattern is also called ''functional pattern''.<ref>{{cite book |last1=Sergio |first1=Antoy |last2=Hanus |first2=Michael |title=Logic Based Program Synthesis and Transformation |chapter=Declarative Programming with Function Patterns |series=Lecture Notes in Computer Science |year=2006 |doi=10.1007/11680093_2 |volume=3901 |pages=6β22 |isbn=978-3-540-32654-0}}</ref> Functional patterns are enabled by the combined functional and logic features of Curry and support concise definitions of tasks requiring deep pattern matching in hierarchical data structures.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)