add nickserv and a cli. Fix #2
[cloogle-irc.git] / test.icl
index fce0299..4347744 100644 (file)
--- a/test.icl
+++ b/test.icl
@@ -1,17 +1,20 @@
 module test
 
-from Data.Func import $
-import Data.Either
-import Data.Maybe
-import StdEnv
+import Gast
 import IRC
+import GenBimap
+import Data.Func
+import Data.Either
+
+import Text
+
+derive ggen IRCMessage, Either, IRCUser, IRCCommand, Maybe, CSepList, IRCNumReply, IRCReplies
+derive genShow IRCMessage, Either, IRCUser, IRCCommand, Maybe, CSepList, IRCNumReply, IRCReplies
 
-from Text import class Text(concat), instance Text String
+//Doesn't work, generates illegal irc commands with spaces in recipients
+Start = concat $ Test [] pParsePrint
 
-Start = concat $ map toString
-       [NICK "clooglebot" Nothing
-       ,USER "cloogle" "0" "cloogle" "Cloogle bot"
-       ,JOIN (CSepList ["#cloogle"]) Nothing
-       ,PRIVMSG (CSepList ["#cloogle"]) "Hello world"
-       ,QUIT Nothing
-       ]
+pParsePrint :: IRCMessage -> Bool
+pParsePrint a
+# str = toString a
+= either (const False) ((==)str o toString) $ parseIRCMessage str