Skip to content
/ loop Public

Unbounded loops with early breaks and continues for OCaml 5.

License

Notifications You must be signed in to change notification settings

leostera/loop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

loop

A small control-flow utility for unbounded loops with support for break and continueing loops.

By default it will loop infinitely, but it won't get in the way of unbounded exceptions or other unhandled effects.

Getting Started

opam install loop

Usage

The usage should feel rather natural:

  1. start a loop
  2. call continue or break as you see fit

Examples

Here's a small REPL:

let repl () =
  let open Loop in
  loop (fun () ->
    let expr = read () in
    let result = eval expr in
    print result;
    match result with
    | Exit -> break ()
    | _ -> ())

About

Unbounded loops with early breaks and continues for OCaml 5.

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Languages