seasonedcc / composable-functions

Types and functions to make composition easy and safe
MIT License
649 stars 13 forks source link

Accept plain functions in combinators #154

Closed gustavoguichard closed 2 months ago

gustavoguichard commented 2 months ago

This is a work in progress for a POC. The idea is to be able to accept any function in combinators, so we simplify their usage:

const add = (a: number, b: number) => a + b

// from:
const fn = collect({ add: composable(add), toString: map(composable(add), String) })

// to:
const fn = collect({ add, toString: map(add, String) })

TODO:

diogob commented 2 months ago

Interesting idea.

gustavoguichard commented 2 months ago

Closing it in favor of #155