Algebraic data types: Difference between revisions

Content added Content deleted
m (→‎{{header|Phix}}: syntax coloured, made runnable and p2js/linux compatible)
(Rename task name. Justification: The task highlights algebraic data types and has marginal to do with switch case. Further it is a more complex application.)
Line 1: Line 1:
{{task|Data Structures}}
{{task|Algebraic data types}}


Some languages offer direct support for [[wp:Algebraic_data_type|algebraic data types]] and pattern matching on them. While this of course can always be simulated with manual tagging and conditionals, it allows for terse code which is easy to read, and can represent the algorithm directly.
Some languages offer direct support for [[wp:Algebraic_data_type|algebraic data types]] and pattern matching on them. While this of course can always be simulated with manual tagging and conditionals, it allows for terse code which is easy to read, and can represent the algorithm directly.