Some OCaml packages


Cmdliner

Blocks

Man page 'flags' provided by Cmdliner:

`S section
`P paragraph
`I label-text paragraph
`Pre pre-formatted text
`Noblank suppress blank line between 2 blocks
`Blocks list of (more) blocks

From https://erratique.ch/software/cmdliner/doc/Cmdliner/Manpage/index.html

'Markup'

  • Italics: $(i, text)
  • Bold: $(b, text)

https://erratique.ch/software/cmdliner/doc/tool_man.html#doclang

  • $(tname): term name (ie, command name?)
  • $(mname): main command name
  • $(iname)

https://erratique.ch/software/cmdliner/doc/Cmdliner/Cmd/index.html#info

  • eval_ok: type for successful evaluation
  • eval_error: type for unsuccessful evaluation

https://erratique.ch/software/cmdliner/doc/Cmdliner/Cmd/index.html#eval_low

Term

  • const value: a Term that evaluates to value
  • ($) / app: function application with respect to Term

Evaluate Term to get Result, which can be used to get an exit status.

Env

Cmd

  • val v : info -> 'a Term.t -> 'a t
    • v i t is a command with information i and command line syntax parsed by Cmd.t.

Arg

Converters:

  • file: convert to file path. Also checks if the file exists ??

Hardcaml

Operations

https://github.com/janestreet/hardcaml/blob/master/docs/combinational_logic.md

  • Addition: Args must have same width, result will have that width
    • (+:): addition
    • (-:): subtraction
  • Multiplication: Args can be of different width, result will have sum of arg widths
    • (*:): unsigned multiplication
    • (*+): signed multiplication
  • (&:): logical and
  • (|:): logical or
  • (^:): logical xor
  • (:)~: logical not

Vectors:

  • Splice: select v ~high:3 ~low:2 or v.:[3,2]
  • Concatenation: v1 @ v2

menhir