CategoricalData / hydra

Transformations transformed
Apache License 2.0
64 stars 9 forks source link

Fix operator precedence / lots of irritating silly parentheses (LISP) #84

Open joshsh opened 1 year ago

joshsh commented 1 year ago

Both in Haskell and Java code generation, Hydra is currently over-cautious about parenthesization, leading to expressions like:

primitiveArity x = (typeArity (Graph.primitiveType x))

and

hydra.extras.Extras.typeArity(((instance.value)).codomain));

The generated code is correct, but it looks dumb when these extra parens are included. The reasons have to do with operator precedence as well as some additional quirks of Java codegen.