(* * * * * * * * * * *
 * Resource Aware ML *
 * * * * * * * * * * *
 *
 * * *  Use Cases * *
 *
 * File:
 *   example/list_map.raml
 *
 * Author:
 *   Jan Hoffmann, Shu-Chun Weng (2014)
 *
 * Description:
 *   Some variations of list map.
 *
 *)


(* The usual list map function. *)
let rec map f l =
  match l with
    | [] -> []
    | x::xs ->
      let ys = map f xs in
      (f x)::ys


let _ =
  let f = fun c -> c * (c*c); Raml.tick 1.0 in
  let x = [1;2;3;1;3;3] in
  map f x