gcanti / fp-ts

Functional programming in TypeScript
https://gcanti.github.io/fp-ts/
MIT License
10.89k stars 503 forks source link

Implement Auto Currying #1644

Open jleider opened 2 years ago

jleider commented 2 years ago

🚀 Feature request

@drizzer14 has put together a really cool feature that seems like it would be a great addition to fp-ts.

https://v10i.dev/p/auto-currying-in-typescript

The one downside is it requires TS v4.2.2+ which the current 2.x line only supports 3.5+

Current Behavior

There isn't one that I am aware of.

Who does this impact? Who is this for?

Anyone wanting to curry a 2+-ary function.

Your environment

Software Version(s)
fp-ts 2.11
TypeScript 4.2.2+
DenisFrezzato commented 2 years ago

That curry function is not type safe (as well as compose) Playground. fp-ts had them, but then they were removed because of this issue, so I don't think they would be welcome here.

drizzer14 commented 2 years ago

Hello people! Thanks for mentioning my fun experiment here.

I totally agree with @DenisFrezzato about my functions not being type-safe; this issue of his is absolutely valid and I don't have a solution to broken generics as of now. I also don't know if it's even possible to have my types work when generic functions are supplied to them, but will take some time and think about it.

enricopolanski commented 2 years ago

This is a relevant typescript issue for who's interested.