package functoria

  1. Overview
  2. Docs

Representation of module signatures.

type 'a t =
  1. | Type : 'a -> 'a t
  2. | Function : 'a t * 'b t -> ('a -> 'b) t

The type for values representing module types.

val v : 'a -> 'a t

type t is a value representing the module type t.

val (@->) : 'a t -> 'b t -> ('a -> 'b) t

x @-> y is the functor type from the module signature x to the module signature y. This corresponds to prepending a parameter to the list of functor parameters. For example:

kv_ro @-> ip @-> kv_ro

This describes a functor type that accepts two arguments -- a kv_ro and an ip device -- and returns a kv_ro.

val is_functor : _ t -> bool

is_functor t is true if t has type (a -> b) t.

val pp : 'a t Fmt.t

pp is the pretty printer for module types.

Useful module types

type job

Type for job values.

val job : job t

job is the signature for user's application main module.

type argv

The type for command-line arguments, similar to the usual Sys.argv.

val argv : argv t

argv is a value representing argv module types.

type info

The type for application about the application being built.

val info : info t

info is a value representing info module types.