the-sett / elm-syntax-dsl

A DSL for creating Elm syntax trees and pretty printing Elm source code.
BSD 3-Clause "New" or "Revised" License
20 stars 4 forks source link

Improve API for common infix binary #13

Closed showell closed 4 years ago

showell commented 5 years ago

I think most folks will want to to ignore infixNon (as discussed on chat w/Rupert). Also, it's probably intuitive to have the params in the order that you most naturally write code.

Here's my helper to demonstrate:

binOp expr1 op expr2 =
    -- CG.infixNon may be deprecated eventually
    CG.opApply op CG.infixNon expr1 expr2
showell commented 4 years ago

I think we discussed eliminating infixNon based on the idea that the pretty printer already knows how to figure out associativity?