38 karma · joined April 14, 2023
That's exactly how lambdas (and all functions) work in actually functional languages like Haskell. And it's a good thing,lambdas shouldn't allow statements.
> how you can't pipe/chain things
Ironically after switching from Elixir to a language where I can have any operator I wish, I found myself using the equivalent of Elixir's |> only on a very rare occasion. IMO they're vastly overrated.
Elixir is afraid of most "functional concepts".
I remember a similar discussion here a couple months ago and some guy linking numerous open bug reports in Docker's repo with this very issue.
> Disclaimer. Teaching functional programming is out of scope of this project, so the documentation assumes you already know what FP is.
Personally, and some might disagree here, but I think you simply shouldn't use fp-ts before you have a solid experience with "real" FP languages, because any usage of this library is quite messy on its own (after all, JS simply wasn't created for this) and it's easy to create even more mess and get frustrated about it later on. It's also IMO a bit useless to try and teach it because in order to get a good grasp of the abstractions you'd have to practice them yourself and see how they help your real code, and it's something that's much harder to do in JS than in a language which has you covered. You'd rather start with Haskell or PureScript if you wish to learn more.
I think PureScript has the best compromise here, top-level type signatures are not enforced but if you don't include one you'll get a warning with the inferred signature. On the one hand, this is very helpful because sometimes I have a grasp for what expression I want to use, but am not sure about its type, so I simply comment out the desired signature and let the compiler tell me which direction I'm moving in, i.e. what's the type of what I just wrote. On the other hand, it being a warning also basically ensures nobody writes their top-level functions without the type signatures. Really the best of the two worlds. I think simply disallowing top-level functions without type signatures would hurt my workflow a lot.
You're talking about a company which happily pays billions in fines because its just a fraction of what they otherwise manage to get away with. They're not at all afraid of doing a lot of illegal stuff, I find it highly unlikely they'd be afraid to step into a minor grey area.
Yep, I have no dogs here either :^)
I think there are many more severe problems with Elixir which make it not even a remotely functional PL for me (rather, procedural + macros), but arguments order is not one of them.