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

Add a comment to `Declaration` to explain not to use it. #26

Open rupertlssmith opened 3 years ago

rupertlssmith commented 3 years ago
type Declaration
    = DeclWithComment (Comment DocComment) (String -> Declaration)
    | DeclNoComment Declaration

I added structured comments on top of stil4m/elm-syntax, which has no support for them. This meant doing strange things to shoe-horn my implementation onto it. You can just ignore this and build comments and declarations with the DSL provided. At some point I should move this off of stil4m/elm-syntax, as there are other issues that it makes hard to solve.

This type is confusing though. It is exposed so that the pretty printer module knows that kind of declaration it is dealing with.

Add a comment to explain this, and say that you should not use its constructors directly.