Re: [Caml-list] New to Ocaml

2010-02-02 Thread Richard Jones
On Mon, Feb 01, 2010 at 11:18:07PM -0500, chaithanya kr wrote: Hi all. I am new to Ocaml. Just started learning recently. There's also a beginners group for learning OCaml: Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Rich. -- Richard Jones Red Hat

Re: [Caml-list] New to Ocaml

2010-02-01 Thread Erik de Castro Lopo
chaithanya kr wrote: Hi all. I am new to Ocaml. Just started learning recently. I was studying lists in ocaml. In that, suppose there is a list by name singly_list, then by saying List.length singly_list;; I will get the length of the linked list. Similarly can anyone tell me as to how

Re: [Caml-list] New to Ocaml

2010-02-01 Thread Miguel Pignatelli
let sorted_list = List.sort unsorted_list in You should also provide to List.sort a function to compare the elements of the list, the function should have type: 'a - 'a - int For basic types, like ints or chars the Pervasives.compare function would serve: # let l =