Lst.map;; let rec fact n = if n < 2 then 1 else n * (fact (n - 1));; fact 5;; #trace fact;; fact 4;; #trace Lst.replicate;; Lst.replicate 3 'a';; #uninstall_printer Strng.toplevel_printer;; #remove_printer Strng.toplevel_printer;; Lst.replicate 3 'a';; #untrace Lst.replicate;; #install_printer Strng.toplevel_printer;; Lst.replicate 3 'a';; ['a'; 'b'];; Strng.from_string;; Strng.of_string "asd";; Strng.to_string ['a'; 'b'; 'c'];; let p = (5,3,["*****";"hello";"*****"]);; let p = (5,3,Lst.map Strng.of_string ["*****";"hello";"*****"]);; #remove_printer Picture.toplevel_printer;; p;; #install_printer Picture.toplevel_printer;; let p1 = (5, 1, Strng.of_string "hello");; let p2 = (5, 1, Strng.of_string "world");; above;; Picture.above;; Picture.above p1 p2;; let p1 = (5, 1, [Strng.of_string "hello"]);; let p2 = (5, 1, [Strng.of_string "world"]);; Picture.above p1 p2;; Picture.stack;; Picture.stack [p1; p2; p1; p1; p2];; let rec foldr1 f = function | [] -> failwith "empty list" | [h] -> h | h :: t -> f h (foldr1 f t);; foldr1 (+) [3;4;5];; Lst.foldr;; Lst.foldr (+) 0 [3;4;5];; Lst.foldr (fun s1 s2 -> s1 ^ "," ^ s2) "" ["asd"; "qwe"; "zxc"];; foldr1 (fun s1 s2 -> s1 ^ "," ^ s2) ["asd"; "qwe"; "zxc"];; p1;; Picture.beside p1 p2;; let rec zip_with f xs ys = match (xs, ys) with | ([], _) | (_, []) -> [] | (xsh :: xst, ysh :: yst) -> f xsh ysh :: zip_with f xst yst;; zip_with (+) [1; 2] [3; 4; 5];; let h = Picture.pixer 'h';; let h = Picture.pixel 'h';; let e = Picture.pixel 'e';; Picture.beside h e;; let row s = spread (Lst.map Picture.picture s);; let row s = Picture.spread (Lst.map Picture.picture s);; let row s = Picture.spread (Lst.map Picture.pixel s);; row ['a'; 'b'; 'c'; 'd'];; open Picture;; pixel;; tile;; p00;; p01;; tile [[p00; p01; p02]; [p10; p11; p12]];; #remove_printer Picture.toplevel_printer;; tile [[p00; p01; p02]; [p10; p11; p12]];; #install_printer Picture.toplevel_printer;; empty;; empty 5 5;; #remove_printer Picture.toplevel_printer;; empty 5 5;; #install_printer Picture.toplevel_printer;;