small range library for OCaml
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/ISSUE_TEMPLATE Update bug_report.md Dec 5, 2018
docs
src
.gitignore
CONTRIBUTING.md
LICENSE
README
range.opam

README

Range Library

This small library has two goals :
   * enable to fold a sequence of integers like a list
   * split a range, making distributed computing easy

Example of usage

    (* print numbers between 100 and 200 *)
     Range.(from 100 200 |> iter (Printf.printf "%d\n"));;

     (* print sum of all values between 1 and 50 *)
     Range.(from 1 50 |> fold (+) 0 |> print_int);;
     
     (* print sum of all values between 1 and 50, adding 4 to all elements and excluding 53 *)
     Range.(from 1 50 |> map ((+) 4) |> filter ((!=) 53) |> fold (+) 0 |> print_int);;
     
     
     API documentation available at : https://aldrikfr.github.io/range/