diff --git a/README.md b/README.md index 0660c59..4fa0eb2 100644 --- a/README.md +++ b/README.md @@ -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). @@ -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.