A Template for Single-File Programs

The following code template, which is available on-line, is designed for constructing a single-file program in ATS:

(*
**
** This is a template for a single-file ATS program
**
*)

(* ****** ****** *)

(*
** please do not change unless you know what you do
*)
//
staload _(*anon*) = "libc/SATS/stdio.sats"
//
staload _(*anon*) = "prelude/DATS/array.dats"
staload _(*anon*) = "prelude/DATS/array0.dats"
//
staload _(*anon*) = "prelude/DATS/list.dats"
staload _(*anon*) = "prelude/DATS/list0.dats"
staload _(*anon*) = "prelude/DATS/list_vt.dats"
//
staload _(*anon*) = "prelude/DATS/matrix.dats"
staload _(*anon*) = "prelude/DATS/matrix0.dats"
//
staload _(*anon*) = "prelude/DATS/option.dats"
staload _(*anon*) = "prelude/DATS/option0.dats"
//
staload _(*anon*) = "prelude/DATS/pointer.dats"
//
staload _(*anon*) = "prelude/DATS/reference.dats"
//
(* ****** ****** *)

//
// please write you program in this section
//

(* ****** ****** *)

implement main () = () // a dummy implementation for [main]

Each line starting with the keyword staload essentially allows the ATS compiler atsopt to gain access to the definition of certain library functions. I will cover elsewhere in the book the topic on programming with library functions in ATS.