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

`Elm.Pretty` is confusing. #15

Closed rupertlssmith closed 4 years ago

rupertlssmith commented 4 years ago

Calling the Elm.Pretty functions pretty is confusing, as there is also Pretty.pretty and they do quite different things.

Better names might be:

toDoc
buildDoc
doc
prepareLayout

I guess having Pretty.pretty renamed to Pretty.layout would also be an option.

rupertlssmith commented 4 years ago

Make it more obvious what Doc is - something that gets fed to the pretty printer.

Could also add a helper function for Doc -> String in Elm.Pretty so the pretty printer does not need to be imported seperately.