News for hackers. Stuff that matters.
Re:Learn Functional Programming Design from Redux by the_gipsy on Tuesday August 04, 2020 @04:41AM (#24047927)
> JavaScript isn't that. It carries too much legacy baggage. Too many gotchas; too many pointy bits. It's also just super noisy.

Not only that. If you use types, and then an FP library, and then immutability, these three are at always at odds with each other.

Re:Learn Functional Programming Design from Redux by lf-non on Tuesday August 04, 2020 @05:40AM (#24048275)
Very correct.

In addition, it becomes a real pain when using generics with constraints in TS. TS doesn't support either type classes or module/namespace level generics so you end up duplicating the same constraints applied to generic parameters across several functions.

It is often easier to just use stateless classes instead and incur the runtime overhead of instantiation even if that object serves no purpose.

Re:Learn Functional Programming Design from Redux by the_gipsy on Tuesday August 04, 2020 @05:05PM (#24054492)
Can you not simply `export type T` and use `f<U extends T>`?