package vcaml

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

A Defun.Vim.t value is a reified value corresponding to the type of a function. It is used by wrap_viml_function to produce a regular ocaml function of the correct type.

Important notes about Nil:

1. If you are wrapping a function that takes no arguments, just use return T. Do not use Nil @-> return T.

2. If you are wrapping a native (non-API) Vimscript function that does not have an explicit return statement, its implicit return is Integer 0, not Nil.

type ('f, 'leftmost_input, 'out) t
val return : 'a Type.t -> ('a Api_call.Or_error.t, unit, 'a) t

Wraps a Type.t to be used as the rightmost (return) type of this function.

val (@->) : 'a Type.t -> ('b, _, 'output) t -> ('a -> 'b, 'a, 'output) t

Add an extra argument to an existing function arity.

Using this operator, function types will look extremely closely to how the underlying OCaml type will end up. For example, a Vim function with (OCaml) type int -> string -> int -> buffer would use the arity Integer @-> String @-> Integer @-> return Buffer.