package devkit

  1. Overview
  2. Docs
Development kit - general purpose library

Install

Dune Dependency

Authors

Maintainers

Sources

devkit-1.20240429.tbz
sha256=222f8ac131b1d970dab7eeb2714bfd6b9338b88b1082e6e01c136ae19e7eaef4
sha512=c9e6d93e3d21e5530c0f4d5baca51bf1f0a5d19248f8af7678d0665bb5cdf295d7aaaaa3e50eb2e44b8720e55097cc675af4dc8ec45acf9da39feb3eae1405d5

doc/devkit.core/Devkit_core/Prelude/index.html

Module Devkit_core.PreludeSource

Useful shortcuts

Sourcemodule Enum = ExtEnum
Sourceval ($) : ('a -> 'b) -> ('c -> 'a) -> 'c -> 'b

function composition : f $ g is equivalent to (fun x -> f (g x))

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

2-function composition : f $$ g is equivalent to (fun x y -> f (g x) (g y))

Sourceval id : 'a -> 'a

identity

Sourceval identity : 'a -> 'a

idem

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

reverse arguments, flip f x y is equivalent to f y x

Sourceval apply2 : ('a -> 'b) -> ('a * 'a) -> 'b * 'b

map over 2-tuple

Sourceval some : 'a -> 'a option

some x is equivalent to Some x

Sourceval const : 'a -> unit -> 'a
  • returns

    function returning given value

Sourceval curry : (('a * 'b) -> 'c) -> 'a -> 'b -> 'c
  • returns

    curried version from function of tuple

Sourceval uncurry : ('a -> 'b -> 'c) -> ('a * 'b) -> 'c
  • returns

    function of tuple from curried function

Sourceval (!!) : 'a Lazy.t -> 'a

Lazy.force

Sourceval printfn : ('a, unit, string, unit) format4 -> 'a

printf to stdout with newline

Sourceval eprintfn : ('a, unit, string, unit) format4 -> 'a

printf to stderr with newline

Sourcemodule Fresh (T : sig ... end) () : sig ... end

abstract type generator

Sourceval tuck : 'a list ref -> 'a -> unit
Sourceval cons : 'a list -> 'a -> 'a list
Sourceval (+=) : int ref -> int -> unit
Sourceval (-=) : int ref -> int -> unit
Sourceval round : float -> float
Sourceval atoi : string -> string -> int

atoi name value

  • returns

    integer of string value

  • raises Failure

    if value is not an integer (with name and value in exception message)

Sourceval call_me_maybe : ('a -> unit) option -> 'a -> unit
OCaml

Innovation. Community. Security.