For-each in ATS using a tail-recursive function

Run Settings
LanguageATS
Language Version
Run Command
staload "share/atspre_staload.hats" extern fun process (x: int): void fun loop {n:int} (xs: list(int, n)): void = case+ xs of | list_nil () => () | list_cons (x, xs1) => let val () = process (x) in loop (xs1) end // end of [loop] implement process (x) = println!("x = ", x) implement main0 () = loop ($list {int} (1,2,3,4,5))
Editor Settings
Theme
Key bindings
Full width
Lines