import Data.Typeable ( Typeable )
+-- | Wrapper around a list of strings (usernames).
+--
newtype Usernames =
Usernames { get_usernames :: [String] }
deriving (Data, Show, Typeable)
instance Default Usernames where
+ -- | The default list of usernames is empty.
+ --
def = Usernames []
+
instance DCT.Configured Usernames where
+ -- | This allows us to read a 'Usernames' object out of a
+ -- Configurator 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 Usernames
+ -- constructor to it.
convert (DCT.List xs) =
fmap Usernames (mapM convert_string xs)
where