I have create a video to talk about the InjectOne and InjectLast operators in DIVEX.

InjectOne can be used to fix the value of one element in an array parameter whose element type is a function by allowing us to provide a function as a value for that element. The resulting function will still contain the array parameter but it will represent the remainder of the array. InjectLast also fixes the value of one element in an array parameter whose element type is a function (by allowing us to provide a function as a value for one element) but it also removes the array parameter from the resulting function, basically closing the array parameter. Like Inject, these operators allow us to supply functions that have extra parameters compared to the function represented by the array element type. The extra parameters will be bubbled up to the resulting function.

You can try the example in the browser here: https://divex.dev/try-in-the-browser-cscompose/?sample=InjectOneInjectLast

I have created a video to explain (via an example) the ReplaceOne and ReplaceLast operators in DIVEX and Composition Language 1.

ReplaceOne can be used to fix the value of one element in an array parameter by allowing us to provide a function that returns a value for one element. The resulting function will still contain the array parameter but it will represent the remainder of the array. ReplaceLast also fixes the value of one element in an array parameter (by allowing us to provide a function that returns a value) but it also removes the array parameter from the resulting function, basically closing the array parameter.

You can try the example in the browser: https://divex.dev/try-in-the-browser-cscompose/?sample=ReplaceOneReplaceLast

In this video, I demonstrate the ApplyOne and ApplyLast operators.

ApplyOne can be used to fix the value of one element in an array parameter. The resulting function will still contain the array parameter but it will represent the remainder of the array. ApplyLast also fixes the value of one element in an array parameter but it also removes the array parameter from the resulting function, basically closing the array parameter.

You can try this example in the browser here: https://divex.dev/try-in-the-browser-cscompose/?sample=ApplyOneApplyLast

In this video I compare the partial application feature of F# with DIVEX.

In F#, you need to fix all the dependencies of low-level functions before you pass them as arguments to high level functions (using partial application). When using DIVEX, you can inject low-level functions as arguments for high-level functions without fixing all the dependencies of low-level functions. This allows us to create potentially-pure functions and compose them without injecting impure functions. We can delay the injection of impure functions to the last possible moment.

The source code is here: https://github.com/ymassad/DivexExamples/tree/main/DivexVersusFSharpPartialApplication

This example cannot be tried in the browser. To try it, you need to download the DIVEX visual studio extension from http://divex.dev

In this video I show an example of Dependency Injection where functions and types and defined using F# and where functions are composed using Composition Language 1.

Because DIVEX allows injection of a function, say function 1, into another function, say function 2, even if function 1 has extra parameters compared to the dependency parameter defined in function 2, we can delay the injection of impure dependencies to the last possible moment.

The source code is here: https://github.com/ymassad/DivexExamples/tree/main/DependencyInjectionFSharp

The code in this example is based on code from fsharpforfunandprofit.com (see https://fsharpforfunandprofit.com/posts/dependencies-2/).

The license for the original code can be found here: https://fsharpforfunandprofit.com/about/license/

You can download the DIVEX Visual Studio extension from https://divex.dev

In this video, I demonstrate a larger example of DIVEX and Composition Language 1: The Document Translation example.

In this example functions and types are defined using F#. Because this example is relatively large, it better demonstrates the benefits of DIVEX and Composition Language 1.

You cannot try this example in the browser. If you want to try it you have to download the Visual Studio extension from https://divex.dev

Source code can be found here: https://github.com/ymassad/DivexExamples/tree/main/DocumentTranslationFSharp

I have created a video about the JoinAllInputs operator. This operator will join or merge all parameters of a function that are of the same name.

You can try this example in the browser here: https://divex.dev/try-in-the-browser-cscompose/?sample=JoinAllInputs

In this video I talk about the JoinByType operator. This operator can join or merge two or more parameters of the same type.

You can try the example in the browser here: https://divex.dev/try-in-the-browser-cscompose/?sample=JoinByType

In this video I talk about the JoinByName operator in DIVEX and Composition Language 1.

The JoinByName operator allows you to join or merge two parameters of a function that have the same name. DIVEX functions are allowed to have parameters with the same name. This can happen for example if you inject two functions into a function, and these two functions have parameters with the same name.

You can try the example in the browser here: https://divex.dev/try-in-the-browser-cscompose/?sample=JoinByName

In this video I talk about the Inject operator in DIVEX and Composition Language 1. The Inject operator allows you to inject a function as a value for a parameter whose type is a function. The special thing about this operator is that the injection will work even if the injected function has extra parameters. These parameters will be bubbled up to the resulting function.

You can try this example in the browser: https://divex.dev/try-in-the-browser-cscompose/?sample=Inject