- -- config file. By default Configurator wouldn't know what to do,
- -- so we have to tell it that we expect a list, and if that list
- -- has strings in it, we can apply the Lists constructor to
- -- it.
- convert (DCT.List xs) =
- -- mapM gives us a Maybe [String] here.
- fmap Lists (mapM convert_string xs)
- where
- convert_string :: DCT.Value -> Maybe String
- convert_string = DCT.convert
-
- -- If we read anything other than a list of values out of the file,
- -- fail.
- convert _ = Nothing
+ -- config file: by default Configurator wouldn't know what to do.
+ convert = convert_newtype_list Lists