Content deleted Content added
m wikilink |
Tom.Reding (talk | contribs) m +{{Authority control}} (2 IDs from Wikidata), WP:GenFixes on |
||
Line 1:
{{
{{
{{
In [[computer science]], '''pattern matching''' is the act of checking a given '''sequence''' of [[Lexical analysis#Token|tokens]] for the presence of the constituents of some [[pattern]]. In contrast to [[pattern recognition]], the match usually has to be exact: "either it will or will not be a match." The patterns generally have the form of either [[string (computer science)|sequences]] or [[tree structure]]s. Uses of pattern matching include outputting the locations (if any) of a pattern within a token sequence, to output some component of the matched pattern, and to substitute the matching pattern with some other token sequence (i.e., [[Regular expression|search and replace]]).
Line 64:
The creations of these functions can be automated by Haskell's data [[Record (computer science)|record]] syntax.
This [[Ocaml]] example which defines a [[
<syntaxhighlight lang="ocaml">
Line 250:
==External links==
{{
{{Commons category}}
*[http://www.haskell.org/tutorial/patterns.html A Gentle Introduction to Haskell: Patterns]
*[https://archive.is/19990225161739/http://www.haskell.org/development/views.html Views: An Extension to Haskell Pattern Matching]
Line 267:
{{Strings |state=collapsed}}
{{Authority control}}
{{DEFAULTSORT:Pattern Matching}}
|