summaryrefslogtreecommitdiff
path: root/KikiD
diff options
context:
space:
mode:
Diffstat (limited to 'KikiD')
-rw-r--r--KikiD/Message.hs14
1 files changed, 9 insertions, 5 deletions
diff --git a/KikiD/Message.hs b/KikiD/Message.hs
index c4903cc..5b642f3 100644
--- a/KikiD/Message.hs
+++ b/KikiD/Message.hs
@@ -5,14 +5,18 @@ import qualified KikiD.GetLine
5import qualified Data.ByteString.Char8 as B 5import qualified Data.ByteString.Char8 as B
6import Data.Monoid 6import Data.Monoid
7import Text.Read 7import Text.Read
8import Data.Char (ord)
9import Control.Monad
8 10
9data KikiDMessage = TODO deriving (Show,Read) 11data KikiDMessage = TODO deriving (Show,Read)
10 12
11instance Serialize KikiDMessage where 13instance Serialize KikiDMessage where
12 put = putByteString . B.pack . show 14 put m = mapM_ (putWord8 . fromIntegral . ord) "TODO"
15 -- putByteString . B.pack $ show m ++ "\n"
13 get = do 16 get = do
14 x <- KikiD.GetLine.getLine 17 t <- getWord8
15 case (readEither (B.unpack x) :: Either String KikiDMessage) of 18 o <- getWord8
16 Right m -> return m 19 d <- getWord8
17 Left er -> fail ("PARSE ERROR: " <> er) 20 o <- getWord8
21 return TODO
18 22