home | articles | links | fun | about
Up to: Quick math and science observations

Notes on ML programming

reduce/fold ... apply function to next item in sequence.

F(1, [2,3,4,5])

=> F(1, 2, [3,4,5])...

etc.

f( 1, f(2, f(3 ... ) ) )

WOW... i made my maxlist function!!

        fun max(x,y) = if x > y then x else y;

         fun maxlist nil = 0
         | maxlist [h] = h   
         | maxlist (h::t) = max(h, maxlist(t));

Int.toString

print integers!!

Links

Good guide, get intuition: http://www.dcs.napier.ac.uk/course-notes/sml/manual.html

Deal with errors: http://web.access.net.au/felixadv/files/output/book/a6445.html

Quick guide: http://www.cs.oswego.edu/~odendahl/manuals/ml/con.html

!!This is verbatim link !!

Another quick guide:
http://www.cs.unc.edu/~stotts/COMP204/ML/p1.html http://www.cs.unc.edu/~stotts/COMP204/ML/p2.html http://www.cs.unc.edu/~stotts/COMP204/ML/p3.html http://www.cs.unc.edu/~stotts/COMP204/ML/p4.html