r/functionalprogramming • • May 08 '21

JavaScript How to write better JavaScript using plumbing techniques

https://piotrjaworski.medium.com/how-to-write-better-javascript-using-plumbing-techniques-68aa78be817c
16 Upvotes

5 comments sorted by

6

u/gyre_gimble May 08 '21

To write better iavascript use rescript, purescript, or even typescript. The best way to write javascript is to not to write javascript and use any of the above.

2

u/snowtigger May 08 '21

Fair enough, all things mentioned in the article also work with TypeScript.

3

u/reifyK May 09 '21

Except for the type system JS has all ingredients to efficiently write purely functional code. So I addressed the shortcoming by implementing an extended (higher-rank/kind) HM runtime type system. It allows gradual typing in Javascript. ADTs are Scott encoded. It is almost ready and the results are remarkable.

1

u/konnnyy May 15 '21

Dynamic typing is both awesome and expressive. JavaScript itself is nice to work with too.

10

u/danielo515 May 08 '21

I will always praise people spreading the functional word, but was that cryptic title necessary to refer to function composition?