fp-ts icon indicating copy to clipboard operation
fp-ts copied to clipboard

Implement Auto Currying

Open jleider opened this issue 3 years ago • 3 comments
trafficstars

🚀 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+

jleider avatar Dec 30 '21 16:12 jleider

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.

DenisFrezzato avatar Dec 30 '21 18:12 DenisFrezzato

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.

drizzer14 avatar Dec 31 '21 14:12 drizzer14

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

enricopolanski avatar Dec 31 '21 17:12 enricopolanski