dhall-lang / dhall-haskell

Maintainable configuration files
https://dhall-lang.org/
BSD 3-Clause "New" or "Revised" License
908 stars 211 forks source link

Document the significance of `Nothing :: Maybe CharacterSet` #2527

Open fpringle opened 11 months ago

fpringle commented 11 months ago

The Lam, Pi, Combine, CombineTypes, Prefer and Equivalent constructors of Expr all have a Maybe CharacterSet field, without any documentation describing what a Nothing would signify in this context. Based on the source code I believe Nothing means "infer the CharacterSet based on the input". If this it the case, some documentation should be added to the constructors to explain this. Alternatively, a sum-type would be more expressive e.g.

data CharacterSetSource
  = Infer
  | Specify CharacterSet