package GT

  1. Overview
  2. Docs
Generic programming with extensible transformations

Install

Dune Dependency

Authors

Maintainers

Sources

v0.4.2.tar.gz
sha256=d23fb8e20ca28ec9ae07feee45b39aee8fb87ab11ec55211e2365f2c5a1c4ccf
sha512=0ade04e78a4d8e24acf24d3e4cdf358532d68284fa8e801b25bdf21c3c0483bb97d1350e86abcf9f93efec870b07f0f067a5dccae81686b14265baab3a4e7c13

doc/GT.common/GTCommon/Plugin_intf/index.html

Module GTCommon.Plugin_intf

Base class type that all trait should follow.

For single type declaration

type ('a, 'b, ...) typ = ...

plugin generate a plugin class called traitnname_typ_t and a transformation function called traitname_t.

Generated transformation functions can make use of inherited attribute for type parameter (which is being generated by method typ_g#inh_of_param) or simply ignore it. For example, transformation function for type parameter 'a can have types either 'a -> 'sa (see plugins Show and Gmap as examples) or 'ia -> 'a -> 'sa.

type plugin_args = (Ppxlib.longident * Ppxlib.expression) list

A type that stores additional arguments passed to each plugin.

class virtual ['loc, 'exp, 'typ, 'type_arg, 'ctf, 'cf, 'str, 'sign] typ_g : object ... end

Base class type for all plugins.

module Make (AstHelpers : GTHELPERS_sig.S) : sig ... end

Functor that takes AST construction functions for a specific backend and constructs a plugin object.

module type MAKE = functor (AstHelpers : GTHELPERS_sig.S) -> sig ... end
OCaml

Innovation. Community. Security.