mdgriffith / design-discussion-elm-ui-2

A repo for discussing changes to Elm UI 2
17 stars 0 forks source link

Consider replacing attribute lists with builder pattern #4

Open jhbrown94 opened 4 years ago

jhbrown94 commented 4 years ago
myfunc attrs ...  =
...
 button ([Font.color blue] ++ attrs) {label = ..., onPress = ...}

seems uglier than something like

button |> Font.withColor blue |> attrs |> build {label = ..., onPress = ...}

With this change, one can compose attributes arguments with >>:

 ...
 myfunc (Font.color red >> Font.size large >> Font.underline) ...