Singly-linked list/Element definition: Difference between revisions

m
Line 165:
=={{header|OCaml}}==
 
This task is not idiomatic for OCaml. Usually, all data in pure functional programming is immutable, and deconstructed through [[Pattern Matching]]. OCaml already contains a built-in parametrically polymorphic list type that can take any data member type, including numeric values. These lists are then used very frequently. Because of this, lists have additional special syntactic sugar. OCaml's built-in lists, like most functional data structures, are immutable, and are deconstructed through [[Pattern Matching]].
 
An equivalent declaration for such a list type without the special syntax would look like this:
Anonymous user