the-sett/elm-syntax-dsl

falsely removes parens

Opened this issue · 1 comments

In the example

import Elm.CodeGen exposing (construct, parens, val, access)
import Elm.Pretty exposing (prettyExpression)
import Pretty exposing (pretty)

expression =
    construct "f"
        [ access
            (parens (construct "A" [ val "()" ]))
            "a"
        ]

When the expression is printed, the result is

expression |> prettyExpression |> pretty 120
--> "f A ().a"

but it should be

--> "f (A ()).a"

Thanks for the test case.