
https://www.tutorialspoint.com/execute_smlnj_online.php

fun times10(x) = 10*x;
times10(5);

times10(5.1);     
yields error; expecting int

fun square(y:real) = y*y;
square(5.1);
square(5);
square(5.0);

4::[3,5,7];
hd([4,3,5,7]);
tl([4,3,5,7]);

fun append ([],lis2) = lis2
| append(h::t,lis2) = h::append(t,lis2);
append([1,2],[3,4]);

fun length([]) = 0
| length (h::t)=1+length(t);
length([1,2,3,4,5]);

fun adder([]) = 0
| adder (h::t)=h+adder(t);
adder([1,2,3,4,5]);

let val radius = 2.7
    val pi = 3.14
in pi*radius*radius
end;

map (fn x=> x+1) [1,2,3];

val newList = map (fn x => x * x * x) [1, 3, 5];

fun add a b = a+b;
fun add5 x = add 5 x;

add5 10;



