New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Runtime error by passing a function to an onClick #35
Comments
Doesn't Elm cause a runtime error as well in the same case? I know passing functions via messages is not 'safe' in the Elm style (nor storing them in the model). I wonder if there is a way to turn this into a compile-time error, at the very least I will leave this open to research in to doing that (no method is popping immediately to mind)... |
It uses immutability, effects and exhaustive check to do the trick. |
It fails at the 'will not see runtime errors in practice' quite a bit. There are a LOT of cases it will crash at runtime. For note, OCaml actually does quite substantially more exhaustiveness checks than Elm with a far better type system (One good way to crash the runtime involves some And Elm's effects are... more like message passing processes, not effects. |
You are so right
|
Heh, yeah I hit quite a number of them with fairly stock code when I was developing an Elm app (not even javascript related crashed, I know how to deal with the DOM), that combined with the hostile community steered me away from it, but it was still an interesting design that I wanted to pursue, however I had a lot of code that I'd have to rewrite, instead of doing that I made this |
I'm not sure if this is the best way to use TEA, but I've run into a runtime error in this situation:
I get an error on
bucklescript-tea/src/vdom.ml
Line 154 in 51403a6
because this uses ocaml.equal which doesn't like comparing functions:
The text was updated successfully, but these errors were encountered: