Singly-linked list/Element definition: Difference between revisions

Content added Content deleted
Line 310: Line 310:


<lang ATS>(* The Rosetta Code linear list type can contain any vt@ype.
<lang ATS>(* The Rosetta Code linear list type can contain any vt@ype.
(The ‘@’ means it doesn’t have to be the size of a pointer. You can
(The ‘@’ means it doesn’t have to be the size of a pointer.
read {0 <= n} as ‘for all non-negative n’. *)
You can read {0 <= n} as ‘for all non-negative n’. *)
dataviewtype rclist_vt (vt : vt@ype+, n : int) =
dataviewtype rclist_vt (vt : vt@ype+, n : int) =
| rclist_vt_nil (vt, 0)
| rclist_vt_nil (vt, 0)