Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
mbarbin authored Sep 27, 2024
1 parent 01f9d50 commit d4c1702
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ Provider is an OCaml library for creating Traits and Interfaces. It allows you t

In essence, Provider handles dynamic dispatch, where the target of a function call is not known until runtime. This is particularly useful in situations where there are multiple ways to provide a certain functionality, and the choice of provider is determined by the end user.

This library started as an experimental project that extracted a pattern featured in the [Eio](https://github.com/ocaml-multicore/eio) project. The goal was to make this pattern reusable in other projects.

## Documentation

Published [here](https://mbarbin.github.io/provider).
Expand All @@ -20,6 +18,12 @@ Published [here](https://mbarbin.github.io/provider).

The rationale for this design is detailed in the [Eio documentation](https://github.com/ocaml-multicore/eio/blob/main/doc/rationale.md#dynamic-dispatch).

## Motivation

The Provider library started as an experimental project that extracted a pattern featured in the [Eio](https://github.com/ocaml-multicore/eio) project. The goal was to make this pattern reusable in other projects.

We then went on to use Provider as building block for the parametrization of the [Vcs](https://github.com/mbarbin/vcs) project.

## Implementation

At its core, a provider is just a pair consisting of an internal state and a virtual-table of first-class modules operating on that state. This allows dynamic dispatch, but for example doesn't include open recursion or inheritance in its execution model. This design offers an interesting balance between object-oriented and modular programming.
Expand Down

0 comments on commit d4c1702

Please sign in to comment.