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

Feature: Function for generating chains of any binary operator. #19

Open rupertlssmith opened 4 years ago

rupertlssmith commented 4 years ago

A function with this signature would be useful:

binOpChain : Expression -> BinOp -> List Expression -> Expression

Can use it to chain appends for example:

binOpChain expr append [ expr2, expr3, expr4 ]
-- expr1 ++ expr2 ++ expr3 ++ expr4