package spotlib

  1. Overview
  2. Docs
Useful functions for OCaml programming used by @camlspotter

Install

Dune Dependency

Authors

Maintainers

Sources

spotlib-4.0.3.tar.bz2
sha256=f54a8492d5071dcee88b34e47418f43c3eee4bb5a0f5c0ec93f12a129c0dc7ab
md5=32059838fd3933adc704dbc3692e036a

Description

Spotlib is a small library package used for several softwares by Jun Furuse. It is almost a poor replication of Jane Street Core, but it is small.

Published: 15 Jan 2018

README

Spotlib

Yet another extension of OCaml standard library.

Module name convension

  • X.Open: Recommended to open it when X is used

  • X.Pervasives: They are included in Spotlib.Spot. Opening Spotlib.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.

Dependencies (5)

  1. ocaml-migrate-parsetree < "2.0.0"
  2. ppx_test >= "1.6.0"
  3. jbuilder >= "1.0+beta7"
  4. ocamlfind build
  5. ocaml >= "4.04.0" & < "4.12.0"

Dev Dependencies

None

Used by (9)

  1. ocamltter >= "3.0.0"
  2. opamfind >= "1.2.0"
  3. orakuda < "1.2.0"
  4. ppx_meta_conv
  5. ppx_orakuda = "3.0.0" | >= "3.0.3"
  6. scaml < "1.5.0"
  7. spotinstall >= "1.2.1"
  8. treeprint >= "2.1.1" & < "2.3.0"
  9. unmagic

Conflicts

None

OCaml

Innovation. Community. Security.