nikos nikosn wrote:firstly, i dont know how can this "import Data.List (maximum, minimum, minimumBy)" be done in sml. i am trying to understand differences in these two languages..
I would deduce that imports the functions
maximum,
minimum and
minimumBy from the
Data.List library. Those are functions that operate on lists so
maximum m will give the maximum element of the list
m. From the usage of
minimumBy I would deduce it is a two argument function that takes a comparator (of two arguments) and a list, and returns the minimum element according to that comparator. The rest of the code looks pretty straightforward.
You should be able to deduce what
$ does from the usage...