package spotlib
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=d6b19a0d6c4753d64eb6ebf0dcea7578b3dfde019c039b41f024ae4c03f7624c
md5=1b8cc7a0e15c35935bc9680c4e77e768
README.md.html
Spotlib
Yet another extension of OCaml standard library.
Module name convension
X.Open
: Recommended to open it whenX
is usedX.Pervasives
: They are included inSpotlib.Spot
. OpeningSpotlib.Spot
make them available.
Function name convension
Functions of stdlib are kept as they are. Only the exception is the conversions of non tail recursions to tail recursions.
Tail recursion
Non tail recursive functions in stdlib may be replaced by tail recursive equivalents. In that case, the original functions xxx
in stdlib should be accessible by xxx_ntr
.
Exception
Some functions xxx
do not raise exceptions even for strange inputs. xxx_exn
may throw exceptions for the strange inputs.
For example, List.take 10 [] = []
following the behaviour of Haskell's take
. take_exn
throws Invalid_argument "List.take"
instead.
Option
Many stdlib functions xxx
throw exceptions Not_found
when searching fails. xxx_opt
returns None
instead.
Default
Many stdlib functions may raise exceptions for some inputs. xxx_def
never throws exceptions for such inputs. Ex. String.sub
and String.sub_default
: String.sub "hello" 3 5
throws an exception, but String.sub_default "hello" 3 5 = "lo"
.
Function type convension
No labels for basic functions. Proposes to use flip, flip2... instead.