seasonedcc / composable-functions

Types and functions to make composition easy and safe
MIT License
666 stars 14 forks source link

Domain function composition #9

Closed diogob closed 2 years ago

diogob commented 2 years ago

Purpose

To be able to write domain functions that depend on the result of other domain functions without having to write a bunch of boilerplate.

Technical details

Since every domain function takes 2 arguments and returns a Promise<Result<Output>> we have to define some semantics for our composition: