Algebraic data types: Difference between revisions

Content added Content deleted
((remove indent and) align balance's patterns in columns for clarity)
m (→‎{{header|Tcl}}: formatting)
Line 227: Line 227:
We can then code our solution similar to Haskell:
We can then code our solution similar to Haskell:


<lang tcl>
<lang tcl>datatype define Color = R | B
datatype define Color = R | B
datatype define Tree = E | T color left val right
datatype define Tree = E | T color left val right


Line 257: Line 256:
}
}
}
}
}</lang>
}
</lang>


{{Omit from|C++}}
{{Omit from|C++}}