X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2FUsernames.hs;h=6aec228ed06397873a3dc496afcf221f5dc9a19c;hb=dad4547feb83fcc2035df684936cedba6272a86f;hp=92e5c4376f77fc2416044941ee3457f0597727cc;hpb=d7c6b5499c0969b6e488d9fc583f93bbb4e3d4c7;p=dead%2Fhalcyon.git diff --git a/src/Usernames.hs b/src/Usernames.hs index 92e5c43..6aec228 100644 --- a/src/Usernames.hs +++ b/src/Usernames.hs @@ -15,16 +15,26 @@ import System.Console.CmdArgs.Default ( Default(..) ) 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