But most importantly, prototypal inheritance, in other words invoking the object's own methods as if they were pure functions is what really puts me off.
232 karma · joined May 10, 2019
But most importantly, prototypal inheritance, in other words invoking the object's own methods as if they were pure functions is what really puts me off.
That said, Haskell just feels like a different beast. I also don't know how interop would actually work with these different solutions, would feel like unnecessary complexity if anything. Only to end up losing the benefits of Haskell's strong typing.
I've been struggling to justify spending more time & effort on concepts mostly exclusive to Haskell, only to be able to be productive on it. I keep thinking I should brush up my Elixir skills instead.
Edit: Ok so I tried it. Template Haskell seems to break it, which my projects use heavily. And does not even report syntax errors in some files. Seems like yet another dead end for me as an editor setup, unfortunately.
We got a lot of books detailing various type theories, algorithmic nuances and so on in Haskell, but very little resources to actually help anyone get off the ground with practical web development.
China is as strong and determined as ever, I really don't see any way the protesters would get what they ultimately want.
What I'd do is simply break down the larger pure function into smaller pure functions and sequencing them in the monad.
This way you would still retain purity with your functions but you could log every intermediate step by simply logging their output (and its corresponding input). Would probably make the code more maintainable as well.
From what I understand Haskell has great tooling for function profiling. Unfortunately, I got no experience with these yet so I can't say if they'd help you solve such problems.
Edit: Btw sounds like property based testing might work well as a solution to this kind of problem. It works really well with pure functions.
However, you can just log the output if you like without putting IO into the function. I see zero reasons why anybody would push such logging into production. It behaves exactly the same way on your own computer as it would in production - it's just a pure function.
Whatever we may think is morally right, HK does not seem to be putting together that hard resistance, nor is it building up its own armed forces to declare and maintain independence with. China thinks HK is legally theirs and nothing we say or do will change their position over it.
That's why I don't see these protests achieving anything.
I don't understand this.
If you have a monad like
do
...
_ <- doSomething arg1
let result :: Result = pureFun arg2 arg3
...
How is that not simpler and better than having that pureFun invoke a bunch of side effects and perhaps even mutate something that you have to be aware of? How does this take away the benefits of side effect isolation?Let's say in a chat app with a Redux setup I'd maintain channel users, messages, own profile details etc. in the app's own local state. With LiveView I'd only need to store the user specific stuff in this user's own state. Some of which I'd store in the socket.assigns of Phoenix Channels subscriptions even now with a conventional Redux setup.
I'm struggling to justify spending more time on picking up Haskell myself as I can't see clearly what's at the end of that tunnel.