package base

  1. Overview
  2. Docs
Full standard library replacement for OCaml

Install

Dune Dependency

Authors

Maintainers

Sources

v0.16.3.tar.gz
md5=04572fc23a4651604cfcab83f720cb4c
sha512=69380ed392faf4495459f97f70a10a6959fce71d2e6ba093472fc272141646307fd7872407de855dfa48ef0435f6587eae5aa50f4a67eac40a9e1946d0c3c070

doc/base/Base/Fn/index.html

Module Base.FnSource

Various combinators for functions.

Sourceval (|>) : 'a -> ('a -> 'b) -> 'b

A "pipe" operator. x |> f is equivalent to f x.

See ppx_pipebang for further details.

Sourceval const : 'a -> _ -> 'a

Produces a function that just returns its first argument.

Sourceval ignore : _ -> unit

Ignores its argument and returns ().

Sourceval non : ('a -> bool) -> 'a -> bool

Negates a boolean function.

Sourceval forever : (unit -> unit) -> exn

forever f runs f () until it throws an exception and returns the exception. This function is useful for read_line loops, etc.

Sourceval apply_n_times : n:int -> ('a -> 'a) -> 'a -> 'a

apply_n_times ~n f x is the n-fold application of f to x.

Sourceval id : 'a -> 'a

The identity function.

See also: Sys.opaque_identity.

Sourceval compose : ('b -> 'c) -> ('a -> 'b) -> 'a -> 'c

compose f g x is f (g x).

Sourceval flip : ('a -> 'b -> 'c) -> 'b -> 'a -> 'c

Reverses the order of arguments for a binary function.

OCaml

Innovation. Community. Security.