{-# LANGUAGE DeriveDataTypeable, RecordWildCards, OverloadedStrings #-}
module Network.IRC.Bot.Types
    ( User(..)
    , nullUser
    ) where

import Data.ByteString          (ByteString)
import Data.Data                (Data, Typeable)
import Network.Socket           (HostName)

data User = User
    { User -> ByteString
username   :: ByteString    -- ^ username on client system
    , User -> HostName
hostname   :: HostName  -- ^ hostname of client system
    , User -> HostName
servername :: HostName  -- ^ irc server client is connected to
    , User -> ByteString
realname   :: ByteString    -- ^ client's real name
    }
    deriving (Typeable User
DataType
Constr
Typeable User
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> User -> c User)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c User)
-> (User -> Constr)
-> (User -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c User))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c User))
-> ((forall b. Data b => b -> b) -> User -> User)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> User -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> User -> r)
-> (forall u. (forall d. Data d => d -> u) -> User -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> User -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> User -> m User)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> User -> m User)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> User -> m User)
-> Data User
User -> DataType
User -> Constr
(forall b. Data b => b -> b) -> User -> User
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> User -> c User
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c User
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> User -> u
forall u. (forall d. Data d => d -> u) -> User -> [u]
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> User -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> User -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> User -> m User
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> User -> m User
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c User
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> User -> c User
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c User)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c User)
$cUser :: Constr
$tUser :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> User -> m User
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> User -> m User
gmapMp :: (forall d. Data d => d -> m d) -> User -> m User
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> User -> m User
gmapM :: (forall d. Data d => d -> m d) -> User -> m User
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> User -> m User
gmapQi :: Int -> (forall d. Data d => d -> u) -> User -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> User -> u
gmapQ :: (forall d. Data d => d -> u) -> User -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> User -> [u]
gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> User -> r
$cgmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> User -> r
gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> User -> r
$cgmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> User -> r
gmapT :: (forall b. Data b => b -> b) -> User -> User
$cgmapT :: (forall b. Data b => b -> b) -> User -> User
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c User)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c User)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c User)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c User)
dataTypeOf :: User -> DataType
$cdataTypeOf :: User -> DataType
toConstr :: User -> Constr
$ctoConstr :: User -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c User
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c User
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> User -> c User
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> User -> c User
$cp1Data :: Typeable User
Data, Typeable, User -> User -> Bool
(User -> User -> Bool) -> (User -> User -> Bool) -> Eq User
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: User -> User -> Bool
$c/= :: User -> User -> Bool
== :: User -> User -> Bool
$c== :: User -> User -> Bool
Eq, Eq User
Eq User
-> (User -> User -> Ordering)
-> (User -> User -> Bool)
-> (User -> User -> Bool)
-> (User -> User -> Bool)
-> (User -> User -> Bool)
-> (User -> User -> User)
-> (User -> User -> User)
-> Ord User
User -> User -> Bool
User -> User -> Ordering
User -> User -> User
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: User -> User -> User
$cmin :: User -> User -> User
max :: User -> User -> User
$cmax :: User -> User -> User
>= :: User -> User -> Bool
$c>= :: User -> User -> Bool
> :: User -> User -> Bool
$c> :: User -> User -> Bool
<= :: User -> User -> Bool
$c<= :: User -> User -> Bool
< :: User -> User -> Bool
$c< :: User -> User -> Bool
compare :: User -> User -> Ordering
$ccompare :: User -> User -> Ordering
$cp1Ord :: Eq User
Ord, ReadPrec [User]
ReadPrec User
Int -> ReadS User
ReadS [User]
(Int -> ReadS User)
-> ReadS [User] -> ReadPrec User -> ReadPrec [User] -> Read User
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [User]
$creadListPrec :: ReadPrec [User]
readPrec :: ReadPrec User
$creadPrec :: ReadPrec User
readList :: ReadS [User]
$creadList :: ReadS [User]
readsPrec :: Int -> ReadS User
$creadsPrec :: Int -> ReadS User
Read, Int -> User -> ShowS
[User] -> ShowS
User -> HostName
(Int -> User -> ShowS)
-> (User -> HostName) -> ([User] -> ShowS) -> Show User
forall a.
(Int -> a -> ShowS) -> (a -> HostName) -> ([a] -> ShowS) -> Show a
showList :: [User] -> ShowS
$cshowList :: [User] -> ShowS
show :: User -> HostName
$cshow :: User -> HostName
showsPrec :: Int -> User -> ShowS
$cshowsPrec :: Int -> User -> ShowS
Show)

nullUser :: User
nullUser :: User
nullUser = User :: ByteString -> HostName -> HostName -> ByteString -> User
User { username :: ByteString
username   = ByteString
""
                , hostname :: HostName
hostname   = HostName
"."
                , servername :: HostName
servername = HostName
"."
                , realname :: ByteString
realname   = ByteString
""
                }