Anonymous user
Algebraic data types: Difference between revisions
no edit summary
No edit summary |
|||
Line 8:
{{trans|Haskell}}
In E, a pattern can be used almost anywhere a variable name can. Additionally, there are two operators used for pattern matching idioms: <
Both of those operators are defined in terms of the basic bind/match operation: <
def balance(tree) {
Line 51:
=={{header|Haskell}}==
<
data Color = R | B
data Tree a = E | T Color (Tree a) a (Tree a)
Line 70:
| otherwise = s
T _ a y b = ins s
</
=={{header|OCaml}}==
|