Closed manveru closed 1 week ago
Thank you
Thanks! It was pretty surprising to not be able to call very basic pure functions in gleam in guards. It's something i do quite often in ocaml. Would be rad if gleam tracked purity somehow (??maybe not possible??) and allowed a bit more capability than erlang does here... even if it means drastically different compiled output?
i dunno, i'm a rookie. don't listen to me ;)
Hello! It's not just a matter of purity, the VM only permits certain operations in guards for performance reasons. It is not possible to support arbitrary pure expressions.
Purity tracking itself would be easy :)
I'm having a go at implementing this.
See https://www.erlang.org/doc/reference_manual/expressions.html#guard-expressions