What is the OCaml idiom equivalent to Python's range function?

Posted by Pramod on Stack Overflow See other posts from Stack Overflow or by Pramod
Published on 2008-10-28T16:06:33Z Indexed on 2010/05/28 1:41 UTC
Read the original article Hit count: 306

Filed under:
|

I want to create a list of integers from 1 to n. I can do this in Python using range(1, n+1), and in Haskell using: take n (iterate (1+) 1).

What is the right OCaml idiom for this?

© Stack Overflow or respective owner

Related posts about python

Related posts about ocaml