Archived
1
0
Fork 0

Some API refactoring.

I can't say how I hate the Types.hs thing in Haskell!
This commit is contained in:
Julien Dessaux 2011-04-24 23:08:06 +02:00
parent d4be110200
commit 864a364da9
7 changed files with 47 additions and 51 deletions

View file

@ -1,28 +1,14 @@
module Hsbot.Config
( Config (..)
, TLSConfig (..)
, defaultConfig
( defaultConfig
, defaultTLSConfig
, noSSL
) where
import Control.Concurrent.Chan
import Network
import qualified Network.IRC as IRC
import Network.TLS
import Network.TLS.Extra
import Hsbot.Message
data Config = Config
{ configErrors :: Maybe String
, configTLS :: TLSConfig
, configAddress :: String
, configPort :: PortID
, configChannels :: [String]
, configNicknames :: [String]
, configRealname :: String
, configPlugins :: [(String, Chan Message -> Chan Message -> IO ())]
}
import Hsbot.Types
defaultConfig :: Config
defaultConfig = Config
@ -35,15 +21,6 @@ defaultConfig = Config
, configRealname = "The One True bot, with it's haskell soul."
, configPlugins = [] }
data TLSConfig = TLSConfig
{ sslOn :: Bool
, sslCert :: String
, sslKey :: String
, sslVersions :: [Network.TLS.Version]
, sslCiphers :: [Network.TLS.Cipher]
, sslVerify :: Bool
} deriving (Show)
defaultTLSConfig :: TLSConfig
defaultTLSConfig = TLSConfig
{ sslOn = True