Search Results

Search found 3 results on 1 pages for 'romerun'.

Page 1/1 | 1 

  • multiple paramters type

    - by romerun
    I'm trying to write something like this: type 'a 'b xxx = {aaa: 'a: bbb: 'b: ccc: int};; It does not compile. Is it just syntax error, or they don't allow multiple paramters on type ? Then why ?

    Read the article

  • multiple parameters type

    - by romerun
    I'm trying to write something like this: type 'a 'b xxx = {aaa: 'a: bbb: 'b: ccc: int};; It does not compile. Is it just syntax error, or they don't allow multiple paramters on type ? Then why ?

    Read the article

  • how to get a sub list from a list in ocaml

    - by romerun
    Hi, I'm looking at the List document. It seems the library does not provide a sublist function. I'm trying to get list of elements from i to j. Now I have to write it as: let rec sublist list i j = if i j then [] else (List.nth list i) :: (sublist list (i+1) j) which is quite concise but I'm questioning the efficiency of List.nth, because if it's O(n), I would rather have to write it in a less concise way. I'm wondering why didn't they provide List.sublist func, if List.nth is not O(1), because it's such a quite common operation..

    Read the article

1