{-# LANGUAGE OverloadedStrings #-}

module Types where

import Control.Monad.Reader
import Data.ByteString
import System.IO

data Bot = Bot {
  socket :: Handle
}

type Net = ReaderT Bot IO

data Message = Message (Maybe Prefix) Command Params
               deriving (Eq, Read, Show)

-- The (optional) prefix can be either a servername or a nickname
-- with optional username and host
data Prefix = User NickName (Maybe UserName) (Maybe ServerName)
            | Server ServerName
              deriving (Eq, Read, Show)

type Command    = ByteString
type NickName   = ByteString
type Param      = ByteString
type Params     = [Param]
type ServerName = ByteString
type UserName   = ByteString
