X-Git-Url: http://gitweb.michael.orlitzky.com/?p=dead%2Fhtsn-import.git;a=blobdiff_plain;f=src%2FConnectionString.hs;h=702cd0ef83a026c6f9a2e0ea298ef3ef8b7e551a;hp=26f81d6f620a010987cf16104ad3ed8734d6e0dd;hb=HEAD;hpb=cdd0f36ab4aa8aadc416f6b9cbe6117c26d2ddf2 diff --git a/src/ConnectionString.hs b/src/ConnectionString.hs index 26f81d6..702cd0e 100644 --- a/src/ConnectionString.hs +++ b/src/ConnectionString.hs @@ -1,12 +1,15 @@ {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE OverloadedStrings #-} --- | Definition of and instances for the ConnectionString type. +-- | Definition of and instances for the ConnectionString type. This +-- type is simply a wrapper around a 'String', but the newtype +-- allows us to give it a separate 'Default' instance. -- module ConnectionString ( ConnectionString(..) ) where +-- System imports. -- DC is needed only for the DCT.Configured instance of String. import qualified Data.Configurator as DC() import qualified Data.Configurator.Types as DCT ( @@ -17,6 +20,7 @@ import Data.Data (Data) import System.Console.CmdArgs.Default (Default(..)) import Data.Typeable (Typeable) + -- | A newtype around a string that allows us to give a more -- appropriate default value for a connection string. -- @@ -24,6 +28,7 @@ newtype ConnectionString = ConnectionString { get_connection_string :: String } deriving (Data, Show, Typeable) + instance Default ConnectionString where -- | This default is appropriate for SQLite databases which require -- no authentication and live entirely in a file (or in this case,