package traits

  1. Overview
  2. Docs

Traits

This package provides simple building blocks for generic functionality in OCaml using modules and functors. Its functionality is provided through the Traits module.

Motivation

This package was originally developed to avoid coupling of operation (such as equality or ordering comparison) with the type information. Consider this:

Int.equal 1 2

The fact that we call Int.equal carries both the operation (equal) and the type (int). The original purpose has been stated to de-couple these into separate things:

Eq.eq (module Int) 1 2

It is, however, planned to extend this package to provide more common abstractions.

OCaml

Innovation. Community. Security.