Talk:Algebraic data types: Difference between revisions

no edit summary
(describe distinction)
No edit summary
Line 2:
:Actually, I think this is an ideal example of a key functional programming loanguage capability. Most functional programming pattern matching examples use very trivial patterns which could just as easily be implemented with an imperative switch statement. This example shows how pattern matching can simplify rather complex decision making. Regex stuff is rather primitive by comparison. There are only a handful of programming languages that are powerful enough to implement this example, so I don't expect this page to grow very large. --[[User:IanOsgood|IanOsgood]] 08:01, 7 November 2007 (MST)
:There are two mostly distinct basic concepts: pattern matching/destructuring of data structures (which this task is about) and regular-expression-style text matching. There can also be systems which combine features of both; for example, [[:Category:E|E]] allows regular expressions within data-structure patterns, and uses regular-expression-style quantification within term-tree patterns. --[[User:Kevin Reid|Kevin Reid]] 11:19, 7 November 2007 (MST)
 
How about some test data?