Legend:
Library
Module
Module type
Parameter
Class
Class type

Various combinators for functions.

`val (|>) : 'a -> ('a -> 'b) -> 'b`

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

See ppx_pipebang for further details.

`val const : 'a -> _ -> 'a`

Produces a function that just returns its first argument.

`val ignore : _ -> unit`

Ingores its argument and returns `()`.

`val non : ('a -> bool) -> 'a -> bool`

Negates a boolean function.

`val 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.

`val apply_n_times : n:int -> ('a -> 'a) -> 'a -> 'a`

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

`val id : 'a -> 'a`

The identity function.

See also: `Sys.opaque_identity`.

`val compose : ('b -> 'c) -> ('a -> 'b) -> 'a -> 'c`

`compose f g x` is `f (g x)`.

`val flip : ('a -> 'b -> 'c) -> 'b -> 'a -> 'c`

Reverses the order of arguments for a binary function.
{"ft_lang_label":"__label__en","ft_lang_prob":0.5188291,"math_prob":0.8941581,"size":670,"snap":"2023-14-2023-23","text_gpt3_token_len":181,"char_repetition_ratio":0.12012012,"word_repetition_ratio":0.082474224,"special_character_ratio":0.24776119,"punctuation_ratio":0.16935484,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9513278,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-03-26T11:50:47Z\",\"WARC-Record-ID\":\"<urn:uuid:bdb2bee5-a8a3-4523-9f70-34bbd42bcfe4>\",\"Content-Length\":\"743938\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:4b68fab3-5903-4945-8ed5-8db65a7ca911>\",\"WARC-Concurrent-To\":\"<urn:uuid:e8908648-f69e-468b-ac48-ca88596d9b95>\",\"WARC-IP-Address\":\"51.159.83.169\",\"WARC-Target-URI\":\"https://v3.ocaml.org/u/c208440793aa1aa9d82e70e53cad6da8/base/v0.15.0/doc/Base/Fn/index.html\",\"WARC-Payload-Digest\":\"sha1:VDRV5AHHEDNE6Z4MKCXDYXWLMUKQ6Z6G\",\"WARC-Block-Digest\":\"sha1:S6CZLMYGEPNGL4SHXRLQ7MWOFLMVU5CU\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-14/CC-MAIN-2023-14_segments_1679296945472.93_warc_CC-MAIN-20230326111045-20230326141045-00411.warc.gz\"}"}