- Notifications
You must be signed in to change notification settings - Fork 4
Home
The DSL may include syntax for defining the configuration type, or it may cover only functions and instances for an existing type. The former would require usage of Template Haskell, the latter could be done in plain Haskell for instance through a free monad.
-
the configuration type
Titself -
default value for
T -
validation function for
T -
instance ToJSON T -
instance FromJSON (T -> T) -
command line parsing function for
T -
possibly (in case of maybe)
instance FromJSON T -
possibly an arbitrary instance
-
possibly some test properties
-
property names between
ToJSONandFromJSONinstances -
property names could be derived from record field names
-
option names could be derived from property names or field names
-
command line help messages and config file documentation could be shared
-
ToJSONinstance could be derived fromT -
FromJSONinstances could be derived from theT(needs some parameters) -
option parser could (mostly and often) be derived from
T -
essentially all of the above could be used in test properties
-
arbitrary instance could explicitly include the default value