Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Algaeff.Reader
SourceEffects for reading immutable environments.
module R = Algaeff.Reader.Make (struct type env = int end)
let () = R.run ~env:42 @@ fun () ->
(* this will print out 42 *)
print_int (R.read ());
(* this will print out 43 *)
R.scope (fun i -> i + 1) (fun () -> print_int (R.read ()));
(* this will print out 42 again *)
print_int (R.read ())
This should be equivalent to Unmonad
applying to the standard reader monad.