Functional programming using standard ML