Everyone’s relationship to their tools of choice has an emotional component. Check out this talk, you might find it interesting:
“The Pervert’s Guide To Programming Languages” https://youtu.be/mZyvIHYn2zk
You can't get those in Elm.
It might make sense for other people. It doesn’t add up for me.
It’s intellectually dishonest to point to implementation bugs as fundamental flaws.
After a couple of years running in production, my opinion is that it is well-made generally.
Finding clever ways to break a technology isn’t a fair reflection of “real world” use, in my opinion.
Imagine my shock................
tail : List a -> Maybe (List a)
Nice try though.You're thinking of the partial functions from Haskell's Prelude.
You must be doing something wrong than. :)
The world is impure. Pretending it is not is just laughable. I am saying this and I am actually writing only functional code for living, but I understand when I cannot solve the problem with functional concepts.
Few example:
- now()
- random()
- runSqlQuery()
- open a file
My code might be 90% pure functions but the rest is mutations, handling non-idempotent things, dealing with state, as the world is.
How about Time.now()? :) Source of disturbance, it should not be allowed to be used in programming etc. etc.
Of course Time.now() is an effectful routine.
This is not a strange idea to “FP purist zealots” either.
How is it defined in Elm?
Time.now : Task x Posix
How is it defined in Haskell? Data.Time.Clock.getCurrentTime :: IO UTCTime
And no, you have not given any examples of using JavaScript in a type-safe way. If you think you have, it means you don’t adequately understand type-safety.
This confirms my belief that most criticisms of Elm are emotional responses, not rational ones.
Allowing arbitrary JS functions to be called from wherever would indeed break everything. Want to use `Math.random()`? Whoops! There goes referential transparency. Want to use `document.querySelector()`? Hello runtime errors my old friend. Want to use `function(x) { return x / 0; }`?
Yeah, have fun with that. I'll stay in North Korea ¯\_(ツ)_/¯