Open erikjara opened 4 years ago
@erikjara fp-ts@1
had class encoding and fluent API. In this issue you can check out what were the reasons that leaded to the actual encoding.
EDIT: I'm a fp-ts
user since when the fluent API was still around. I don't miss it at all. Composing functions with pipe
and flow
is more powerful. We can create any function and compose them along with the ones from the library. With the fluent API you either have to create a function ("breaking" the fluent flow) or create a new data type extending the one from the library adding the method you're interested in.
@erikjara consider using 1.19, if you prefer the fluent api.
yarn add fp-ts@1.19.5
Also, the pipe
function was back-ported, so you'll have access to either style.
🚀 Feature request
Current Behavior
When you use any
Monad
likeOption
,Either
, etc. You need to usepipe
to mutate the wrapped result itself, for example:Desired Behavior
I saw in another languajes like Java or something else where they use an Fluent Interface for those chain operations:
also
jQuery
takes a place in Fluent API implementation:Then a desired behavior could be something like this:
Suggested Solution
Use the Polyformic this in Typescript in the
Monads
Interfaces.Who does this impact? Who is this for?
Impact all users
Describe alternatives you've considered
I can't get another alternative right now
Additional context
Your environment