Singly-linked list/Element definition: Difference between revisions
Singly-linked list/Element definition (view source)
Revision as of 21:58, 20 March 2022
, 2 years ago→{{header|ATS}}
m (→{{header|ATS}}) |
|||
Line 309:
=={{header|ATS}}==
<lang ATS>(* The Rosetta Code garbage-collected list type can contain any
datatype rclist_t (t : t@ype+, n : int) =
| rclist_t_nil (t, 0)
| {0 <= n} rclist_t_cons (t, n + 1) of rclist_t (t, n)
(* The Rosetta Code linear list type can contain any vt@ype and so is
dataviewtype rclist_vt (vt : vt@ype+, n : int) =
| rclist_vt_nil (vt, 0)
|