package hack_parallel

  1. Overview
  2. Docs
Parallel and shared memory library

Install

Dune Dependency

Authors

Maintainers

Sources

1.0.1.tar.gz
md5=ba7c72bc207e326b72e294fc76f6ad2c
sha512=5020d47f97bea2f88e2a40411894d03232a7f2282606926c93c7d4c96d72e94a966be852897a9b16f7e0893ba376512045abb9d93020a7c03c3def4f3d918f8e

doc/hack_parallel.hack_core/Hack_monad/Make/index.html

Module Hack_monad.MakeSource

Parameters

module M : Basic

Signature

A monad is an abstraction of the concept of sequencing of computations. A value of type 'a monad represents a computation that returns a value of type 'a.

include Infix with type 'a t := 'a M.t
Sourceval (>>=) : 'a M.t -> ('a -> 'b M.t) -> 'b M.t

t >>= f returns a computation that sequences the computations represented by two monad elements. The resulting computation first does t to yield a value v, and then runs the computation returned by f v.

Sourceval (>>|) : 'a M.t -> ('a -> 'b) -> 'b M.t

t >>| f is t >>= (fun a -> return (f a)).

Sourcemodule Monad_infix : Infix with type 'a t := 'a M.t
Sourceval bind : 'a M.t -> ('a -> 'b M.t) -> 'b M.t

bind t f = t >>= f

Sourceval return : 'a -> 'a M.t

return v returns the (trivial) computation that returns v.

Sourceval map : 'a M.t -> f:('a -> 'b) -> 'b M.t

map t ~f is t >>| f.

Sourceval join : 'a M.t M.t -> 'a M.t

join t is t >>= (fun t' -> t').

Sourceval ignore : 'a M.t -> unit M.t

ignore t = map t ~f:(fun _ -> ()).

Sourceval all : 'a M.t list -> 'a list M.t
Sourceval all_ignore : unit M.t list -> unit M.t
OCaml

Innovation. Community. Security.