packages feed

lambdabot 4.0 → 4.1

raw patch · 232 files changed

+33175/−17784 lines, 232 filesdep +QuickCheckdep +arraydep +arrowsdep −fpsdep −haskell98new-component:exe:ftnew-component:exe:quickchecknew-component:exe:smallchecknew-uploaderbinary-added

Dependencies added: QuickCheck, array, arrows, binary, bytestring, containers, directory, oeis, old-time, pretty, process, random, regex-compat, regex-posix, zlib

Dependencies removed: fps, haskell98

Files

AUTHORS view
@@ -1,5 +1,6 @@ Andrew J. Bromage <ajb@spamcop.net> aka Pseudonym on #haskell     * the 'bot itself+    * @free  Shae M. Erisson <shae@ScannedInAvian.com> aka shapr on #haskell     * FactModule@@ -30,7 +31,7 @@     * New build system, 6.4 port     * dynamic module loading with hs-plugins     * Simplfied module interface-    * @babel, @plugs, @version, @code, @spell, @djinn, @unlambda, @hylo, @freshname+    * @babel, @plugs, @version, @code, @spell, @djinn, @unlambda, @hylo, @freshname, @ft, @src     * Offline mode     * General hacking     * Cabalised build system@@ -99,3 +100,11 @@ Pete Kazmier <pete-lambdabot@kazmier.com>     * Url page title chaser     * Contextual messages++Stefan O'Rear <stefanor@cox.net> aka sorear on #haskell+    * @nazi-on, @nazi-off, @activity+    * Non-flat nick namespace+    * Separation of servers out of base++Spencer Janssen <sjanssen@cse.unl.edu> aka sjanssen on #haskell+    * @undo, @redo
Boot.hs view
@@ -30,11 +30,11 @@ import System.Exit            ( exitFailure )  lambdabotMain :: [Char]-lambdabotMain = lambdaPath ++ "Main.o" -- entry point into yi lib+lambdabotMain = lambdaPath ++ "DMain.o" -- entry point into lambdabot lib  -- path to plugins lambdaPath :: String-lambdaPath = "./dist/build/lambdabot/lambdabot-tmp/"+lambdaPath = "./dist/build/"  mainSym :: Symbol mainSym  = "dynmain"        -- main entry point
+ COMMANDS view
@@ -0,0 +1,47 @@+babel provides: babel+base has no visible commands+bf provides: bf+check provides: check+compose provides: . compose+dice provides: dice+dict provides: dict dict-help all-dicts devils easton elements foldoc gazetteer hitchcock jargon lojban vera web1913 wn world02+djinn provides: djinn djinn-add djinn-del djinn-env djinn-names djinn-clr djinn-ver+dummy provides: eval choose id read show dummy bug get-shapr faq paste learn map shootout botsnack wiki oldwiki docs source fptools+elite provides: elite+eval provides: run let undefine+fact provides: fact fact-set fact-delete fact-cons fact-snoc fact-update+figlet provides: figlet figlet'+free provides: free+fresh provides: freshname+ft provides: ft+haddock provides: index+help provides: help+hoogle provides: hoogle hoogle++instances provides: instances instances-importing+karma provides: karma karma+ karma- karma-all+localtime provides: time localtime localtime-reply+log has no visible commands+more provides: more+pl provides: pointless pl-resume pl+pointful provides: pointful pointy repoint unpointless unpl unpf+poll provides: poll-list poll-show poll-add choice-add vote poll-result poll-close poll-remove+pretty provides: pretty+quote provides: quote remember ghc fortune yow arr yarr keal b52s brain palomer girl19 v yhjulwwiefzojcbxybbruweejw protontorpedo+search provides: gwiki google wikipedia gsite+seen provides: users seen+slap provides: slap+small provides: scheck+source provides: src+spell provides: spell spell-all+state has no visible commands+system provides: echo list listchans listmodules uptime+tell provides: tell ask messages messages? clear-messages+todo provides: todo todo-add+topic provides: topic-tell topic-cons topic-snoc topic-tail topic-init topic-null+type provides: type kind+undo provides: undo redo+unlambda provides: unlambda+url provides: url-title tiny-url+version provides: version+vixen provides: vixen+where provides: where url what where+
− COPYING
@@ -1,22 +0,0 @@-Copyright (c) 2003 Andrew J. Bromage-Portions Copyright (c) 2003 Shae Erisson, Sven M. Hallberg, Taylor Campbell-Portions Copyright (c) 2003-2006 Members of the AUTHORS file--Permission is hereby granted, free of charge, to any person obtaining-a copy of this software and associated documentation files (the-"Software"), to deal in the Software without restriction, including-without limitation the rights to use, copy, modify, merge, publish,-distribute, sublicense, and/or sell copies of the Software, and to-permit persons to whom the Software is furnished to do so, subject-to the following conditions:--The above copyright notice and this permission notice shall be included-in all copies or substantial portions of the Software.--THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY-KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE-WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Config.hs view
@@ -3,23 +3,14 @@ -- module Config where -data Protocol = Irc | Xmpp- -- | The 'Config' type provides configurations for lambdabot. It is used --   when lambdabot is started to determine the name of lambdabot, what --   IRC-network lambdabot should join, which channels lambdabot should --   join upon successful connection, etc. -- data Config = Config {-        name      :: String,        -- ^ The nickname of lambdabot-        userinfo  :: String,        -- ^ The userinfo string for lambdabot-        host      :: String,        -- ^ Host to join-        port      :: Int,           -- ^ The port number to use on the host-        protocol  :: Protocol,      -- ^ either irc or xmpp/jabber         verbose   :: Bool,          -- ^ Should lambdabot be verbose?         textwidth :: Int,           -- ^ How many columns should we use-        autojoin  :: [String],      -- ^ List of channels to autojoin-        admins    :: [String],      -- ^ List of nicknames that are admins         proxy     :: Maybe ([Char], Integer), -- ^ A proxy given as                                               --   a pair of host and port. @@ -39,7 +30,11 @@         commandPrefixes :: [String],          -- what prefixes to use for Haskell evalution-        evalPrefixes :: [String]+        evalPrefixes :: [String],++        -- particular commands we'd like to disable+        -- (to disable whole plugins, remove them from Modules.hs)+        disabledCommands :: [String] }  --@@ -47,25 +42,9 @@ -- config :: Config config = Config {-        name            = "lambdabot",-        userinfo        = "Lambda_Robots:_100%_Loyal",-        host            = "chat.freenode.net",-        protocol        = Irc,--        port            = 6667,         verbose         = True,         textwidth       = 350,-        proxy           = Just ("www-proxy",3128),-        autojoin        = ["#haskell","#haskell-blah","#flippi"-                          ,"#haskell-overflow","#gentoo-haskell"-                          ,"#haskell_ru", "#darcs" ,  "#perl6"-                          ,"#haskell.it","#haskell.se", "#haskell.es","#ScannedInAvian"],---        admins          = [-                "Pseudonym",    "shapr", "Heffalump",    "Igloo",-                "Cale",         "dons", "TheHunter",    "musasabi"-        ],+        proxy           = Nothing, -- Just ("www-proxy",3128),          fortunePath     = "/home/dons/fortune/",         fptoolsPath     = "/home/dons/fptools",@@ -74,5 +53,8 @@         outputDir       = "State/",          commandPrefixes = ["@","?"],-        evalPrefixes   = [">"]+        evalPrefixes    = [">"],++        disabledCommands = ["state"]+    }
+ DMain.hs view
@@ -0,0 +1,10 @@+module DMain where++import LMain+import DynModules+import Shared++------------------------------------------------------------------------++dynmain :: DynLoad  -> IO ()+dynmain fn = main' (Just fn) modulesInfo
+ DynModules.hs view
@@ -0,0 +1,2 @@++MODULES Base System Dynamic : Dict Dummy Karma Quote Seen State Topic Type Eval Babel Version More Pl Help Dice Search Vixen Fact Todo Spell Haddock Hoogle Where Elite Localtime Poll Djinn Pretty Compose Lambda Unlambda Log Slap DrHylo Instances Fresh Tell Url Free Undo BF FT Check Small Figlet
− IRC.hs
@@ -1,331 +0,0 @@------ | The IRC module processes the IRC protocol and provides a nice API for sending---   and recieving IRC messages with an IRC server.----module IRC ( IrcMessage-           , readerLoop-           , writerLoop-           , offlineReaderLoop-           , offlineWriterLoop-           , privmsg-           , quit-           , timeReply-           , errShowMsg -- TODO: remove-           , user-           , setNick-           ) where--import Message-import Lib.Util (split, breakOnGlue, clean)-import qualified Lib.Util as Util (concatWith) --import Data.List (isPrefixOf)-import Data.Char (chr,isSpace)--import Control.Concurrent-import Control.Exception-import Control.Monad.Trans ( MonadIO, liftIO )-import Control.Monad (when)--import System.IO (Handle, hGetLine)-import System.Console.Readline  (readline, addHistory)--import qualified Data.ByteString.Char8 as P (pack, hPut, hPutStrLn)----- | An IRC message is a prefix, a command and a list of parameters.-data IrcMessage-  = IrcMessage {-        msgPrefix   :: !String,-        msgCommand  :: !String,-        msgParams   :: ![String]-  }-  deriving (Show)--instance Message IrcMessage where-    nick        = IRC.nick-    fullName    = IRC.fullName-    names       = IRC.names-    channels    = IRC.channels-    joinChannel = IRC.join-    partChannel = IRC.part-    getTopic    = IRC.getTopic-    setTopic    = IRC.setTopic-    body        = IRC.msgParams-    command     = IRC.msgCommand---- | 'mkMessage' creates a new message from a cmd and a list of parameters.-mkMessage :: String -- ^ Command-          -> [String] -- ^ Parameters-          -> IrcMessage -- ^ Returns: The created message--mkMessage cmd params = IrcMessage { msgPrefix = "", msgCommand = cmd, msgParams = params }---- | 'nick' extracts the nickname involved in a given message.-nick :: IrcMessage -> String-nick = fst . breakOnGlue "!" . msgPrefix---- | 'fullName' extracts the full user name involved in a given message.-fullName :: IrcMessage -> String-fullName = snd . breakOnGlue "!" . msgPrefix---- | 'channels' extracts the channels a IrcMessage operate on.-channels :: IrcMessage -> [String]-channels msg-  = let cstr = head $ msgParams msg-    in map (\(x:xs) -> if x == ':' then xs else x:xs) (split "," cstr)-           -- solves what seems to be an inconsistency in the parser---- | 'privmsg' creates a private message to the person designated.-privmsg :: String -- ^ Who should recieve the message (nick)-        -> String -- ^ What is the message?-        -> IrcMessage -- ^ Constructed message-privmsg who msg = if action then mkMessage "PRIVMSG" [who, ':':(chr 0x1):("ACTION " ++ clean_msg ++ ((chr 0x1):[]))]-                            else mkMessage "PRIVMSG" [who, ':' : clean_msg]-    where cleaned_msg = case concatMap clean msg of-              str@('@':_) -> ' ':str-              str         -> str-          (clean_msg,action) = case cleaned_msg of-              ('/':'m':'e':r) -> (dropWhile isSpace r,True)-              str             -> (str,False)---- | 'setTopic' takes a channel and a topic. It then returns the message---   which sets the channels topic.-setTopic :: String -- ^ Channel-         -> String -- ^ Topic-         -> IrcMessage-setTopic chan topic = mkMessage "TOPIC" [chan, ':' : topic]---- | 'getTopic' Returns the topic for a channel, given as a String-getTopic :: String -> IrcMessage-getTopic chan = mkMessage "TOPIC" [chan]---- | 'quit' creates a server QUIT message. The input string given is the---   quit message, given to other parties when leaving the network.-quit :: String -> IrcMessage-quit msg = mkMessage "QUIT" [':' : msg]---- | 'join' creates a join message. String given is the location (channel)---   to join.-join :: String -> IrcMessage-join loc = mkMessage "JOIN" [loc]---- | 'part' parts the channel given.-part :: String -> IrcMessage-part loc = mkMessage "PART" [loc]---- | 'names' builds a NAMES message from a list of channels.-names :: [String] -> IrcMessage-names chans = mkMessage "NAMES" [Util.concatWith "," chans]---- | Construct a privmsg from the CTCP TIME notice, to feed up to--- the @localtime-reply plugin, which then passes the output to--- the appropriate client.-timeReply :: IrcMessage -> IrcMessage-timeReply msg    = -   IrcMessage { msgPrefix  = msgPrefix (msg)-              , msgCommand = "PRIVMSG"-              , msgParams  = [head (msgParams msg)-                             ,":@localtime-reply " ++ (IRC.nick msg) ++ ":" ++-                                (init $ drop 7 (last (msgParams msg))) ]-              }---- Only needed for Base.hs-errShowMsg :: IrcMessage -> String-errShowMsg msg = "ERROR> <" ++ msgPrefix msg ++-      "> [" ++ msgCommand msg ++ "] " ++ show (msgParams msg)--user :: String -> String -> String -> IrcMessage-user nick_ server ircname = IRC.mkMessage "USER" [nick_, "localhost", server, ircname]--setNick :: String -> IrcMessage-setNick nick_ = IRC.mkMessage "NICK" [nick_]-------------------------------------------------------------------------- Encoding and decoding of messages---- | 'encodeMessage' takes a message and converts it to a function.---   giving this function a string will attach the string to the message---   and output a string containing IRC protocol commands ready for writing---   on the outgoing stream socket.-encodeMessage :: IrcMessage -> String -> String-encodeMessage msg-  = encodePrefix (msgPrefix msg) . encodeCommand (msgCommand msg)-          . encodeParams (msgParams msg)-  where-    encodePrefix [] = id-    encodePrefix prefix = showChar ':' . showString prefix . showChar ' '--    encodeCommand cmd = showString cmd--    encodeParams [] = id-    encodeParams (p:ps) = showChar ' ' . showString p . encodeParams ps---- | 'decodeMessage' Takes an input line from the IRC protocol stream---   and decodes it into a message.-decodeMessage :: String -> IrcMessage-decodeMessage line =-    let (prefix, rest1) = decodePrefix (,) line-        (cmd, rest2)    = decodeCmd (,) rest1-        params          = decodeParams rest2-    in IrcMessage { msgPrefix = prefix, msgCommand = cmd, msgParams = params }-  where-    decodePrefix k (':':cs) = decodePrefix' k cs-      where decodePrefix' j ""       = j "" ""-            decodePrefix' j (' ':ds) = j "" ds-            decodePrefix' j (c:ds)   = decodePrefix' (j . (c:)) ds--    decodePrefix k cs = k "" cs--    decodeCmd k []       = k "" ""-    decodeCmd k (' ':cs) = k "" cs-    decodeCmd k (c:cs)   = decodeCmd (k . (c:)) cs--    decodeParams :: String -> [String]-    decodeParams xs = decodeParams' [] [] xs-      where-        decodeParams' param params []-          | null param = reverse params-          | otherwise  = reverse (reverse param : params)-        decodeParams' param params (' ' : cs)-          | null param = decodeParams' [] params cs-          | otherwise  = decodeParams' [] (reverse param : params) cs-        decodeParams' param params rest@(c@':' : cs)-          | null param = reverse (rest : params)-          | otherwise  = decodeParams' (c:param) params cs-        decodeParams' param params (c:cs) = decodeParams' (c:param) params cs-------------------------------------------------------------------------------- Lambdabot is asynchronous. We has reader and writer threads, and they--- don't know about each other.------ However, in Offline mode, we need to keep them in lock step. this--- complicates things.------ Online reader loop, the mvars are unused--readerLoop :: ThreadId -> Pipe IrcMessage -> Pipe IrcMessage -> Handle -> MVar () -> MVar () -> IO ()-readerLoop th chanr chanw h _ _ = handleIO th $ do-    io (putStrLn "Forking threads ...")-    readerLoop'-  where-    readerLoop' = do-        line <- hGetLine h-        let line' = filter (\c -> c /= '\n' && c /= '\r') line-        if pING `isPrefixOf` line'-            then writeChan chanw (Just $ IRC.mkMessage "PONG" [drop 5 line'])-            else writeChan chanr (Just $ IRC.decodeMessage line')-        readerLoop'--    pING = "PING "-{-# INLINE readerLoop #-}------- online writer loop------ Implements flood control: RFC 2813, section 5.8----writerLoop :: ThreadId -> Pipe IrcMessage -> Handle -> MVar () -> MVar () -> IO ()-writerLoop th chanw h _ _ = handleIO th $ do-    sem1 <- newQSem 0-    sem2 <- newQSem 5-    forkIO $ sequence_ . repeat $ do-           waitQSem sem1-           threadDelay 2000000-           signalQSem sem2-    writerLoop' (sem1,sem2)-  where-    writerLoop' sems@(sem1,sem2) = do-           mmsg <- readChan chanw-           waitQSem sem2-           case mmsg of-            Nothing  -> return ()-            Just msg -> P.hPut h $ P.pack $ IRC.encodeMessage msg "\r"-           signalQSem sem1-           writerLoop' sems-{-# INLINE writerLoop #-}----- --- Offline reader and writer loops. A prompt with line editing--- Takes a string from stdin, wraps it as an irc message, and _blocks_--- waiting for the writer thread (to keep things in sync).------ We (incorrectly) assume there's at least one write for every read.--- If a command returns no output (i.e. @more on an empty buffer) then--- we block in offline mode :(--- --- the mvars are used to keep the normally async threads in step.----offlineReaderLoop :: ThreadId -> Pipe IrcMessage -> Pipe IrcMessage -> Handle-                  -> MVar () -> MVar () -> IO ()-offlineReaderLoop th chanr _chanw _h syncR syncW = handleIO th readerLoop'-  where-    readerLoop' = do-        takeMVar syncR  -- wait till writer lets us proceed-        s <- readline "lambdabot> " -- read stdin-        case s of-            Nothing -> error "<eof>"-            Just x -> let s' = dropWhile isSpace x-                      in if null s' then putMVar syncR () >> readerLoop' else do-                addHistory s'--                let mmsg = case s' of-                            "quit" -> Nothing-                            '>':xs -> Just $ "@run " ++ xs-                            _      -> Just $ "@"     ++ dropWhile (== ' ') s'--                msg <- case mmsg of-                    Nothing   -> error "<quit>"-                    Just msg' -> return msg'--                let m  = IRC.IrcMessage { IRC.msgPrefix  = "null!n=user@null"-                                        , IRC.msgCommand = "PRIVMSG"-                                        , IRC.msgParams  = ["#haskell",":" ++ msg ] }-                writeChan chanr (Just m)-                putMVar syncW () -- let writer go -                readerLoop'------- Offline writer. Print to stdout----offlineWriterLoop :: ThreadId -> Pipe IrcMessage -> Handle -> MVar () -> MVar () -> IO ()-offlineWriterLoop th chanw h syncR syncW = handleIO th writerLoop'-  where-    writerLoop' = do--        takeMVar syncW -- wait for reader to let us go--        let loop = do-            mmsg <- readChan chanw-            case mmsg of-                Nothing  -> return ()-                Just msg -> do-                    let str = case (tail . IRC.msgParams) msg of-                                []    -> []-                                (x:_) -> tail x-                    P.hPutStrLn h (P.pack str)-            threadDelay 25 -- just for fun.-            b <- isEmptyChan chanw-            when (not b) loop-        loop--        putMVar syncR () -- now allow writer to go-        writerLoop'---- | convenience:-io :: forall a (m :: * -> *). (MonadIO m) => IO a -> m a-io = liftIO-{-# INLINE io #-}---- Thread handler, just catch particular things we want to throw out to--- the main thread, to force an exit. errorCalls are used by the--- reader/writer loops to exit. ioErrors are probably sockets closing.-handleIO :: ThreadId -> IO () -> IO ()-handleIO th = handleJust-    (\e -> case () of { _-                | Just _ <- errorCalls e -> Just e-                | Just _ <- ioErrors   e -> Just e-                | otherwise              -> Nothing-    }) (\e -> throwTo th (error (show e)))-
+ IRCBase.hs view
@@ -0,0 +1,141 @@+--+-- | The IRC module processes the IRC protocol and provides a nice API for sending+--   and recieving IRC messages with an IRC server.+--+module IRCBase ( IrcMessage(..)+               , privmsg+               , quit+               , timeReply+               , errShowMsg -- TODO: remove+               , user+               , setNick+               ) where++import Message+import Lib.Util (split, breakOnGlue, clean)+import qualified Lib.Util as Util (concatWith) ++import Data.Char (chr,isSpace)++import Control.Monad (liftM2)++-- | An IRC message is a server, a prefix, a command and a list of parameters.+data IrcMessage+  = IrcMessage {+        msgServer   :: !String,+        msgLBName   :: !String,+        msgPrefix   :: !String,+        msgCommand  :: !String,+        msgParams   :: ![String]+  }+  deriving (Show)++instance Message IrcMessage where+    nick          = IRCBase.nick+    server        = IRCBase.msgServer+    fullName      = IRCBase.fullName+    names         = IRCBase.names+    channels      = IRCBase.channels+    joinChannel   = IRCBase.join+    partChannel   = IRCBase.part+    getTopic      = IRCBase.getTopic+    setTopic      = IRCBase.setTopic+    body          = IRCBase.msgParams+    command       = IRCBase.msgCommand+    lambdabotName = IRCBase.lambdabotName++-- | 'mkMessage' creates a new message from a server, a cmd, and a list of parameters.+mkMessage :: String -- ^ Server+          -> String -- ^ Command+          -> [String] -- ^ Parameters+          -> IrcMessage -- ^ Returns: The created message++mkMessage svr cmd params = IrcMessage { msgServer = svr, msgPrefix = "", msgCommand = cmd, msgParams = params,+                                        msgLBName = "urk!<outputmessage>" }++-- | 'nick' extracts the nickname involved in a given message.+nick :: IrcMessage -> Nick+nick = liftM2 Nick msgServer (fst . breakOnGlue "!" . msgPrefix)++-- | 'fullName' extracts the full user name involved in a given message.+fullName :: IrcMessage -> String+fullName = snd . breakOnGlue "!" . msgPrefix++-- | 'channels' extracts the channels a IrcMessage operate on.+channels :: IrcMessage -> [Nick]+channels msg+  = let cstr = head $ msgParams msg+    in map (Nick (msgServer msg)) $+       map (\(x:xs) -> if x == ':' then xs else x:xs) (split "," cstr)+           -- solves what seems to be an inconsistency in the parser++-- | 'privmsg' creates a private message to the person designated.+privmsg :: Nick -- ^ Who should recieve the message (nick)+        -> String -- ^ What is the message?+        -> IrcMessage -- ^ Constructed message+privmsg who msg = if action then mk [nName who, ':':(chr 0x1):("ACTION " ++ clean_msg ++ ((chr 0x1):[]))]+                            else mk [nName who, ':' : clean_msg]+    where mk = mkMessage (nTag who) "PRIVMSG"+          cleaned_msg = case concatMap clean msg of+              str@('@':_) -> ' ':str+              str         -> str+          (clean_msg,action) = case cleaned_msg of+              ('/':'m':'e':r) -> (dropWhile isSpace r,True)+              str             -> (str,False)++-- | 'setTopic' takes a channel and a topic. It then returns the message+--   which sets the channels topic.+setTopic :: Nick -- ^ Channel+         -> String -- ^ Topic+         -> IrcMessage+setTopic chan topic = mkMessage (nTag chan) "TOPIC" [nName chan, ':' : topic]++-- | 'getTopic' Returns the topic for a channel, given as a String+getTopic :: Nick -> IrcMessage+getTopic chan = mkMessage (nTag chan) "TOPIC" [nName chan]++-- | 'quit' creates a server QUIT message. The input string given is the+--   quit message, given to other parties when leaving the network.+quit :: String -> String -> IrcMessage+quit svr msg = mkMessage svr "QUIT" [':' : msg]++-- | 'join' creates a join message. String given is the location (channel)+--   to join.+join :: Nick -> IrcMessage+join loc = mkMessage (nTag loc) "JOIN" [nName loc]++-- | 'part' parts the channel given.+part :: Nick -> IrcMessage+part loc = mkMessage (nTag loc) "PART" [nName loc]++-- | 'names' builds a NAMES message from a list of channels.+names :: String -> [String] -> IrcMessage+names svr chans = mkMessage svr "NAMES" [Util.concatWith "," chans]++-- | Construct a privmsg from the CTCP TIME notice, to feed up to+-- the @localtime-reply plugin, which then passes the output to+-- the appropriate client.+timeReply :: IrcMessage -> IrcMessage+timeReply msg    = +   IrcMessage { msgPrefix  = msgPrefix (msg)+              , msgServer  = msgServer (msg)+              , msgLBName  = msgLBName (msg)+              , msgCommand = "PRIVMSG"+              , msgParams  = [head (msgParams msg)+                             ,":@localtime-reply " ++ (nName $ IRCBase.nick msg) ++ ":" +++                                (init $ drop 7 (last (msgParams msg))) ]+              }++-- Only needed for Base.hs+errShowMsg :: IrcMessage -> String+errShowMsg msg = "ERROR> <" ++ msgServer msg ++ (':' : msgPrefix msg) +++      "> [" ++ msgCommand msg ++ "] " ++ show (msgParams msg)++user :: String -> String -> String -> String -> IrcMessage+user svr nick_ server_ ircname = IRCBase.mkMessage svr "USER" [nick_, "localhost", server_, ircname]++setNick :: Nick -> IrcMessage+setNick nick_ = IRCBase.mkMessage (nTag nick_) "NICK" [nName nick_]++lambdabotName :: IrcMessage -> Nick+lambdabotName msg = Nick (msgServer msg) (msgLBName msg)
LBState.hs view
@@ -21,6 +21,8 @@ import Control.Monad.Reader import Control.Monad.Trans (liftIO) +import Message(Nick)+ -- withMWriter :: MVar a -> (a -> (a -> IO ()) -> IO b) -> IO b -- | Update the module's private state. -- This is the preferred way of changing the state. The state will be locked@@ -34,12 +36,14 @@ -- that came to my mind had even more serious deficiencies such as being prone -- to race conditions or semantic obscurities. withMS :: (s -> (s -> LB ()) -> LB a) -> ModuleT s LB a-withMS f = lbIO $ \conv -> withMWriter ?ref $ \x writer ->-  conv $ f x (liftIO . writer)+withMS f = do+    ref <- getRef+    lift . lbIO $ \conv -> withMWriter ref $ \x writer ->+        conv $ f x (liftIO . writer)  -- | Read the module's private state. readMS :: ModuleT s LB s-readMS = liftIO $ readMVar ?ref+readMS = getRef >>= liftIO . readMVar  -- | Produces a with-function. Needs a better name. accessorMS :: (s -> (t, t -> s)) ->@@ -49,7 +53,7 @@  -- | Modify the module's private state. modifyMS :: (s -> s) -> ModuleT s LB ()-modifyMS f = liftIO $ modifyMVar_ ?ref (return . f)+modifyMS f = getRef >>= liftIO . flip modifyMVar_ (return . f)  -- | Write the module's private state. Try to use withMS instead. writeMS :: s -> ModuleT s LB ()@@ -62,7 +66,7 @@ -- This simple implementation is linear in the number of private states used. data GlobalPrivate g p = GP {   global :: !g,-  private :: ![(String,MVar (Maybe p))],+  private :: ![(Nick,MVar (Maybe p))],   maxSize :: Int } @@ -77,21 +81,22 @@  -- Needs a better interface. The with-functions are hardly useful. -- | Writes private state. For now, it locks everything.-withPS :: String  -- ^ The target+withPS :: Nick  -- ^ The target   -> (Maybe p -> (Maybe p -> LB ()) -> LB a)     -- ^ @Just x@ writes x in the user's private state, @Nothing@ removes it.   -> ModuleT (GlobalPrivate g p) LB a withPS who f = do   mvar <- accessPS return id who-  lbIO $ \conv -> withMWriter mvar $ \x writer -> conv $ f x (liftIO . writer)+  lift . lbIO $ \conv -> withMWriter mvar $ \x writer ->+      conv $ f x (liftIO . writer)  -- | Reads private state.-readPS :: String -> ModuleT (GlobalPrivate g p) LB (Maybe p)+readPS :: Nick -> ModuleT (GlobalPrivate g p) LB (Maybe p) readPS = accessPS (liftIO . readMVar) (\_ -> return Nothing)  -- | Reads private state, executes one of the actions success and failure -- which take an MVar and an action producing a @Nothing@ MVar, respectively.-accessPS :: (MVar (Maybe p) -> LB a) -> (LB (MVar (Maybe p)) -> LB a) -> String+accessPS :: (MVar (Maybe p) -> LB a) -> (LB (MVar (Maybe p)) -> LB a) -> Nick   -> ModuleT (GlobalPrivate g p) LB a accessPS success failure who = withMS $ \state writer ->    case lookup who $ private state of@@ -117,19 +122,18 @@   -- The old interface, as we don't wanna be too fancy right now.-writePS :: String -> Maybe p -> ModuleT (GlobalPrivate g p) LB ()+writePS :: Nick -> Maybe p -> ModuleT (GlobalPrivate g p) LB () writePS who x = withPS who (\_ writer -> writer x)  writeGS :: g -> ModuleT (GlobalPrivate g p) LB () writeGS g = withGS (\_ writer -> writer g)  -- | run an IO action in another thread, with a timeout, lifted into LB-forkLB :: LB a -> LB ()+forkLB :: LB a -> LB ThreadId forkLB f = (`liftLB` f) $ \g -> do             forkIO $ do                 timeout (15 * 1000 * 1000) g                 return ()-            return ()  -- | lift an io transformer into LB liftLB :: (IO a -> IO b) -> LB a -> LB b
+ LICENSE view
@@ -0,0 +1,22 @@+Copyright (c) 2003 Andrew J. Bromage+Portions Copyright (c) 2003 Shae Erisson, Sven M. Hallberg, Taylor Campbell+Portions Copyright (c) 2003-2006 Members of the AUTHORS file++Permission is hereby granted, free of charge, to any person obtaining+a copy of this software and associated documentation files (the+"Software"), to deal in the Software without restriction, including+without limitation the rights to use, copy, modify, merge, publish,+distribute, sublicense, and/or sell copies of the Software, and to+permit persons to whom the Software is furnished to do so, subject+to the following conditions:++The above copyright notice and this permission notice shall be included+in all copies or substantial portions of the Software.++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY+KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE+WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ LMain.hs view
@@ -0,0 +1,52 @@+module LMain where++import Shared+import Lambdabot+import Message+import IRCBase++import Lib.Util( listToMaybeAll )++import qualified Data.Map as M++import System.Environment++import Data.Maybe+import Control.Monad.State (get, liftIO)++data Args = Args { initcmds   :: [String] }++main' :: Maybe DynLoad -> (LB (), [String]) -> IO ()+main' dyn (loadStaticModules, pl) = do+    x    <- getArgs+    let a = parseArgs x+    case a of+        Just args -> runIrc (fromMaybe ["offline"] $ listToMaybeAll $ initcmds args) loadStaticModules ld pl+        _         -> putStrLn "Usage: lambdabot [-e 'cmd']*"++    where ld = fromMaybe (error "no dynamic loading") dyn+          parseArgs ("-e":cmd:x)       = parseArgs x >>$ \a -> a { initcmds = cmd : initcmds a }+          parseArgs []                 = Just $ Args { initcmds = [] }+          parseArgs _                  = Nothing+          (>>$) = flip fmap+++------------------------------------------------------------------------++received :: IrcMessage -> LB ()+received msg = do s   <- get+                  case M.lookup (command msg) (ircCallbacks s) of+                    Just cbs -> allCallbacks (map snd cbs) msg+                    _        -> return ()++-- If an error reaches allCallbacks, then all we can sensibly do is+-- write it on standard out. Hopefully BaseModule will have caught it already+-- if it can see a better place to send it++allCallbacks :: Message a => [a -> LB ()] -> a -> LB ()+allCallbacks [] _ = return ()+allCallbacks (f:fs) msg = do+    handleIrc (liftIO . putStrLn . ("Main: caught (and ignoring) "++). show) (f msg)+    allCallbacks fs msg++------------------------------------------------------------------------
Lambdabot.hs view
@@ -8,34 +8,34 @@ -- module Lambdabot (         MODULE(..), Module(..),-        ModuleT, ModState, ModuleLB, Mode(..),+        ModuleT, ModuleLB, ModuleUnit, Mode(..),          IRCRState(..), IRCRWState(..), IRCError(..),-        module Msg,          LB(..), lbIO,          withModule, withAllModules, getDictKeys, -        send, send_,+        getRef, getName, bindModule0, bindModule1, bindModule2,++        send, addServer, remServer, addServer',         ircPrivmsg, ircPrivmsg', -- not generally used+        ircPrivmsgF,+         ircQuit, ircReconnect,         ircGetChannels,         ircSignalConnect, Callback, ircInstallOutputFilter, OutputFilter,         ircInstallModule, ircUnloadModule,-        serverSignOn,-        ircRead,+        flushModuleState,          ircLoad, ircUnload, -        checkPrivs, mkCN, handleIrc, catchIrc, runIrc,+        checkPrivs, checkIgnore, mkCN, handleIrc, catchIrc, runIrc,   ) where  import qualified Message as Msg import qualified Shared  as S-import qualified Config (config, name, admins, host, port, Protocol(..))-import qualified IRC    (IrcMessage, quit, privmsg, readerLoop-                        ,writerLoop, offlineReaderLoop, offlineWriterLoop, user, setNick)+import qualified IRCBase as IRC (IrcMessage, quit, privmsg)  import Lib.Signals import Lib.Util@@ -43,13 +43,18 @@  import Prelude hiding           (mod, catch) -import Network                  (withSocketsDo, connectTo, PortID(PortNumber))+import Network                  (withSocketsDo)  import System.Exit import System.IO-import System.Posix.Process++#ifndef mingw32_HOST_OS import System.Posix.Signals +-- n.b comment this out for prof+import System.Posix.Process     ( exitImmediately )+#endif+ import Data.Char import Data.IORef               (newIORef, IORef, readIORef, writeIORef) import Data.List                (isSuffixOf, inits, tails)@@ -57,6 +62,7 @@ import Data.Map (Map) import qualified Data.Map as M hiding (Map) import qualified Data.ByteString.Char8 as P+import Data.ByteString (ByteString)  import Control.Concurrent import Control.Exception@@ -69,6 +75,12 @@ import GHC.Err #endif +#ifdef mingw32_HOST_OS+-- compatability shim+exitImmediately :: ExitCode -> IO a+exitImmediately = exitWith+#endif+ ------------------------------------------------------------------------ -- -- Lambdabot state@@ -77,22 +89,27 @@ -- | Global read-only state. data IRCRState   = IRCRState {-        ircServer      :: String,-        ircReadChan    :: Pipe,-        ircReadThread  :: ThreadId,-        ircWriteChan   :: Pipe,-        ircWriteThread :: ThreadId+        ircMainThread  :: ThreadId,+        ircInitDoneMVar:: MVar (),+        ircQuitMVar    :: MVar ()+        -- ^This is a mildly annoying hack.  In order to prevent the program+        -- from closing immediately, we have to keep the main thread alive, but+        -- the obvious infinite-MVar-wait technique doesn't work - the garbage+        -- collector helpfully notices that the MVar is dead, kills the main+        -- thread (which will never wake up, so why keep it around), thus+        -- terminating the program.  Behold the infinite wisdom that is the+        -- Glasgow FP group.   } -type Pipe = Chan (Maybe IRC.IrcMessage)- type Callback = IRC.IrcMessage -> LB () -type OutputFilter = String -> [String] -> LB [String]+type OutputFilter = Msg.Nick -> [String] -> LB [String]  -- | Global read\/write state. data IRCRWState = IRCRWState {-        ircPrivilegedUsers :: Map String Bool,+        ircServerMap       :: Map String (String, IRC.IrcMessage -> LB ()),+        ircPrivilegedUsers :: Map Msg.Nick Bool,+        ircIgnoredUsers    :: Map Msg.Nick Bool,          ircChannels        :: Map ChanName String,             -- ^ maps channel names to topics@@ -104,18 +121,65 @@          ircCommands        :: Map String ModuleRef,         ircPrivCommands    :: [String],-        ircStayConnected   :: Bool,-        ircDynLoad         :: S.DynLoad+        ircStayConnected   :: !Bool,+        ircDynLoad         :: S.DynLoad,+        ircOnStartupCmds   :: [String],+        ircPlugins         :: [String]     } -newtype ChanName = ChanName { getCN :: String } -- should be abstract, always lowercase+-- The virtual chat system.+--+-- The virtual chat system sits between the chat drivers and the rest of+-- Lambdabot.  It provides a mapping between the String server "tags" and+-- functions which are able to handle sending messages.+-- +-- When a message is recieved, the chat module is expected to call+-- `LMain.received'.  This is not ideal.++addServer :: String -> (IRC.IrcMessage -> LB ()) -> ModuleT s LB ()+addServer tag sendf = do+    s <- get+    let svrs = ircServerMap s+    name <- getName+    case M.lookup tag svrs of+        Nothing -> put (s { ircServerMap = M.insert tag (name,sendf) svrs})+        Just _ -> fail $ "attempted to create two servers named " ++ tag++-- This is a crutch until all the servers are pluginized.+addServer' :: String -> (IRC.IrcMessage -> LB ()) -> LB ()+addServer' tag sendf = do+    s <- get+    let svrs = ircServerMap s+    case M.lookup tag svrs of+        Nothing -> put (s { ircServerMap = M.insert tag ("<core>",sendf) svrs})+        Just _ -> fail $ "attempted to create two servers named " ++ tag++remServer :: String -> LB ()+remServer tag = do+    s <- get+    let svrs = ircServerMap s+    case M.lookup tag svrs of+        Just _ -> do let svrs' = M.delete tag svrs+                     main <- asks ircMainThread+                     when (M.null svrs') $ io $ throwTo main (ErrorCall "all servers detached")+                     put (s { ircServerMap = svrs' })+        Nothing -> fail $ "attempted to delete nonexistent servers named " ++ tag++send :: IRC.IrcMessage -> LB ()+send msg = do+    s <- gets ircServerMap+    case M.lookup (Msg.server msg) s of+        Just (_, sendf) -> sendf msg+        Nothing -> io $ hPutStrLn stderr $ "sending message to bogus server: " ++ show msg++newtype ChanName = ChanName { getCN :: Msg.Nick } -- should be abstract, always lowercase   deriving (Eq, Ord)  instance Show ChanName where show (ChanName x) = show x  -- | only use the "smart constructor":-mkCN :: String -> ChanName-mkCN = ChanName . map toLower+mkCN :: Msg.Nick -> ChanName+mkCN = ChanName . liftM2 Msg.Nick Msg.nTag (map toLower . Msg.nName)  -- --------------------------------------------------------------------- --@@ -128,13 +192,12 @@ -- instances Monad, Functor, MonadIO, MonadState, MonadError  -newtype LB a = LB { runLB :: ReaderT (IORef (Maybe IRCRState),IORef IRCRWState) IO a }+newtype LB a = LB { runLB :: ReaderT (IRCRState,IORef IRCRWState) IO a }     deriving (Monad,Functor,MonadIO)  -- Actually, this isn't a reader anymore instance MonadReader IRCRState LB where-    ask   = LB $ fmap (maybe (error "No connection") id) $-                        io . readIORef =<< asks fst+    ask   = LB $ asks fst     local = error "You are not supposed to call local"  instance MonadState IRCRWState LB where@@ -155,30 +218,22 @@               `catch` \e -> conv $ h $ IRCRaised e  -- A type for handling both Haskell exceptions and external signals-data IRCError = IRCRaised Exception | SignalCaught Signal deriving Show+data IRCError = IRCRaised Exception | SignalCaught Signal +instance Show IRCError where+    show (IRCRaised    e) = show e+    show (SignalCaught s) = show s+ -- lbIO return :: LB (LB a -> IO a) -- CPS to work around predicativiy of haskell's type system. lbIO :: ((forall a. LB a -> IO a) -> IO b) -> LB b lbIO k = LB . ReaderT $ \r -> k (\(LB m) -> m `runReaderT` r) --- | Take a state, and a lambdabot monad action, run the action,--- preserving the state before and after you run the action.-localLB :: Maybe IRCRState -> LB a -> LB a-localLB new (LB m) = LB $ do-    ref <- asks fst-    old <- io $ readIORef ref-    io $ writeIORef ref new-    res <- m-    io $ writeIORef ref old-    return res- -- | run a computation in the LB monad-evalLB :: LB a -> IRCRWState -> IO a-evalLB (LB lb) rws = do+evalLB :: LB a -> IRCRState -> IRCRWState -> IO a+evalLB (LB lb) rs rws = do     ref  <- newIORef rws-    ref' <- newIORef Nothing-    lb `runReaderT` (ref',ref)+    lb `runReaderT` (rs,ref)  -- May wish to add more things to the things caught, or restructure things  -- a bit. Can't just catch everything - in particular EOFs from the socket@@ -204,82 +259,82 @@ -- (i.e. print a message and exit). Non-fatal exceptions should be dealt -- with in the mainLoop or further down. ---runIrc :: Mode -> LB a -> LB () -> S.DynLoad -> IO ()-runIrc mode initialise loop ld = withSocketsDo $ do+runIrc :: [String] -> LB a -> S.DynLoad -> [String] -> IO ()+runIrc evcmds initialise ld plugins = withSocketsDo $ do+    rost <- initRoState     r <- try $ evalLB (do withDebug "Initialising plugins" initialise-                          withIrcSignalCatch (mainLoop mode loop))-                       (initState (Config.admins Config.config) ld)+                          withIrcSignalCatch mainLoop)+                       rost (initState ld plugins evcmds)      -- clean up and go home     case r of-        Left _  -> exitWith (ExitFailure 1) -- won't happen.  exitImmediately cleans it all up+        Left er -> do putStrLn "exception:"+                      print er+                      exitWith (ExitFailure 1) -- won't happen.  exitImmediately cleans it all up         Right _ -> exitWith ExitSuccess  --+-- | Default ro state+--+initRoState :: IO IRCRState+initRoState = do+    threadmain <- io myThreadId+    quitMVar <- io newEmptyMVar+    initDoneMVar <- io newEmptyMVar++    return $ IRCRState {+                 ircQuitMVar    = quitMVar,+                 ircInitDoneMVar= initDoneMVar,+                 ircMainThread  = threadmain+             }++-- -- | Default rw state ---initState :: [String] -> S.DynLoad -> IRCRWState-initState as ld = IRCRWState {-        ircPrivilegedUsers = M.fromList $ zip as (repeat True),+initState :: S.DynLoad -> [String] -> [String] -> IRCRWState+initState ld plugins evcmds = IRCRWState {+        ircPrivilegedUsers = M.singleton (Msg.Nick "offlinerc" "null") True,+        ircIgnoredUsers    = M.empty,         ircChannels        = M.empty,         ircModules         = M.empty,+        ircServerMap       = M.empty,         ircCallbacks       = M.empty,         ircOutputFilters   = [             ([],cleanOutput),             ([],lineify),             ([],cleanOutput),-            ([],reduceIndent),+        --  ([],reduceIndent),             ([],checkRecip) ],         ircCommands        = M.empty,         ircPrivCommands    = [],         ircStayConnected   = True,-        ircDynLoad         = ld+        ircDynLoad         = ld,+        ircPlugins         = plugins,+        ircOnStartupCmds   = evcmds     }  ----- Actually connect to the irc server+-- Actually, this isn't a loop anymore.  FIXME: better name. ---mainLoop :: Mode -> LB a -> LB ()-mainLoop mode loop = do--    -- in offline mode we connect to stdin/stdout. in online mode our-    -- handles are network pipes-    (hin,hout,rloop,wloop) <- case mode of-        Online  -> do-            let portnum  = PortNumber $ fromIntegral (Config.port Config.config)-            s <- io $ connectTo (Config.host Config.config) portnum-            return (s,s,IRC.readerLoop,IRC.writerLoop)-        Offline -> return (stdin, stdout, IRC.offlineReaderLoop, IRC.offlineWriterLoop)--    io $ hSetBuffering hout NoBuffering-    io $ hSetBuffering hin  NoBuffering-    threadmain <- io myThreadId-    chanr      <- io newChan-    chanw      <- io newChan-    syncR      <- io $ newMVar () -- used in offline to make threads synchronous-    syncW      <- io newEmptyMVar-    threadr    <- io $ forkIO $ rloop threadmain chanr chanw hin syncR syncW-    threadw    <- io $ forkIO $ wloop threadmain chanw hout syncR syncW--    let chans = IRCRState {-                    ircServer      = Config.host Config.config,-                    ircReadChan    = chanr,-                    ircReadThread  = threadr,-                    ircWriteChan   = chanw,-                    ircWriteThread = threadw-                }+mainLoop :: LB ()+mainLoop = do      catchIrc-       (localLB (Just chans) loop >> return ())+       (do asks ircInitDoneMVar >>= io . flip putMVar ()+           asks ircQuitMVar >>= io . takeMVar+           fail "don't write to the quitMVar!")        (\e -> do -- catch anything, print informative message, and clean up             io $ hPutStrLn stderr $                        (case e of                             IRCRaised ex   -> "Exception: " ++ show ex                             SignalCaught s -> "Signal: " ++ ircSignalMessage s)-            withDebug "Running exit handlers"    runExitHandlers-            withDebug "Writing persistent state" flushModuleState-            io $ do hPutStrLn stderr "Exiting ... "-                    exitImmediately (ExitFailure 1))+        --  withDebug "Running exit handlers"    runExitHandlers+        --  withDebug "Writing persistent state" flushModuleState+            runExitHandlers >> flushModuleState++      -- this kills profiling output:+            io $ exitImmediately (ExitFailure 1))+       --    throwError e)  -- | run 'exit' handler on modules@@ -288,7 +343,9 @@  -- | flush state of modules flushModuleState :: LB ()-flushModuleState = withAllModules (\m -> writeGlobalState m ?name) >> return ()+flushModuleState = do+    withAllModules (\m -> getName >>= writeGlobalState m)+    return ()  ------------------------------------------------------------------------ @@ -337,7 +394,7 @@     process :: Msg.Message a         => m                                -- ^ phantom     (required)         -> a                                -- ^ the message (uneeded by most?)-        -> String                           -- ^ target+        -> Msg.Nick                         -- ^ target         -> String                           -- ^ command         -> String                           -- ^ the arguments to the command         -> ModuleLB s                       -- ^ maybe output@@ -347,7 +404,7 @@     contextual :: Msg.Message a         => m                                -- ^ phantom     (required)         -> a                                -- ^ the message-        -> String                           -- ^ target+        -> Msg.Nick                         -- ^ target         -> String                           -- ^ the text         -> ModuleLB s                       -- ^ maybe output @@ -359,6 +416,12 @@              -> String -> String            -- ^ command, args              -> ModuleLB s                  -- ^ maybe output +    -- A bytestring version+    --+    fprocess_ :: m                        -- ^ phantom+              -> ByteString -> ByteString -- ^ command, args+              -> ModuleF s                -- ^ maybe output+ ------------------------------------------------------------------------      contextual _ _ _ _ = return []@@ -373,11 +436,6 @@     moduleSerialize _  = Nothing     moduleDefState  _  = return $ error "state not initalized" --- work around weird issue in 6.5, where the missing default fails-#if __GLASGOW_HASKELL__ >= 605-    process _ _ _ _ _ = GHC.Err.noMethodBindingError "Lambdabot.process"#-#endif- -- | An existential type holding a module, used to represent modules on -- the value level, for manipluation at runtime by the dynamic linker. --@@ -386,19 +444,40 @@ data ModuleRef = forall m s. (Module m s) => ModuleRef m (MVar s) String  ----- | This \"transformer\" encodes the additional information a module might +-- | This transformer encodes the additional information a module might  --   need to access its name or its state. ----- TODO: remove implicit parameters. It won't be valid Haskell'----type ModuleT s m a = (?ref :: MVar s, ?name :: String) => m a+newtype ModuleT s m a = ModuleT { moduleT :: ReaderT (MVar s, String) m a }+    deriving (Functor, Monad, MonadTrans, MonadIO, MonadError e, MonadState t) --- Name !!!-type ModState s a = (?ref :: MVar s, ?name :: String) => a+getRef :: Monad m => ModuleT s m (MVar s)+getRef  = ModuleT $ ask >>= return . fst +getName :: Monad m => ModuleT s m String+getName = ModuleT $ ask >>= return . snd++-- | bind an action to the current module so it can be run from the plain+--   `LB' monad.+bindModule0 :: ModuleT s LB a -> ModuleT s LB (LB a)+bindModule0 act = bindModule1 (const act) >>= return . ($ ())++-- | variant of `bindModule0' for monad actions with one argument+bindModule1 :: (a -> ModuleT s LB b) -> ModuleT s LB (a -> LB b)+bindModule1 act = ModuleT $+    ask >>= \st -> return (\val -> runReaderT (moduleT $ act val) st)++-- | variant of `bindModule0' for monad actions with two arguments+bindModule2 :: (a -> b -> ModuleT s LB c) -> ModuleT s LB (a -> b -> LB c)+bindModule2 act = bindModule1 (uncurry act) >>= return . curry+ -- | A nicer synonym for some ModuleT stuffs-type ModuleLB m = ModuleT m LB [String]+type ModuleLB s = ModuleT s LB [String] +-- | And for packed output+type ModuleF  s = ModuleT s LB [ByteString]++type ModuleUnit s = ModuleT s LB ()+ -- --------------------------------------------------------------------- -- -- Handling global state@@ -409,19 +488,22 @@ writeGlobalState mod name = case moduleSerialize mod of   Nothing  -> return ()   Just ser -> do-    state <- io $ readMVar ?ref -- readMS+    state <- getRef >>= (io . readMVar) -- readMS     case serialize ser state of         Nothing  -> return ()   -- do not write any state         Just out -> io $ P.writeFile (toFilename name) out  -- | Read it in readGlobalState :: Module m s => m -> String -> IO (Maybe s)-readGlobalState mod name = case moduleSerialize mod of-    Nothing  -> return Nothing-    Just ser -> do+readGlobalState mod name+    | Just ser <- moduleSerialize mod  = do         state <- Just `fmap` P.readFile (toFilename name) `catch` \_ -> return Nothing-        let state' = deserialize ser =<< state -- Monad Maybe-        return $ maybe Nothing (Just $) state'+        catch (evaluate $ maybe Nothing (Just $!) (deserialize ser =<< state)) -- Monad Maybe)+              (\e -> do hPutStrLn stderr $ "Error parsing state file for: "+                                        ++ name ++ ": " ++ show e+                        hPutStrLn stderr $ "Try removing: "++show (toFilename name)+                        return Nothing) -- proceed irregardless+    | otherwise = return Nothing  -- | helper toFilename :: String -> String@@ -439,21 +521,20 @@      let modref = ModuleRef mod ref modname -    -- TODO-    let ?ref = ref; ?name = modname -- yikes-    moduleInit mod-    let cmds  = moduleCmds mod-        privs = modulePrivs mod+    flip runReaderT (ref, modname) . moduleT $ do+        moduleInit mod+        let cmds  = moduleCmds mod+            privs = modulePrivs mod -    s <- get-    let modmap = ircModules s-        cmdmap = ircCommands s-    put $ s {-      ircModules = M.insert modname modref modmap,-      ircCommands = addList [ (cmd,modref) | cmd <- cmds++privs ] cmdmap,-      ircPrivCommands = ircPrivCommands s ++ privs-    }-    io $ hPutStr stderr "." >> hFlush stderr+        s <- get+        let modmap = ircModules s+            cmdmap = ircCommands s+        put $ s {+          ircModules = M.insert modname modref modmap,+          ircCommands = addList [ (cmd,modref) | cmd <- cmds++privs ] cmdmap,+          ircPrivCommands = ircPrivCommands s ++ privs+        }+        io $ hPutStr stderr "." >> hFlush stderr  -- -- | Unregister a module's entry in the irc state@@ -467,10 +548,12 @@     let modmap = ircModules s         cmdmap = ircCommands s         cbs    = ircCallbacks s+        svrs   = ircServerMap s         ofs    = ircOutputFilters s     put $ s { ircCommands      = M.filter (\(ModuleRef _ _ name) -> name /= modname) cmdmap }             { ircModules       = M.delete modname modmap }             { ircCallbacks     = filter ((/=modname) . fst) `fmap` cbs }+            { ircServerMap     = M.filter ((/=modname) . fst) svrs }             { ircOutputFilters = filter ((/=modname) . fst) ofs }   ) @@ -498,97 +581,77 @@ ircSignalConnect str f = do      s <- get     let cbs = ircCallbacks s+    name <- getName     case M.lookup str cbs of -- TODO-        Nothing -> put (s { ircCallbacks = M.insert str [(?name,f)]    cbs})-        Just fs -> put (s { ircCallbacks = M.insert str ((?name,f):fs) cbs})+        Nothing -> put (s { ircCallbacks = M.insert str [(name,f)]    cbs})+        Just fs -> put (s { ircCallbacks = M.insert str ((name,f):fs) cbs})  ircInstallOutputFilter :: OutputFilter -> ModuleT s LB ()-ircInstallOutputFilter f =+ircInstallOutputFilter f = do+    name <- getName     modify $ \s ->-        s { ircOutputFilters = (?name, f): ircOutputFilters s }+        s { ircOutputFilters = (name, f): ircOutputFilters s }  -- | Checks if the given user has admin permissions and excecute the action --   only in this case. checkPrivs :: IRC.IrcMessage -> LB Bool checkPrivs msg = gets (isJust . M.lookup (Msg.nick msg) . ircPrivilegedUsers) +-- | Checks if the given user is being ignored.+--   Privileged users can't be ignored.+checkIgnore :: IRC.IrcMessage -> LB Bool+checkIgnore msg = liftM2 (&&) (liftM not (checkPrivs msg))+                  (gets (isJust . M.lookup (Msg.nick msg) . ircIgnoredUsers))+ ------------------------------------------------------------------------ -- Some generic server operations -serverSignOn :: Config.Protocol -> String -> String -> LB ()-serverSignOn Config.Irc  nick userinfo = ircSignOn nick userinfo-serverSignOn Config.Xmpp nick _        = jabberSignOn nick--jabberSignOn :: String -> LB ()-jabberSignOn _ = undefined--ircSignOn :: String -> String -> LB ()-ircSignOn nick ircname = do-    server <- asks ircServer--    -- password support. TODO: Move this to IRC?-    -- If plugin initialising was delayed till after we connected, we'd-    -- be able to write a Passwd plugin.-    send . Just $ IRC.user nick server ircname-    send . Just $ IRC.setNick nick-    mpasswd <- liftIO (handleJust ioErrors (const (return "")) $-                       readFile "State/passwd")-    case readM mpasswd of-      Nothing     -> return ()-      Just passwd -> ircPrivmsg "nickserv" $ Just $ "identify " ++ passwd--ircGetChannels :: LB [String]+ircGetChannels :: LB [Msg.Nick] ircGetChannels = (map getCN . M.keys) `fmap` gets ircChannels  -- Send a quit message, settle and wait for the server to drop our -- handle. At which point the main thread gets a closed handle eof -- exceptoin, we clean up and go home-ircQuit :: String -> LB ()-ircQuit msg = do+ircQuit :: String -> String -> LB ()+ircQuit svr msg = do     modify $ \state -> state { ircStayConnected = False }-    send  . Just $ IRC.quit msg+    send  $ IRC.quit svr msg     liftIO $ threadDelay 1000     io $ hPutStrLn stderr "Quit" -ircReconnect :: String -> LB ()-ircReconnect msg = do-    send . Just $ IRC.quit msg+ircReconnect :: String -> String -> LB ()+ircReconnect svr msg = do+    send $ IRC.quit svr msg     liftIO $ threadDelay 1000 -ircRead :: LB (Maybe IRC.IrcMessage)-ircRead = do-    chanr <- asks ircReadChan-    liftIO (readChan chanr)---- --- convenient wrapper----send_ :: IRC.IrcMessage -> LB ()-send_ = send . Just--send :: Maybe IRC.IrcMessage -> LB ()-send line = do-    chanw <- asks ircWriteChan-    io (writeChan chanw line)- -- | Send a message to a channel\/user. If the message is too long, the rest --   of it is saved in the (global) more-state.-ircPrivmsg :: String        -- ^ The channel\/user.-           -> Maybe String  -- ^ The message.+ircPrivmsg :: Msg.Nick      -- ^ The channel\/user.+           -> String        -- ^ The message.            -> LB () -ircPrivmsg who Nothing = ircPrivmsg' who Nothing-ircPrivmsg who (Just msg) = do+ircPrivmsg who msg = do     filters   <- gets ircOutputFilters     sendlines <- foldr (\f -> (=<<) (f who)) ((return . lines) msg) $ map snd filters-    mapM_ (\s -> ircPrivmsg' who (Just $ take textwidth s)) (take 10 sendlines)+    mapM_ (\s -> ircPrivmsg' who (take textwidth s)) (take 10 sendlines)  -- A raw send version-ircPrivmsg' :: String -> Maybe String -> LB ()-ircPrivmsg' who (Just "")  = ircPrivmsg' who (Just " ")-ircPrivmsg' who (Just msg) = send . Just $ IRC.privmsg who msg-ircPrivmsg' _   Nothing    = send Nothing+ircPrivmsg' :: Msg.Nick -> String -> LB ()+ircPrivmsg' who ""  = ircPrivmsg' who " "+ircPrivmsg' who msg = send $ IRC.privmsg who msg +----------------------------------------------------------------------------------++ircPrivmsgF :: Msg.Nick -> ByteString -> LB ()+ircPrivmsgF who s= ircPrivmsg who (P.unpack s) -- TODO++{-+rawPrivmsgF :: String -> Maybe ByteString -> LB ()+rawPrivmsgF _   Nothing  = send Nothing+rawPrivmsgF who (Just s) | P.null s  = ircPrivmsg' who (Just " ")+                         | otherwise = send . Just $ IRC.privmsgF who msg+-}+ ------------------------------------------------------------------------ -- Module handling @@ -610,7 +673,8 @@     case maybemod of       -- TODO stick this ref stuff in a monad instead. more portable in       -- the long run.-      Just (ModuleRef m ref name) -> let ?ref = ref; ?name = name in f m+      Just (ModuleRef m ref name) -> do+          runReaderT (moduleT $ f m) (ref, name)       _                           -> def  -- | Interpret a function in the context of all modules@@ -618,8 +682,7 @@ withAllModules f = do     mods <- gets $ M.elems . ircModules :: LB [ModuleRef]     (`mapM` mods) $ \(ModuleRef m ref name) -> do-        let ?ref = ref; ?name = name-        f m+        runReaderT (moduleT $ f m) (ref, name)  getDictKeys :: (MonadState s m) => (s -> Map k a) -> m [k] getDictKeys dict = gets (M.keys . dict)@@ -672,13 +735,16 @@ -- | Don't send any output to alleged bots. checkRecip :: OutputFilter checkRecip who msg-    | who == Config.name Config.config       = return []-    | "bot" `isSuffixOf` lowerCaseString who = return []-    | otherwise                              = return msg+--  FIXME: this doesn't work with plugin protocols :(+--  | who == Config.name Config.config                   = return []+    | "bot" `isSuffixOf` lowerCaseString (Msg.nName who) = return []+    | otherwise                                          = return msg  -- | Divide the lines' indent by two+{- reduceIndent :: OutputFilter reduceIndent _ msg = return $ map redLine msg     where         redLine (' ':' ':xs)        = ' ':redLine xs         redLine xs                  = xs+-}
Lib/AltTime.hs view
@@ -7,14 +7,13 @@     module System.Time   ) where -import Lib.Util (listToStr)-import Lib.Binary- import Control.Arrow (first) +import Data.Binary++import Data.List import System.Time (TimeDiff(..), noTimeDiff) import qualified System.Time as T-  (ClockTime(..), getClockTime, diffClockTimes, addToClockTime)  -- | Wrapping ClockTime (which doesn't provide a Read instance!) seems -- easier than talking care of the serialization of UserStatus@@ -51,54 +50,48 @@  -- | Pretty-print a TimeDiff. Both positive and negative Timediffs produce --   the same output.+--+-- 14d 17h 8m 53s+-- timeDiffPretty :: TimeDiff -> String-timeDiffPretty td = listToStr "and" $ filter (not . null) [-    prettyP years "year",-    prettyP (months `mod` 12) "month",-    prettyP (days `mod` 28) "day",-    prettyP (hours `mod` 24) "hour",-    prettyP (mins `mod` 60) "minute",-    prettyP (secs `mod` 60) "second"]+timeDiffPretty td = concat . intersperse " " $ filter (not . null) [+    prettyP years             "y",+    prettyP (months `mod` 12) "m",+    prettyP (days   `mod` 28) "d",+    prettyP (hours  `mod` 24) "h",+    prettyP (mins   `mod` 60) "m",+    prettyP (secs   `mod` 60) "s"]   where-    prettyP i str | i == 0    = ""-                  | i == 1    = "1 " ++ str-                  | otherwise = show i ++ " " ++ str ++ "s"+    prettyP 0 _ = []+    prettyP i s = show i ++ s      secs = abs $ tdSec td -- This is a hack, but there wasn't an sane output                           -- for negative TimeDiffs anyway.-    mins = secs `div` 60-    hours = mins `div` 60-    days = hours `div` 24-    months = days `div` 28-    years = months `div` 12+    mins   = secs   `div` 60+    hours  = mins   `div` 60+    days   = hours  `div` 24+    months = days   `div` 28+    years  = months `div` 12  ------------------------------------------------------------------------  instance Binary ClockTime where-        put_ bh (ClockTime (T.TOD i j)) = do-                put_ bh i-                put_ bh j-        get bh = do-                i <- get bh-                j <- get bh-                return (ClockTime (T.TOD i j))+        put (ClockTime (T.TOD i j)) = put i >> put j+        get = do i <- get+                 j <- get+                 return (ClockTime (T.TOD i j))  instance Binary TimeDiff where-        put_ bh (TimeDiff ye mo da ho mi se ps) = do-                put_ bh ye-                put_ bh mo-                put_ bh da-                put_ bh ho-                put_ bh mi-                put_ bh se-                put_ bh ps-        get bh = do-                ye <- get bh -                mo <- get bh -                da <- get bh -                ho <- get bh -                mi <- get bh -                se <- get bh -                ps <- get bh +        put (TimeDiff ye mo da ho mi se ps) = do+                put ye; put mo; put da; put ho; put mi; put se; put ps+        get = do+                ye <- get+                mo <- get+                da <- get+                ho <- get+                mi <- get+                se <- get+                ps <- get                 return (TimeDiff ye mo da ho mi se ps)+ 
− Lib/Binary.hs
@@ -1,287 +0,0 @@-{-# OPTIONS -cpp -fasm #-}------ (c) The University of Glasgow 2002--- (c) Don Stewart 2005-6------ Binary I/O library, with special tweaks for GHC--- and--- Unboxed mutable Ints------ Based on the nhc98 Binary library, which is copyright--- (c) Malcolm Wallace and Colin Runciman, University of York, 1998.--- Under the terms of the license for that software, we must tell you--- where you can obtain the original version of the Binary library, namely---     http://www.cs.york.ac.uk/fp/nhc98/--module Lib.Binary ( Binary(..), openBinIO_, putByte, getWord8 ) where--#include "MachDeps.h"--#ifndef SIZEOF_HSINT-#define SIZEOF_HSINT  INT_SIZE_IN_BYTES-#endif--import Data.Char        (ord, chr)-import Foreign          (Int32, Int64, Word8, Word32, Word64-	                    ,Bits(shiftR, shiftL, (.|.), (.&.)))-import System.IO as IO  (Handle, hPutChar, hGetChar)--import GHC.IOBase       (IO(..))-import GHC.Exts--import qualified Data.ByteString as P (hGet,hPut)-import qualified Data.ByteString.Base as P (ByteString(..))----------------------------------------------------------------------------data BinHandle = BinIO {-# UNPACK #-} !FastMutInt {-# UNPACK #-} !IO.Handle--class Binary a where-    put_   :: BinHandle -> a -> IO ()-    get    :: BinHandle -> IO a--openBinIO_ :: IO.Handle -> IO BinHandle-openBinIO_ h = openBinIO h (error "Binary.BinHandle: no user data")--openBinIO :: Handle -> t -> IO BinHandle-openBinIO h _mod = do-  r <- newFastMutInt-  writeFastMutInt r 0-  return (BinIO r h)---- -------------------------------------------------------------------------------- Low-level reading/writing of bytes--putWord8 :: BinHandle -> Word8 -> IO ()-putWord8 (BinIO ix_r h) w = do-    ix <- readFastMutInt ix_r-    hPutChar h (chr (fromIntegral w))	-- XXX not really correct-    writeFastMutInt ix_r (ix+1)-    return ()--getWord8 :: BinHandle -> IO Word8-getWord8 (BinIO ix_r h) = do-    ix <- readFastMutInt ix_r-    c <- hGetChar h-    writeFastMutInt ix_r (ix+1)-    return $! (fromIntegral (ord c))	-- XXX not really correct--getByte :: BinHandle -> IO Word8-getByte = getWord8-{-# INLINE getByte #-}--putByte :: BinHandle -> Word8 -> IO ()-putByte bh w = put_ bh w---- -------------------------------------------------------------------------------- Primitve Word writes--instance Binary Word8 where-  put_ = putWord8-  get  = getWord8--instance Binary Word32 where-  put_ h w = do-    putByte h (fromIntegral (w `shiftR` 24))-    putByte h (fromIntegral ((w `shiftR` 16) .&. 0xff))-    putByte h (fromIntegral ((w `shiftR` 8)  .&. 0xff))-    putByte h (fromIntegral (w .&. 0xff))-  get h = do-    w1 <- getWord8 h-    w2 <- getWord8 h-    w3 <- getWord8 h-    w4 <- getWord8 h-    return $! ((fromIntegral w1 `shiftL` 24) .|. -	       (fromIntegral w2 `shiftL` 16) .|. -	       (fromIntegral w3 `shiftL`  8) .|. -	       (fromIntegral w4))--instance Binary Word64 where-  put_ h w = do-    putByte h (fromIntegral (w `shiftR` 56))-    putByte h (fromIntegral ((w `shiftR` 48) .&. 0xff))-    putByte h (fromIntegral ((w `shiftR` 40) .&. 0xff))-    putByte h (fromIntegral ((w `shiftR` 32) .&. 0xff))-    putByte h (fromIntegral ((w `shiftR` 24) .&. 0xff))-    putByte h (fromIntegral ((w `shiftR` 16) .&. 0xff))-    putByte h (fromIntegral ((w `shiftR`  8) .&. 0xff))-    putByte h (fromIntegral (w .&. 0xff))-  get h = do-    w1 <- getWord8 h-    w2 <- getWord8 h-    w3 <- getWord8 h-    w4 <- getWord8 h-    w5 <- getWord8 h-    w6 <- getWord8 h-    w7 <- getWord8 h-    w8 <- getWord8 h-    return $! ((fromIntegral w1 `shiftL` 56) .|. -	       (fromIntegral w2 `shiftL` 48) .|. -	       (fromIntegral w3 `shiftL` 40) .|. -	       (fromIntegral w4 `shiftL` 32) .|. -	       (fromIntegral w5 `shiftL` 24) .|. -	       (fromIntegral w6 `shiftL` 16) .|. -	       (fromIntegral w7 `shiftL`  8) .|. -	       (fromIntegral w8))--instance Binary Int32 where-  put_ h w = put_ h (fromIntegral w :: Word32)-  get h    = do w <- get h; return $! (fromIntegral (w::Word32))--instance Binary Int64 where-  put_ h w = put_ h (fromIntegral w :: Word64)-  get h    = do w <- get h; return $! (fromIntegral (w::Word64))---- -------------------------------------------------------------------------------- Instances for standard types--instance Binary Int where-#if SIZEOF_HSINT == 4-    put_ bh i = put_ bh (fromIntegral i :: Int32)-    get  bh = do-	x <- get bh-	return $! (fromIntegral (x :: Int32))-#elif SIZEOF_HSINT == 8-    put_ bh i = put_ bh (fromIntegral i :: Int64)-    get  bh = do-	x <- get bh-	return $! (fromIntegral (x :: Int64))-#else-#error "unsupported sizeof(HsInt)"-#endif---    getF bh   = getBitsF bh 32--instance Binary Integer where-    put_ bh (S# i#) = do putByte bh 0; put_ bh (I# i#)-    put_ bh (J# s# a#) = do- 	putByte bh 1;-	put_ bh (I# s#)-	let sz# = sizeofByteArray# a#  -- in *bytes*-	put_ bh (I# sz#)  -- in *bytes*-	putByteArray bh a# sz#-   -    get bh = do -	b <- getByte bh-	case b of-	  0 -> do (I# i#) <- get bh-		  return (S# i#)-	  _ -> do (I# s#) <- get bh-		  sz <- get bh-		  (BA a#) <- getByteArray bh sz-		  return (J# s# a#)--putByteArray :: BinHandle -> ByteArray# -> Int# -> IO ()-putByteArray bh a s# = loop 0#-  where loop n# -	   | n# ==# s# = return ()-	   | otherwise = do-	   	putByte bh (indexByteArray a n#)-		loop (n# +# 1#)--getByteArray :: BinHandle -> Int -> IO ByteArray-getByteArray bh (I# sz) = do-  (MBA arr) <- newByteArray sz -  let loop n-	   | n ==# sz = return ()-	   | otherwise = do-		w <- getByte bh -		writeByteArray arr n w-		loop (n +# 1#)-  loop 0#-  freezeByteArray arr--data ByteArray = BA ByteArray#-data MBA = MBA (MutableByteArray# RealWorld)--newByteArray :: Int# -> IO MBA-newByteArray sz = IO $ \s ->-  case newByteArray# sz s of { (# s', arr #) ->-  (# s', MBA arr #) }--freezeByteArray :: MutableByteArray# RealWorld -> IO ByteArray-freezeByteArray arr = IO $ \s ->-  case unsafeFreezeByteArray# arr s of { (# s', arr' #) ->-  (# s', BA arr' #) }--writeByteArray :: MutableByteArray# RealWorld -> Int# -> Word8 -> IO ()--writeByteArray arr i w8 = IO $ \s ->-  case fromIntegral w8 of { W# w# -> -  case writeCharArray# arr i (chr# (word2Int# w#)) s  of { s' ->-  (# s' , () #) }}--indexByteArray :: (Num b) => ByteArray# -> Int# -> b-indexByteArray a# n# = fromIntegral (I# (ord# (indexCharArray# a# n#)))--instance (Binary a, Binary b) => Binary (a,b) where-    put_ bh (a,b) = do put_ bh a; put_ bh b-    get bh        = do a <- get bh-                       b <- get bh-                       return (a,b)--instance Binary a => Binary [a] where-    put_ bh l =-	do put_ bh (length l)-	   mapM (put_ bh) l-	   return ()-    get bh =-	do len <- get bh-	   mapM (\_ -> get bh) [1..(len::Int)]--instance Binary a => Binary (Maybe a) where-    put_ bh Nothing  = putByte bh 0-    put_ bh (Just a) = do putByte bh 1; put_ bh a-    get bh           = do h <- getWord8 bh-                          case h of-                            0 -> return Nothing-                            _ -> do x <- get bh; return (Just x)---- Instances for FastPackedStrings-instance Binary P.ByteString where-    put_ bh@(BinIO ix_r h) ps@(P.PS _ptr _s l) = do-            put_ bh l   -- size-            ix <- readFastMutInt ix_r-            P.hPut h ps-            writeFastMutInt ix_r (ix+l)-            return ()--    get bh@(BinIO ix_r h) = do-            l  <- get bh-            ix <- readFastMutInt ix_r-            ps <- {-#SCC "Binary.ByteString.get" #-}P.hGet h l-            writeFastMutInt ix_r (ix+l)-            return $! ps--{--            ps <- P.generate l $ \ptr -> do-                  let loop p n# | n# ==# l# = return ()-                                | otherwise = do-                                        c <- hGetChar h-                                        poke p (c2w c)-                                        loop (p `plusPtr` 1) (n# +# 1#)-                  loop ptr 0#-                  return l-            where-                c2w = fromIntegral . ord--}----------------------------------------------------------------------------- FastMutInt----data FastMutInt = FastMutInt !(MutableByteArray# RealWorld)--newFastMutInt :: IO FastMutInt-newFastMutInt = IO $ \s ->-  case newByteArray# size s of { (# s', arr #) ->-  (# s', FastMutInt arr #) }-  where I# size = SIZEOF_HSINT--readFastMutInt :: FastMutInt -> IO Int-readFastMutInt (FastMutInt arr) = IO $ \s ->-  case readIntArray# arr 0# s of { (# s', i #) ->-  (# s', I# i #) }--writeFastMutInt :: FastMutInt -> Int -> IO ()-writeFastMutInt (FastMutInt arr) (I# i) = IO $ \s ->-  case writeIntArray# arr 0# i s of { s' ->-  (# s', () #) }
+ Lib/FixPrecedence.hs view
@@ -0,0 +1,343 @@+module Lib.FixPrecedence (withPrecExp, withPrecDecl, precTable, FixPrecedence(..) ) where++import qualified Data.Map as M+import Language.Haskell.Syntax+import Data.List++{-+    PrecedenceData++    This is a data type to hold precedence information.  It simply records,+    for each operator, its precedence level (a number), and associativity+    (one of HsAssocNone, HsAssocLeft, or HsAssocRight).+-}+type PrecedenceData = M.Map HsQName (HsAssoc, Int)++{-+    findPrec++    Looks up precedence information for a goven operator.  If the operator+    is not in the precedence data, the Haskell report specifies that it+    should be treated as infixl 9.+-}+findPrec :: PrecedenceData -> HsQName -> (HsAssoc, Int)+findPrec = flip (M.findWithDefault defaultPrec)+    where defaultPrec = (HsAssocLeft, 9)++{-+    precWrong++    This returns True iff the first operator should be a parent of the+    second in the expression tree, when they occur consecutively left to+    right in the input.  This is called "wrong" because the parser in+    Language.Haskell.Parser treats everything as left associative at the+    same precedence, so the right-most operator will be the parent in the+    expression tree in the original input.++    XXX: Currently, this function treats operators with no associativity+         as if they were left associative.  It also looks only at the+         associativity of the left-most operator.  This should work for+         correct code, but it does not report errors for incorrect code.+-}+precWrong :: PrecedenceData -> HsQName -> HsQName -> Bool+precWrong pd a b = let (assoc, prec) = findPrec pd a+                       (_, prec')    = findPrec pd b+                   in     (prec < prec')+                       || (prec == prec' && assoc == HsAssocRight)++{-+    nameFromQOp++    Extracts the HsQName from an HsQOp.+-}+nameFromQOp :: HsQOp -> HsQName+nameFromQOp (HsQVarOp s) = s+nameFromQOp (HsQConOp s) = s++nameFromOp :: HsOp -> HsQName+nameFromOp (HsVarOp n) = UnQual n+nameFromOp (HsConOp n) = UnQual n++{-+    withPrecExp++    This routine fixes up an expression by applying precedence data.+-}+withPrecExp :: PrecedenceData -> HsExp -> HsExp++{-+    This is the heart of the whole thing.  It applies an algorithm+    described by LaLonde and Rivieres in ACM Transactions on Programming+    Languages and Systems, January 1981.  The idea is to take a parse+    tree with a consistent left-associative organization, and rearrange it+    to match a precedence table.++    A few changes have been made.  LaLonde and Rivieres remove parentheses+    from their parse tree, which isn't necessary here; and they work with+    an inherently right-associative grammar, while Language.Haskell.Parser+    produces a left-associative grammar.+-}+withPrecExp pd (HsInfixApp k@(HsInfixApp e qop' f) qop g) =+    let g'  = withPrecExp pd g+        op  = nameFromQOp qop+        op' = nameFromQOp qop'+    in  if precWrong pd op' op+        then let e' = withPrecExp pd e+                 f' = withPrecExp pd f+             in  withPrecExp pd (HsInfixApp e' qop' (HsInfixApp f' qop g'))+        else HsInfixApp (withPrecExp pd k) qop g'++withPrecExp pd (HsInfixApp e op f) =+    HsInfixApp (withPrecExp pd e) op (withPrecExp pd f)++{-+    The remaining cases simply propogate the correction throughout other+    elements of the grammar.+-}+withPrecExp _  (HsVar v)                = HsVar v+withPrecExp _  (HsCon c)                = HsCon c+withPrecExp _  (HsLit l)                = HsLit l+withPrecExp pd (HsApp e f)              =+    HsApp (withPrecExp pd e) (withPrecExp pd f)+withPrecExp pd (HsNegApp e)             =+    HsNegApp (withPrecExp pd e)+withPrecExp pd (HsLambda loc pats e)    =+    let pats' = map (withPrecPat pd) pats+    in  HsLambda loc pats' (withPrecExp pd e)+withPrecExp pd (HsLet decls e)          =+    let (pd', decls') = mapAccumL withPrecDecl pd decls+    in  HsLet decls' (withPrecExp pd' e)+withPrecExp pd (HsIf e f g)             =+    HsIf (withPrecExp pd e) (withPrecExp pd f) (withPrecExp pd g)+withPrecExp pd (HsCase e alts)          =+    let alts' = map (withPrecAlt pd) alts+    in  HsCase (withPrecExp pd e) alts'+withPrecExp pd (HsDo stmts)             =+    let (_, stmts') = mapAccumL withPrecStmt pd stmts+    in  HsDo stmts'+withPrecExp pd (HsTuple exps)           =+    let exps' = map (withPrecExp pd) exps+    in  HsTuple exps'+withPrecExp pd (HsList exps)            =+    let exps' = map (withPrecExp pd) exps+    in  HsList exps'+withPrecExp pd (HsParen e)              =+    HsParen (withPrecExp pd e)+withPrecExp pd (HsLeftSection e op)     =+    HsLeftSection (withPrecExp pd e) op+withPrecExp pd (HsRightSection op e)    =+    HsRightSection op (withPrecExp pd e)+withPrecExp pd (HsRecConstr n upd)      =+    let upd' = map (withPrecUpd pd) upd+    in  HsRecConstr n upd'+withPrecExp pd (HsRecUpdate e upd)      =+    let upd' = map (withPrecUpd pd) upd+    in  HsRecUpdate (withPrecExp pd e) upd'+withPrecExp pd (HsEnumFrom e)           =+    HsEnumFrom (withPrecExp pd e)+withPrecExp pd (HsEnumFromThen e f)     =+    HsEnumFromThen (withPrecExp pd e) (withPrecExp pd f)+withPrecExp pd (HsEnumFromTo e f)       =+    HsEnumFromTo (withPrecExp pd e) (withPrecExp pd f)+withPrecExp pd (HsEnumFromThenTo e f g) =+    HsEnumFromThenTo (withPrecExp pd e) (withPrecExp pd f) (withPrecExp pd g)+withPrecExp pd (HsListComp e stmts)     =+    let (_, stmts') = mapAccumL withPrecStmt pd stmts+    in  HsListComp (withPrecExp pd e) stmts'+withPrecExp pd (HsExpTypeSig l e t)     =+    HsExpTypeSig l (withPrecExp pd e) t+withPrecExp pd (HsAsPat n e)            =+    HsAsPat n (withPrecExp pd e)+withPrecExp _  (HsWildCard)             =+    HsWildCard+withPrecExp pd (HsIrrPat e)             =+    HsIrrPat (withPrecExp pd e)++{-+    This function is analogous to withPrec, but operates on patterns instead+    of expressions.+-}+withPrecPat :: PrecedenceData -> HsPat -> HsPat++{-+    This is the same algorithm based on Lalonde and Rivieres, but designed+    to work with infix data constructors in pattern matching.+-}+withPrecPat pd (HsPInfixApp k@(HsPInfixApp e op' f) op g) =+    let g' = withPrecPat pd g+    in  if precWrong pd op' op+        then let e' = withPrecPat pd e+                 f' = withPrecPat pd f+             in  withPrecPat pd (HsPInfixApp e' op' (HsPInfixApp f' op g'))+        else HsPInfixApp (withPrecPat pd k) op g'++withPrecPat pd (HsPInfixApp e op f) =+    HsPInfixApp (withPrecPat pd e) op (withPrecPat pd f)++withPrecPat _  (HsPVar n)           = HsPVar n+withPrecPat _  (HsPLit l)           = HsPLit l+withPrecPat pd (HsPNeg p)           = HsPNeg (withPrecPat pd p)+withPrecPat pd (HsPApp n ps)        = let ps' = map (withPrecPat pd) ps+                                      in  HsPApp n ps'+withPrecPat pd (HsPTuple ps)        = let ps' = map (withPrecPat pd) ps+                                      in  HsPTuple ps'+withPrecPat pd (HsPList ps)         = let ps' = map (withPrecPat pd) ps+                                      in  HsPList ps'+withPrecPat pd (HsPParen p)         = HsPParen (withPrecPat pd p)+withPrecPat pd (HsPRec n pfs)       = let pfs' = map (withPrecPatField pd) pfs+                                      in  HsPRec n pfs'+withPrecPat pd (HsPAsPat n p)       = HsPAsPat n (withPrecPat pd p)+withPrecPat _  (HsPWildCard)        = HsPWildCard+withPrecPat pd (HsPIrrPat p)        = HsPIrrPat (withPrecPat pd p)++{-+    Propogates precedence fixing through a pattern "field"+-}+withPrecPatField :: PrecedenceData -> HsPatField -> HsPatField+withPrecPatField pd (HsPFieldPat n p) = HsPFieldPat n (withPrecPat pd p)++{-+    Propogates precedence fixing through declaration sections.  This+    gets interesting, because declarations can actually change the+    existing precedence, so withPrecDecl returns both the transformed+    tree and an augmented precedence relation.+-}+withPrecDecl :: PrecedenceData -> HsDecl -> (PrecedenceData, HsDecl)+withPrecDecl pd d@(HsInfixDecl _ assoc p ops)  =+    let nms      = map nameFromOp ops+        prec     = (assoc, p)+        pd'      = M.union pd $ M.fromList $ map (flip (,) prec) nms+    in  (pd', d)+withPrecDecl pd (HsClassDecl l ctx n ns decls) =+    let (pd', decls') = mapAccumL withPrecDecl pd decls+    in  (pd', HsClassDecl l ctx n ns decls')+withPrecDecl pd (HsInstDecl l ctx n ts decls)  =+    -- The question of what to do with fixity declarations here is+    -- interesting.  The report says they aren't allowed (4.3.2), but+    -- GHC accepts them as of version 6.6 and apparently ignores them.+    -- The best thing is probably to match GHC's behavior.+    let decls' = map snd $ map (withPrecDecl pd) decls+    in  (pd, HsInstDecl l ctx n ts decls')+withPrecDecl pd (HsFunBind ms)                 =+    let ms' = map (withPrecMatch pd) ms+    in  (pd, HsFunBind ms')+withPrecDecl pd (HsPatBind l p rhs decls)      =+    let p'     = withPrecPat pd p+        (pd',decls') = mapAccumL withPrecDecl pd decls+        rhs'   = withPrecRhs pd' rhs+    in  (pd, HsPatBind l p' rhs' decls')+withPrecDecl pd d                              = (pd, d)++{-+    Propogates precedence fixing through HsMatch+-}+withPrecMatch :: PrecedenceData -> HsMatch -> HsMatch+withPrecMatch pd (HsMatch l n ps rhs decls)           =+    let ps'           = map (withPrecPat pd) ps+        (pd', decls') = mapAccumL withPrecDecl pd decls+        rhs'          = withPrecRhs pd' rhs+    in  HsMatch l n ps' rhs' decls'++{-+    Propogates precedence fixing through HsRhs+-}+withPrecRhs :: PrecedenceData -> HsRhs -> HsRhs+withPrecRhs pd (HsUnGuardedRhs e)  = HsUnGuardedRhs (withPrecExp pd e)+withPrecRhs pd (HsGuardedRhss grs) = let grs' = map (withPrecGRhs pd) grs+                                     in HsGuardedRhss grs'++withPrecGRhs :: PrecedenceData -> HsGuardedRhs -> HsGuardedRhs+withPrecGRhs pd (HsGuardedRhs l e f) =+    HsGuardedRhs l (withPrecExp pd e) (withPrecExp pd f)++{-+    Propogates precedence fixing through case statement alternatives.+-}+withPrecAlt :: PrecedenceData -> HsAlt -> HsAlt+withPrecAlt pd (HsAlt l p alts ds) =+    let (pd', ds') = mapAccumL withPrecDecl pd ds+    in HsAlt l (withPrecPat pd p) (withPrecGAlts pd' alts) ds'++withPrecGAlts :: PrecedenceData -> HsGuardedAlts -> HsGuardedAlts+withPrecGAlts pd (HsUnGuardedAlt e) = HsUnGuardedAlt (withPrecExp pd e)+withPrecGAlts pd (HsGuardedAlts alts) = let alts' = map (withPrecGAlt pd) alts+                                        in  HsGuardedAlts alts'++withPrecGAlt :: PrecedenceData -> HsGuardedAlt -> HsGuardedAlt+withPrecGAlt pd (HsGuardedAlt l e f) =+    HsGuardedAlt l (withPrecExp pd e) (withPrecExp pd f)++{-+    Propogates precedence fixing through do blocks.  Because let statements+    can change precedence, the result is both the transformed tree and an+    augmented precedence relation, much like in withPrecDecl.+-}+withPrecStmt :: PrecedenceData -> HsStmt -> (PrecedenceData, HsStmt)+withPrecStmt pd (HsGenerator l p e) =+    (pd, HsGenerator l (withPrecPat pd p) (withPrecExp pd e))+withPrecStmt pd (HsQualifier e) = (pd, HsQualifier (withPrecExp pd e))+withPrecStmt pd (HsLetStmt ds)  = let (pd', ds') = mapAccumL withPrecDecl pd ds+                                  in  (pd', HsLetStmt ds')++{-+    Propogates precedence fixing through record field updates.+-}+withPrecUpd :: PrecedenceData -> HsFieldUpdate -> HsFieldUpdate+withPrecUpd pd (HsFieldUpdate n e) = HsFieldUpdate n (withPrecExp pd e)++{-+    This is the default precedence table used for parsing expressions.+    It is taken from the precedences of the main operators in the Haskell+    Prelude.++    XXX: It might be a good idea to search the standard library docs for+         other operators.  These are the ones listed in the Haskell Report+         section 4.  For example, one that is not included here is+         Data.Ratio.%+-}+precTable :: PrecedenceData+precTable = M.fromList+    [+        (UnQual (HsSymbol "!!"),      (HsAssocLeft,  9)),+        (UnQual (HsSymbol "."),       (HsAssocRight, 9)),+        (UnQual (HsSymbol "^"),       (HsAssocRight, 8)),+        (UnQual (HsSymbol "^^"),      (HsAssocRight, 8)),+        (UnQual (HsSymbol "**"),      (HsAssocLeft,  8)),+        (UnQual (HsSymbol "*"),       (HsAssocLeft,  7)),+        (UnQual (HsSymbol "/"),       (HsAssocLeft,  7)),+        (UnQual (HsIdent  "div"),     (HsAssocLeft,  7)),+        (UnQual (HsIdent  "mod"),     (HsAssocLeft,  7)),+        (UnQual (HsIdent  "rem"),     (HsAssocLeft,  7)),+        (UnQual (HsIdent  "quot"),    (HsAssocLeft,  7)),+        (UnQual (HsSymbol "+"),       (HsAssocLeft,  6)),+        (UnQual (HsSymbol "-"),       (HsAssocLeft,  6)),+        (UnQual (HsSymbol ":"),       (HsAssocRight, 5)),+        (Special HsCons,              (HsAssocRight, 5)),+        (UnQual (HsSymbol "++"),      (HsAssocRight, 5)),+        (UnQual (HsSymbol "=="),      (HsAssocNone,  4)),+        (UnQual (HsSymbol "/="),      (HsAssocNone,  4)),+        (UnQual (HsSymbol "<"),       (HsAssocNone,  4)),+        (UnQual (HsSymbol "<="),      (HsAssocNone,  4)),+        (UnQual (HsSymbol ">"),       (HsAssocNone,  4)),+        (UnQual (HsSymbol ">="),      (HsAssocNone,  4)),+        (UnQual (HsIdent  "elem"),    (HsAssocNone,  4)),+        (UnQual (HsIdent  "notElem"), (HsAssocNone,  4)),+        (UnQual (HsSymbol "&&"),      (HsAssocRight, 3)),+        (UnQual (HsSymbol "||"),      (HsAssocRight, 2)),+        (UnQual (HsSymbol ">>"),      (HsAssocLeft,  1)),+        (UnQual (HsSymbol ">>="),     (HsAssocLeft,  1)),+        (UnQual (HsSymbol "$"),       (HsAssocRight, 0)),+        (UnQual (HsSymbol "$!"),      (HsAssocRight, 0)),+        (UnQual (HsIdent  "seq"),     (HsAssocRight, 0))+    ]+++class FixPrecedence a where+    fixPrecedence :: a -> a++instance FixPrecedence HsExp where+    fixPrecedence = withPrecExp precTable++instance FixPrecedence HsDecl where+    fixPrecedence = snd . withPrecDecl precTable+
+ Lib/OEIS.hs view
@@ -0,0 +1,397 @@+-- | A Haskell interface to the Online Encyclopedia of Integer+-- Sequences (OEIS),  <http://www.research.att.com/~njas/sequences/>.+-- Comments, suggestions, or bug reports should be sent to +-- Brent Yorgey, byorgey /at/ gmail /dot/ com.+--+-- Modified for lambdabot by Twan van Laarhoven, twanvl /at/ gmail /dot/ com++module Lib.OEIS +  ( +    -- * Example usage+    -- $sample+    +    -- * Lookup functions+    getSequenceByID, lookupSequenceByID, +    extendSequence, lookupSequence,+    searchSequence_IO,+    getSequenceByID_IO, lookupSequenceByID_IO,+    extendSequence_IO, lookupSequence_IO,++    -- * Data structures+    SequenceData,+    Language(..), Keyword(..),+    OEISSequence(..)++  ) where++import Config+import Lib.Url+import Network.URI+import System.IO.Unsafe (unsafePerformIO)+import Data.List (intersperse, isPrefixOf, tails, foldl')+import Data.Char (toUpper, toLower, isSpace)+import Data.Maybe (listToMaybe, fromMaybe)+import Control.Arrow++type SequenceData = [Integer]+++-- | Look up a sequence in the OEIS using its search function+searchSequence_IO :: String -> IO (Maybe OEISSequence)+searchSequence_IO x = getOEIS (baseSearchURI++) (escapeURIString isAllowedInURI $ x)++-- | Look up a sequence in the OEIS by its catalog number.  Generally+-- this would be its A-number, but M-numbers (from the /Encyclopedia of+-- Integer Sequences/) and N-numbers (from the /Handbook of Integer+-- Sequences/) can be used as well.+--+-- Note that the result is not in the 'IO' monad, even though the+-- implementation requires looking up information via the+-- Internet. There are no side effects to speak of, and from a+-- practical point of view the function is referentially transparent+-- (OEIS A-numbers could change in theory, but it's extremely+-- unlikely).  If you're a nitpicky purist, feel free to use the+-- provided 'getSequenceByID_IO' instead.+-- +-- Examples:+-- +-- > Prelude Math.OEIS> getSequenceByID "A000040"    -- the prime numbers+-- > Just [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47...+-- >+-- > Prelude Math.OEIS> getSequenceByID "A-1"        -- no such sequence!+-- > Nothing++getSequenceByID :: String -> Maybe SequenceData+getSequenceByID = unsafePerformIO . getSequenceByID_IO++-- | The same as 'getSequenceByID', but with a result in the 'IO'+-- monad.+getSequenceByID_IO :: String -> IO (Maybe SequenceData)+getSequenceByID_IO x = lookupSequenceByID_IO x >>= return . fmap sequenceData++-- | Look up a sequence by ID number, returning a data structure+-- containing the entirety of the information the OEIS has on the+-- sequence.+--+-- The standard disclaimer about not being in the 'IO' monad applies.+--+-- Examples:+--+-- > Prelude Math.OEIS> description `fmap` lookupSequenceByID "A000040"+-- > Just "The prime numbers."+-- >+-- > Prelude Math.OEIS> keywords `fmap` lookupSequenceByID "A000105"+-- > Just [Nonn,Hard,Nice,Core]++lookupSequenceByID :: String -> Maybe OEISSequence+lookupSequenceByID = unsafePerformIO . lookupSequenceByID_IO++-- | The same as 'lookupSequenceByID', but in the 'IO' monad.+lookupSequenceByID_IO :: String -> IO (Maybe OEISSequence)+lookupSequenceByID_IO = getOEIS idSearchURI++-- | Extend a sequence by using it as a lookup to the OEIS, taking +-- the first sequence returned as a result, and using it to augment +-- the original sequence.+--+-- Note that @xs@ is guaranteed to be a prefix of @extendSequence xs@.+-- If the matched OEIS sequence contains any elements prior to those+-- matching @xs@, they will be dropped.  In addition, if no matching+-- sequences are found, @xs@ will be returned unchanged.+--+-- The result is not in the 'IO' monad even though the implementation+-- requires looking up information via the Internet.  There are no+-- side effects, and practically speaking this function is+-- referentially transparent (technically, results may change from+-- time to time when the OEIS database is updated; this is slightly+-- more likely than the results of 'getSequenceByID' changing, but still+-- unlikely enough to be essentially a non-issue.  Again, purists may+-- use 'extendSequence_IO').+--+-- Examples:+--+-- > Prelude Math.OEIS> extendSequence [5,7,11,13,17]+-- > [5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71...+--+-- > Prelude Math.OEIS> extendSequence [2,4,8,16,32]+-- > [2,4,8,16,32,64,128,256,512,1024,2048,4096,8192...+--+-- > Prelude Math.OEIS> extendSequence [9,8,7,41,562]   -- nothing matches+-- > [9,8,7,41,562]++extendSequence :: SequenceData -> SequenceData+extendSequence = unsafePerformIO . extendSequence_IO++-- | The same as 'extendSequence', but in the 'IO' monad.+extendSequence_IO :: [Integer] -> IO [Integer]+extendSequence_IO [] = return []+extendSequence_IO xs = do oeis <- lookupSequence_IO xs+                          case oeis of +                            Nothing -> return xs+                            Just s  -> return $ extend xs (sequenceData s)++-- | Find a matching sequence in the OEIS database, returning a data+-- structure containing the entirety of the information the OEIS has+-- on the sequence.+--+-- The standard disclaimer about not being in the 'IO' monad applies.+lookupSequence :: SequenceData -> Maybe OEISSequence+lookupSequence = unsafePerformIO . lookupSequence_IO++-- | The same as 'lookupSequence', but in the 'IO' monad.+lookupSequence_IO :: SequenceData -> IO (Maybe OEISSequence)+lookupSequence_IO = getOEIS seqSearchURI++-- | @extend xs ext@ returns the maximal suffix of @ext@ of which @xs@ is+-- a prefix, or @xs@ if @xs@ is not a prefix of any suffixes of @ext@. It+-- is guaranteed that+--+-- > forall xs ext. xs `isPrefixOf` (extend xs ext)+extend :: SequenceData -> SequenceData -> SequenceData+extend xs ext = fromMaybe xs . listToMaybe . filter (xs `isPrefixOf`) $ tails ext++baseSearchURI :: String+baseSearchURI = "http://www.research.att.com/~njas/sequences/?n=1&fmt=3&q="++idSearchURI :: String -> String+idSearchURI n = baseSearchURI ++ "id:" ++ n++seqSearchURI :: SequenceData -> String+seqSearchURI xs = baseSearchURI ++ (concat . intersperse "," . map show $ xs)++data LookupError = LookupError deriving Show++getOEIS :: (a -> String) -> a -> IO (Maybe OEISSequence)+getOEIS toURI key = case parseURI (toURI key) of+                      Nothing  -> return Nothing+                      Just uri -> do content <- get uri+                                     case content of+                                       (Left LookupError) -> return Nothing+                                       (Right text) -> return $ parseOEIS text++get :: URI -> IO (Either LookupError String)+get uri = do+    eresp <- getHtmlPage uri (proxy config)+    case eresp of+      [] -> return (Left LookupError)+      xs -> return (Right $ unlines $ dropWhile (/="\r") xs)+++-----------------------------------------------------------++-- | Programming language that some code to generate the sequence is+-- written in.  The only languages indicated natively by the OEIS+-- database are Mathematica and Maple; any other languages will be+-- listed (usually in parentheses) at the beginning of the actual code+-- snippet.+data Language = Mathematica | Maple | Other deriving Show++-- | OEIS keywords.  For more information on the meaning of each+-- keyword, see+-- <http://www.research.att.com/~njas/sequences/eishelp2.html#RK>.+data Keyword = Base | Bref | Cofr | Cons | Core | Dead | Dumb | Dupe |+               Easy | Eigen | Fini | Frac | Full | Hard | More | Mult |+               New | Nice | Nonn | Obsc | Sign | Tabf | Tabl | Uned |+               Unkn | Walk | Word +       deriving (Eq,Show,Read)++readKeyword :: String -> Keyword+readKeyword = read . capitalize++capitalize :: String -> String+capitalize ""     = ""+capitalize (c:cs) = toUpper c : map toLower cs++-- | Data structure for storing an OEIS entry.  For more information+-- on the various components, see+-- <http://www.research.att.com/~njas/sequences/eishelp2.html>.++data OEISSequence = +  OEIS { catalogNums  :: [String], +         -- ^ Catalog number(s), e.g. A000040, N1425. (%I)+         sequenceData :: SequenceData, +         -- ^ The actual sequence data (or absolute values of the sequence data in the case of signed sequences).  (%S,T,U)+         signedData   :: SequenceData,    +         -- ^ Signed sequence data (empty for sequences with all positive entries).  (%V,W,X)+         description  :: String,+         -- ^ Short description of the sequence. (%N)+         references   :: [String],        +         -- ^ List of academic references. (%D)+         links        :: [String],        +         -- ^ List of links to more information on the web. (%H)+         formulas     :: [String],        +         -- ^ Formulas or equations involving the sequence. (%F)+         xrefs        :: [String],        +         -- ^ Cross-references to other sequences. (%Y)+         author       :: String,          +         -- ^ Author who input the sequence into the database. (%A)+         offset       :: Int,             +         -- ^ Subscript\/index of the first term. (%O)+         firstGT1     :: Int,             +         -- ^ Index of the first term \> 1.  (%O)+         programs     :: [(Language,String)],  +         -- ^ Code that can be used to generate the sequence. (%p,t,o)+         extensions   :: [String],        +         -- ^ Corrections, extensions, or edits. (%E)+         examples     :: [String],        +         -- ^ Examples. (%e)+         keywords     :: [Keyword],       +         -- ^ Keywords. (%K)+         comments     :: [String]         +         -- ^ Comments. (%C)+       }  deriving Show++emptyOEIS :: OEISSequence+emptyOEIS = OEIS [] [] [] "" [] [] [] [] "" 0 0 [] [] [] [] []++addElement :: (Char, String) -> (OEISSequence -> OEISSequence)+addElement ('I', x) c = c { catalogNums = words x }+addElement (t, x)   c | t `elem` "STU" = c { sequenceData = nums ++ (sequenceData c) }+    where nums = map read $ csvItems x +addElement (t, x)   c | t `elem` "VWX" = c { signedData = nums ++ (signedData c) }+    where nums = map read $ csvItems x+addElement ('N', x) c = c { description = x                  }+addElement ('D', x) c = c { references  = x : (references c) } +addElement ('H', x) c = c { links       = x : (links c)      }+addElement ('F', x) c = c { formulas    = x : (formulas c)   }+addElement ('Y', x) c = c { xrefs       = x : (xrefs c)      }+addElement ('A', x) c = c { author      = x                  }+addElement ('O', x) c = c { offset      = read o             +                          , firstGT1    = read f }+  where (o,f) = second tail . span (/=',') $ x+addElement ('p', x) c = c { programs    = (Mathematica, x) :+                                            (programs c)     }+addElement ('t', x) c = c { programs    = (Maple, x) :+                                            (programs c)     }+addElement ('o', x) c = c { programs    = (Other, x) : +                                            (programs c)     }+addElement ('E', x) c = c { extensions  = x : (extensions c) }+addElement ('e', x) c = c { examples    = x : (examples c)   }+addElement ('K', x) c = c { keywords    = parseKeywords x    }+addElement ('C', x) c = c { comments    = x : (comments c)   }++parseOEIS :: String -> Maybe OEISSequence+parseOEIS x = if "no match" `isPrefixOf` (ls!!1) +                then Nothing+                else Just . foldl' (flip addElement) emptyOEIS . reverse . parseRawOEIS $ ls'+    where ls = lines x+          ls' = init . dropWhile ((/= "%") . take 1) $ ls++parseRawOEIS :: [String] -> [(Char, String)]+parseRawOEIS = map parseItem . combineConts++parseKeywords :: String -> [Keyword]+parseKeywords = map readKeyword . csvItems++csvItems :: String -> [String]+csvItems "" = []+csvItems x = item : others+    where (item, rest) = span (/=',') x+          others = csvItems $ del ',' rest++del :: Char -> String -> String+del _ ""     = ""+del c (x:xs) | c==x      = xs+             | otherwise = (x:xs)++parseItem :: String -> (Char, String)+parseItem s = (c, str) +    where ( '%':c:_ , rest) = splitWord s+          ( _idNum, str )   = if (c == 'I') then ("", rest)+                                            else splitWord rest+                           +combineConts :: [String] -> [String]+combineConts [] = []+combineConts [x] = [x]+combineConts (s@('%':_:_) : ss) = +  uncurry (:) . (joinConts s *** combineConts) . break isItem $ ss++splitWord :: String -> (String, String)+splitWord = second trimLeft . break isSpace++isItem :: String -> Bool+isItem x = not (null x) && '%' == head x++joinConts :: String -> [String] -> String+joinConts s conts = s ++ (concat . map trimLeft $ conts)++trimLeft :: String -> String+trimLeft = dropWhile isSpace++{- $sample++Suppose we are interested in answering the question, \"how many+distinct binary trees are there with exactly 20 nodes?\" Some naive+code to answer this question might be as follows:++> import Data.List (genericLength)+>+> -- data-less binary trees.+> data BTree = Empty | Fork BTree BTree  deriving Show+>+> -- A list of all the binary trees with exactly n nodes.+> listTrees :: Int -> [BTree]+> listTrees 0 = [Empty]+> listTrees n = [Fork left right | +>                k <- [0..n-1],+>                left <- listTrees k,+>                right <- listTrees (n-1-k) ]+> +> countTrees :: Int -> Integer+> countTrees = genericLength . listTrees++The problem, of course, is that @countTrees@ is horribly inefficient:++@+*Main> :set +s+*Main> countTrees 5+42+(0.00 secs, 0 bytes)+*Main> countTrees 10+16796+(0.47 secs, 27513240 bytes)+*Main> countTrees 12+208012+(7.32 secs, 357487720 bytes)+*Main> countTrees 13+*** Exception: stack overflow+@++There's really no way we can evaluate @countTrees 20@.  The solution? Cheat!++> import Math.OEIS+>+> -- countTrees works ok up to 10 nodes.+> smallTreeCounts = map countTrees [0..10]+> +> -- now, extend the sequence via the OEIS!+> treeCounts = extendSequence smallTreeCounts++Now we can answer the question:++> *Main> treeCounts !! 20+> 6564120420++Sweet.  Of course, to have any sort of confidence in our answer, more+research is required!  Let's see what combinatorial goodness we have+stumbled across.++@+*Main> description \`fmap\` lookupSequence smallTreeCounts+Just \"Catalan numbers: C(n) = binomial(2n,n)\/(n+1) = (2n)!\/(n!(n+1)!). Also called Segner numbers.\"+@++Catalan numbers, interesting.  And a nice formula we could use to code+up a /real/ solution!  Hmm, where can we read more about these+so-called \'Catalan numbers\'?++@+*Main> (head . references) \`fmap\` lookupSequence smallTreeCounts+Just [\"A. Bernini, F. Disanto, R. Pinzani and S. Rinaldi, Permutations defining convex permutominoes, preprint, 2007.\"]+*Main> (head . links) \`fmap\` lookupSequence smallTreeCounts+Just [\"N. J. A. Sloane, \<a href=\\\"http:\/\/www.research.att.com\/~njas\/sequences\/b000108.txt\\\"\>The first 200 Catalan numbers\<\/a\>\"]+@++And so on.  Reams of collected mathematical knowledge at your+fingertips!  You must promise only to use this power for Good.  +-}
Lib/Parser.hs view
@@ -1,8443 +1,84 @@-{-# OPTIONS -fglasgow-exts -cpp #-}-{-# OPTIONS -w #-}--------------------------------------------------------------------------------- |--- Module      :  Lib.Haskell.Parser--- Copyright   :  (c) Simon Marlow, Sven Panne 1997-2000--- License     :  BSD-style (see the file libraries/base/LICENSE)------ Maintainer  :  libraries@haskell.org--- Stability   :  experimental--- Portability :  portable------ Haskell parser, modified to be provide an expression parser.----------------------------------------------------------------------------------module Lib.Parser (-              parseExpr,-              ParseMode(..), defaultParseMode, ParseResult(..)) where-import Language.Haskell.Syntax-import Language.Haskell.ParseMonad-import Language.Haskell.Lexer-import Language.Haskell.ParseUtils-#if __GLASGOW_HASKELL__ >= 503-import GHC.Exts-#else-import GlaExts-#endif---- parser produced by Happy Version 1.15--newtype HappyAbsSyn  = HappyAbsSyn (() -> ())-happyIn4 :: (HsModule) -> (HappyAbsSyn )-happyIn4 x = unsafeCoerce# x-{-# INLINE happyIn4 #-}-happyOut4 :: (HappyAbsSyn ) -> (HsModule)-happyOut4 x = unsafeCoerce# x-{-# INLINE happyOut4 #-}-happyIn5 :: (([HsImportDecl],[HsDecl])) -> (HappyAbsSyn )-happyIn5 x = unsafeCoerce# x-{-# INLINE happyIn5 #-}-happyOut5 :: (HappyAbsSyn ) -> (([HsImportDecl],[HsDecl]))-happyOut5 x = unsafeCoerce# x-{-# INLINE happyOut5 #-}-happyIn6 :: (([HsImportDecl],[HsDecl])) -> (HappyAbsSyn )-happyIn6 x = unsafeCoerce# x-{-# INLINE happyIn6 #-}-happyOut6 :: (HappyAbsSyn ) -> (([HsImportDecl],[HsDecl]))-happyOut6 x = unsafeCoerce# x-{-# INLINE happyOut6 #-}-happyIn7 :: (()) -> (HappyAbsSyn )-happyIn7 x = unsafeCoerce# x-{-# INLINE happyIn7 #-}-happyOut7 :: (HappyAbsSyn ) -> (())-happyOut7 x = unsafeCoerce# x-{-# INLINE happyOut7 #-}-happyIn8 :: (()) -> (HappyAbsSyn )-happyIn8 x = unsafeCoerce# x-{-# INLINE happyIn8 #-}-happyOut8 :: (HappyAbsSyn ) -> (())-happyOut8 x = unsafeCoerce# x-{-# INLINE happyOut8 #-}-happyIn9 :: (Maybe [HsExportSpec]) -> (HappyAbsSyn )-happyIn9 x = unsafeCoerce# x-{-# INLINE happyIn9 #-}-happyOut9 :: (HappyAbsSyn ) -> (Maybe [HsExportSpec])-happyOut9 x = unsafeCoerce# x-{-# INLINE happyOut9 #-}-happyIn10 :: ([HsExportSpec]) -> (HappyAbsSyn )-happyIn10 x = unsafeCoerce# x-{-# INLINE happyIn10 #-}-happyOut10 :: (HappyAbsSyn ) -> ([HsExportSpec])-happyOut10 x = unsafeCoerce# x-{-# INLINE happyOut10 #-}-happyIn11 :: (()) -> (HappyAbsSyn )-happyIn11 x = unsafeCoerce# x-{-# INLINE happyIn11 #-}-happyOut11 :: (HappyAbsSyn ) -> (())-happyOut11 x = unsafeCoerce# x-{-# INLINE happyOut11 #-}-happyIn12 :: ([HsExportSpec]) -> (HappyAbsSyn )-happyIn12 x = unsafeCoerce# x-{-# INLINE happyIn12 #-}-happyOut12 :: (HappyAbsSyn ) -> ([HsExportSpec])-happyOut12 x = unsafeCoerce# x-{-# INLINE happyOut12 #-}-happyIn13 :: (HsExportSpec) -> (HappyAbsSyn )-happyIn13 x = unsafeCoerce# x-{-# INLINE happyIn13 #-}-happyOut13 :: (HappyAbsSyn ) -> (HsExportSpec)-happyOut13 x = unsafeCoerce# x-{-# INLINE happyOut13 #-}-happyIn14 :: ([HsImportDecl]) -> (HappyAbsSyn )-happyIn14 x = unsafeCoerce# x-{-# INLINE happyIn14 #-}-happyOut14 :: (HappyAbsSyn ) -> ([HsImportDecl])-happyOut14 x = unsafeCoerce# x-{-# INLINE happyOut14 #-}-happyIn15 :: (HsImportDecl) -> (HappyAbsSyn )-happyIn15 x = unsafeCoerce# x-{-# INLINE happyIn15 #-}-happyOut15 :: (HappyAbsSyn ) -> (HsImportDecl)-happyOut15 x = unsafeCoerce# x-{-# INLINE happyOut15 #-}-happyIn16 :: (Bool) -> (HappyAbsSyn )-happyIn16 x = unsafeCoerce# x-{-# INLINE happyIn16 #-}-happyOut16 :: (HappyAbsSyn ) -> (Bool)-happyOut16 x = unsafeCoerce# x-{-# INLINE happyOut16 #-}-happyIn17 :: (Maybe Module) -> (HappyAbsSyn )-happyIn17 x = unsafeCoerce# x-{-# INLINE happyIn17 #-}-happyOut17 :: (HappyAbsSyn ) -> (Maybe Module)-happyOut17 x = unsafeCoerce# x-{-# INLINE happyOut17 #-}-happyIn18 :: (Maybe (Bool, [HsImportSpec])) -> (HappyAbsSyn )-happyIn18 x = unsafeCoerce# x-{-# INLINE happyIn18 #-}-happyOut18 :: (HappyAbsSyn ) -> (Maybe (Bool, [HsImportSpec]))-happyOut18 x = unsafeCoerce# x-{-# INLINE happyOut18 #-}-happyIn19 :: ((Bool, [HsImportSpec])) -> (HappyAbsSyn )-happyIn19 x = unsafeCoerce# x-{-# INLINE happyIn19 #-}-happyOut19 :: (HappyAbsSyn ) -> ((Bool, [HsImportSpec]))-happyOut19 x = unsafeCoerce# x-{-# INLINE happyOut19 #-}-happyIn20 :: (Bool) -> (HappyAbsSyn )-happyIn20 x = unsafeCoerce# x-{-# INLINE happyIn20 #-}-happyOut20 :: (HappyAbsSyn ) -> (Bool)-happyOut20 x = unsafeCoerce# x-{-# INLINE happyOut20 #-}-happyIn21 :: ([HsImportSpec]) -> (HappyAbsSyn )-happyIn21 x = unsafeCoerce# x-{-# INLINE happyIn21 #-}-happyOut21 :: (HappyAbsSyn ) -> ([HsImportSpec])-happyOut21 x = unsafeCoerce# x-{-# INLINE happyOut21 #-}-happyIn22 :: (HsImportSpec) -> (HappyAbsSyn )-happyIn22 x = unsafeCoerce# x-{-# INLINE happyIn22 #-}-happyOut22 :: (HappyAbsSyn ) -> (HsImportSpec)-happyOut22 x = unsafeCoerce# x-{-# INLINE happyOut22 #-}-happyIn23 :: ([HsCName]) -> (HappyAbsSyn )-happyIn23 x = unsafeCoerce# x-{-# INLINE happyIn23 #-}-happyOut23 :: (HappyAbsSyn ) -> ([HsCName])-happyOut23 x = unsafeCoerce# x-{-# INLINE happyOut23 #-}-happyIn24 :: (HsCName) -> (HappyAbsSyn )-happyIn24 x = unsafeCoerce# x-{-# INLINE happyIn24 #-}-happyOut24 :: (HappyAbsSyn ) -> (HsCName)-happyOut24 x = unsafeCoerce# x-{-# INLINE happyOut24 #-}-happyIn25 :: (HsDecl) -> (HappyAbsSyn )-happyIn25 x = unsafeCoerce# x-{-# INLINE happyIn25 #-}-happyOut25 :: (HappyAbsSyn ) -> (HsDecl)-happyOut25 x = unsafeCoerce# x-{-# INLINE happyOut25 #-}-happyIn26 :: (Int) -> (HappyAbsSyn )-happyIn26 x = unsafeCoerce# x-{-# INLINE happyIn26 #-}-happyOut26 :: (HappyAbsSyn ) -> (Int)-happyOut26 x = unsafeCoerce# x-{-# INLINE happyOut26 #-}-happyIn27 :: (HsAssoc) -> (HappyAbsSyn )-happyIn27 x = unsafeCoerce# x-{-# INLINE happyIn27 #-}-happyOut27 :: (HappyAbsSyn ) -> (HsAssoc)-happyOut27 x = unsafeCoerce# x-{-# INLINE happyOut27 #-}-happyIn28 :: ([HsOp]) -> (HappyAbsSyn )-happyIn28 x = unsafeCoerce# x-{-# INLINE happyIn28 #-}-happyOut28 :: (HappyAbsSyn ) -> ([HsOp])-happyOut28 x = unsafeCoerce# x-{-# INLINE happyOut28 #-}-happyIn29 :: ([HsDecl]) -> (HappyAbsSyn )-happyIn29 x = unsafeCoerce# x-{-# INLINE happyIn29 #-}-happyOut29 :: (HappyAbsSyn ) -> ([HsDecl])-happyOut29 x = unsafeCoerce# x-{-# INLINE happyOut29 #-}-happyIn30 :: ([HsDecl]) -> (HappyAbsSyn )-happyIn30 x = unsafeCoerce# x-{-# INLINE happyIn30 #-}-happyOut30 :: (HappyAbsSyn ) -> ([HsDecl])-happyOut30 x = unsafeCoerce# x-{-# INLINE happyOut30 #-}-happyIn31 :: (HsDecl) -> (HappyAbsSyn )-happyIn31 x = unsafeCoerce# x-{-# INLINE happyIn31 #-}-happyOut31 :: (HappyAbsSyn ) -> (HsDecl)-happyOut31 x = unsafeCoerce# x-{-# INLINE happyOut31 #-}-happyIn32 :: ([HsType]) -> (HappyAbsSyn )-happyIn32 x = unsafeCoerce# x-{-# INLINE happyIn32 #-}-happyOut32 :: (HappyAbsSyn ) -> ([HsType])-happyOut32 x = unsafeCoerce# x-{-# INLINE happyOut32 #-}-happyIn33 :: ([HsDecl]) -> (HappyAbsSyn )-happyIn33 x = unsafeCoerce# x-{-# INLINE happyIn33 #-}-happyOut33 :: (HappyAbsSyn ) -> ([HsDecl])-happyOut33 x = unsafeCoerce# x-{-# INLINE happyOut33 #-}-happyIn34 :: ([HsDecl]) -> (HappyAbsSyn )-happyIn34 x = unsafeCoerce# x-{-# INLINE happyIn34 #-}-happyOut34 :: (HappyAbsSyn ) -> ([HsDecl])-happyOut34 x = unsafeCoerce# x-{-# INLINE happyOut34 #-}-happyIn35 :: (HsDecl) -> (HappyAbsSyn )-happyIn35 x = unsafeCoerce# x-{-# INLINE happyIn35 #-}-happyOut35 :: (HappyAbsSyn ) -> (HsDecl)-happyOut35 x = unsafeCoerce# x-{-# INLINE happyOut35 #-}-happyIn36 :: ([HsDecl]) -> (HappyAbsSyn )-happyIn36 x = unsafeCoerce# x-{-# INLINE happyIn36 #-}-happyOut36 :: (HappyAbsSyn ) -> ([HsDecl])-happyOut36 x = unsafeCoerce# x-{-# INLINE happyOut36 #-}-happyIn37 :: (HsDecl) -> (HappyAbsSyn )-happyIn37 x = unsafeCoerce# x-{-# INLINE happyIn37 #-}-happyOut37 :: (HappyAbsSyn ) -> (HsDecl)-happyOut37 x = unsafeCoerce# x-{-# INLINE happyOut37 #-}-happyIn38 :: ([HsName]) -> (HappyAbsSyn )-happyIn38 x = unsafeCoerce# x-{-# INLINE happyIn38 #-}-happyOut38 :: (HappyAbsSyn ) -> ([HsName])-happyOut38 x = unsafeCoerce# x-{-# INLINE happyOut38 #-}-happyIn39 :: (HsType) -> (HappyAbsSyn )-happyIn39 x = unsafeCoerce# x-{-# INLINE happyIn39 #-}-happyOut39 :: (HappyAbsSyn ) -> (HsType)-happyOut39 x = unsafeCoerce# x-{-# INLINE happyOut39 #-}-happyIn40 :: (HsType) -> (HappyAbsSyn )-happyIn40 x = unsafeCoerce# x-{-# INLINE happyIn40 #-}-happyOut40 :: (HappyAbsSyn ) -> (HsType)-happyOut40 x = unsafeCoerce# x-{-# INLINE happyOut40 #-}-happyIn41 :: (HsType) -> (HappyAbsSyn )-happyIn41 x = unsafeCoerce# x-{-# INLINE happyIn41 #-}-happyOut41 :: (HappyAbsSyn ) -> (HsType)-happyOut41 x = unsafeCoerce# x-{-# INLINE happyOut41 #-}-happyIn42 :: (HsQName) -> (HappyAbsSyn )-happyIn42 x = unsafeCoerce# x-{-# INLINE happyIn42 #-}-happyOut42 :: (HappyAbsSyn ) -> (HsQName)-happyOut42 x = unsafeCoerce# x-{-# INLINE happyOut42 #-}-happyIn43 :: (HsQualType) -> (HappyAbsSyn )-happyIn43 x = unsafeCoerce# x-{-# INLINE happyIn43 #-}-happyOut43 :: (HappyAbsSyn ) -> (HsQualType)-happyOut43 x = unsafeCoerce# x-{-# INLINE happyOut43 #-}-happyIn44 :: (HsContext) -> (HappyAbsSyn )-happyIn44 x = unsafeCoerce# x-{-# INLINE happyIn44 #-}-happyOut44 :: (HappyAbsSyn ) -> (HsContext)-happyOut44 x = unsafeCoerce# x-{-# INLINE happyOut44 #-}-happyIn45 :: ([HsType]) -> (HappyAbsSyn )-happyIn45 x = unsafeCoerce# x-{-# INLINE happyIn45 #-}-happyOut45 :: (HappyAbsSyn ) -> ([HsType])-happyOut45 x = unsafeCoerce# x-{-# INLINE happyOut45 #-}-happyIn46 :: ((HsName, [HsName])) -> (HappyAbsSyn )-happyIn46 x = unsafeCoerce# x-{-# INLINE happyIn46 #-}-happyOut46 :: (HappyAbsSyn ) -> ((HsName, [HsName]))-happyOut46 x = unsafeCoerce# x-{-# INLINE happyOut46 #-}-happyIn47 :: ([HsName]) -> (HappyAbsSyn )-happyIn47 x = unsafeCoerce# x-{-# INLINE happyIn47 #-}-happyOut47 :: (HappyAbsSyn ) -> ([HsName])-happyOut47 x = unsafeCoerce# x-{-# INLINE happyOut47 #-}-happyIn48 :: ([HsConDecl]) -> (HappyAbsSyn )-happyIn48 x = unsafeCoerce# x-{-# INLINE happyIn48 #-}-happyOut48 :: (HappyAbsSyn ) -> ([HsConDecl])-happyOut48 x = unsafeCoerce# x-{-# INLINE happyOut48 #-}-happyIn49 :: (HsConDecl) -> (HappyAbsSyn )-happyIn49 x = unsafeCoerce# x-{-# INLINE happyIn49 #-}-happyOut49 :: (HappyAbsSyn ) -> (HsConDecl)-happyOut49 x = unsafeCoerce# x-{-# INLINE happyOut49 #-}-happyIn50 :: ((HsName, [HsBangType])) -> (HappyAbsSyn )-happyIn50 x = unsafeCoerce# x-{-# INLINE happyIn50 #-}-happyOut50 :: (HappyAbsSyn ) -> ((HsName, [HsBangType]))-happyOut50 x = unsafeCoerce# x-{-# INLINE happyOut50 #-}-happyIn51 :: ((HsName, [HsBangType])) -> (HappyAbsSyn )-happyIn51 x = unsafeCoerce# x-{-# INLINE happyIn51 #-}-happyOut51 :: (HappyAbsSyn ) -> ((HsName, [HsBangType]))-happyOut51 x = unsafeCoerce# x-{-# INLINE happyOut51 #-}-happyIn52 :: (HsBangType) -> (HappyAbsSyn )-happyIn52 x = unsafeCoerce# x-{-# INLINE happyIn52 #-}-happyOut52 :: (HappyAbsSyn ) -> (HsBangType)-happyOut52 x = unsafeCoerce# x-{-# INLINE happyOut52 #-}-happyIn53 :: (HsBangType) -> (HappyAbsSyn )-happyIn53 x = unsafeCoerce# x-{-# INLINE happyIn53 #-}-happyOut53 :: (HappyAbsSyn ) -> (HsBangType)-happyOut53 x = unsafeCoerce# x-{-# INLINE happyOut53 #-}-happyIn54 :: ([([HsName],HsBangType)]) -> (HappyAbsSyn )-happyIn54 x = unsafeCoerce# x-{-# INLINE happyIn54 #-}-happyOut54 :: (HappyAbsSyn ) -> ([([HsName],HsBangType)])-happyOut54 x = unsafeCoerce# x-{-# INLINE happyOut54 #-}-happyIn55 :: (([HsName],HsBangType)) -> (HappyAbsSyn )-happyIn55 x = unsafeCoerce# x-{-# INLINE happyIn55 #-}-happyOut55 :: (HappyAbsSyn ) -> (([HsName],HsBangType))-happyOut55 x = unsafeCoerce# x-{-# INLINE happyOut55 #-}-happyIn56 :: (HsBangType) -> (HappyAbsSyn )-happyIn56 x = unsafeCoerce# x-{-# INLINE happyIn56 #-}-happyOut56 :: (HappyAbsSyn ) -> (HsBangType)-happyOut56 x = unsafeCoerce# x-{-# INLINE happyOut56 #-}-happyIn57 :: ([HsQName]) -> (HappyAbsSyn )-happyIn57 x = unsafeCoerce# x-{-# INLINE happyIn57 #-}-happyOut57 :: (HappyAbsSyn ) -> ([HsQName])-happyOut57 x = unsafeCoerce# x-{-# INLINE happyOut57 #-}-happyIn58 :: ([HsQName]) -> (HappyAbsSyn )-happyIn58 x = unsafeCoerce# x-{-# INLINE happyIn58 #-}-happyOut58 :: (HappyAbsSyn ) -> ([HsQName])-happyOut58 x = unsafeCoerce# x-{-# INLINE happyOut58 #-}-happyIn59 :: ([HsDecl]) -> (HappyAbsSyn )-happyIn59 x = unsafeCoerce# x-{-# INLINE happyIn59 #-}-happyOut59 :: (HappyAbsSyn ) -> ([HsDecl])-happyOut59 x = unsafeCoerce# x-{-# INLINE happyOut59 #-}-happyIn60 :: ([HsDecl]) -> (HappyAbsSyn )-happyIn60 x = unsafeCoerce# x-{-# INLINE happyIn60 #-}-happyOut60 :: (HappyAbsSyn ) -> ([HsDecl])-happyOut60 x = unsafeCoerce# x-{-# INLINE happyOut60 #-}-happyIn61 :: ([HsDecl]) -> (HappyAbsSyn )-happyIn61 x = unsafeCoerce# x-{-# INLINE happyIn61 #-}-happyOut61 :: (HappyAbsSyn ) -> ([HsDecl])-happyOut61 x = unsafeCoerce# x-{-# INLINE happyOut61 #-}-happyIn62 :: ([HsDecl]) -> (HappyAbsSyn )-happyIn62 x = unsafeCoerce# x-{-# INLINE happyIn62 #-}-happyOut62 :: (HappyAbsSyn ) -> ([HsDecl])-happyOut62 x = unsafeCoerce# x-{-# INLINE happyOut62 #-}-happyIn63 :: (HsDecl) -> (HappyAbsSyn )-happyIn63 x = unsafeCoerce# x-{-# INLINE happyIn63 #-}-happyOut63 :: (HappyAbsSyn ) -> (HsDecl)-happyOut63 x = unsafeCoerce# x-{-# INLINE happyOut63 #-}-happyIn64 :: ([HsDecl]) -> (HappyAbsSyn )-happyIn64 x = unsafeCoerce# x-{-# INLINE happyIn64 #-}-happyOut64 :: (HappyAbsSyn ) -> ([HsDecl])-happyOut64 x = unsafeCoerce# x-{-# INLINE happyOut64 #-}-happyIn65 :: (HsRhs) -> (HappyAbsSyn )-happyIn65 x = unsafeCoerce# x-{-# INLINE happyIn65 #-}-happyOut65 :: (HappyAbsSyn ) -> (HsRhs)-happyOut65 x = unsafeCoerce# x-{-# INLINE happyOut65 #-}-happyIn66 :: ([HsGuardedRhs]) -> (HappyAbsSyn )-happyIn66 x = unsafeCoerce# x-{-# INLINE happyIn66 #-}-happyOut66 :: (HappyAbsSyn ) -> ([HsGuardedRhs])-happyOut66 x = unsafeCoerce# x-{-# INLINE happyOut66 #-}-happyIn67 :: (HsGuardedRhs) -> (HappyAbsSyn )-happyIn67 x = unsafeCoerce# x-{-# INLINE happyIn67 #-}-happyOut67 :: (HappyAbsSyn ) -> (HsGuardedRhs)-happyOut67 x = unsafeCoerce# x-{-# INLINE happyOut67 #-}-happyIn68 :: (HsExp) -> (HappyAbsSyn )-happyIn68 x = unsafeCoerce# x-{-# INLINE happyIn68 #-}-happyOut68 :: (HappyAbsSyn ) -> (HsExp)-happyOut68 x = unsafeCoerce# x-{-# INLINE happyOut68 #-}-happyIn69 :: (HsExp) -> (HappyAbsSyn )-happyIn69 x = unsafeCoerce# x-{-# INLINE happyIn69 #-}-happyOut69 :: (HappyAbsSyn ) -> (HsExp)-happyOut69 x = unsafeCoerce# x-{-# INLINE happyOut69 #-}-happyIn70 :: (HsExp) -> (HappyAbsSyn )-happyIn70 x = unsafeCoerce# x-{-# INLINE happyIn70 #-}-happyOut70 :: (HappyAbsSyn ) -> (HsExp)-happyOut70 x = unsafeCoerce# x-{-# INLINE happyOut70 #-}-happyIn71 :: (HsExp) -> (HappyAbsSyn )-happyIn71 x = unsafeCoerce# x-{-# INLINE happyIn71 #-}-happyOut71 :: (HappyAbsSyn ) -> (HsExp)-happyOut71 x = unsafeCoerce# x-{-# INLINE happyOut71 #-}-happyIn72 :: (HsExp) -> (HappyAbsSyn )-happyIn72 x = unsafeCoerce# x-{-# INLINE happyIn72 #-}-happyOut72 :: (HappyAbsSyn ) -> (HsExp)-happyOut72 x = unsafeCoerce# x-{-# INLINE happyOut72 #-}-happyIn73 :: (HsExp) -> (HappyAbsSyn )-happyIn73 x = unsafeCoerce# x-{-# INLINE happyIn73 #-}-happyOut73 :: (HappyAbsSyn ) -> (HsExp)-happyOut73 x = unsafeCoerce# x-{-# INLINE happyOut73 #-}-happyIn74 :: (HsExp) -> (HappyAbsSyn )-happyIn74 x = unsafeCoerce# x-{-# INLINE happyIn74 #-}-happyOut74 :: (HappyAbsSyn ) -> (HsExp)-happyOut74 x = unsafeCoerce# x-{-# INLINE happyOut74 #-}-happyIn75 :: ([HsPat]) -> (HappyAbsSyn )-happyIn75 x = unsafeCoerce# x-{-# INLINE happyIn75 #-}-happyOut75 :: (HappyAbsSyn ) -> ([HsPat])-happyOut75 x = unsafeCoerce# x-{-# INLINE happyOut75 #-}-happyIn76 :: (HsPat) -> (HappyAbsSyn )-happyIn76 x = unsafeCoerce# x-{-# INLINE happyIn76 #-}-happyOut76 :: (HappyAbsSyn ) -> (HsPat)-happyOut76 x = unsafeCoerce# x-{-# INLINE happyOut76 #-}-happyIn77 :: (HsExp) -> (HappyAbsSyn )-happyIn77 x = unsafeCoerce# x-{-# INLINE happyIn77 #-}-happyOut77 :: (HappyAbsSyn ) -> (HsExp)-happyOut77 x = unsafeCoerce# x-{-# INLINE happyOut77 #-}-happyIn78 :: (HsExp) -> (HappyAbsSyn )-happyIn78 x = unsafeCoerce# x-{-# INLINE happyIn78 #-}-happyOut78 :: (HappyAbsSyn ) -> (HsExp)-happyOut78 x = unsafeCoerce# x-{-# INLINE happyOut78 #-}-happyIn79 :: (HsExp) -> (HappyAbsSyn )-happyIn79 x = unsafeCoerce# x-{-# INLINE happyIn79 #-}-happyOut79 :: (HappyAbsSyn ) -> (HsExp)-happyOut79 x = unsafeCoerce# x-{-# INLINE happyOut79 #-}-happyIn80 :: (Int) -> (HappyAbsSyn )-happyIn80 x = unsafeCoerce# x-{-# INLINE happyIn80 #-}-happyOut80 :: (HappyAbsSyn ) -> (Int)-happyOut80 x = unsafeCoerce# x-{-# INLINE happyOut80 #-}-happyIn81 :: ([HsExp]) -> (HappyAbsSyn )-happyIn81 x = unsafeCoerce# x-{-# INLINE happyIn81 #-}-happyOut81 :: (HappyAbsSyn ) -> ([HsExp])-happyOut81 x = unsafeCoerce# x-{-# INLINE happyOut81 #-}-happyIn82 :: (HsExp) -> (HappyAbsSyn )-happyIn82 x = unsafeCoerce# x-{-# INLINE happyIn82 #-}-happyOut82 :: (HappyAbsSyn ) -> (HsExp)-happyOut82 x = unsafeCoerce# x-{-# INLINE happyOut82 #-}-happyIn83 :: ([HsExp]) -> (HappyAbsSyn )-happyIn83 x = unsafeCoerce# x-{-# INLINE happyIn83 #-}-happyOut83 :: (HappyAbsSyn ) -> ([HsExp])-happyOut83 x = unsafeCoerce# x-{-# INLINE happyOut83 #-}-happyIn84 :: ([HsStmt]) -> (HappyAbsSyn )-happyIn84 x = unsafeCoerce# x-{-# INLINE happyIn84 #-}-happyOut84 :: (HappyAbsSyn ) -> ([HsStmt])-happyOut84 x = unsafeCoerce# x-{-# INLINE happyOut84 #-}-happyIn85 :: (HsStmt) -> (HappyAbsSyn )-happyIn85 x = unsafeCoerce# x-{-# INLINE happyIn85 #-}-happyOut85 :: (HappyAbsSyn ) -> (HsStmt)-happyOut85 x = unsafeCoerce# x-{-# INLINE happyOut85 #-}-happyIn86 :: ([HsAlt]) -> (HappyAbsSyn )-happyIn86 x = unsafeCoerce# x-{-# INLINE happyIn86 #-}-happyOut86 :: (HappyAbsSyn ) -> ([HsAlt])-happyOut86 x = unsafeCoerce# x-{-# INLINE happyOut86 #-}-happyIn87 :: ([HsAlt]) -> (HappyAbsSyn )-happyIn87 x = unsafeCoerce# x-{-# INLINE happyIn87 #-}-happyOut87 :: (HappyAbsSyn ) -> ([HsAlt])-happyOut87 x = unsafeCoerce# x-{-# INLINE happyOut87 #-}-happyIn88 :: ([HsAlt]) -> (HappyAbsSyn )-happyIn88 x = unsafeCoerce# x-{-# INLINE happyIn88 #-}-happyOut88 :: (HappyAbsSyn ) -> ([HsAlt])-happyOut88 x = unsafeCoerce# x-{-# INLINE happyOut88 #-}-happyIn89 :: (HsAlt) -> (HappyAbsSyn )-happyIn89 x = unsafeCoerce# x-{-# INLINE happyIn89 #-}-happyOut89 :: (HappyAbsSyn ) -> (HsAlt)-happyOut89 x = unsafeCoerce# x-{-# INLINE happyOut89 #-}-happyIn90 :: (HsGuardedAlts) -> (HappyAbsSyn )-happyIn90 x = unsafeCoerce# x-{-# INLINE happyIn90 #-}-happyOut90 :: (HappyAbsSyn ) -> (HsGuardedAlts)-happyOut90 x = unsafeCoerce# x-{-# INLINE happyOut90 #-}-happyIn91 :: ([HsGuardedAlt]) -> (HappyAbsSyn )-happyIn91 x = unsafeCoerce# x-{-# INLINE happyIn91 #-}-happyOut91 :: (HappyAbsSyn ) -> ([HsGuardedAlt])-happyOut91 x = unsafeCoerce# x-{-# INLINE happyOut91 #-}-happyIn92 :: (HsGuardedAlt) -> (HappyAbsSyn )-happyIn92 x = unsafeCoerce# x-{-# INLINE happyIn92 #-}-happyOut92 :: (HappyAbsSyn ) -> (HsGuardedAlt)-happyOut92 x = unsafeCoerce# x-{-# INLINE happyOut92 #-}-happyIn93 :: (HsPat) -> (HappyAbsSyn )-happyIn93 x = unsafeCoerce# x-{-# INLINE happyIn93 #-}-happyOut93 :: (HappyAbsSyn ) -> (HsPat)-happyOut93 x = unsafeCoerce# x-{-# INLINE happyOut93 #-}-happyIn94 :: ([HsStmt]) -> (HappyAbsSyn )-happyIn94 x = unsafeCoerce# x-{-# INLINE happyIn94 #-}-happyOut94 :: (HappyAbsSyn ) -> ([HsStmt])-happyOut94 x = unsafeCoerce# x-{-# INLINE happyOut94 #-}-happyIn95 :: ([HsStmt]) -> (HappyAbsSyn )-happyIn95 x = unsafeCoerce# x-{-# INLINE happyIn95 #-}-happyOut95 :: (HappyAbsSyn ) -> ([HsStmt])-happyOut95 x = unsafeCoerce# x-{-# INLINE happyOut95 #-}-happyIn96 :: ([HsFieldUpdate]) -> (HappyAbsSyn )-happyIn96 x = unsafeCoerce# x-{-# INLINE happyIn96 #-}-happyOut96 :: (HappyAbsSyn ) -> ([HsFieldUpdate])-happyOut96 x = unsafeCoerce# x-{-# INLINE happyOut96 #-}-happyIn97 :: (HsFieldUpdate) -> (HappyAbsSyn )-happyIn97 x = unsafeCoerce# x-{-# INLINE happyIn97 #-}-happyOut97 :: (HappyAbsSyn ) -> (HsFieldUpdate)-happyOut97 x = unsafeCoerce# x-{-# INLINE happyOut97 #-}-happyIn98 :: (HsExp) -> (HappyAbsSyn )-happyIn98 x = unsafeCoerce# x-{-# INLINE happyIn98 #-}-happyOut98 :: (HappyAbsSyn ) -> (HsExp)-happyOut98 x = unsafeCoerce# x-{-# INLINE happyOut98 #-}-happyIn99 :: (HsName) -> (HappyAbsSyn )-happyIn99 x = unsafeCoerce# x-{-# INLINE happyIn99 #-}-happyOut99 :: (HappyAbsSyn ) -> (HsName)-happyOut99 x = unsafeCoerce# x-{-# INLINE happyOut99 #-}-happyIn100 :: (HsQName) -> (HappyAbsSyn )-happyIn100 x = unsafeCoerce# x-{-# INLINE happyIn100 #-}-happyOut100 :: (HappyAbsSyn ) -> (HsQName)-happyOut100 x = unsafeCoerce# x-{-# INLINE happyOut100 #-}-happyIn101 :: (HsName) -> (HappyAbsSyn )-happyIn101 x = unsafeCoerce# x-{-# INLINE happyIn101 #-}-happyOut101 :: (HappyAbsSyn ) -> (HsName)-happyOut101 x = unsafeCoerce# x-{-# INLINE happyOut101 #-}-happyIn102 :: (HsQName) -> (HappyAbsSyn )-happyIn102 x = unsafeCoerce# x-{-# INLINE happyIn102 #-}-happyOut102 :: (HappyAbsSyn ) -> (HsQName)-happyOut102 x = unsafeCoerce# x-{-# INLINE happyOut102 #-}-happyIn103 :: (HsName) -> (HappyAbsSyn )-happyIn103 x = unsafeCoerce# x-{-# INLINE happyIn103 #-}-happyOut103 :: (HappyAbsSyn ) -> (HsName)-happyOut103 x = unsafeCoerce# x-{-# INLINE happyOut103 #-}-happyIn104 :: (HsQName) -> (HappyAbsSyn )-happyIn104 x = unsafeCoerce# x-{-# INLINE happyIn104 #-}-happyOut104 :: (HappyAbsSyn ) -> (HsQName)-happyOut104 x = unsafeCoerce# x-{-# INLINE happyOut104 #-}-happyIn105 :: (HsQName) -> (HappyAbsSyn )-happyIn105 x = unsafeCoerce# x-{-# INLINE happyIn105 #-}-happyOut105 :: (HappyAbsSyn ) -> (HsQName)-happyOut105 x = unsafeCoerce# x-{-# INLINE happyOut105 #-}-happyIn106 :: (HsName) -> (HappyAbsSyn )-happyIn106 x = unsafeCoerce# x-{-# INLINE happyIn106 #-}-happyOut106 :: (HappyAbsSyn ) -> (HsName)-happyOut106 x = unsafeCoerce# x-{-# INLINE happyOut106 #-}-happyIn107 :: (HsQName) -> (HappyAbsSyn )-happyIn107 x = unsafeCoerce# x-{-# INLINE happyIn107 #-}-happyOut107 :: (HappyAbsSyn ) -> (HsQName)-happyOut107 x = unsafeCoerce# x-{-# INLINE happyOut107 #-}-happyIn108 :: (HsOp) -> (HappyAbsSyn )-happyIn108 x = unsafeCoerce# x-{-# INLINE happyIn108 #-}-happyOut108 :: (HappyAbsSyn ) -> (HsOp)-happyOut108 x = unsafeCoerce# x-{-# INLINE happyOut108 #-}-happyIn109 :: (HsQOp) -> (HappyAbsSyn )-happyIn109 x = unsafeCoerce# x-{-# INLINE happyIn109 #-}-happyOut109 :: (HappyAbsSyn ) -> (HsQOp)-happyOut109 x = unsafeCoerce# x-{-# INLINE happyOut109 #-}-happyIn110 :: (HsQOp) -> (HappyAbsSyn )-happyIn110 x = unsafeCoerce# x-{-# INLINE happyIn110 #-}-happyOut110 :: (HappyAbsSyn ) -> (HsQOp)-happyOut110 x = unsafeCoerce# x-{-# INLINE happyOut110 #-}-happyIn111 :: (HsQName) -> (HappyAbsSyn )-happyIn111 x = unsafeCoerce# x-{-# INLINE happyIn111 #-}-happyOut111 :: (HappyAbsSyn ) -> (HsQName)-happyOut111 x = unsafeCoerce# x-{-# INLINE happyOut111 #-}-happyIn112 :: (HsQName) -> (HappyAbsSyn )-happyIn112 x = unsafeCoerce# x-{-# INLINE happyIn112 #-}-happyOut112 :: (HappyAbsSyn ) -> (HsQName)-happyOut112 x = unsafeCoerce# x-{-# INLINE happyOut112 #-}-happyIn113 :: (HsName) -> (HappyAbsSyn )-happyIn113 x = unsafeCoerce# x-{-# INLINE happyIn113 #-}-happyOut113 :: (HappyAbsSyn ) -> (HsName)-happyOut113 x = unsafeCoerce# x-{-# INLINE happyOut113 #-}-happyIn114 :: (HsQName) -> (HappyAbsSyn )-happyIn114 x = unsafeCoerce# x-{-# INLINE happyIn114 #-}-happyOut114 :: (HappyAbsSyn ) -> (HsQName)-happyOut114 x = unsafeCoerce# x-{-# INLINE happyOut114 #-}-happyIn115 :: (HsName) -> (HappyAbsSyn )-happyIn115 x = unsafeCoerce# x-{-# INLINE happyIn115 #-}-happyOut115 :: (HappyAbsSyn ) -> (HsName)-happyOut115 x = unsafeCoerce# x-{-# INLINE happyOut115 #-}-happyIn116 :: (HsQName) -> (HappyAbsSyn )-happyIn116 x = unsafeCoerce# x-{-# INLINE happyIn116 #-}-happyOut116 :: (HappyAbsSyn ) -> (HsQName)-happyOut116 x = unsafeCoerce# x-{-# INLINE happyOut116 #-}-happyIn117 :: (HsName) -> (HappyAbsSyn )-happyIn117 x = unsafeCoerce# x-{-# INLINE happyIn117 #-}-happyOut117 :: (HappyAbsSyn ) -> (HsName)-happyOut117 x = unsafeCoerce# x-{-# INLINE happyOut117 #-}-happyIn118 :: (HsQName) -> (HappyAbsSyn )-happyIn118 x = unsafeCoerce# x-{-# INLINE happyIn118 #-}-happyOut118 :: (HappyAbsSyn ) -> (HsQName)-happyOut118 x = unsafeCoerce# x-{-# INLINE happyOut118 #-}-happyIn119 :: (HsQName) -> (HappyAbsSyn )-happyIn119 x = unsafeCoerce# x-{-# INLINE happyIn119 #-}-happyOut119 :: (HappyAbsSyn ) -> (HsQName)-happyOut119 x = unsafeCoerce# x-{-# INLINE happyOut119 #-}-happyIn120 :: (HsName) -> (HappyAbsSyn )-happyIn120 x = unsafeCoerce# x-{-# INLINE happyIn120 #-}-happyOut120 :: (HappyAbsSyn ) -> (HsName)-happyOut120 x = unsafeCoerce# x-{-# INLINE happyOut120 #-}-happyIn121 :: (HsName) -> (HappyAbsSyn )-happyIn121 x = unsafeCoerce# x-{-# INLINE happyIn121 #-}-happyOut121 :: (HappyAbsSyn ) -> (HsName)-happyOut121 x = unsafeCoerce# x-{-# INLINE happyOut121 #-}-happyIn122 :: (HsQName) -> (HappyAbsSyn )-happyIn122 x = unsafeCoerce# x-{-# INLINE happyIn122 #-}-happyOut122 :: (HappyAbsSyn ) -> (HsQName)-happyOut122 x = unsafeCoerce# x-{-# INLINE happyOut122 #-}-happyIn123 :: (HsLiteral) -> (HappyAbsSyn )-happyIn123 x = unsafeCoerce# x-{-# INLINE happyIn123 #-}-happyOut123 :: (HappyAbsSyn ) -> (HsLiteral)-happyOut123 x = unsafeCoerce# x-{-# INLINE happyOut123 #-}-happyIn124 :: (SrcLoc) -> (HappyAbsSyn )-happyIn124 x = unsafeCoerce# x-{-# INLINE happyIn124 #-}-happyOut124 :: (HappyAbsSyn ) -> (SrcLoc)-happyOut124 x = unsafeCoerce# x-{-# INLINE happyOut124 #-}-happyIn125 :: (()) -> (HappyAbsSyn )-happyIn125 x = unsafeCoerce# x-{-# INLINE happyIn125 #-}-happyOut125 :: (HappyAbsSyn ) -> (())-happyOut125 x = unsafeCoerce# x-{-# INLINE happyOut125 #-}-happyIn126 :: (()) -> (HappyAbsSyn )-happyIn126 x = unsafeCoerce# x-{-# INLINE happyIn126 #-}-happyOut126 :: (HappyAbsSyn ) -> (())-happyOut126 x = unsafeCoerce# x-{-# INLINE happyOut126 #-}-happyIn127 :: (Module) -> (HappyAbsSyn )-happyIn127 x = unsafeCoerce# x-{-# INLINE happyIn127 #-}-happyOut127 :: (HappyAbsSyn ) -> (Module)-happyOut127 x = unsafeCoerce# x-{-# INLINE happyOut127 #-}-happyIn128 :: (HsName) -> (HappyAbsSyn )-happyIn128 x = unsafeCoerce# x-{-# INLINE happyIn128 #-}-happyOut128 :: (HappyAbsSyn ) -> (HsName)-happyOut128 x = unsafeCoerce# x-{-# INLINE happyOut128 #-}-happyIn129 :: (HsName) -> (HappyAbsSyn )-happyIn129 x = unsafeCoerce# x-{-# INLINE happyIn129 #-}-happyOut129 :: (HappyAbsSyn ) -> (HsName)-happyOut129 x = unsafeCoerce# x-{-# INLINE happyOut129 #-}-happyIn130 :: (HsQName) -> (HappyAbsSyn )-happyIn130 x = unsafeCoerce# x-{-# INLINE happyIn130 #-}-happyOut130 :: (HappyAbsSyn ) -> (HsQName)-happyOut130 x = unsafeCoerce# x-{-# INLINE happyOut130 #-}-happyIn131 :: (HsQName) -> (HappyAbsSyn )-happyIn131 x = unsafeCoerce# x-{-# INLINE happyIn131 #-}-happyOut131 :: (HappyAbsSyn ) -> (HsQName)-happyOut131 x = unsafeCoerce# x-{-# INLINE happyOut131 #-}-happyIn132 :: (HsName) -> (HappyAbsSyn )-happyIn132 x = unsafeCoerce# x-{-# INLINE happyIn132 #-}-happyOut132 :: (HappyAbsSyn ) -> (HsName)-happyOut132 x = unsafeCoerce# x-{-# INLINE happyOut132 #-}-happyInTok :: Token -> (HappyAbsSyn )-happyInTok x = unsafeCoerce# x-{-# INLINE happyInTok #-}-happyOutTok :: (HappyAbsSyn ) -> Token-happyOutTok x = unsafeCoerce# x-{-# INLINE happyOutTok #-}--type HappyReduction m = -	   Int# -	-> (Token)-	-> HappyState (Token) (HappyStk HappyAbsSyn -> m HappyAbsSyn)-	-> [HappyState (Token) (HappyStk HappyAbsSyn -> m HappyAbsSyn)] -	-> HappyStk HappyAbsSyn -	-> m HappyAbsSyn--action_0,- action_1,- action_2,- action_3,- action_4,- action_5,- action_6,- action_7,- action_8,- action_9,- action_10,- action_11,- action_12,- action_13,- action_14,- action_15,- action_16,- action_17,- action_18,- action_19,- action_20,- action_21,- action_22,- action_23,- action_24,- action_25,- action_26,- action_27,- action_28,- action_29,- action_30,- action_31,- action_32,- action_33,- action_34,- action_35,- action_36,- action_37,- action_38,- action_39,- action_40,- action_41,- action_42,- action_43,- action_44,- action_45,- action_46,- action_47,- action_48,- action_49,- action_50,- action_51,- action_52,- action_53,- action_54,- action_55,- action_56,- action_57,- action_58,- action_59,- action_60,- action_61,- action_62,- action_63,- action_64,- action_65,- action_66,- action_67,- action_68,- action_69,- action_70,- action_71,- action_72,- action_73,- action_74,- action_75,- action_76,- action_77,- action_78,- action_79,- action_80,- action_81,- action_82,- action_83,- action_84,- action_85,- action_86,- action_87,- action_88,- action_89,- action_90,- action_91,- action_92,- action_93,- action_94,- action_95,- action_96,- action_97,- action_98,- action_99,- action_100,- action_101,- action_102,- action_103,- action_104,- action_105,- action_106,- action_107,- action_108,- action_109,- action_110,- action_111,- action_112,- action_113,- action_114,- action_115,- action_116,- action_117,- action_118,- action_119,- action_120,- action_121,- action_122,- action_123,- action_124,- action_125,- action_126,- action_127,- action_128,- action_129,- action_130,- action_131,- action_132,- action_133,- action_134,- action_135,- action_136,- action_137,- action_138,- action_139,- action_140,- action_141,- action_142,- action_143,- action_144,- action_145,- action_146,- action_147,- action_148,- action_149,- action_150,- action_151,- action_152,- action_153,- action_154,- action_155,- action_156,- action_157,- action_158,- action_159,- action_160,- action_161,- action_162,- action_163,- action_164,- action_165,- action_166,- action_167,- action_168,- action_169,- action_170,- action_171,- action_172,- action_173,- action_174,- action_175,- action_176,- action_177,- action_178,- action_179,- action_180,- action_181,- action_182,- action_183,- action_184,- action_185,- action_186,- action_187,- action_188,- action_189,- action_190,- action_191,- action_192,- action_193,- action_194,- action_195,- action_196,- action_197,- action_198,- action_199,- action_200,- action_201,- action_202,- action_203,- action_204,- action_205,- action_206,- action_207,- action_208,- action_209,- action_210,- action_211,- action_212,- action_213,- action_214,- action_215,- action_216,- action_217,- action_218,- action_219,- action_220,- action_221,- action_222,- action_223,- action_224,- action_225,- action_226,- action_227,- action_228,- action_229,- action_230,- action_231,- action_232,- action_233,- action_234,- action_235,- action_236,- action_237,- action_238,- action_239,- action_240,- action_241,- action_242,- action_243,- action_244,- action_245,- action_246,- action_247,- action_248,- action_249,- action_250,- action_251,- action_252,- action_253,- action_254,- action_255,- action_256,- action_257,- action_258,- action_259,- action_260,- action_261,- action_262,- action_263,- action_264,- action_265,- action_266,- action_267,- action_268,- action_269,- action_270,- action_271,- action_272,- action_273,- action_274,- action_275,- action_276,- action_277,- action_278,- action_279,- action_280,- action_281,- action_282,- action_283,- action_284,- action_285,- action_286,- action_287,- action_288,- action_289,- action_290,- action_291,- action_292,- action_293,- action_294,- action_295,- action_296,- action_297,- action_298,- action_299,- action_300,- action_301,- action_302,- action_303,- action_304,- action_305,- action_306,- action_307,- action_308,- action_309,- action_310,- action_311,- action_312,- action_313,- action_314,- action_315,- action_316,- action_317,- action_318,- action_319,- action_320,- action_321,- action_322,- action_323,- action_324,- action_325,- action_326,- action_327,- action_328,- action_329,- action_330,- action_331,- action_332,- action_333,- action_334,- action_335,- action_336,- action_337,- action_338,- action_339,- action_340,- action_341,- action_342,- action_343,- action_344,- action_345,- action_346,- action_347,- action_348,- action_349,- action_350,- action_351,- action_352,- action_353,- action_354,- action_355,- action_356,- action_357,- action_358,- action_359,- action_360,- action_361,- action_362,- action_363,- action_364,- action_365,- action_366,- action_367,- action_368,- action_369,- action_370,- action_371,- action_372,- action_373,- action_374,- action_375,- action_376,- action_377,- action_378,- action_379,- action_380,- action_381,- action_382,- action_383,- action_384,- action_385,- action_386,- action_387,- action_388,- action_389,- action_390,- action_391,- action_392,- action_393,- action_394,- action_395,- action_396,- action_397,- action_398,- action_399,- action_400,- action_401,- action_402,- action_403,- action_404,- action_405,- action_406,- action_407,- action_408,- action_409,- action_410,- action_411,- action_412,- action_413,- action_414,- action_415,- action_416,- action_417,- action_418,- action_419,- action_420,- action_421,- action_422,- action_423,- action_424,- action_425,- action_426,- action_427,- action_428,- action_429,- action_430,- action_431,- action_432,- action_433,- action_434,- action_435,- action_436,- action_437,- action_438,- action_439,- action_440,- action_441,- action_442,- action_443,- action_444,- action_445,- action_446,- action_447,- action_448,- action_449,- action_450,- action_451,- action_452,- action_453,- action_454,- action_455,- action_456,- action_457,- action_458,- action_459,- action_460,- action_461,- action_462,- action_463,- action_464,- action_465,- action_466,- action_467,- action_468,- action_469,- action_470,- action_471,- action_472,- action_473,- action_474,- action_475,- action_476,- action_477,- action_478,- action_479,- action_480,- action_481,- action_482,- action_483,- action_484,- action_485,- action_486,- action_487,- action_488,- action_489,- action_490 :: () => Int# -> HappyReduction (P)--happyReduce_1,- happyReduce_2,- happyReduce_3,- happyReduce_4,- happyReduce_5,- happyReduce_6,- happyReduce_7,- happyReduce_8,- happyReduce_9,- happyReduce_10,- happyReduce_11,- happyReduce_12,- happyReduce_13,- happyReduce_14,- happyReduce_15,- happyReduce_16,- happyReduce_17,- happyReduce_18,- happyReduce_19,- happyReduce_20,- happyReduce_21,- happyReduce_22,- happyReduce_23,- happyReduce_24,- happyReduce_25,- happyReduce_26,- happyReduce_27,- happyReduce_28,- happyReduce_29,- happyReduce_30,- happyReduce_31,- happyReduce_32,- happyReduce_33,- happyReduce_34,- happyReduce_35,- happyReduce_36,- happyReduce_37,- happyReduce_38,- happyReduce_39,- happyReduce_40,- happyReduce_41,- happyReduce_42,- happyReduce_43,- happyReduce_44,- happyReduce_45,- happyReduce_46,- happyReduce_47,- happyReduce_48,- happyReduce_49,- happyReduce_50,- happyReduce_51,- happyReduce_52,- happyReduce_53,- happyReduce_54,- happyReduce_55,- happyReduce_56,- happyReduce_57,- happyReduce_58,- happyReduce_59,- happyReduce_60,- happyReduce_61,- happyReduce_62,- happyReduce_63,- happyReduce_64,- happyReduce_65,- happyReduce_66,- happyReduce_67,- happyReduce_68,- happyReduce_69,- happyReduce_70,- happyReduce_71,- happyReduce_72,- happyReduce_73,- happyReduce_74,- happyReduce_75,- happyReduce_76,- happyReduce_77,- happyReduce_78,- happyReduce_79,- happyReduce_80,- happyReduce_81,- happyReduce_82,- happyReduce_83,- happyReduce_84,- happyReduce_85,- happyReduce_86,- happyReduce_87,- happyReduce_88,- happyReduce_89,- happyReduce_90,- happyReduce_91,- happyReduce_92,- happyReduce_93,- happyReduce_94,- happyReduce_95,- happyReduce_96,- happyReduce_97,- happyReduce_98,- happyReduce_99,- happyReduce_100,- happyReduce_101,- happyReduce_102,- happyReduce_103,- happyReduce_104,- happyReduce_105,- happyReduce_106,- happyReduce_107,- happyReduce_108,- happyReduce_109,- happyReduce_110,- happyReduce_111,- happyReduce_112,- happyReduce_113,- happyReduce_114,- happyReduce_115,- happyReduce_116,- happyReduce_117,- happyReduce_118,- happyReduce_119,- happyReduce_120,- happyReduce_121,- happyReduce_122,- happyReduce_123,- happyReduce_124,- happyReduce_125,- happyReduce_126,- happyReduce_127,- happyReduce_128,- happyReduce_129,- happyReduce_130,- happyReduce_131,- happyReduce_132,- happyReduce_133,- happyReduce_134,- happyReduce_135,- happyReduce_136,- happyReduce_137,- happyReduce_138,- happyReduce_139,- happyReduce_140,- happyReduce_141,- happyReduce_142,- happyReduce_143,- happyReduce_144,- happyReduce_145,- happyReduce_146,- happyReduce_147,- happyReduce_148,- happyReduce_149,- happyReduce_150,- happyReduce_151,- happyReduce_152,- happyReduce_153,- happyReduce_154,- happyReduce_155,- happyReduce_156,- happyReduce_157,- happyReduce_158,- happyReduce_159,- happyReduce_160,- happyReduce_161,- happyReduce_162,- happyReduce_163,- happyReduce_164,- happyReduce_165,- happyReduce_166,- happyReduce_167,- happyReduce_168,- happyReduce_169,- happyReduce_170,- happyReduce_171,- happyReduce_172,- happyReduce_173,- happyReduce_174,- happyReduce_175,- happyReduce_176,- happyReduce_177,- happyReduce_178,- happyReduce_179,- happyReduce_180,- happyReduce_181,- happyReduce_182,- happyReduce_183,- happyReduce_184,- happyReduce_185,- happyReduce_186,- happyReduce_187,- happyReduce_188,- happyReduce_189,- happyReduce_190,- happyReduce_191,- happyReduce_192,- happyReduce_193,- happyReduce_194,- happyReduce_195,- happyReduce_196,- happyReduce_197,- happyReduce_198,- happyReduce_199,- happyReduce_200,- happyReduce_201,- happyReduce_202,- happyReduce_203,- happyReduce_204,- happyReduce_205,- happyReduce_206,- happyReduce_207,- happyReduce_208,- happyReduce_209,- happyReduce_210,- happyReduce_211,- happyReduce_212,- happyReduce_213,- happyReduce_214,- happyReduce_215,- happyReduce_216,- happyReduce_217,- happyReduce_218,- happyReduce_219,- happyReduce_220,- happyReduce_221,- happyReduce_222,- happyReduce_223,- happyReduce_224,- happyReduce_225,- happyReduce_226,- happyReduce_227,- happyReduce_228,- happyReduce_229,- happyReduce_230,- happyReduce_231,- happyReduce_232,- happyReduce_233,- happyReduce_234,- happyReduce_235,- happyReduce_236,- happyReduce_237,- happyReduce_238,- happyReduce_239,- happyReduce_240,- happyReduce_241,- happyReduce_242,- happyReduce_243,- happyReduce_244,- happyReduce_245,- happyReduce_246,- happyReduce_247,- happyReduce_248,- happyReduce_249,- happyReduce_250,- happyReduce_251,- happyReduce_252,- happyReduce_253,- happyReduce_254,- happyReduce_255,- happyReduce_256,- happyReduce_257,- happyReduce_258,- happyReduce_259,- happyReduce_260,- happyReduce_261,- happyReduce_262,- happyReduce_263,- happyReduce_264,- happyReduce_265,- happyReduce_266,- happyReduce_267,- happyReduce_268,- happyReduce_269,- happyReduce_270,- happyReduce_271,- happyReduce_272,- happyReduce_273,- happyReduce_274,- happyReduce_275,- happyReduce_276,- happyReduce_277,- happyReduce_278,- happyReduce_279,- happyReduce_280,- happyReduce_281,- happyReduce_282,- happyReduce_283,- happyReduce_284,- happyReduce_285,- happyReduce_286,- happyReduce_287,- happyReduce_288,- happyReduce_289 :: () => HappyReduction (P)--action_0 (133#) = happyShift action_21-action_0 (134#) = happyShift action_22-action_0 (135#) = happyShift action_23-action_0 (136#) = happyShift action_24-action_0 (141#) = happyShift action_25-action_0 (142#) = happyShift action_26-action_0 (143#) = happyShift action_27-action_0 (144#) = happyShift action_28-action_0 (145#) = happyShift action_29-action_0 (151#) = happyShift action_30-action_0 (154#) = happyShift action_31-action_0 (160#) = happyShift action_32-action_0 (165#) = happyShift action_33-action_0 (167#) = happyShift action_34-action_0 (169#) = happyShift action_35-action_0 (170#) = happyShift action_36-action_0 (175#) = happyShift action_37-action_0 (177#) = happyShift action_38-action_0 (178#) = happyShift action_39-action_0 (185#) = happyShift action_40-action_0 (192#) = happyShift action_41-action_0 (68#) = happyGoto action_3-action_0 (69#) = happyGoto action_4-action_0 (70#) = happyGoto action_5-action_0 (71#) = happyGoto action_6-action_0 (72#) = happyGoto action_7-action_0 (73#) = happyGoto action_8-action_0 (74#) = happyGoto action_9-action_0 (77#) = happyGoto action_10-action_0 (78#) = happyGoto action_11-action_0 (79#) = happyGoto action_12-action_0 (98#) = happyGoto action_13-action_0 (100#) = happyGoto action_14-action_0 (102#) = happyGoto action_15-action_0 (112#) = happyGoto action_16-action_0 (113#) = happyGoto action_17-action_0 (114#) = happyGoto action_18-action_0 (115#) = happyGoto action_19-action_0 (123#) = happyGoto action_20-action_0 x = happyTcHack x happyFail--action_1 (124#) = happyGoto action_2-action_1 x = happyTcHack x happyFail--action_2 (186#) = happyShift action_96-action_2 x = happyTcHack x happyFail--action_3 (193#) = happyAccept-action_3 x = happyTcHack x happyFail--action_4 x = happyTcHack x happyReduce_148--action_5 x = happyTcHack x happyReduce_149--action_6 (137#) = happyShift action_91-action_6 (138#) = happyShift action_73-action_6 (139#) = happyShift action_74-action_6 (140#) = happyShift action_75-action_6 (155#) = happyShift action_92-action_6 (157#) = happyShift action_79-action_6 (158#) = happyShift action_93-action_6 (167#) = happyShift action_94-action_6 (168#) = happyShift action_95-action_6 (104#) = happyGoto action_85-action_6 (107#) = happyGoto action_86-action_6 (109#) = happyGoto action_87-action_6 (111#) = happyGoto action_88-action_6 (116#) = happyGoto action_65-action_6 (117#) = happyGoto action_66-action_6 (118#) = happyGoto action_89-action_6 (120#) = happyGoto action_69-action_6 (122#) = happyGoto action_90-action_6 x = happyTcHack x happyReduce_150--action_7 x = happyTcHack x happyReduce_152--action_8 x = happyTcHack x happyReduce_154--action_9 (133#) = happyShift action_21-action_9 (134#) = happyShift action_22-action_9 (135#) = happyShift action_23-action_9 (136#) = happyShift action_24-action_9 (141#) = happyShift action_25-action_9 (142#) = happyShift action_26-action_9 (143#) = happyShift action_27-action_9 (144#) = happyShift action_28-action_9 (145#) = happyShift action_29-action_9 (151#) = happyShift action_30-action_9 (154#) = happyShift action_31-action_9 (165#) = happyShift action_33-action_9 (169#) = happyShift action_35-action_9 (177#) = happyShift action_38-action_9 (192#) = happyShift action_41-action_9 (77#) = happyGoto action_84-action_9 (78#) = happyGoto action_11-action_9 (79#) = happyGoto action_12-action_9 (98#) = happyGoto action_13-action_9 (100#) = happyGoto action_14-action_9 (102#) = happyGoto action_15-action_9 (112#) = happyGoto action_16-action_9 (113#) = happyGoto action_17-action_9 (114#) = happyGoto action_18-action_9 (115#) = happyGoto action_19-action_9 (123#) = happyGoto action_20-action_9 x = happyTcHack x happyReduce_161--action_10 x = happyTcHack x happyReduce_163--action_11 (148#) = happyShift action_83-action_11 x = happyTcHack x happyReduce_169--action_12 x = happyTcHack x happyReduce_172--action_13 x = happyTcHack x happyReduce_174--action_14 (164#) = happyShift action_82-action_14 x = happyTcHack x happyReduce_173--action_15 x = happyTcHack x happyReduce_226--action_16 x = happyTcHack x happyReduce_229--action_17 x = happyTcHack x happyReduce_253--action_18 x = happyTcHack x happyReduce_233--action_19 x = happyTcHack x happyReduce_259--action_20 x = happyTcHack x happyReduce_175--action_21 x = happyTcHack x happyReduce_255--action_22 x = happyTcHack x happyReduce_254--action_23 x = happyTcHack x happyReduce_261--action_24 x = happyTcHack x happyReduce_260--action_25 x = happyTcHack x happyReduce_275--action_26 x = happyTcHack x happyReduce_277--action_27 x = happyTcHack x happyReduce_276--action_28 x = happyTcHack x happyReduce_278--action_29 (133#) = happyShift action_21-action_29 (134#) = happyShift action_22-action_29 (135#) = happyShift action_23-action_29 (136#) = happyShift action_24-action_29 (137#) = happyShift action_72-action_29 (138#) = happyShift action_73-action_29 (139#) = happyShift action_74-action_29 (140#) = happyShift action_75-action_29 (141#) = happyShift action_25-action_29 (142#) = happyShift action_26-action_29 (143#) = happyShift action_27-action_29 (144#) = happyShift action_28-action_29 (145#) = happyShift action_29-action_29 (146#) = happyShift action_76-action_29 (151#) = happyShift action_30-action_29 (153#) = happyShift action_77-action_29 (154#) = happyShift action_31-action_29 (155#) = happyShift action_78-action_29 (157#) = happyShift action_79-action_29 (160#) = happyShift action_32-action_29 (165#) = happyShift action_33-action_29 (167#) = happyShift action_80-action_29 (168#) = happyShift action_81-action_29 (169#) = happyShift action_35-action_29 (170#) = happyShift action_36-action_29 (175#) = happyShift action_37-action_29 (177#) = happyShift action_38-action_29 (178#) = happyShift action_39-action_29 (185#) = happyShift action_40-action_29 (192#) = happyShift action_41-action_29 (68#) = happyGoto action_57-action_29 (69#) = happyGoto action_4-action_29 (70#) = happyGoto action_5-action_29 (71#) = happyGoto action_58-action_29 (72#) = happyGoto action_7-action_29 (73#) = happyGoto action_8-action_29 (74#) = happyGoto action_9-action_29 (77#) = happyGoto action_10-action_29 (78#) = happyGoto action_11-action_29 (79#) = happyGoto action_12-action_29 (80#) = happyGoto action_59-action_29 (81#) = happyGoto action_60-action_29 (98#) = happyGoto action_13-action_29 (100#) = happyGoto action_14-action_29 (102#) = happyGoto action_15-action_29 (105#) = happyGoto action_61-action_29 (107#) = happyGoto action_62-action_29 (110#) = happyGoto action_63-action_29 (111#) = happyGoto action_64-action_29 (112#) = happyGoto action_16-action_29 (113#) = happyGoto action_17-action_29 (114#) = happyGoto action_18-action_29 (115#) = happyGoto action_19-action_29 (116#) = happyGoto action_65-action_29 (117#) = happyGoto action_66-action_29 (118#) = happyGoto action_67-action_29 (119#) = happyGoto action_68-action_29 (120#) = happyGoto action_69-action_29 (121#) = happyGoto action_70-action_29 (122#) = happyGoto action_71-action_29 (123#) = happyGoto action_20-action_29 x = happyTcHack x happyFail--action_30 (133#) = happyShift action_21-action_30 (134#) = happyShift action_22-action_30 (135#) = happyShift action_23-action_30 (136#) = happyShift action_24-action_30 (141#) = happyShift action_25-action_30 (142#) = happyShift action_26-action_30 (143#) = happyShift action_27-action_30 (144#) = happyShift action_28-action_30 (145#) = happyShift action_29-action_30 (151#) = happyShift action_30-action_30 (152#) = happyShift action_56-action_30 (154#) = happyShift action_31-action_30 (160#) = happyShift action_32-action_30 (165#) = happyShift action_33-action_30 (167#) = happyShift action_34-action_30 (169#) = happyShift action_35-action_30 (170#) = happyShift action_36-action_30 (175#) = happyShift action_37-action_30 (177#) = happyShift action_38-action_30 (178#) = happyShift action_39-action_30 (185#) = happyShift action_40-action_30 (192#) = happyShift action_41-action_30 (68#) = happyGoto action_53-action_30 (69#) = happyGoto action_4-action_30 (70#) = happyGoto action_5-action_30 (71#) = happyGoto action_6-action_30 (72#) = happyGoto action_7-action_30 (73#) = happyGoto action_8-action_30 (74#) = happyGoto action_9-action_30 (77#) = happyGoto action_10-action_30 (78#) = happyGoto action_11-action_30 (79#) = happyGoto action_12-action_30 (82#) = happyGoto action_54-action_30 (83#) = happyGoto action_55-action_30 (98#) = happyGoto action_13-action_30 (100#) = happyGoto action_14-action_30 (102#) = happyGoto action_15-action_30 (112#) = happyGoto action_16-action_30 (113#) = happyGoto action_17-action_30 (114#) = happyGoto action_18-action_30 (115#) = happyGoto action_19-action_30 (123#) = happyGoto action_20-action_30 x = happyTcHack x happyFail--action_31 x = happyTcHack x happyReduce_181--action_32 (124#) = happyGoto action_52-action_32 x = happyTcHack x happyReduce_279--action_33 (133#) = happyShift action_21-action_33 (134#) = happyShift action_22-action_33 (135#) = happyShift action_23-action_33 (136#) = happyShift action_24-action_33 (141#) = happyShift action_25-action_33 (142#) = happyShift action_26-action_33 (143#) = happyShift action_27-action_33 (144#) = happyShift action_28-action_33 (145#) = happyShift action_29-action_33 (151#) = happyShift action_30-action_33 (154#) = happyShift action_31-action_33 (165#) = happyShift action_33-action_33 (169#) = happyShift action_35-action_33 (177#) = happyShift action_38-action_33 (192#) = happyShift action_41-action_33 (77#) = happyGoto action_51-action_33 (78#) = happyGoto action_11-action_33 (79#) = happyGoto action_12-action_33 (98#) = happyGoto action_13-action_33 (100#) = happyGoto action_14-action_33 (102#) = happyGoto action_15-action_33 (112#) = happyGoto action_16-action_33 (113#) = happyGoto action_17-action_33 (114#) = happyGoto action_18-action_33 (115#) = happyGoto action_19-action_33 (123#) = happyGoto action_20-action_33 x = happyTcHack x happyFail--action_34 (133#) = happyShift action_21-action_34 (134#) = happyShift action_22-action_34 (135#) = happyShift action_23-action_34 (136#) = happyShift action_24-action_34 (141#) = happyShift action_25-action_34 (142#) = happyShift action_26-action_34 (143#) = happyShift action_27-action_34 (144#) = happyShift action_28-action_34 (145#) = happyShift action_29-action_34 (151#) = happyShift action_30-action_34 (154#) = happyShift action_31-action_34 (165#) = happyShift action_33-action_34 (169#) = happyShift action_35-action_34 (177#) = happyShift action_38-action_34 (192#) = happyShift action_41-action_34 (74#) = happyGoto action_50-action_34 (77#) = happyGoto action_10-action_34 (78#) = happyGoto action_11-action_34 (79#) = happyGoto action_12-action_34 (98#) = happyGoto action_13-action_34 (100#) = happyGoto action_14-action_34 (102#) = happyGoto action_15-action_34 (112#) = happyGoto action_16-action_34 (113#) = happyGoto action_17-action_34 (114#) = happyGoto action_18-action_34 (115#) = happyGoto action_19-action_34 (123#) = happyGoto action_20-action_34 x = happyTcHack x happyFail--action_35 x = happyTcHack x happyReduce_256--action_36 (133#) = happyShift action_21-action_36 (134#) = happyShift action_22-action_36 (135#) = happyShift action_23-action_36 (136#) = happyShift action_24-action_36 (141#) = happyShift action_25-action_36 (142#) = happyShift action_26-action_36 (143#) = happyShift action_27-action_36 (144#) = happyShift action_28-action_36 (145#) = happyShift action_29-action_36 (151#) = happyShift action_30-action_36 (154#) = happyShift action_31-action_36 (160#) = happyShift action_32-action_36 (165#) = happyShift action_33-action_36 (167#) = happyShift action_34-action_36 (169#) = happyShift action_35-action_36 (170#) = happyShift action_36-action_36 (175#) = happyShift action_37-action_36 (177#) = happyShift action_38-action_36 (178#) = happyShift action_39-action_36 (185#) = happyShift action_40-action_36 (192#) = happyShift action_41-action_36 (68#) = happyGoto action_49-action_36 (69#) = happyGoto action_4-action_36 (70#) = happyGoto action_5-action_36 (71#) = happyGoto action_6-action_36 (72#) = happyGoto action_7-action_36 (73#) = happyGoto action_8-action_36 (74#) = happyGoto action_9-action_36 (77#) = happyGoto action_10-action_36 (78#) = happyGoto action_11-action_36 (79#) = happyGoto action_12-action_36 (98#) = happyGoto action_13-action_36 (100#) = happyGoto action_14-action_36 (102#) = happyGoto action_15-action_36 (112#) = happyGoto action_16-action_36 (113#) = happyGoto action_17-action_36 (114#) = happyGoto action_18-action_36 (115#) = happyGoto action_19-action_36 (123#) = happyGoto action_20-action_36 x = happyTcHack x happyFail--action_37 (148#) = happyShift action_48-action_37 (94#) = happyGoto action_46-action_37 (125#) = happyGoto action_47-action_37 x = happyTcHack x happyReduce_280--action_38 x = happyTcHack x happyReduce_258--action_39 (133#) = happyShift action_21-action_39 (134#) = happyShift action_22-action_39 (135#) = happyShift action_23-action_39 (136#) = happyShift action_24-action_39 (141#) = happyShift action_25-action_39 (142#) = happyShift action_26-action_39 (143#) = happyShift action_27-action_39 (144#) = happyShift action_28-action_39 (145#) = happyShift action_29-action_39 (151#) = happyShift action_30-action_39 (154#) = happyShift action_31-action_39 (160#) = happyShift action_32-action_39 (165#) = happyShift action_33-action_39 (167#) = happyShift action_34-action_39 (169#) = happyShift action_35-action_39 (170#) = happyShift action_36-action_39 (175#) = happyShift action_37-action_39 (177#) = happyShift action_38-action_39 (178#) = happyShift action_39-action_39 (185#) = happyShift action_40-action_39 (192#) = happyShift action_41-action_39 (68#) = happyGoto action_45-action_39 (69#) = happyGoto action_4-action_39 (70#) = happyGoto action_5-action_39 (71#) = happyGoto action_6-action_39 (72#) = happyGoto action_7-action_39 (73#) = happyGoto action_8-action_39 (74#) = happyGoto action_9-action_39 (77#) = happyGoto action_10-action_39 (78#) = happyGoto action_11-action_39 (79#) = happyGoto action_12-action_39 (98#) = happyGoto action_13-action_39 (100#) = happyGoto action_14-action_39 (102#) = happyGoto action_15-action_39 (112#) = happyGoto action_16-action_39 (113#) = happyGoto action_17-action_39 (114#) = happyGoto action_18-action_39 (115#) = happyGoto action_19-action_39 (123#) = happyGoto action_20-action_39 x = happyTcHack x happyFail--action_40 (148#) = happyShift action_44-action_40 (36#) = happyGoto action_42-action_40 (125#) = happyGoto action_43-action_40 x = happyTcHack x happyReduce_280--action_41 x = happyTcHack x happyReduce_257--action_42 (180#) = happyShift action_144-action_42 x = happyTcHack x happyFail--action_43 (7#) = happyGoto action_140-action_43 (8#) = happyGoto action_141-action_43 (33#) = happyGoto action_143-action_43 x = happyTcHack x happyReduce_11--action_44 (7#) = happyGoto action_140-action_44 (8#) = happyGoto action_141-action_44 (33#) = happyGoto action_142-action_44 x = happyTcHack x happyReduce_11--action_45 (189#) = happyShift action_139-action_45 x = happyTcHack x happyFail--action_46 x = happyTcHack x happyReduce_160--action_47 (133#) = happyShift action_21-action_47 (134#) = happyShift action_22-action_47 (135#) = happyShift action_23-action_47 (136#) = happyShift action_24-action_47 (141#) = happyShift action_25-action_47 (142#) = happyShift action_26-action_47 (143#) = happyShift action_27-action_47 (144#) = happyShift action_28-action_47 (145#) = happyShift action_29-action_47 (147#) = happyShift action_136-action_47 (151#) = happyShift action_30-action_47 (154#) = happyShift action_31-action_47 (160#) = happyShift action_32-action_47 (165#) = happyShift action_33-action_47 (167#) = happyShift action_34-action_47 (169#) = happyShift action_35-action_47 (170#) = happyShift action_36-action_47 (175#) = happyShift action_37-action_47 (177#) = happyShift action_38-action_47 (178#) = happyShift action_39-action_47 (185#) = happyShift action_137-action_47 (192#) = happyShift action_41-action_47 (68#) = happyGoto action_132-action_47 (69#) = happyGoto action_4-action_47 (70#) = happyGoto action_5-action_47 (71#) = happyGoto action_133-action_47 (72#) = happyGoto action_7-action_47 (73#) = happyGoto action_8-action_47 (74#) = happyGoto action_9-action_47 (77#) = happyGoto action_10-action_47 (78#) = happyGoto action_11-action_47 (79#) = happyGoto action_12-action_47 (93#) = happyGoto action_134-action_47 (95#) = happyGoto action_138-action_47 (98#) = happyGoto action_13-action_47 (100#) = happyGoto action_14-action_47 (102#) = happyGoto action_15-action_47 (112#) = happyGoto action_16-action_47 (113#) = happyGoto action_17-action_47 (114#) = happyGoto action_18-action_47 (115#) = happyGoto action_19-action_47 (123#) = happyGoto action_20-action_47 x = happyTcHack x happyFail--action_48 (133#) = happyShift action_21-action_48 (134#) = happyShift action_22-action_48 (135#) = happyShift action_23-action_48 (136#) = happyShift action_24-action_48 (141#) = happyShift action_25-action_48 (142#) = happyShift action_26-action_48 (143#) = happyShift action_27-action_48 (144#) = happyShift action_28-action_48 (145#) = happyShift action_29-action_48 (147#) = happyShift action_136-action_48 (151#) = happyShift action_30-action_48 (154#) = happyShift action_31-action_48 (160#) = happyShift action_32-action_48 (165#) = happyShift action_33-action_48 (167#) = happyShift action_34-action_48 (169#) = happyShift action_35-action_48 (170#) = happyShift action_36-action_48 (175#) = happyShift action_37-action_48 (177#) = happyShift action_38-action_48 (178#) = happyShift action_39-action_48 (185#) = happyShift action_137-action_48 (192#) = happyShift action_41-action_48 (68#) = happyGoto action_132-action_48 (69#) = happyGoto action_4-action_48 (70#) = happyGoto action_5-action_48 (71#) = happyGoto action_133-action_48 (72#) = happyGoto action_7-action_48 (73#) = happyGoto action_8-action_48 (74#) = happyGoto action_9-action_48 (77#) = happyGoto action_10-action_48 (78#) = happyGoto action_11-action_48 (79#) = happyGoto action_12-action_48 (93#) = happyGoto action_134-action_48 (95#) = happyGoto action_135-action_48 (98#) = happyGoto action_13-action_48 (100#) = happyGoto action_14-action_48 (102#) = happyGoto action_15-action_48 (112#) = happyGoto action_16-action_48 (113#) = happyGoto action_17-action_48 (114#) = happyGoto action_18-action_48 (115#) = happyGoto action_19-action_48 (123#) = happyGoto action_20-action_48 x = happyTcHack x happyFail--action_49 (188#) = happyShift action_131-action_49 x = happyTcHack x happyFail--action_50 (133#) = happyShift action_21-action_50 (134#) = happyShift action_22-action_50 (135#) = happyShift action_23-action_50 (136#) = happyShift action_24-action_50 (141#) = happyShift action_25-action_50 (142#) = happyShift action_26-action_50 (143#) = happyShift action_27-action_50 (144#) = happyShift action_28-action_50 (145#) = happyShift action_29-action_50 (151#) = happyShift action_30-action_50 (154#) = happyShift action_31-action_50 (165#) = happyShift action_33-action_50 (169#) = happyShift action_35-action_50 (177#) = happyShift action_38-action_50 (192#) = happyShift action_41-action_50 (77#) = happyGoto action_84-action_50 (78#) = happyGoto action_11-action_50 (79#) = happyGoto action_12-action_50 (98#) = happyGoto action_13-action_50 (100#) = happyGoto action_14-action_50 (102#) = happyGoto action_15-action_50 (112#) = happyGoto action_16-action_50 (113#) = happyGoto action_17-action_50 (114#) = happyGoto action_18-action_50 (115#) = happyGoto action_19-action_50 (123#) = happyGoto action_20-action_50 x = happyTcHack x happyReduce_159--action_51 x = happyTcHack x happyReduce_168--action_52 (133#) = happyShift action_21-action_52 (134#) = happyShift action_22-action_52 (135#) = happyShift action_23-action_52 (136#) = happyShift action_24-action_52 (141#) = happyShift action_25-action_52 (142#) = happyShift action_26-action_52 (143#) = happyShift action_27-action_52 (144#) = happyShift action_28-action_52 (145#) = happyShift action_29-action_52 (151#) = happyShift action_30-action_52 (154#) = happyShift action_31-action_52 (165#) = happyShift action_33-action_52 (169#) = happyShift action_35-action_52 (177#) = happyShift action_38-action_52 (192#) = happyShift action_41-action_52 (75#) = happyGoto action_128-action_52 (76#) = happyGoto action_129-action_52 (77#) = happyGoto action_130-action_52 (78#) = happyGoto action_11-action_52 (79#) = happyGoto action_12-action_52 (98#) = happyGoto action_13-action_52 (100#) = happyGoto action_14-action_52 (102#) = happyGoto action_15-action_52 (112#) = happyGoto action_16-action_52 (113#) = happyGoto action_17-action_52 (114#) = happyGoto action_18-action_52 (115#) = happyGoto action_19-action_52 (123#) = happyGoto action_20-action_52 x = happyTcHack x happyFail--action_53 (153#) = happyShift action_125-action_53 (156#) = happyShift action_126-action_53 (161#) = happyShift action_127-action_53 x = happyTcHack x happyReduce_186--action_54 (152#) = happyShift action_124-action_54 x = happyTcHack x happyFail--action_55 (153#) = happyShift action_123-action_55 x = happyTcHack x happyReduce_187--action_56 x = happyTcHack x happyReduce_224--action_57 (146#) = happyShift action_121-action_57 (153#) = happyShift action_122-action_57 x = happyTcHack x happyFail--action_58 (137#) = happyShift action_91-action_58 (138#) = happyShift action_73-action_58 (139#) = happyShift action_74-action_58 (140#) = happyShift action_75-action_58 (155#) = happyShift action_92-action_58 (157#) = happyShift action_79-action_58 (158#) = happyShift action_93-action_58 (167#) = happyShift action_94-action_58 (168#) = happyShift action_95-action_58 (104#) = happyGoto action_85-action_58 (107#) = happyGoto action_86-action_58 (109#) = happyGoto action_120-action_58 (111#) = happyGoto action_88-action_58 (116#) = happyGoto action_65-action_58 (117#) = happyGoto action_66-action_58 (118#) = happyGoto action_89-action_58 (120#) = happyGoto action_69-action_58 (122#) = happyGoto action_90-action_58 x = happyTcHack x happyReduce_150--action_59 (146#) = happyShift action_118-action_59 (153#) = happyShift action_119-action_59 x = happyTcHack x happyFail--action_60 (146#) = happyShift action_116-action_60 (153#) = happyShift action_117-action_60 x = happyTcHack x happyFail--action_61 x = happyTcHack x happyReduce_249--action_62 x = happyTcHack x happyReduce_250--action_63 (133#) = happyShift action_21-action_63 (134#) = happyShift action_22-action_63 (135#) = happyShift action_23-action_63 (136#) = happyShift action_24-action_63 (141#) = happyShift action_25-action_63 (142#) = happyShift action_26-action_63 (143#) = happyShift action_27-action_63 (144#) = happyShift action_28-action_63 (145#) = happyShift action_29-action_63 (151#) = happyShift action_30-action_63 (154#) = happyShift action_31-action_63 (160#) = happyShift action_32-action_63 (165#) = happyShift action_33-action_63 (167#) = happyShift action_34-action_63 (169#) = happyShift action_35-action_63 (170#) = happyShift action_36-action_63 (175#) = happyShift action_37-action_63 (177#) = happyShift action_38-action_63 (178#) = happyShift action_39-action_63 (185#) = happyShift action_40-action_63 (192#) = happyShift action_41-action_63 (69#) = happyGoto action_114-action_63 (70#) = happyGoto action_5-action_63 (71#) = happyGoto action_115-action_63 (72#) = happyGoto action_7-action_63 (73#) = happyGoto action_8-action_63 (74#) = happyGoto action_9-action_63 (77#) = happyGoto action_10-action_63 (78#) = happyGoto action_11-action_63 (79#) = happyGoto action_12-action_63 (98#) = happyGoto action_13-action_63 (100#) = happyGoto action_14-action_63 (102#) = happyGoto action_15-action_63 (112#) = happyGoto action_16-action_63 (113#) = happyGoto action_17-action_63 (114#) = happyGoto action_18-action_63 (115#) = happyGoto action_19-action_63 (123#) = happyGoto action_20-action_63 x = happyTcHack x happyFail--action_64 (146#) = happyShift action_113-action_64 x = happyTcHack x happyReduce_243--action_65 x = happyTcHack x happyReduce_252--action_66 x = happyTcHack x happyReduce_262--action_67 (146#) = happyShift action_112-action_67 x = happyTcHack x happyFail--action_68 x = happyTcHack x happyReduce_239--action_69 x = happyTcHack x happyReduce_265--action_70 x = happyTcHack x happyReduce_267--action_71 (146#) = happyReduce_266-action_71 x = happyTcHack x happyReduce_268--action_72 (146#) = happyReduce_269-action_72 x = happyTcHack x happyReduce_272--action_73 x = happyTcHack x happyReduce_264--action_74 x = happyTcHack x happyReduce_274--action_75 x = happyTcHack x happyReduce_263--action_76 x = happyTcHack x happyReduce_223--action_77 x = happyTcHack x happyReduce_183--action_78 (133#) = happyShift action_21-action_78 (134#) = happyShift action_22-action_78 (135#) = happyShift action_23-action_78 (136#) = happyShift action_24-action_78 (169#) = happyShift action_35-action_78 (177#) = happyShift action_38-action_78 (192#) = happyShift action_41-action_78 (112#) = happyGoto action_111-action_78 (113#) = happyGoto action_17-action_78 (114#) = happyGoto action_102-action_78 (115#) = happyGoto action_19-action_78 x = happyTcHack x happyFail--action_79 x = happyTcHack x happyReduce_251--action_80 (133#) = happyShift action_21-action_80 (134#) = happyShift action_22-action_80 (135#) = happyShift action_23-action_80 (136#) = happyShift action_24-action_80 (141#) = happyShift action_25-action_80 (142#) = happyShift action_26-action_80 (143#) = happyShift action_27-action_80 (144#) = happyShift action_28-action_80 (145#) = happyShift action_29-action_80 (151#) = happyShift action_30-action_80 (154#) = happyShift action_31-action_80 (165#) = happyShift action_33-action_80 (169#) = happyShift action_35-action_80 (177#) = happyShift action_38-action_80 (192#) = happyShift action_41-action_80 (74#) = happyGoto action_50-action_80 (77#) = happyGoto action_10-action_80 (78#) = happyGoto action_11-action_80 (79#) = happyGoto action_12-action_80 (98#) = happyGoto action_13-action_80 (100#) = happyGoto action_14-action_80 (102#) = happyGoto action_15-action_80 (112#) = happyGoto action_16-action_80 (113#) = happyGoto action_17-action_80 (114#) = happyGoto action_18-action_80 (115#) = happyGoto action_19-action_80 (123#) = happyGoto action_20-action_80 x = happyTcHack x happyReduce_270--action_81 (146#) = happyReduce_271-action_81 x = happyTcHack x happyReduce_273--action_82 (133#) = happyShift action_21-action_82 (134#) = happyShift action_22-action_82 (135#) = happyShift action_23-action_82 (136#) = happyShift action_24-action_82 (141#) = happyShift action_25-action_82 (142#) = happyShift action_26-action_82 (143#) = happyShift action_27-action_82 (144#) = happyShift action_28-action_82 (145#) = happyShift action_29-action_82 (151#) = happyShift action_30-action_82 (154#) = happyShift action_31-action_82 (165#) = happyShift action_33-action_82 (169#) = happyShift action_35-action_82 (177#) = happyShift action_38-action_82 (192#) = happyShift action_41-action_82 (77#) = happyGoto action_110-action_82 (78#) = happyGoto action_11-action_82 (79#) = happyGoto action_12-action_82 (98#) = happyGoto action_13-action_82 (100#) = happyGoto action_14-action_82 (102#) = happyGoto action_15-action_82 (112#) = happyGoto action_16-action_82 (113#) = happyGoto action_17-action_82 (114#) = happyGoto action_18-action_82 (115#) = happyGoto action_19-action_82 (123#) = happyGoto action_20-action_82 x = happyTcHack x happyFail--action_83 (133#) = happyShift action_21-action_83 (134#) = happyShift action_22-action_83 (145#) = happyShift action_108-action_83 (149#) = happyShift action_109-action_83 (169#) = happyShift action_35-action_83 (177#) = happyShift action_38-action_83 (192#) = happyShift action_41-action_83 (96#) = happyGoto action_105-action_83 (97#) = happyGoto action_106-action_83 (100#) = happyGoto action_107-action_83 (112#) = happyGoto action_16-action_83 (113#) = happyGoto action_17-action_83 x = happyTcHack x happyFail--action_84 x = happyTcHack x happyReduce_162--action_85 x = happyTcHack x happyReduce_247--action_86 x = happyTcHack x happyReduce_248--action_87 (133#) = happyShift action_21-action_87 (134#) = happyShift action_22-action_87 (135#) = happyShift action_23-action_87 (136#) = happyShift action_24-action_87 (141#) = happyShift action_25-action_87 (142#) = happyShift action_26-action_87 (143#) = happyShift action_27-action_87 (144#) = happyShift action_28-action_87 (145#) = happyShift action_29-action_87 (151#) = happyShift action_30-action_87 (154#) = happyShift action_31-action_87 (160#) = happyShift action_32-action_87 (165#) = happyShift action_33-action_87 (167#) = happyShift action_34-action_87 (169#) = happyShift action_35-action_87 (170#) = happyShift action_36-action_87 (175#) = happyShift action_37-action_87 (177#) = happyShift action_38-action_87 (178#) = happyShift action_39-action_87 (185#) = happyShift action_40-action_87 (192#) = happyShift action_41-action_87 (72#) = happyGoto action_103-action_87 (73#) = happyGoto action_104-action_87 (74#) = happyGoto action_9-action_87 (77#) = happyGoto action_10-action_87 (78#) = happyGoto action_11-action_87 (79#) = happyGoto action_12-action_87 (98#) = happyGoto action_13-action_87 (100#) = happyGoto action_14-action_87 (102#) = happyGoto action_15-action_87 (112#) = happyGoto action_16-action_87 (113#) = happyGoto action_17-action_87 (114#) = happyGoto action_18-action_87 (115#) = happyGoto action_19-action_87 (123#) = happyGoto action_20-action_87 x = happyTcHack x happyFail--action_88 x = happyTcHack x happyReduce_243--action_89 x = happyTcHack x happyReduce_237--action_90 x = happyTcHack x happyReduce_266--action_91 x = happyTcHack x happyReduce_269--action_92 (133#) = happyShift action_21-action_92 (134#) = happyShift action_22-action_92 (135#) = happyShift action_23-action_92 (136#) = happyShift action_24-action_92 (169#) = happyShift action_35-action_92 (177#) = happyShift action_38-action_92 (192#) = happyShift action_41-action_92 (112#) = happyGoto action_101-action_92 (113#) = happyGoto action_17-action_92 (114#) = happyGoto action_102-action_92 (115#) = happyGoto action_19-action_92 x = happyTcHack x happyFail--action_93 (124#) = happyGoto action_100-action_93 x = happyTcHack x happyReduce_279--action_94 x = happyTcHack x happyReduce_270--action_95 x = happyTcHack x happyReduce_271--action_96 (135#) = happyShift action_98-action_96 (136#) = happyShift action_99-action_96 (127#) = happyGoto action_97-action_96 x = happyTcHack x happyFail--action_97 (145#) = happyShift action_200-action_97 (9#) = happyGoto action_198-action_97 (10#) = happyGoto action_199-action_97 x = happyTcHack x happyFail--action_98 x = happyTcHack x happyReduce_283--action_99 x = happyTcHack x happyReduce_284--action_100 (133#) = happyShift action_21-action_100 (135#) = happyShift action_23-action_100 (136#) = happyShift action_24-action_100 (145#) = happyShift action_196-action_100 (151#) = happyShift action_197-action_100 (169#) = happyShift action_35-action_100 (177#) = happyShift action_38-action_100 (192#) = happyShift action_41-action_100 (39#) = happyGoto action_187-action_100 (40#) = happyGoto action_188-action_100 (41#) = happyGoto action_189-action_100 (42#) = happyGoto action_190-action_100 (43#) = happyGoto action_191-action_100 (44#) = happyGoto action_192-action_100 (113#) = happyGoto action_193-action_100 (114#) = happyGoto action_194-action_100 (115#) = happyGoto action_19-action_100 (132#) = happyGoto action_195-action_100 x = happyTcHack x happyFail--action_101 (155#) = happyShift action_186-action_101 x = happyTcHack x happyFail--action_102 (155#) = happyShift action_185-action_102 x = happyTcHack x happyFail--action_103 x = happyTcHack x happyReduce_151--action_104 x = happyTcHack x happyReduce_153--action_105 (149#) = happyShift action_183-action_105 (153#) = happyShift action_184-action_105 x = happyTcHack x happyFail--action_106 x = happyTcHack x happyReduce_221--action_107 (159#) = happyShift action_182-action_107 x = happyTcHack x happyFail--action_108 (137#) = happyShift action_91-action_108 (139#) = happyShift action_74-action_108 (167#) = happyShift action_94-action_108 (168#) = happyShift action_95-action_108 (118#) = happyGoto action_67-action_108 (120#) = happyGoto action_69-action_108 (122#) = happyGoto action_90-action_108 x = happyTcHack x happyFail--action_109 x = happyTcHack x happyReduce_170--action_110 x = happyTcHack x happyReduce_167--action_111 (155#) = happyShift action_181-action_111 x = happyTcHack x happyFail--action_112 x = happyTcHack x happyReduce_230--action_113 x = happyTcHack x happyReduce_234--action_114 (146#) = happyShift action_180-action_114 x = happyTcHack x happyFail--action_115 (137#) = happyShift action_91-action_115 (138#) = happyShift action_73-action_115 (139#) = happyShift action_74-action_115 (140#) = happyShift action_75-action_115 (155#) = happyShift action_92-action_115 (157#) = happyShift action_79-action_115 (167#) = happyShift action_94-action_115 (168#) = happyShift action_95-action_115 (104#) = happyGoto action_85-action_115 (107#) = happyGoto action_86-action_115 (109#) = happyGoto action_87-action_115 (111#) = happyGoto action_88-action_115 (116#) = happyGoto action_65-action_115 (117#) = happyGoto action_66-action_115 (118#) = happyGoto action_89-action_115 (120#) = happyGoto action_69-action_115 (122#) = happyGoto action_90-action_115 x = happyTcHack x happyReduce_150--action_116 x = happyTcHack x happyReduce_177--action_117 (133#) = happyShift action_21-action_117 (134#) = happyShift action_22-action_117 (135#) = happyShift action_23-action_117 (136#) = happyShift action_24-action_117 (141#) = happyShift action_25-action_117 (142#) = happyShift action_26-action_117 (143#) = happyShift action_27-action_117 (144#) = happyShift action_28-action_117 (145#) = happyShift action_29-action_117 (151#) = happyShift action_30-action_117 (154#) = happyShift action_31-action_117 (160#) = happyShift action_32-action_117 (165#) = happyShift action_33-action_117 (167#) = happyShift action_34-action_117 (169#) = happyShift action_35-action_117 (170#) = happyShift action_36-action_117 (175#) = happyShift action_37-action_117 (177#) = happyShift action_38-action_117 (178#) = happyShift action_39-action_117 (185#) = happyShift action_40-action_117 (192#) = happyShift action_41-action_117 (68#) = happyGoto action_179-action_117 (69#) = happyGoto action_4-action_117 (70#) = happyGoto action_5-action_117 (71#) = happyGoto action_6-action_117 (72#) = happyGoto action_7-action_117 (73#) = happyGoto action_8-action_117 (74#) = happyGoto action_9-action_117 (77#) = happyGoto action_10-action_117 (78#) = happyGoto action_11-action_117 (79#) = happyGoto action_12-action_117 (98#) = happyGoto action_13-action_117 (100#) = happyGoto action_14-action_117 (102#) = happyGoto action_15-action_117 (112#) = happyGoto action_16-action_117 (113#) = happyGoto action_17-action_117 (114#) = happyGoto action_18-action_117 (115#) = happyGoto action_19-action_117 (123#) = happyGoto action_20-action_117 x = happyTcHack x happyFail--action_118 x = happyTcHack x happyReduce_225--action_119 x = happyTcHack x happyReduce_182--action_120 (133#) = happyShift action_21-action_120 (134#) = happyShift action_22-action_120 (135#) = happyShift action_23-action_120 (136#) = happyShift action_24-action_120 (141#) = happyShift action_25-action_120 (142#) = happyShift action_26-action_120 (143#) = happyShift action_27-action_120 (144#) = happyShift action_28-action_120 (145#) = happyShift action_29-action_120 (146#) = happyShift action_178-action_120 (151#) = happyShift action_30-action_120 (154#) = happyShift action_31-action_120 (160#) = happyShift action_32-action_120 (165#) = happyShift action_33-action_120 (167#) = happyShift action_34-action_120 (169#) = happyShift action_35-action_120 (170#) = happyShift action_36-action_120 (175#) = happyShift action_37-action_120 (177#) = happyShift action_38-action_120 (178#) = happyShift action_39-action_120 (185#) = happyShift action_40-action_120 (192#) = happyShift action_41-action_120 (72#) = happyGoto action_103-action_120 (73#) = happyGoto action_104-action_120 (74#) = happyGoto action_9-action_120 (77#) = happyGoto action_10-action_120 (78#) = happyGoto action_11-action_120 (79#) = happyGoto action_12-action_120 (98#) = happyGoto action_13-action_120 (100#) = happyGoto action_14-action_120 (102#) = happyGoto action_15-action_120 (112#) = happyGoto action_16-action_120 (113#) = happyGoto action_17-action_120 (114#) = happyGoto action_18-action_120 (115#) = happyGoto action_19-action_120 (123#) = happyGoto action_20-action_120 x = happyTcHack x happyFail--action_121 x = happyTcHack x happyReduce_176--action_122 (133#) = happyShift action_21-action_122 (134#) = happyShift action_22-action_122 (135#) = happyShift action_23-action_122 (136#) = happyShift action_24-action_122 (141#) = happyShift action_25-action_122 (142#) = happyShift action_26-action_122 (143#) = happyShift action_27-action_122 (144#) = happyShift action_28-action_122 (145#) = happyShift action_29-action_122 (151#) = happyShift action_30-action_122 (154#) = happyShift action_31-action_122 (160#) = happyShift action_32-action_122 (165#) = happyShift action_33-action_122 (167#) = happyShift action_34-action_122 (169#) = happyShift action_35-action_122 (170#) = happyShift action_36-action_122 (175#) = happyShift action_37-action_122 (177#) = happyShift action_38-action_122 (178#) = happyShift action_39-action_122 (185#) = happyShift action_40-action_122 (192#) = happyShift action_41-action_122 (68#) = happyGoto action_177-action_122 (69#) = happyGoto action_4-action_122 (70#) = happyGoto action_5-action_122 (71#) = happyGoto action_6-action_122 (72#) = happyGoto action_7-action_122 (73#) = happyGoto action_8-action_122 (74#) = happyGoto action_9-action_122 (77#) = happyGoto action_10-action_122 (78#) = happyGoto action_11-action_122 (79#) = happyGoto action_12-action_122 (98#) = happyGoto action_13-action_122 (100#) = happyGoto action_14-action_122 (102#) = happyGoto action_15-action_122 (112#) = happyGoto action_16-action_122 (113#) = happyGoto action_17-action_122 (114#) = happyGoto action_18-action_122 (115#) = happyGoto action_19-action_122 (123#) = happyGoto action_20-action_122 x = happyTcHack x happyFail--action_123 (133#) = happyShift action_21-action_123 (134#) = happyShift action_22-action_123 (135#) = happyShift action_23-action_123 (136#) = happyShift action_24-action_123 (141#) = happyShift action_25-action_123 (142#) = happyShift action_26-action_123 (143#) = happyShift action_27-action_123 (144#) = happyShift action_28-action_123 (145#) = happyShift action_29-action_123 (151#) = happyShift action_30-action_123 (154#) = happyShift action_31-action_123 (160#) = happyShift action_32-action_123 (165#) = happyShift action_33-action_123 (167#) = happyShift action_34-action_123 (169#) = happyShift action_35-action_123 (170#) = happyShift action_36-action_123 (175#) = happyShift action_37-action_123 (177#) = happyShift action_38-action_123 (178#) = happyShift action_39-action_123 (185#) = happyShift action_40-action_123 (192#) = happyShift action_41-action_123 (68#) = happyGoto action_176-action_123 (69#) = happyGoto action_4-action_123 (70#) = happyGoto action_5-action_123 (71#) = happyGoto action_6-action_123 (72#) = happyGoto action_7-action_123 (73#) = happyGoto action_8-action_123 (74#) = happyGoto action_9-action_123 (77#) = happyGoto action_10-action_123 (78#) = happyGoto action_11-action_123 (79#) = happyGoto action_12-action_123 (98#) = happyGoto action_13-action_123 (100#) = happyGoto action_14-action_123 (102#) = happyGoto action_15-action_123 (112#) = happyGoto action_16-action_123 (113#) = happyGoto action_17-action_123 (114#) = happyGoto action_18-action_123 (115#) = happyGoto action_19-action_123 (123#) = happyGoto action_20-action_123 x = happyTcHack x happyFail--action_124 x = happyTcHack x happyReduce_178--action_125 (133#) = happyShift action_21-action_125 (134#) = happyShift action_22-action_125 (135#) = happyShift action_23-action_125 (136#) = happyShift action_24-action_125 (141#) = happyShift action_25-action_125 (142#) = happyShift action_26-action_125 (143#) = happyShift action_27-action_125 (144#) = happyShift action_28-action_125 (145#) = happyShift action_29-action_125 (151#) = happyShift action_30-action_125 (154#) = happyShift action_31-action_125 (160#) = happyShift action_32-action_125 (165#) = happyShift action_33-action_125 (167#) = happyShift action_34-action_125 (169#) = happyShift action_35-action_125 (170#) = happyShift action_36-action_125 (175#) = happyShift action_37-action_125 (177#) = happyShift action_38-action_125 (178#) = happyShift action_39-action_125 (185#) = happyShift action_40-action_125 (192#) = happyShift action_41-action_125 (68#) = happyGoto action_175-action_125 (69#) = happyGoto action_4-action_125 (70#) = happyGoto action_5-action_125 (71#) = happyGoto action_6-action_125 (72#) = happyGoto action_7-action_125 (73#) = happyGoto action_8-action_125 (74#) = happyGoto action_9-action_125 (77#) = happyGoto action_10-action_125 (78#) = happyGoto action_11-action_125 (79#) = happyGoto action_12-action_125 (98#) = happyGoto action_13-action_125 (100#) = happyGoto action_14-action_125 (102#) = happyGoto action_15-action_125 (112#) = happyGoto action_16-action_125 (113#) = happyGoto action_17-action_125 (114#) = happyGoto action_18-action_125 (115#) = happyGoto action_19-action_125 (123#) = happyGoto action_20-action_125 x = happyTcHack x happyFail--action_126 (133#) = happyShift action_21-action_126 (134#) = happyShift action_22-action_126 (135#) = happyShift action_23-action_126 (136#) = happyShift action_24-action_126 (141#) = happyShift action_25-action_126 (142#) = happyShift action_26-action_126 (143#) = happyShift action_27-action_126 (144#) = happyShift action_28-action_126 (145#) = happyShift action_29-action_126 (151#) = happyShift action_30-action_126 (154#) = happyShift action_31-action_126 (160#) = happyShift action_32-action_126 (165#) = happyShift action_33-action_126 (167#) = happyShift action_34-action_126 (169#) = happyShift action_35-action_126 (170#) = happyShift action_36-action_126 (175#) = happyShift action_37-action_126 (177#) = happyShift action_38-action_126 (178#) = happyShift action_39-action_126 (185#) = happyShift action_40-action_126 (192#) = happyShift action_41-action_126 (68#) = happyGoto action_174-action_126 (69#) = happyGoto action_4-action_126 (70#) = happyGoto action_5-action_126 (71#) = happyGoto action_6-action_126 (72#) = happyGoto action_7-action_126 (73#) = happyGoto action_8-action_126 (74#) = happyGoto action_9-action_126 (77#) = happyGoto action_10-action_126 (78#) = happyGoto action_11-action_126 (79#) = happyGoto action_12-action_126 (98#) = happyGoto action_13-action_126 (100#) = happyGoto action_14-action_126 (102#) = happyGoto action_15-action_126 (112#) = happyGoto action_16-action_126 (113#) = happyGoto action_17-action_126 (114#) = happyGoto action_18-action_126 (115#) = happyGoto action_19-action_126 (123#) = happyGoto action_20-action_126 x = happyTcHack x happyReduce_188--action_127 (133#) = happyShift action_21-action_127 (134#) = happyShift action_22-action_127 (135#) = happyShift action_23-action_127 (136#) = happyShift action_24-action_127 (141#) = happyShift action_25-action_127 (142#) = happyShift action_26-action_127 (143#) = happyShift action_27-action_127 (144#) = happyShift action_28-action_127 (145#) = happyShift action_29-action_127 (151#) = happyShift action_30-action_127 (154#) = happyShift action_31-action_127 (160#) = happyShift action_32-action_127 (165#) = happyShift action_33-action_127 (167#) = happyShift action_34-action_127 (169#) = happyShift action_35-action_127 (170#) = happyShift action_36-action_127 (175#) = happyShift action_37-action_127 (177#) = happyShift action_38-action_127 (178#) = happyShift action_39-action_127 (185#) = happyShift action_173-action_127 (192#) = happyShift action_41-action_127 (68#) = happyGoto action_169-action_127 (69#) = happyGoto action_4-action_127 (70#) = happyGoto action_5-action_127 (71#) = happyGoto action_133-action_127 (72#) = happyGoto action_7-action_127 (73#) = happyGoto action_8-action_127 (74#) = happyGoto action_9-action_127 (77#) = happyGoto action_10-action_127 (78#) = happyGoto action_11-action_127 (79#) = happyGoto action_12-action_127 (84#) = happyGoto action_170-action_127 (85#) = happyGoto action_171-action_127 (93#) = happyGoto action_172-action_127 (98#) = happyGoto action_13-action_127 (100#) = happyGoto action_14-action_127 (102#) = happyGoto action_15-action_127 (112#) = happyGoto action_16-action_127 (113#) = happyGoto action_17-action_127 (114#) = happyGoto action_18-action_127 (115#) = happyGoto action_19-action_127 (123#) = happyGoto action_20-action_127 x = happyTcHack x happyFail--action_128 (133#) = happyShift action_21-action_128 (134#) = happyShift action_22-action_128 (135#) = happyShift action_23-action_128 (136#) = happyShift action_24-action_128 (141#) = happyShift action_25-action_128 (142#) = happyShift action_26-action_128 (143#) = happyShift action_27-action_128 (144#) = happyShift action_28-action_128 (145#) = happyShift action_29-action_128 (151#) = happyShift action_30-action_128 (154#) = happyShift action_31-action_128 (163#) = happyShift action_168-action_128 (165#) = happyShift action_33-action_128 (169#) = happyShift action_35-action_128 (177#) = happyShift action_38-action_128 (192#) = happyShift action_41-action_128 (76#) = happyGoto action_167-action_128 (77#) = happyGoto action_130-action_128 (78#) = happyGoto action_11-action_128 (79#) = happyGoto action_12-action_128 (98#) = happyGoto action_13-action_128 (100#) = happyGoto action_14-action_128 (102#) = happyGoto action_15-action_128 (112#) = happyGoto action_16-action_128 (113#) = happyGoto action_17-action_128 (114#) = happyGoto action_18-action_128 (115#) = happyGoto action_19-action_128 (123#) = happyGoto action_20-action_128 x = happyTcHack x happyFail--action_129 x = happyTcHack x happyReduce_165--action_130 x = happyTcHack x happyReduce_166--action_131 (148#) = happyShift action_166-action_131 (86#) = happyGoto action_164-action_131 (125#) = happyGoto action_165-action_131 x = happyTcHack x happyReduce_280--action_132 (147#) = happyShift action_163-action_132 x = happyTcHack x happyReduce_219--action_133 (137#) = happyShift action_91-action_133 (138#) = happyShift action_73-action_133 (139#) = happyShift action_74-action_133 (140#) = happyShift action_75-action_133 (155#) = happyShift action_92-action_133 (157#) = happyShift action_79-action_133 (158#) = happyShift action_93-action_133 (162#) = happyReduce_211-action_133 (167#) = happyShift action_94-action_133 (168#) = happyShift action_95-action_133 (104#) = happyGoto action_85-action_133 (107#) = happyGoto action_86-action_133 (109#) = happyGoto action_87-action_133 (111#) = happyGoto action_88-action_133 (116#) = happyGoto action_65-action_133 (117#) = happyGoto action_66-action_133 (118#) = happyGoto action_89-action_133 (120#) = happyGoto action_69-action_133 (122#) = happyGoto action_90-action_133 x = happyTcHack x happyReduce_150--action_134 (124#) = happyGoto action_162-action_134 x = happyTcHack x happyReduce_279--action_135 (149#) = happyShift action_161-action_135 x = happyTcHack x happyFail--action_136 (133#) = happyShift action_21-action_136 (134#) = happyShift action_22-action_136 (135#) = happyShift action_23-action_136 (136#) = happyShift action_24-action_136 (141#) = happyShift action_25-action_136 (142#) = happyShift action_26-action_136 (143#) = happyShift action_27-action_136 (144#) = happyShift action_28-action_136 (145#) = happyShift action_29-action_136 (147#) = happyShift action_136-action_136 (151#) = happyShift action_30-action_136 (154#) = happyShift action_31-action_136 (160#) = happyShift action_32-action_136 (165#) = happyShift action_33-action_136 (167#) = happyShift action_34-action_136 (169#) = happyShift action_35-action_136 (170#) = happyShift action_36-action_136 (175#) = happyShift action_37-action_136 (177#) = happyShift action_38-action_136 (178#) = happyShift action_39-action_136 (185#) = happyShift action_137-action_136 (192#) = happyShift action_41-action_136 (68#) = happyGoto action_132-action_136 (69#) = happyGoto action_4-action_136 (70#) = happyGoto action_5-action_136 (71#) = happyGoto action_133-action_136 (72#) = happyGoto action_7-action_136 (73#) = happyGoto action_8-action_136 (74#) = happyGoto action_9-action_136 (77#) = happyGoto action_10-action_136 (78#) = happyGoto action_11-action_136 (79#) = happyGoto action_12-action_136 (93#) = happyGoto action_134-action_136 (95#) = happyGoto action_160-action_136 (98#) = happyGoto action_13-action_136 (100#) = happyGoto action_14-action_136 (102#) = happyGoto action_15-action_136 (112#) = happyGoto action_16-action_136 (113#) = happyGoto action_17-action_136 (114#) = happyGoto action_18-action_136 (115#) = happyGoto action_19-action_136 (123#) = happyGoto action_20-action_136 x = happyTcHack x happyFail--action_137 (148#) = happyShift action_44-action_137 (36#) = happyGoto action_159-action_137 (125#) = happyGoto action_43-action_137 x = happyTcHack x happyReduce_280--action_138 (1#) = happyShift action_147-action_138 (150#) = happyShift action_148-action_138 (126#) = happyGoto action_158-action_138 x = happyTcHack x happyFail--action_139 (133#) = happyShift action_21-action_139 (134#) = happyShift action_22-action_139 (135#) = happyShift action_23-action_139 (136#) = happyShift action_24-action_139 (141#) = happyShift action_25-action_139 (142#) = happyShift action_26-action_139 (143#) = happyShift action_27-action_139 (144#) = happyShift action_28-action_139 (145#) = happyShift action_29-action_139 (151#) = happyShift action_30-action_139 (154#) = happyShift action_31-action_139 (160#) = happyShift action_32-action_139 (165#) = happyShift action_33-action_139 (167#) = happyShift action_34-action_139 (169#) = happyShift action_35-action_139 (170#) = happyShift action_36-action_139 (175#) = happyShift action_37-action_139 (177#) = happyShift action_38-action_139 (178#) = happyShift action_39-action_139 (185#) = happyShift action_40-action_139 (192#) = happyShift action_41-action_139 (68#) = happyGoto action_157-action_139 (69#) = happyGoto action_4-action_139 (70#) = happyGoto action_5-action_139 (71#) = happyGoto action_6-action_139 (72#) = happyGoto action_7-action_139 (73#) = happyGoto action_8-action_139 (74#) = happyGoto action_9-action_139 (77#) = happyGoto action_10-action_139 (78#) = happyGoto action_11-action_139 (79#) = happyGoto action_12-action_139 (98#) = happyGoto action_13-action_139 (100#) = happyGoto action_14-action_139 (102#) = happyGoto action_15-action_139 (112#) = happyGoto action_16-action_139 (113#) = happyGoto action_17-action_139 (114#) = happyGoto action_18-action_139 (115#) = happyGoto action_19-action_139 (123#) = happyGoto action_20-action_139 x = happyTcHack x happyFail--action_140 x = happyTcHack x happyReduce_10--action_141 (133#) = happyReduce_279-action_141 (134#) = happyReduce_279-action_141 (135#) = happyReduce_279-action_141 (136#) = happyReduce_279-action_141 (141#) = happyReduce_279-action_141 (142#) = happyReduce_279-action_141 (143#) = happyReduce_279-action_141 (144#) = happyReduce_279-action_141 (145#) = happyReduce_279-action_141 (147#) = happyShift action_156-action_141 (151#) = happyReduce_279-action_141 (154#) = happyReduce_279-action_141 (165#) = happyReduce_279-action_141 (167#) = happyReduce_279-action_141 (169#) = happyReduce_279-action_141 (170#) = happyReduce_279-action_141 (175#) = happyReduce_279-action_141 (177#) = happyReduce_279-action_141 (181#) = happyReduce_279-action_141 (182#) = happyReduce_279-action_141 (183#) = happyReduce_279-action_141 (192#) = happyReduce_279-action_141 (25#) = happyGoto action_150-action_141 (34#) = happyGoto action_151-action_141 (35#) = happyGoto action_152-action_141 (37#) = happyGoto action_153-action_141 (63#) = happyGoto action_154-action_141 (124#) = happyGoto action_155-action_141 x = happyTcHack x happyReduce_72--action_142 (149#) = happyShift action_149-action_142 x = happyTcHack x happyFail--action_143 (1#) = happyShift action_147-action_143 (150#) = happyShift action_148-action_143 (126#) = happyGoto action_146-action_143 x = happyTcHack x happyFail--action_144 (133#) = happyShift action_21-action_144 (134#) = happyShift action_22-action_144 (135#) = happyShift action_23-action_144 (136#) = happyShift action_24-action_144 (141#) = happyShift action_25-action_144 (142#) = happyShift action_26-action_144 (143#) = happyShift action_27-action_144 (144#) = happyShift action_28-action_144 (145#) = happyShift action_29-action_144 (151#) = happyShift action_30-action_144 (154#) = happyShift action_31-action_144 (160#) = happyShift action_32-action_144 (165#) = happyShift action_33-action_144 (167#) = happyShift action_34-action_144 (169#) = happyShift action_35-action_144 (170#) = happyShift action_36-action_144 (175#) = happyShift action_37-action_144 (177#) = happyShift action_38-action_144 (178#) = happyShift action_39-action_144 (185#) = happyShift action_40-action_144 (192#) = happyShift action_41-action_144 (68#) = happyGoto action_145-action_144 (69#) = happyGoto action_4-action_144 (70#) = happyGoto action_5-action_144 (71#) = happyGoto action_6-action_144 (72#) = happyGoto action_7-action_144 (73#) = happyGoto action_8-action_144 (74#) = happyGoto action_9-action_144 (77#) = happyGoto action_10-action_144 (78#) = happyGoto action_11-action_144 (79#) = happyGoto action_12-action_144 (98#) = happyGoto action_13-action_144 (100#) = happyGoto action_14-action_144 (102#) = happyGoto action_15-action_144 (112#) = happyGoto action_16-action_144 (113#) = happyGoto action_17-action_144 (114#) = happyGoto action_18-action_144 (115#) = happyGoto action_19-action_144 (123#) = happyGoto action_20-action_144 x = happyTcHack x happyFail--action_145 x = happyTcHack x happyReduce_156--action_146 x = happyTcHack x happyReduce_79--action_147 x = happyTcHack x happyReduce_282--action_148 x = happyTcHack x happyReduce_281--action_149 x = happyTcHack x happyReduce_78--action_150 x = happyTcHack x happyReduce_76--action_151 (7#) = happyGoto action_242-action_151 (8#) = happyGoto action_243-action_151 x = happyTcHack x happyReduce_11--action_152 x = happyTcHack x happyReduce_74--action_153 x = happyTcHack x happyReduce_75--action_154 x = happyTcHack x happyReduce_77--action_155 (133#) = happyShift action_21-action_155 (134#) = happyShift action_22-action_155 (135#) = happyShift action_23-action_155 (136#) = happyShift action_24-action_155 (141#) = happyShift action_25-action_155 (142#) = happyShift action_26-action_155 (143#) = happyShift action_27-action_155 (144#) = happyShift action_28-action_155 (145#) = happyShift action_29-action_155 (151#) = happyShift action_30-action_155 (154#) = happyShift action_31-action_155 (165#) = happyShift action_33-action_155 (167#) = happyShift action_34-action_155 (169#) = happyShift action_35-action_155 (170#) = happyShift action_36-action_155 (175#) = happyShift action_37-action_155 (177#) = happyShift action_38-action_155 (181#) = happyShift action_239-action_155 (182#) = happyShift action_240-action_155 (183#) = happyShift action_241-action_155 (192#) = happyShift action_41-action_155 (27#) = happyGoto action_235-action_155 (38#) = happyGoto action_236-action_155 (71#) = happyGoto action_237-action_155 (73#) = happyGoto action_8-action_155 (74#) = happyGoto action_9-action_155 (77#) = happyGoto action_10-action_155 (78#) = happyGoto action_11-action_155 (79#) = happyGoto action_12-action_155 (98#) = happyGoto action_13-action_155 (100#) = happyGoto action_238-action_155 (102#) = happyGoto action_15-action_155 (112#) = happyGoto action_16-action_155 (113#) = happyGoto action_17-action_155 (114#) = happyGoto action_18-action_155 (115#) = happyGoto action_19-action_155 (123#) = happyGoto action_20-action_155 x = happyTcHack x happyFail--action_156 x = happyTcHack x happyReduce_9--action_157 (176#) = happyShift action_234-action_157 x = happyTcHack x happyFail--action_158 x = happyTcHack x happyReduce_213--action_159 (147#) = happyShift action_233-action_159 (180#) = happyShift action_144-action_159 x = happyTcHack x happyFail--action_160 x = happyTcHack x happyReduce_217--action_161 x = happyTcHack x happyReduce_212--action_162 (162#) = happyShift action_232-action_162 x = happyTcHack x happyFail--action_163 (133#) = happyShift action_21-action_163 (134#) = happyShift action_22-action_163 (135#) = happyShift action_23-action_163 (136#) = happyShift action_24-action_163 (141#) = happyShift action_25-action_163 (142#) = happyShift action_26-action_163 (143#) = happyShift action_27-action_163 (144#) = happyShift action_28-action_163 (145#) = happyShift action_29-action_163 (147#) = happyShift action_136-action_163 (151#) = happyShift action_30-action_163 (154#) = happyShift action_31-action_163 (160#) = happyShift action_32-action_163 (165#) = happyShift action_33-action_163 (167#) = happyShift action_34-action_163 (169#) = happyShift action_35-action_163 (170#) = happyShift action_36-action_163 (175#) = happyShift action_37-action_163 (177#) = happyShift action_38-action_163 (178#) = happyShift action_39-action_163 (185#) = happyShift action_137-action_163 (192#) = happyShift action_41-action_163 (68#) = happyGoto action_132-action_163 (69#) = happyGoto action_4-action_163 (70#) = happyGoto action_5-action_163 (71#) = happyGoto action_133-action_163 (72#) = happyGoto action_7-action_163 (73#) = happyGoto action_8-action_163 (74#) = happyGoto action_9-action_163 (77#) = happyGoto action_10-action_163 (78#) = happyGoto action_11-action_163 (79#) = happyGoto action_12-action_163 (93#) = happyGoto action_134-action_163 (95#) = happyGoto action_231-action_163 (98#) = happyGoto action_13-action_163 (100#) = happyGoto action_14-action_163 (102#) = happyGoto action_15-action_163 (112#) = happyGoto action_16-action_163 (113#) = happyGoto action_17-action_163 (114#) = happyGoto action_18-action_163 (115#) = happyGoto action_19-action_163 (123#) = happyGoto action_20-action_163 x = happyTcHack x happyReduce_218--action_164 x = happyTcHack x happyReduce_158--action_165 (7#) = happyGoto action_140-action_165 (8#) = happyGoto action_228-action_165 (87#) = happyGoto action_230-action_165 x = happyTcHack x happyReduce_11--action_166 (7#) = happyGoto action_140-action_166 (8#) = happyGoto action_228-action_166 (87#) = happyGoto action_229-action_166 x = happyTcHack x happyReduce_11--action_167 x = happyTcHack x happyReduce_164--action_168 (133#) = happyShift action_21-action_168 (134#) = happyShift action_22-action_168 (135#) = happyShift action_23-action_168 (136#) = happyShift action_24-action_168 (141#) = happyShift action_25-action_168 (142#) = happyShift action_26-action_168 (143#) = happyShift action_27-action_168 (144#) = happyShift action_28-action_168 (145#) = happyShift action_29-action_168 (151#) = happyShift action_30-action_168 (154#) = happyShift action_31-action_168 (160#) = happyShift action_32-action_168 (165#) = happyShift action_33-action_168 (167#) = happyShift action_34-action_168 (169#) = happyShift action_35-action_168 (170#) = happyShift action_36-action_168 (175#) = happyShift action_37-action_168 (177#) = happyShift action_38-action_168 (178#) = happyShift action_39-action_168 (185#) = happyShift action_40-action_168 (192#) = happyShift action_41-action_168 (68#) = happyGoto action_227-action_168 (69#) = happyGoto action_4-action_168 (70#) = happyGoto action_5-action_168 (71#) = happyGoto action_6-action_168 (72#) = happyGoto action_7-action_168 (73#) = happyGoto action_8-action_168 (74#) = happyGoto action_9-action_168 (77#) = happyGoto action_10-action_168 (78#) = happyGoto action_11-action_168 (79#) = happyGoto action_12-action_168 (98#) = happyGoto action_13-action_168 (100#) = happyGoto action_14-action_168 (102#) = happyGoto action_15-action_168 (112#) = happyGoto action_16-action_168 (113#) = happyGoto action_17-action_168 (114#) = happyGoto action_18-action_168 (115#) = happyGoto action_19-action_168 (123#) = happyGoto action_20-action_168 x = happyTcHack x happyFail--action_169 x = happyTcHack x happyReduce_198--action_170 (153#) = happyShift action_226-action_170 x = happyTcHack x happyReduce_192--action_171 x = happyTcHack x happyReduce_196--action_172 (124#) = happyGoto action_225-action_172 x = happyTcHack x happyReduce_279--action_173 (148#) = happyShift action_44-action_173 (36#) = happyGoto action_224-action_173 (125#) = happyGoto action_43-action_173 x = happyTcHack x happyReduce_280--action_174 x = happyTcHack x happyReduce_190--action_175 (156#) = happyShift action_223-action_175 x = happyTcHack x happyReduce_194--action_176 x = happyTcHack x happyReduce_193--action_177 x = happyTcHack x happyReduce_185--action_178 x = happyTcHack x happyReduce_179--action_179 x = happyTcHack x happyReduce_184--action_180 x = happyTcHack x happyReduce_180--action_181 x = happyTcHack x happyReduce_240--action_182 (133#) = happyShift action_21-action_182 (134#) = happyShift action_22-action_182 (135#) = happyShift action_23-action_182 (136#) = happyShift action_24-action_182 (141#) = happyShift action_25-action_182 (142#) = happyShift action_26-action_182 (143#) = happyShift action_27-action_182 (144#) = happyShift action_28-action_182 (145#) = happyShift action_29-action_182 (151#) = happyShift action_30-action_182 (154#) = happyShift action_31-action_182 (160#) = happyShift action_32-action_182 (165#) = happyShift action_33-action_182 (167#) = happyShift action_34-action_182 (169#) = happyShift action_35-action_182 (170#) = happyShift action_36-action_182 (175#) = happyShift action_37-action_182 (177#) = happyShift action_38-action_182 (178#) = happyShift action_39-action_182 (185#) = happyShift action_40-action_182 (192#) = happyShift action_41-action_182 (68#) = happyGoto action_222-action_182 (69#) = happyGoto action_4-action_182 (70#) = happyGoto action_5-action_182 (71#) = happyGoto action_6-action_182 (72#) = happyGoto action_7-action_182 (73#) = happyGoto action_8-action_182 (74#) = happyGoto action_9-action_182 (77#) = happyGoto action_10-action_182 (78#) = happyGoto action_11-action_182 (79#) = happyGoto action_12-action_182 (98#) = happyGoto action_13-action_182 (100#) = happyGoto action_14-action_182 (102#) = happyGoto action_15-action_182 (112#) = happyGoto action_16-action_182 (113#) = happyGoto action_17-action_182 (114#) = happyGoto action_18-action_182 (115#) = happyGoto action_19-action_182 (123#) = happyGoto action_20-action_182 x = happyTcHack x happyFail--action_183 x = happyTcHack x happyReduce_171--action_184 (133#) = happyShift action_21-action_184 (134#) = happyShift action_22-action_184 (145#) = happyShift action_108-action_184 (169#) = happyShift action_35-action_184 (177#) = happyShift action_38-action_184 (192#) = happyShift action_41-action_184 (97#) = happyGoto action_221-action_184 (100#) = happyGoto action_107-action_184 (112#) = happyGoto action_16-action_184 (113#) = happyGoto action_17-action_184 x = happyTcHack x happyFail--action_185 x = happyTcHack x happyReduce_244--action_186 x = happyTcHack x happyReduce_238--action_187 x = happyTcHack x happyReduce_98--action_188 (133#) = happyShift action_21-action_188 (135#) = happyShift action_23-action_188 (136#) = happyShift action_24-action_188 (145#) = happyShift action_196-action_188 (151#) = happyShift action_197-action_188 (163#) = happyShift action_220-action_188 (166#) = happyReduce_99-action_188 (169#) = happyShift action_35-action_188 (177#) = happyShift action_38-action_188 (192#) = happyShift action_41-action_188 (41#) = happyGoto action_219-action_188 (42#) = happyGoto action_190-action_188 (113#) = happyGoto action_193-action_188 (114#) = happyGoto action_194-action_188 (115#) = happyGoto action_19-action_188 (132#) = happyGoto action_195-action_188 x = happyTcHack x happyReduce_84--action_189 x = happyTcHack x happyReduce_86--action_190 x = happyTcHack x happyReduce_87--action_191 x = happyTcHack x happyReduce_147--action_192 (166#) = happyShift action_218-action_192 x = happyTcHack x happyFail--action_193 x = happyTcHack x happyReduce_289--action_194 x = happyTcHack x happyReduce_92--action_195 x = happyTcHack x happyReduce_88--action_196 (133#) = happyShift action_21-action_196 (135#) = happyShift action_23-action_196 (136#) = happyShift action_24-action_196 (145#) = happyShift action_196-action_196 (146#) = happyShift action_216-action_196 (151#) = happyShift action_197-action_196 (153#) = happyShift action_77-action_196 (163#) = happyShift action_217-action_196 (169#) = happyShift action_35-action_196 (177#) = happyShift action_38-action_196 (192#) = happyShift action_41-action_196 (39#) = happyGoto action_213-action_196 (40#) = happyGoto action_211-action_196 (41#) = happyGoto action_189-action_196 (42#) = happyGoto action_190-action_196 (45#) = happyGoto action_214-action_196 (80#) = happyGoto action_215-action_196 (113#) = happyGoto action_193-action_196 (114#) = happyGoto action_194-action_196 (115#) = happyGoto action_19-action_196 (132#) = happyGoto action_195-action_196 x = happyTcHack x happyFail--action_197 (133#) = happyShift action_21-action_197 (135#) = happyShift action_23-action_197 (136#) = happyShift action_24-action_197 (145#) = happyShift action_196-action_197 (151#) = happyShift action_197-action_197 (152#) = happyShift action_212-action_197 (169#) = happyShift action_35-action_197 (177#) = happyShift action_38-action_197 (192#) = happyShift action_41-action_197 (39#) = happyGoto action_210-action_197 (40#) = happyGoto action_211-action_197 (41#) = happyGoto action_189-action_197 (42#) = happyGoto action_190-action_197 (113#) = happyGoto action_193-action_197 (114#) = happyGoto action_194-action_197 (115#) = happyGoto action_19-action_197 (132#) = happyGoto action_195-action_197 x = happyTcHack x happyFail--action_198 (191#) = happyShift action_209-action_198 x = happyTcHack x happyFail--action_199 x = happyTcHack x happyReduce_12--action_200 (133#) = happyShift action_21-action_200 (134#) = happyShift action_22-action_200 (135#) = happyShift action_23-action_200 (136#) = happyShift action_24-action_200 (145#) = happyShift action_108-action_200 (153#) = happyShift action_207-action_200 (169#) = happyShift action_35-action_200 (177#) = happyShift action_38-action_200 (186#) = happyShift action_208-action_200 (192#) = happyShift action_41-action_200 (11#) = happyGoto action_201-action_200 (12#) = happyGoto action_202-action_200 (13#) = happyGoto action_203-action_200 (100#) = happyGoto action_204-action_200 (112#) = happyGoto action_16-action_200 (113#) = happyGoto action_17-action_200 (114#) = happyGoto action_205-action_200 (115#) = happyGoto action_19-action_200 (130#) = happyGoto action_206-action_200 x = happyTcHack x happyReduce_17--action_201 (146#) = happyShift action_282-action_201 x = happyTcHack x happyFail--action_202 (153#) = happyShift action_281-action_202 (11#) = happyGoto action_280-action_202 x = happyTcHack x happyReduce_17--action_203 x = happyTcHack x happyReduce_19--action_204 x = happyTcHack x happyReduce_20--action_205 x = happyTcHack x happyReduce_287--action_206 (145#) = happyShift action_279-action_206 x = happyTcHack x happyReduce_21--action_207 x = happyTcHack x happyReduce_16--action_208 (135#) = happyShift action_98-action_208 (136#) = happyShift action_99-action_208 (127#) = happyGoto action_278-action_208 x = happyTcHack x happyFail--action_209 (148#) = happyShift action_277-action_209 (5#) = happyGoto action_275-action_209 (125#) = happyGoto action_276-action_209 x = happyTcHack x happyFail--action_210 (152#) = happyShift action_274-action_210 x = happyTcHack x happyFail--action_211 (133#) = happyShift action_21-action_211 (135#) = happyShift action_23-action_211 (136#) = happyShift action_24-action_211 (145#) = happyShift action_196-action_211 (151#) = happyShift action_197-action_211 (163#) = happyShift action_220-action_211 (169#) = happyShift action_35-action_211 (177#) = happyShift action_38-action_211 (192#) = happyShift action_41-action_211 (41#) = happyGoto action_219-action_211 (42#) = happyGoto action_190-action_211 (113#) = happyGoto action_193-action_211 (114#) = happyGoto action_194-action_211 (115#) = happyGoto action_19-action_211 (132#) = happyGoto action_195-action_211 x = happyTcHack x happyReduce_84--action_212 x = happyTcHack x happyReduce_95--action_213 (146#) = happyShift action_272-action_213 (153#) = happyShift action_273-action_213 x = happyTcHack x happyFail--action_214 (146#) = happyShift action_270-action_214 (153#) = happyShift action_271-action_214 x = happyTcHack x happyFail--action_215 (146#) = happyShift action_269-action_215 (153#) = happyShift action_119-action_215 x = happyTcHack x happyFail--action_216 x = happyTcHack x happyReduce_93--action_217 (146#) = happyShift action_268-action_217 x = happyTcHack x happyFail--action_218 (133#) = happyShift action_21-action_218 (135#) = happyShift action_23-action_218 (136#) = happyShift action_24-action_218 (145#) = happyShift action_196-action_218 (151#) = happyShift action_197-action_218 (169#) = happyShift action_35-action_218 (177#) = happyShift action_38-action_218 (192#) = happyShift action_41-action_218 (39#) = happyGoto action_267-action_218 (40#) = happyGoto action_211-action_218 (41#) = happyGoto action_189-action_218 (42#) = happyGoto action_190-action_218 (113#) = happyGoto action_193-action_218 (114#) = happyGoto action_194-action_218 (115#) = happyGoto action_19-action_218 (132#) = happyGoto action_195-action_218 x = happyTcHack x happyFail--action_219 x = happyTcHack x happyReduce_85--action_220 (133#) = happyShift action_21-action_220 (135#) = happyShift action_23-action_220 (136#) = happyShift action_24-action_220 (145#) = happyShift action_196-action_220 (151#) = happyShift action_197-action_220 (169#) = happyShift action_35-action_220 (177#) = happyShift action_38-action_220 (192#) = happyShift action_41-action_220 (39#) = happyGoto action_266-action_220 (40#) = happyGoto action_211-action_220 (41#) = happyGoto action_189-action_220 (42#) = happyGoto action_190-action_220 (113#) = happyGoto action_193-action_220 (114#) = happyGoto action_194-action_220 (115#) = happyGoto action_19-action_220 (132#) = happyGoto action_195-action_220 x = happyTcHack x happyFail--action_221 x = happyTcHack x happyReduce_220--action_222 x = happyTcHack x happyReduce_222--action_223 (133#) = happyShift action_21-action_223 (134#) = happyShift action_22-action_223 (135#) = happyShift action_23-action_223 (136#) = happyShift action_24-action_223 (141#) = happyShift action_25-action_223 (142#) = happyShift action_26-action_223 (143#) = happyShift action_27-action_223 (144#) = happyShift action_28-action_223 (145#) = happyShift action_29-action_223 (151#) = happyShift action_30-action_223 (154#) = happyShift action_31-action_223 (160#) = happyShift action_32-action_223 (165#) = happyShift action_33-action_223 (167#) = happyShift action_34-action_223 (169#) = happyShift action_35-action_223 (170#) = happyShift action_36-action_223 (175#) = happyShift action_37-action_223 (177#) = happyShift action_38-action_223 (178#) = happyShift action_39-action_223 (185#) = happyShift action_40-action_223 (192#) = happyShift action_41-action_223 (68#) = happyGoto action_265-action_223 (69#) = happyGoto action_4-action_223 (70#) = happyGoto action_5-action_223 (71#) = happyGoto action_6-action_223 (72#) = happyGoto action_7-action_223 (73#) = happyGoto action_8-action_223 (74#) = happyGoto action_9-action_223 (77#) = happyGoto action_10-action_223 (78#) = happyGoto action_11-action_223 (79#) = happyGoto action_12-action_223 (98#) = happyGoto action_13-action_223 (100#) = happyGoto action_14-action_223 (102#) = happyGoto action_15-action_223 (112#) = happyGoto action_16-action_223 (113#) = happyGoto action_17-action_223 (114#) = happyGoto action_18-action_223 (115#) = happyGoto action_19-action_223 (123#) = happyGoto action_20-action_223 x = happyTcHack x happyReduce_189--action_224 (180#) = happyShift action_144-action_224 x = happyTcHack x happyReduce_199--action_225 (162#) = happyShift action_264-action_225 x = happyTcHack x happyFail--action_226 (133#) = happyShift action_21-action_226 (134#) = happyShift action_22-action_226 (135#) = happyShift action_23-action_226 (136#) = happyShift action_24-action_226 (141#) = happyShift action_25-action_226 (142#) = happyShift action_26-action_226 (143#) = happyShift action_27-action_226 (144#) = happyShift action_28-action_226 (145#) = happyShift action_29-action_226 (151#) = happyShift action_30-action_226 (154#) = happyShift action_31-action_226 (160#) = happyShift action_32-action_226 (165#) = happyShift action_33-action_226 (167#) = happyShift action_34-action_226 (169#) = happyShift action_35-action_226 (170#) = happyShift action_36-action_226 (175#) = happyShift action_37-action_226 (177#) = happyShift action_38-action_226 (178#) = happyShift action_39-action_226 (185#) = happyShift action_173-action_226 (192#) = happyShift action_41-action_226 (68#) = happyGoto action_169-action_226 (69#) = happyGoto action_4-action_226 (70#) = happyGoto action_5-action_226 (71#) = happyGoto action_133-action_226 (72#) = happyGoto action_7-action_226 (73#) = happyGoto action_8-action_226 (74#) = happyGoto action_9-action_226 (77#) = happyGoto action_10-action_226 (78#) = happyGoto action_11-action_226 (79#) = happyGoto action_12-action_226 (85#) = happyGoto action_263-action_226 (93#) = happyGoto action_172-action_226 (98#) = happyGoto action_13-action_226 (100#) = happyGoto action_14-action_226 (102#) = happyGoto action_15-action_226 (112#) = happyGoto action_16-action_226 (113#) = happyGoto action_17-action_226 (114#) = happyGoto action_18-action_226 (115#) = happyGoto action_19-action_226 (123#) = happyGoto action_20-action_226 x = happyTcHack x happyFail--action_227 x = happyTcHack x happyReduce_155--action_228 (147#) = happyShift action_156-action_228 (88#) = happyGoto action_260-action_228 (89#) = happyGoto action_261-action_228 (124#) = happyGoto action_262-action_228 x = happyTcHack x happyReduce_279--action_229 (149#) = happyShift action_259-action_229 x = happyTcHack x happyFail--action_230 (1#) = happyShift action_147-action_230 (150#) = happyShift action_148-action_230 (126#) = happyGoto action_258-action_230 x = happyTcHack x happyFail--action_231 x = happyTcHack x happyReduce_216--action_232 (133#) = happyShift action_21-action_232 (134#) = happyShift action_22-action_232 (135#) = happyShift action_23-action_232 (136#) = happyShift action_24-action_232 (141#) = happyShift action_25-action_232 (142#) = happyShift action_26-action_232 (143#) = happyShift action_27-action_232 (144#) = happyShift action_28-action_232 (145#) = happyShift action_29-action_232 (151#) = happyShift action_30-action_232 (154#) = happyShift action_31-action_232 (160#) = happyShift action_32-action_232 (165#) = happyShift action_33-action_232 (167#) = happyShift action_34-action_232 (169#) = happyShift action_35-action_232 (170#) = happyShift action_36-action_232 (175#) = happyShift action_37-action_232 (177#) = happyShift action_38-action_232 (178#) = happyShift action_39-action_232 (185#) = happyShift action_40-action_232 (192#) = happyShift action_41-action_232 (68#) = happyGoto action_257-action_232 (69#) = happyGoto action_4-action_232 (70#) = happyGoto action_5-action_232 (71#) = happyGoto action_6-action_232 (72#) = happyGoto action_7-action_232 (73#) = happyGoto action_8-action_232 (74#) = happyGoto action_9-action_232 (77#) = happyGoto action_10-action_232 (78#) = happyGoto action_11-action_232 (79#) = happyGoto action_12-action_232 (98#) = happyGoto action_13-action_232 (100#) = happyGoto action_14-action_232 (102#) = happyGoto action_15-action_232 (112#) = happyGoto action_16-action_232 (113#) = happyGoto action_17-action_232 (114#) = happyGoto action_18-action_232 (115#) = happyGoto action_19-action_232 (123#) = happyGoto action_20-action_232 x = happyTcHack x happyFail--action_233 (133#) = happyShift action_21-action_233 (134#) = happyShift action_22-action_233 (135#) = happyShift action_23-action_233 (136#) = happyShift action_24-action_233 (141#) = happyShift action_25-action_233 (142#) = happyShift action_26-action_233 (143#) = happyShift action_27-action_233 (144#) = happyShift action_28-action_233 (145#) = happyShift action_29-action_233 (147#) = happyShift action_136-action_233 (151#) = happyShift action_30-action_233 (154#) = happyShift action_31-action_233 (160#) = happyShift action_32-action_233 (165#) = happyShift action_33-action_233 (167#) = happyShift action_34-action_233 (169#) = happyShift action_35-action_233 (170#) = happyShift action_36-action_233 (175#) = happyShift action_37-action_233 (177#) = happyShift action_38-action_233 (178#) = happyShift action_39-action_233 (185#) = happyShift action_137-action_233 (192#) = happyShift action_41-action_233 (68#) = happyGoto action_132-action_233 (69#) = happyGoto action_4-action_233 (70#) = happyGoto action_5-action_233 (71#) = happyGoto action_133-action_233 (72#) = happyGoto action_7-action_233 (73#) = happyGoto action_8-action_233 (74#) = happyGoto action_9-action_233 (77#) = happyGoto action_10-action_233 (78#) = happyGoto action_11-action_233 (79#) = happyGoto action_12-action_233 (93#) = happyGoto action_134-action_233 (95#) = happyGoto action_256-action_233 (98#) = happyGoto action_13-action_233 (100#) = happyGoto action_14-action_233 (102#) = happyGoto action_15-action_233 (112#) = happyGoto action_16-action_233 (113#) = happyGoto action_17-action_233 (114#) = happyGoto action_18-action_233 (115#) = happyGoto action_19-action_233 (123#) = happyGoto action_20-action_233 x = happyTcHack x happyFail--action_234 (133#) = happyShift action_21-action_234 (134#) = happyShift action_22-action_234 (135#) = happyShift action_23-action_234 (136#) = happyShift action_24-action_234 (141#) = happyShift action_25-action_234 (142#) = happyShift action_26-action_234 (143#) = happyShift action_27-action_234 (144#) = happyShift action_28-action_234 (145#) = happyShift action_29-action_234 (151#) = happyShift action_30-action_234 (154#) = happyShift action_31-action_234 (160#) = happyShift action_32-action_234 (165#) = happyShift action_33-action_234 (167#) = happyShift action_34-action_234 (169#) = happyShift action_35-action_234 (170#) = happyShift action_36-action_234 (175#) = happyShift action_37-action_234 (177#) = happyShift action_38-action_234 (178#) = happyShift action_39-action_234 (185#) = happyShift action_40-action_234 (192#) = happyShift action_41-action_234 (68#) = happyGoto action_255-action_234 (69#) = happyGoto action_4-action_234 (70#) = happyGoto action_5-action_234 (71#) = happyGoto action_6-action_234 (72#) = happyGoto action_7-action_234 (73#) = happyGoto action_8-action_234 (74#) = happyGoto action_9-action_234 (77#) = happyGoto action_10-action_234 (78#) = happyGoto action_11-action_234 (79#) = happyGoto action_12-action_234 (98#) = happyGoto action_13-action_234 (100#) = happyGoto action_14-action_234 (102#) = happyGoto action_15-action_234 (112#) = happyGoto action_16-action_234 (113#) = happyGoto action_17-action_234 (114#) = happyGoto action_18-action_234 (115#) = happyGoto action_19-action_234 (123#) = happyGoto action_20-action_234 x = happyTcHack x happyFail--action_235 (141#) = happyShift action_254-action_235 (26#) = happyGoto action_253-action_235 x = happyTcHack x happyReduce_51--action_236 (153#) = happyShift action_251-action_236 (158#) = happyShift action_252-action_236 x = happyTcHack x happyFail--action_237 (137#) = happyShift action_91-action_237 (138#) = happyShift action_73-action_237 (139#) = happyShift action_74-action_237 (140#) = happyShift action_75-action_237 (155#) = happyShift action_92-action_237 (157#) = happyShift action_79-action_237 (159#) = happyShift action_250-action_237 (167#) = happyShift action_94-action_237 (168#) = happyShift action_95-action_237 (65#) = happyGoto action_245-action_237 (66#) = happyGoto action_246-action_237 (67#) = happyGoto action_247-action_237 (104#) = happyGoto action_85-action_237 (107#) = happyGoto action_86-action_237 (109#) = happyGoto action_248-action_237 (111#) = happyGoto action_88-action_237 (116#) = happyGoto action_65-action_237 (117#) = happyGoto action_66-action_237 (118#) = happyGoto action_89-action_237 (120#) = happyGoto action_69-action_237 (122#) = happyGoto action_90-action_237 (124#) = happyGoto action_249-action_237 x = happyTcHack x happyReduce_279--action_238 (153#) = happyReduce_82-action_238 (158#) = happyReduce_82-action_238 (164#) = happyShift action_82-action_238 x = happyTcHack x happyReduce_173--action_239 x = happyTcHack x happyReduce_53--action_240 x = happyTcHack x happyReduce_54--action_241 x = happyTcHack x happyReduce_55--action_242 (133#) = happyReduce_279-action_242 (134#) = happyReduce_279-action_242 (135#) = happyReduce_279-action_242 (136#) = happyReduce_279-action_242 (141#) = happyReduce_279-action_242 (142#) = happyReduce_279-action_242 (143#) = happyReduce_279-action_242 (144#) = happyReduce_279-action_242 (145#) = happyReduce_279-action_242 (151#) = happyReduce_279-action_242 (154#) = happyReduce_279-action_242 (165#) = happyReduce_279-action_242 (167#) = happyReduce_279-action_242 (169#) = happyReduce_279-action_242 (170#) = happyReduce_279-action_242 (175#) = happyReduce_279-action_242 (177#) = happyReduce_279-action_242 (181#) = happyReduce_279-action_242 (182#) = happyReduce_279-action_242 (183#) = happyReduce_279-action_242 (192#) = happyReduce_279-action_242 (25#) = happyGoto action_150-action_242 (35#) = happyGoto action_244-action_242 (37#) = happyGoto action_153-action_242 (63#) = happyGoto action_154-action_242 (124#) = happyGoto action_155-action_242 x = happyTcHack x happyReduce_10--action_243 (147#) = happyShift action_156-action_243 x = happyTcHack x happyReduce_71--action_244 x = happyTcHack x happyReduce_73--action_245 (191#) = happyShift action_319-action_245 (64#) = happyGoto action_318-action_245 x = happyTcHack x happyReduce_141--action_246 (161#) = happyReduce_279-action_246 (67#) = happyGoto action_317-action_246 (124#) = happyGoto action_249-action_246 x = happyTcHack x happyReduce_143--action_247 x = happyTcHack x happyReduce_145--action_248 (133#) = happyShift action_21-action_248 (134#) = happyShift action_22-action_248 (135#) = happyShift action_23-action_248 (136#) = happyShift action_24-action_248 (141#) = happyShift action_25-action_248 (142#) = happyShift action_26-action_248 (143#) = happyShift action_27-action_248 (144#) = happyShift action_28-action_248 (145#) = happyShift action_29-action_248 (151#) = happyShift action_30-action_248 (154#) = happyShift action_31-action_248 (165#) = happyShift action_33-action_248 (167#) = happyShift action_34-action_248 (169#) = happyShift action_35-action_248 (170#) = happyShift action_36-action_248 (175#) = happyShift action_37-action_248 (177#) = happyShift action_38-action_248 (192#) = happyShift action_41-action_248 (73#) = happyGoto action_104-action_248 (74#) = happyGoto action_9-action_248 (77#) = happyGoto action_10-action_248 (78#) = happyGoto action_11-action_248 (79#) = happyGoto action_12-action_248 (98#) = happyGoto action_13-action_248 (100#) = happyGoto action_14-action_248 (102#) = happyGoto action_15-action_248 (112#) = happyGoto action_16-action_248 (113#) = happyGoto action_17-action_248 (114#) = happyGoto action_18-action_248 (115#) = happyGoto action_19-action_248 (123#) = happyGoto action_20-action_248 x = happyTcHack x happyFail--action_249 (161#) = happyShift action_316-action_249 x = happyTcHack x happyFail--action_250 (133#) = happyShift action_21-action_250 (134#) = happyShift action_22-action_250 (135#) = happyShift action_23-action_250 (136#) = happyShift action_24-action_250 (141#) = happyShift action_25-action_250 (142#) = happyShift action_26-action_250 (143#) = happyShift action_27-action_250 (144#) = happyShift action_28-action_250 (145#) = happyShift action_29-action_250 (151#) = happyShift action_30-action_250 (154#) = happyShift action_31-action_250 (160#) = happyShift action_32-action_250 (165#) = happyShift action_33-action_250 (167#) = happyShift action_34-action_250 (169#) = happyShift action_35-action_250 (170#) = happyShift action_36-action_250 (175#) = happyShift action_37-action_250 (177#) = happyShift action_38-action_250 (178#) = happyShift action_39-action_250 (185#) = happyShift action_40-action_250 (192#) = happyShift action_41-action_250 (68#) = happyGoto action_315-action_250 (69#) = happyGoto action_4-action_250 (70#) = happyGoto action_5-action_250 (71#) = happyGoto action_6-action_250 (72#) = happyGoto action_7-action_250 (73#) = happyGoto action_8-action_250 (74#) = happyGoto action_9-action_250 (77#) = happyGoto action_10-action_250 (78#) = happyGoto action_11-action_250 (79#) = happyGoto action_12-action_250 (98#) = happyGoto action_13-action_250 (100#) = happyGoto action_14-action_250 (102#) = happyGoto action_15-action_250 (112#) = happyGoto action_16-action_250 (113#) = happyGoto action_17-action_250 (114#) = happyGoto action_18-action_250 (115#) = happyGoto action_19-action_250 (123#) = happyGoto action_20-action_250 x = happyTcHack x happyFail--action_251 (133#) = happyShift action_21-action_251 (145#) = happyShift action_314-action_251 (169#) = happyShift action_35-action_251 (177#) = happyShift action_38-action_251 (192#) = happyShift action_41-action_251 (99#) = happyGoto action_313-action_251 (113#) = happyGoto action_289-action_251 x = happyTcHack x happyFail--action_252 (133#) = happyShift action_21-action_252 (135#) = happyShift action_23-action_252 (136#) = happyShift action_24-action_252 (145#) = happyShift action_196-action_252 (151#) = happyShift action_197-action_252 (169#) = happyShift action_35-action_252 (177#) = happyShift action_38-action_252 (192#) = happyShift action_41-action_252 (39#) = happyGoto action_187-action_252 (40#) = happyGoto action_188-action_252 (41#) = happyGoto action_189-action_252 (42#) = happyGoto action_190-action_252 (43#) = happyGoto action_312-action_252 (44#) = happyGoto action_192-action_252 (113#) = happyGoto action_193-action_252 (114#) = happyGoto action_194-action_252 (115#) = happyGoto action_19-action_252 (132#) = happyGoto action_195-action_252 x = happyTcHack x happyFail--action_253 (137#) = happyShift action_91-action_253 (138#) = happyShift action_73-action_253 (155#) = happyShift action_311-action_253 (167#) = happyShift action_94-action_253 (168#) = happyShift action_95-action_253 (28#) = happyGoto action_305-action_253 (103#) = happyGoto action_306-action_253 (106#) = happyGoto action_307-action_253 (108#) = happyGoto action_308-action_253 (117#) = happyGoto action_309-action_253 (120#) = happyGoto action_310-action_253 x = happyTcHack x happyFail--action_254 x = happyTcHack x happyReduce_52--action_255 x = happyTcHack x happyReduce_157--action_256 x = happyTcHack x happyReduce_214--action_257 (147#) = happyShift action_304-action_257 x = happyTcHack x happyFail--action_258 x = happyTcHack x happyReduce_201--action_259 x = happyTcHack x happyReduce_200--action_260 (7#) = happyGoto action_302-action_260 (8#) = happyGoto action_303-action_260 x = happyTcHack x happyReduce_11--action_261 x = happyTcHack x happyReduce_204--action_262 (133#) = happyShift action_21-action_262 (134#) = happyShift action_22-action_262 (135#) = happyShift action_23-action_262 (136#) = happyShift action_24-action_262 (141#) = happyShift action_25-action_262 (142#) = happyShift action_26-action_262 (143#) = happyShift action_27-action_262 (144#) = happyShift action_28-action_262 (145#) = happyShift action_29-action_262 (151#) = happyShift action_30-action_262 (154#) = happyShift action_31-action_262 (165#) = happyShift action_33-action_262 (167#) = happyShift action_34-action_262 (169#) = happyShift action_35-action_262 (170#) = happyShift action_36-action_262 (175#) = happyShift action_37-action_262 (177#) = happyShift action_38-action_262 (192#) = happyShift action_41-action_262 (71#) = happyGoto action_300-action_262 (73#) = happyGoto action_8-action_262 (74#) = happyGoto action_9-action_262 (77#) = happyGoto action_10-action_262 (78#) = happyGoto action_11-action_262 (79#) = happyGoto action_12-action_262 (93#) = happyGoto action_301-action_262 (98#) = happyGoto action_13-action_262 (100#) = happyGoto action_14-action_262 (102#) = happyGoto action_15-action_262 (112#) = happyGoto action_16-action_262 (113#) = happyGoto action_17-action_262 (114#) = happyGoto action_18-action_262 (115#) = happyGoto action_19-action_262 (123#) = happyGoto action_20-action_262 x = happyTcHack x happyFail--action_263 x = happyTcHack x happyReduce_195--action_264 (133#) = happyShift action_21-action_264 (134#) = happyShift action_22-action_264 (135#) = happyShift action_23-action_264 (136#) = happyShift action_24-action_264 (141#) = happyShift action_25-action_264 (142#) = happyShift action_26-action_264 (143#) = happyShift action_27-action_264 (144#) = happyShift action_28-action_264 (145#) = happyShift action_29-action_264 (151#) = happyShift action_30-action_264 (154#) = happyShift action_31-action_264 (160#) = happyShift action_32-action_264 (165#) = happyShift action_33-action_264 (167#) = happyShift action_34-action_264 (169#) = happyShift action_35-action_264 (170#) = happyShift action_36-action_264 (175#) = happyShift action_37-action_264 (177#) = happyShift action_38-action_264 (178#) = happyShift action_39-action_264 (185#) = happyShift action_40-action_264 (192#) = happyShift action_41-action_264 (68#) = happyGoto action_299-action_264 (69#) = happyGoto action_4-action_264 (70#) = happyGoto action_5-action_264 (71#) = happyGoto action_6-action_264 (72#) = happyGoto action_7-action_264 (73#) = happyGoto action_8-action_264 (74#) = happyGoto action_9-action_264 (77#) = happyGoto action_10-action_264 (78#) = happyGoto action_11-action_264 (79#) = happyGoto action_12-action_264 (98#) = happyGoto action_13-action_264 (100#) = happyGoto action_14-action_264 (102#) = happyGoto action_15-action_264 (112#) = happyGoto action_16-action_264 (113#) = happyGoto action_17-action_264 (114#) = happyGoto action_18-action_264 (115#) = happyGoto action_19-action_264 (123#) = happyGoto action_20-action_264 x = happyTcHack x happyFail--action_265 x = happyTcHack x happyReduce_191--action_266 x = happyTcHack x happyReduce_83--action_267 x = happyTcHack x happyReduce_97--action_268 x = happyTcHack x happyReduce_94--action_269 x = happyTcHack x happyReduce_96--action_270 x = happyTcHack x happyReduce_89--action_271 (133#) = happyShift action_21-action_271 (135#) = happyShift action_23-action_271 (136#) = happyShift action_24-action_271 (145#) = happyShift action_196-action_271 (151#) = happyShift action_197-action_271 (169#) = happyShift action_35-action_271 (177#) = happyShift action_38-action_271 (192#) = happyShift action_41-action_271 (39#) = happyGoto action_298-action_271 (40#) = happyGoto action_211-action_271 (41#) = happyGoto action_189-action_271 (42#) = happyGoto action_190-action_271 (113#) = happyGoto action_193-action_271 (114#) = happyGoto action_194-action_271 (115#) = happyGoto action_19-action_271 (132#) = happyGoto action_195-action_271 x = happyTcHack x happyFail--action_272 x = happyTcHack x happyReduce_91--action_273 (133#) = happyShift action_21-action_273 (135#) = happyShift action_23-action_273 (136#) = happyShift action_24-action_273 (145#) = happyShift action_196-action_273 (151#) = happyShift action_197-action_273 (169#) = happyShift action_35-action_273 (177#) = happyShift action_38-action_273 (192#) = happyShift action_41-action_273 (39#) = happyGoto action_297-action_273 (40#) = happyGoto action_211-action_273 (41#) = happyGoto action_189-action_273 (42#) = happyGoto action_190-action_273 (113#) = happyGoto action_193-action_273 (114#) = happyGoto action_194-action_273 (115#) = happyGoto action_19-action_273 (132#) = happyGoto action_195-action_273 x = happyTcHack x happyFail--action_274 x = happyTcHack x happyReduce_90--action_275 x = happyTcHack x happyFail--action_276 (6#) = happyGoto action_296-action_276 (7#) = happyGoto action_140-action_276 (8#) = happyGoto action_295-action_276 x = happyTcHack x happyFail--action_277 (6#) = happyGoto action_294-action_277 (7#) = happyGoto action_140-action_277 (8#) = happyGoto action_295-action_277 x = happyTcHack x happyFail--action_278 x = happyTcHack x happyReduce_25--action_279 (133#) = happyShift action_21-action_279 (135#) = happyShift action_23-action_279 (145#) = happyShift action_291-action_279 (146#) = happyShift action_292-action_279 (156#) = happyShift action_293-action_279 (169#) = happyShift action_35-action_279 (177#) = happyShift action_38-action_279 (192#) = happyShift action_41-action_279 (23#) = happyGoto action_285-action_279 (24#) = happyGoto action_286-action_279 (99#) = happyGoto action_287-action_279 (101#) = happyGoto action_288-action_279 (113#) = happyGoto action_289-action_279 (115#) = happyGoto action_290-action_279 x = happyTcHack x happyFail--action_280 (146#) = happyShift action_284-action_280 x = happyTcHack x happyFail--action_281 (133#) = happyShift action_21-action_281 (134#) = happyShift action_22-action_281 (135#) = happyShift action_23-action_281 (136#) = happyShift action_24-action_281 (145#) = happyShift action_108-action_281 (169#) = happyShift action_35-action_281 (177#) = happyShift action_38-action_281 (186#) = happyShift action_208-action_281 (192#) = happyShift action_41-action_281 (13#) = happyGoto action_283-action_281 (100#) = happyGoto action_204-action_281 (112#) = happyGoto action_16-action_281 (113#) = happyGoto action_17-action_281 (114#) = happyGoto action_205-action_281 (115#) = happyGoto action_19-action_281 (130#) = happyGoto action_206-action_281 x = happyTcHack x happyReduce_16--action_282 x = happyTcHack x happyReduce_15--action_283 x = happyTcHack x happyReduce_18--action_284 x = happyTcHack x happyReduce_14--action_285 (146#) = happyShift action_344-action_285 (153#) = happyShift action_345-action_285 x = happyTcHack x happyFail--action_286 x = happyTcHack x happyReduce_47--action_287 x = happyTcHack x happyReduce_48--action_288 x = happyTcHack x happyReduce_49--action_289 x = happyTcHack x happyReduce_227--action_290 x = happyTcHack x happyReduce_231--action_291 (137#) = happyShift action_91-action_291 (138#) = happyShift action_73-action_291 (167#) = happyShift action_94-action_291 (168#) = happyShift action_95-action_291 (117#) = happyGoto action_343-action_291 (120#) = happyGoto action_322-action_291 x = happyTcHack x happyFail--action_292 x = happyTcHack x happyReduce_23--action_293 (146#) = happyShift action_342-action_293 x = happyTcHack x happyFail--action_294 (149#) = happyShift action_341-action_294 x = happyTcHack x happyFail--action_295 (133#) = happyReduce_279-action_295 (134#) = happyReduce_279-action_295 (135#) = happyReduce_279-action_295 (136#) = happyReduce_279-action_295 (141#) = happyReduce_279-action_295 (142#) = happyReduce_279-action_295 (143#) = happyReduce_279-action_295 (144#) = happyReduce_279-action_295 (145#) = happyReduce_279-action_295 (147#) = happyShift action_156-action_295 (151#) = happyReduce_279-action_295 (154#) = happyReduce_279-action_295 (165#) = happyReduce_279-action_295 (167#) = happyReduce_279-action_295 (169#) = happyReduce_279-action_295 (170#) = happyReduce_279-action_295 (171#) = happyReduce_279-action_295 (172#) = happyReduce_279-action_295 (173#) = happyReduce_279-action_295 (175#) = happyReduce_279-action_295 (177#) = happyReduce_279-action_295 (179#) = happyReduce_279-action_295 (181#) = happyReduce_279-action_295 (182#) = happyReduce_279-action_295 (183#) = happyReduce_279-action_295 (184#) = happyReduce_279-action_295 (187#) = happyReduce_279-action_295 (190#) = happyReduce_279-action_295 (192#) = happyReduce_279-action_295 (14#) = happyGoto action_334-action_295 (15#) = happyGoto action_335-action_295 (25#) = happyGoto action_150-action_295 (29#) = happyGoto action_336-action_295 (30#) = happyGoto action_337-action_295 (31#) = happyGoto action_338-action_295 (35#) = happyGoto action_339-action_295 (37#) = happyGoto action_153-action_295 (63#) = happyGoto action_154-action_295 (124#) = happyGoto action_340-action_295 x = happyTcHack x happyReduce_8--action_296 (1#) = happyShift action_147-action_296 (150#) = happyShift action_148-action_296 (126#) = happyGoto action_333-action_296 x = happyTcHack x happyFail--action_297 x = happyTcHack x happyReduce_101--action_298 x = happyTcHack x happyReduce_100--action_299 x = happyTcHack x happyReduce_197--action_300 (137#) = happyShift action_91-action_300 (138#) = happyShift action_73-action_300 (139#) = happyShift action_74-action_300 (140#) = happyShift action_75-action_300 (155#) = happyShift action_92-action_300 (157#) = happyShift action_79-action_300 (167#) = happyShift action_94-action_300 (168#) = happyShift action_95-action_300 (104#) = happyGoto action_85-action_300 (107#) = happyGoto action_86-action_300 (109#) = happyGoto action_248-action_300 (111#) = happyGoto action_88-action_300 (116#) = happyGoto action_65-action_300 (117#) = happyGoto action_66-action_300 (118#) = happyGoto action_89-action_300 (120#) = happyGoto action_69-action_300 (122#) = happyGoto action_90-action_300 x = happyTcHack x happyReduce_211--action_301 (163#) = happyShift action_332-action_301 (90#) = happyGoto action_328-action_301 (91#) = happyGoto action_329-action_301 (92#) = happyGoto action_330-action_301 (124#) = happyGoto action_331-action_301 x = happyTcHack x happyReduce_279--action_302 (133#) = happyReduce_279-action_302 (134#) = happyReduce_279-action_302 (135#) = happyReduce_279-action_302 (136#) = happyReduce_279-action_302 (141#) = happyReduce_279-action_302 (142#) = happyReduce_279-action_302 (143#) = happyReduce_279-action_302 (144#) = happyReduce_279-action_302 (145#) = happyReduce_279-action_302 (151#) = happyReduce_279-action_302 (154#) = happyReduce_279-action_302 (165#) = happyReduce_279-action_302 (167#) = happyReduce_279-action_302 (169#) = happyReduce_279-action_302 (170#) = happyReduce_279-action_302 (175#) = happyReduce_279-action_302 (177#) = happyReduce_279-action_302 (192#) = happyReduce_279-action_302 (89#) = happyGoto action_327-action_302 (124#) = happyGoto action_262-action_302 x = happyTcHack x happyReduce_10--action_303 (147#) = happyShift action_156-action_303 x = happyTcHack x happyReduce_202--action_304 (133#) = happyShift action_21-action_304 (134#) = happyShift action_22-action_304 (135#) = happyShift action_23-action_304 (136#) = happyShift action_24-action_304 (141#) = happyShift action_25-action_304 (142#) = happyShift action_26-action_304 (143#) = happyShift action_27-action_304 (144#) = happyShift action_28-action_304 (145#) = happyShift action_29-action_304 (147#) = happyShift action_136-action_304 (151#) = happyShift action_30-action_304 (154#) = happyShift action_31-action_304 (160#) = happyShift action_32-action_304 (165#) = happyShift action_33-action_304 (167#) = happyShift action_34-action_304 (169#) = happyShift action_35-action_304 (170#) = happyShift action_36-action_304 (175#) = happyShift action_37-action_304 (177#) = happyShift action_38-action_304 (178#) = happyShift action_39-action_304 (185#) = happyShift action_137-action_304 (192#) = happyShift action_41-action_304 (68#) = happyGoto action_132-action_304 (69#) = happyGoto action_4-action_304 (70#) = happyGoto action_5-action_304 (71#) = happyGoto action_133-action_304 (72#) = happyGoto action_7-action_304 (73#) = happyGoto action_8-action_304 (74#) = happyGoto action_9-action_304 (77#) = happyGoto action_10-action_304 (78#) = happyGoto action_11-action_304 (79#) = happyGoto action_12-action_304 (93#) = happyGoto action_134-action_304 (95#) = happyGoto action_326-action_304 (98#) = happyGoto action_13-action_304 (100#) = happyGoto action_14-action_304 (102#) = happyGoto action_15-action_304 (112#) = happyGoto action_16-action_304 (113#) = happyGoto action_17-action_304 (114#) = happyGoto action_18-action_304 (115#) = happyGoto action_19-action_304 (123#) = happyGoto action_20-action_304 x = happyTcHack x happyFail--action_305 (153#) = happyShift action_325-action_305 x = happyTcHack x happyReduce_50--action_306 x = happyTcHack x happyReduce_245--action_307 x = happyTcHack x happyReduce_246--action_308 x = happyTcHack x happyReduce_57--action_309 x = happyTcHack x happyReduce_241--action_310 x = happyTcHack x happyReduce_235--action_311 (133#) = happyShift action_21-action_311 (135#) = happyShift action_23-action_311 (169#) = happyShift action_35-action_311 (177#) = happyShift action_38-action_311 (192#) = happyShift action_41-action_311 (113#) = happyGoto action_323-action_311 (115#) = happyGoto action_324-action_311 x = happyTcHack x happyFail--action_312 x = happyTcHack x happyReduce_80--action_313 x = happyTcHack x happyReduce_81--action_314 (137#) = happyShift action_91-action_314 (167#) = happyShift action_94-action_314 (168#) = happyShift action_95-action_314 (120#) = happyGoto action_322-action_314 x = happyTcHack x happyFail--action_315 x = happyTcHack x happyReduce_142--action_316 (133#) = happyShift action_21-action_316 (134#) = happyShift action_22-action_316 (135#) = happyShift action_23-action_316 (136#) = happyShift action_24-action_316 (141#) = happyShift action_25-action_316 (142#) = happyShift action_26-action_316 (143#) = happyShift action_27-action_316 (144#) = happyShift action_28-action_316 (145#) = happyShift action_29-action_316 (151#) = happyShift action_30-action_316 (154#) = happyShift action_31-action_316 (160#) = happyShift action_32-action_316 (165#) = happyShift action_33-action_316 (167#) = happyShift action_34-action_316 (169#) = happyShift action_35-action_316 (170#) = happyShift action_36-action_316 (175#) = happyShift action_37-action_316 (177#) = happyShift action_38-action_316 (178#) = happyShift action_39-action_316 (185#) = happyShift action_40-action_316 (192#) = happyShift action_41-action_316 (69#) = happyGoto action_321-action_316 (70#) = happyGoto action_5-action_316 (71#) = happyGoto action_115-action_316 (72#) = happyGoto action_7-action_316 (73#) = happyGoto action_8-action_316 (74#) = happyGoto action_9-action_316 (77#) = happyGoto action_10-action_316 (78#) = happyGoto action_11-action_316 (79#) = happyGoto action_12-action_316 (98#) = happyGoto action_13-action_316 (100#) = happyGoto action_14-action_316 (102#) = happyGoto action_15-action_316 (112#) = happyGoto action_16-action_316 (113#) = happyGoto action_17-action_316 (114#) = happyGoto action_18-action_316 (115#) = happyGoto action_19-action_316 (123#) = happyGoto action_20-action_316 x = happyTcHack x happyFail--action_317 x = happyTcHack x happyReduce_144--action_318 x = happyTcHack x happyReduce_139--action_319 (148#) = happyShift action_44-action_319 (36#) = happyGoto action_320-action_319 (125#) = happyGoto action_43-action_319 x = happyTcHack x happyReduce_280--action_320 x = happyTcHack x happyReduce_140--action_321 (159#) = happyShift action_367-action_321 x = happyTcHack x happyFail--action_322 (146#) = happyShift action_366-action_322 x = happyTcHack x happyFail--action_323 (155#) = happyShift action_365-action_323 x = happyTcHack x happyFail--action_324 (155#) = happyShift action_364-action_324 x = happyTcHack x happyFail--action_325 (137#) = happyShift action_91-action_325 (138#) = happyShift action_73-action_325 (155#) = happyShift action_311-action_325 (167#) = happyShift action_94-action_325 (168#) = happyShift action_95-action_325 (103#) = happyGoto action_306-action_325 (106#) = happyGoto action_307-action_325 (108#) = happyGoto action_363-action_325 (117#) = happyGoto action_309-action_325 (120#) = happyGoto action_310-action_325 x = happyTcHack x happyFail--action_326 x = happyTcHack x happyReduce_215--action_327 x = happyTcHack x happyReduce_203--action_328 (191#) = happyShift action_319-action_328 (64#) = happyGoto action_362-action_328 x = happyTcHack x happyReduce_141--action_329 (161#) = happyReduce_279-action_329 (92#) = happyGoto action_361-action_329 (124#) = happyGoto action_331-action_329 x = happyTcHack x happyReduce_207--action_330 x = happyTcHack x happyReduce_209--action_331 (161#) = happyShift action_360-action_331 x = happyTcHack x happyFail--action_332 (133#) = happyShift action_21-action_332 (134#) = happyShift action_22-action_332 (135#) = happyShift action_23-action_332 (136#) = happyShift action_24-action_332 (141#) = happyShift action_25-action_332 (142#) = happyShift action_26-action_332 (143#) = happyShift action_27-action_332 (144#) = happyShift action_28-action_332 (145#) = happyShift action_29-action_332 (151#) = happyShift action_30-action_332 (154#) = happyShift action_31-action_332 (160#) = happyShift action_32-action_332 (165#) = happyShift action_33-action_332 (167#) = happyShift action_34-action_332 (169#) = happyShift action_35-action_332 (170#) = happyShift action_36-action_332 (175#) = happyShift action_37-action_332 (177#) = happyShift action_38-action_332 (178#) = happyShift action_39-action_332 (185#) = happyShift action_40-action_332 (192#) = happyShift action_41-action_332 (68#) = happyGoto action_359-action_332 (69#) = happyGoto action_4-action_332 (70#) = happyGoto action_5-action_332 (71#) = happyGoto action_6-action_332 (72#) = happyGoto action_7-action_332 (73#) = happyGoto action_8-action_332 (74#) = happyGoto action_9-action_332 (77#) = happyGoto action_10-action_332 (78#) = happyGoto action_11-action_332 (79#) = happyGoto action_12-action_332 (98#) = happyGoto action_13-action_332 (100#) = happyGoto action_14-action_332 (102#) = happyGoto action_15-action_332 (112#) = happyGoto action_16-action_332 (113#) = happyGoto action_17-action_332 (114#) = happyGoto action_18-action_332 (115#) = happyGoto action_19-action_332 (123#) = happyGoto action_20-action_332 x = happyTcHack x happyFail--action_333 x = happyTcHack x happyFail--action_334 (7#) = happyGoto action_357-action_334 (8#) = happyGoto action_358-action_334 x = happyTcHack x happyReduce_11--action_335 x = happyTcHack x happyReduce_27--action_336 x = happyTcHack x happyReduce_6--action_337 (7#) = happyGoto action_355-action_337 (8#) = happyGoto action_356-action_337 x = happyTcHack x happyReduce_11--action_338 x = happyTcHack x happyReduce_60--action_339 x = happyTcHack x happyReduce_67--action_340 (133#) = happyShift action_21-action_340 (134#) = happyShift action_22-action_340 (135#) = happyShift action_23-action_340 (136#) = happyShift action_24-action_340 (141#) = happyShift action_25-action_340 (142#) = happyShift action_26-action_340 (143#) = happyShift action_27-action_340 (144#) = happyShift action_28-action_340 (145#) = happyShift action_29-action_340 (151#) = happyShift action_30-action_340 (154#) = happyShift action_31-action_340 (165#) = happyShift action_33-action_340 (167#) = happyShift action_34-action_340 (169#) = happyShift action_35-action_340 (170#) = happyShift action_36-action_340 (171#) = happyShift action_348-action_340 (172#) = happyShift action_349-action_340 (173#) = happyShift action_350-action_340 (175#) = happyShift action_37-action_340 (177#) = happyShift action_38-action_340 (179#) = happyShift action_351-action_340 (181#) = happyShift action_239-action_340 (182#) = happyShift action_240-action_340 (183#) = happyShift action_241-action_340 (184#) = happyShift action_352-action_340 (187#) = happyShift action_353-action_340 (190#) = happyShift action_354-action_340 (192#) = happyShift action_41-action_340 (27#) = happyGoto action_235-action_340 (38#) = happyGoto action_236-action_340 (71#) = happyGoto action_237-action_340 (73#) = happyGoto action_8-action_340 (74#) = happyGoto action_9-action_340 (77#) = happyGoto action_10-action_340 (78#) = happyGoto action_11-action_340 (79#) = happyGoto action_12-action_340 (98#) = happyGoto action_13-action_340 (100#) = happyGoto action_238-action_340 (102#) = happyGoto action_15-action_340 (112#) = happyGoto action_16-action_340 (113#) = happyGoto action_17-action_340 (114#) = happyGoto action_18-action_340 (115#) = happyGoto action_19-action_340 (123#) = happyGoto action_20-action_340 x = happyTcHack x happyFail--action_341 x = happyTcHack x happyFail--action_342 x = happyTcHack x happyReduce_22--action_343 (146#) = happyShift action_347-action_343 x = happyTcHack x happyFail--action_344 x = happyTcHack x happyReduce_24--action_345 (133#) = happyShift action_21-action_345 (135#) = happyShift action_23-action_345 (145#) = happyShift action_291-action_345 (169#) = happyShift action_35-action_345 (177#) = happyShift action_38-action_345 (192#) = happyShift action_41-action_345 (24#) = happyGoto action_346-action_345 (99#) = happyGoto action_287-action_345 (101#) = happyGoto action_288-action_345 (113#) = happyGoto action_289-action_345 (115#) = happyGoto action_290-action_345 x = happyTcHack x happyFail--action_346 x = happyTcHack x happyReduce_46--action_347 x = happyTcHack x happyReduce_232--action_348 (133#) = happyShift action_21-action_348 (135#) = happyShift action_23-action_348 (136#) = happyShift action_24-action_348 (145#) = happyShift action_196-action_348 (151#) = happyShift action_197-action_348 (169#) = happyShift action_35-action_348 (177#) = happyShift action_38-action_348 (192#) = happyShift action_41-action_348 (39#) = happyGoto action_187-action_348 (40#) = happyGoto action_188-action_348 (41#) = happyGoto action_189-action_348 (42#) = happyGoto action_190-action_348 (43#) = happyGoto action_383-action_348 (44#) = happyGoto action_192-action_348 (113#) = happyGoto action_193-action_348 (114#) = happyGoto action_194-action_348 (115#) = happyGoto action_19-action_348 (132#) = happyGoto action_195-action_348 x = happyTcHack x happyFail--action_349 (133#) = happyShift action_21-action_349 (135#) = happyShift action_23-action_349 (136#) = happyShift action_24-action_349 (145#) = happyShift action_196-action_349 (151#) = happyShift action_197-action_349 (169#) = happyShift action_35-action_349 (177#) = happyShift action_38-action_349 (192#) = happyShift action_41-action_349 (39#) = happyGoto action_187-action_349 (40#) = happyGoto action_188-action_349 (41#) = happyGoto action_189-action_349 (42#) = happyGoto action_190-action_349 (43#) = happyGoto action_382-action_349 (44#) = happyGoto action_192-action_349 (113#) = happyGoto action_193-action_349 (114#) = happyGoto action_194-action_349 (115#) = happyGoto action_19-action_349 (132#) = happyGoto action_195-action_349 x = happyTcHack x happyFail--action_350 (145#) = happyShift action_381-action_350 x = happyTcHack x happyFail--action_351 (192#) = happyShift action_380-action_351 (16#) = happyGoto action_379-action_351 x = happyTcHack x happyReduce_30--action_352 (133#) = happyShift action_21-action_352 (135#) = happyShift action_23-action_352 (136#) = happyShift action_24-action_352 (145#) = happyShift action_196-action_352 (151#) = happyShift action_197-action_352 (169#) = happyShift action_35-action_352 (177#) = happyShift action_38-action_352 (192#) = happyShift action_41-action_352 (39#) = happyGoto action_187-action_352 (40#) = happyGoto action_188-action_352 (41#) = happyGoto action_189-action_352 (42#) = happyGoto action_190-action_352 (43#) = happyGoto action_378-action_352 (44#) = happyGoto action_192-action_352 (113#) = happyGoto action_193-action_352 (114#) = happyGoto action_194-action_352 (115#) = happyGoto action_19-action_352 (132#) = happyGoto action_195-action_352 x = happyTcHack x happyFail--action_353 (133#) = happyShift action_21-action_353 (135#) = happyShift action_23-action_353 (136#) = happyShift action_24-action_353 (145#) = happyShift action_196-action_353 (151#) = happyShift action_197-action_353 (169#) = happyShift action_35-action_353 (177#) = happyShift action_38-action_353 (192#) = happyShift action_41-action_353 (39#) = happyGoto action_187-action_353 (40#) = happyGoto action_188-action_353 (41#) = happyGoto action_189-action_353 (42#) = happyGoto action_190-action_353 (43#) = happyGoto action_377-action_353 (44#) = happyGoto action_192-action_353 (113#) = happyGoto action_193-action_353 (114#) = happyGoto action_194-action_353 (115#) = happyGoto action_19-action_353 (132#) = happyGoto action_195-action_353 x = happyTcHack x happyFail--action_354 (135#) = happyShift action_23-action_354 (46#) = happyGoto action_374-action_354 (115#) = happyGoto action_375-action_354 (129#) = happyGoto action_376-action_354 x = happyTcHack x happyFail--action_355 (133#) = happyReduce_279-action_355 (134#) = happyReduce_279-action_355 (135#) = happyReduce_279-action_355 (136#) = happyReduce_279-action_355 (141#) = happyReduce_279-action_355 (142#) = happyReduce_279-action_355 (143#) = happyReduce_279-action_355 (144#) = happyReduce_279-action_355 (145#) = happyReduce_279-action_355 (151#) = happyReduce_279-action_355 (154#) = happyReduce_279-action_355 (165#) = happyReduce_279-action_355 (167#) = happyReduce_279-action_355 (169#) = happyReduce_279-action_355 (170#) = happyReduce_279-action_355 (171#) = happyReduce_279-action_355 (172#) = happyReduce_279-action_355 (173#) = happyReduce_279-action_355 (175#) = happyReduce_279-action_355 (177#) = happyReduce_279-action_355 (181#) = happyReduce_279-action_355 (182#) = happyReduce_279-action_355 (183#) = happyReduce_279-action_355 (184#) = happyReduce_279-action_355 (187#) = happyReduce_279-action_355 (190#) = happyReduce_279-action_355 (192#) = happyReduce_279-action_355 (25#) = happyGoto action_150-action_355 (31#) = happyGoto action_372-action_355 (35#) = happyGoto action_339-action_355 (37#) = happyGoto action_153-action_355 (63#) = happyGoto action_154-action_355 (124#) = happyGoto action_373-action_355 x = happyTcHack x happyReduce_10--action_356 (147#) = happyShift action_156-action_356 x = happyTcHack x happyReduce_58--action_357 (133#) = happyReduce_279-action_357 (134#) = happyReduce_279-action_357 (135#) = happyReduce_279-action_357 (136#) = happyReduce_279-action_357 (141#) = happyReduce_279-action_357 (142#) = happyReduce_279-action_357 (143#) = happyReduce_279-action_357 (144#) = happyReduce_279-action_357 (145#) = happyReduce_279-action_357 (151#) = happyReduce_279-action_357 (154#) = happyReduce_279-action_357 (165#) = happyReduce_279-action_357 (167#) = happyReduce_279-action_357 (169#) = happyReduce_279-action_357 (170#) = happyReduce_279-action_357 (171#) = happyReduce_279-action_357 (172#) = happyReduce_279-action_357 (173#) = happyReduce_279-action_357 (175#) = happyReduce_279-action_357 (177#) = happyReduce_279-action_357 (179#) = happyReduce_279-action_357 (181#) = happyReduce_279-action_357 (182#) = happyReduce_279-action_357 (183#) = happyReduce_279-action_357 (184#) = happyReduce_279-action_357 (187#) = happyReduce_279-action_357 (190#) = happyReduce_279-action_357 (192#) = happyReduce_279-action_357 (15#) = happyGoto action_370-action_357 (25#) = happyGoto action_150-action_357 (29#) = happyGoto action_371-action_357 (30#) = happyGoto action_337-action_357 (31#) = happyGoto action_338-action_357 (35#) = happyGoto action_339-action_357 (37#) = happyGoto action_153-action_357 (63#) = happyGoto action_154-action_357 (124#) = happyGoto action_340-action_357 x = happyTcHack x happyReduce_10--action_358 (147#) = happyShift action_156-action_358 x = happyTcHack x happyReduce_7--action_359 x = happyTcHack x happyReduce_206--action_360 (133#) = happyShift action_21-action_360 (134#) = happyShift action_22-action_360 (135#) = happyShift action_23-action_360 (136#) = happyShift action_24-action_360 (141#) = happyShift action_25-action_360 (142#) = happyShift action_26-action_360 (143#) = happyShift action_27-action_360 (144#) = happyShift action_28-action_360 (145#) = happyShift action_29-action_360 (151#) = happyShift action_30-action_360 (154#) = happyShift action_31-action_360 (160#) = happyShift action_32-action_360 (165#) = happyShift action_33-action_360 (167#) = happyShift action_34-action_360 (169#) = happyShift action_35-action_360 (170#) = happyShift action_36-action_360 (175#) = happyShift action_37-action_360 (177#) = happyShift action_38-action_360 (178#) = happyShift action_39-action_360 (185#) = happyShift action_40-action_360 (192#) = happyShift action_41-action_360 (69#) = happyGoto action_369-action_360 (70#) = happyGoto action_5-action_360 (71#) = happyGoto action_115-action_360 (72#) = happyGoto action_7-action_360 (73#) = happyGoto action_8-action_360 (74#) = happyGoto action_9-action_360 (77#) = happyGoto action_10-action_360 (78#) = happyGoto action_11-action_360 (79#) = happyGoto action_12-action_360 (98#) = happyGoto action_13-action_360 (100#) = happyGoto action_14-action_360 (102#) = happyGoto action_15-action_360 (112#) = happyGoto action_16-action_360 (113#) = happyGoto action_17-action_360 (114#) = happyGoto action_18-action_360 (115#) = happyGoto action_19-action_360 (123#) = happyGoto action_20-action_360 x = happyTcHack x happyFail--action_361 x = happyTcHack x happyReduce_208--action_362 x = happyTcHack x happyReduce_205--action_363 x = happyTcHack x happyReduce_56--action_364 x = happyTcHack x happyReduce_242--action_365 x = happyTcHack x happyReduce_236--action_366 x = happyTcHack x happyReduce_228--action_367 (133#) = happyShift action_21-action_367 (134#) = happyShift action_22-action_367 (135#) = happyShift action_23-action_367 (136#) = happyShift action_24-action_367 (141#) = happyShift action_25-action_367 (142#) = happyShift action_26-action_367 (143#) = happyShift action_27-action_367 (144#) = happyShift action_28-action_367 (145#) = happyShift action_29-action_367 (151#) = happyShift action_30-action_367 (154#) = happyShift action_31-action_367 (160#) = happyShift action_32-action_367 (165#) = happyShift action_33-action_367 (167#) = happyShift action_34-action_367 (169#) = happyShift action_35-action_367 (170#) = happyShift action_36-action_367 (175#) = happyShift action_37-action_367 (177#) = happyShift action_38-action_367 (178#) = happyShift action_39-action_367 (185#) = happyShift action_40-action_367 (192#) = happyShift action_41-action_367 (68#) = happyGoto action_368-action_367 (69#) = happyGoto action_4-action_367 (70#) = happyGoto action_5-action_367 (71#) = happyGoto action_6-action_367 (72#) = happyGoto action_7-action_367 (73#) = happyGoto action_8-action_367 (74#) = happyGoto action_9-action_367 (77#) = happyGoto action_10-action_367 (78#) = happyGoto action_11-action_367 (79#) = happyGoto action_12-action_367 (98#) = happyGoto action_13-action_367 (100#) = happyGoto action_14-action_367 (102#) = happyGoto action_15-action_367 (112#) = happyGoto action_16-action_367 (113#) = happyGoto action_17-action_367 (114#) = happyGoto action_18-action_367 (115#) = happyGoto action_19-action_367 (123#) = happyGoto action_20-action_367 x = happyTcHack x happyFail--action_368 x = happyTcHack x happyReduce_146--action_369 (163#) = happyShift action_396-action_369 x = happyTcHack x happyFail--action_370 x = happyTcHack x happyReduce_26--action_371 x = happyTcHack x happyReduce_5--action_372 x = happyTcHack x happyReduce_59--action_373 (133#) = happyShift action_21-action_373 (134#) = happyShift action_22-action_373 (135#) = happyShift action_23-action_373 (136#) = happyShift action_24-action_373 (141#) = happyShift action_25-action_373 (142#) = happyShift action_26-action_373 (143#) = happyShift action_27-action_373 (144#) = happyShift action_28-action_373 (145#) = happyShift action_29-action_373 (151#) = happyShift action_30-action_373 (154#) = happyShift action_31-action_373 (165#) = happyShift action_33-action_373 (167#) = happyShift action_34-action_373 (169#) = happyShift action_35-action_373 (170#) = happyShift action_36-action_373 (171#) = happyShift action_348-action_373 (172#) = happyShift action_349-action_373 (173#) = happyShift action_350-action_373 (175#) = happyShift action_37-action_373 (177#) = happyShift action_38-action_373 (181#) = happyShift action_239-action_373 (182#) = happyShift action_240-action_373 (183#) = happyShift action_241-action_373 (184#) = happyShift action_352-action_373 (187#) = happyShift action_353-action_373 (190#) = happyShift action_354-action_373 (192#) = happyShift action_41-action_373 (27#) = happyGoto action_235-action_373 (38#) = happyGoto action_236-action_373 (71#) = happyGoto action_237-action_373 (73#) = happyGoto action_8-action_373 (74#) = happyGoto action_9-action_373 (77#) = happyGoto action_10-action_373 (78#) = happyGoto action_11-action_373 (79#) = happyGoto action_12-action_373 (98#) = happyGoto action_13-action_373 (100#) = happyGoto action_238-action_373 (102#) = happyGoto action_15-action_373 (112#) = happyGoto action_16-action_373 (113#) = happyGoto action_17-action_373 (114#) = happyGoto action_18-action_373 (115#) = happyGoto action_19-action_373 (123#) = happyGoto action_20-action_373 x = happyTcHack x happyFail--action_374 (159#) = happyShift action_395-action_374 x = happyTcHack x happyFail--action_375 x = happyTcHack x happyReduce_286--action_376 (47#) = happyGoto action_394-action_376 x = happyTcHack x happyReduce_104--action_377 (159#) = happyShift action_393-action_377 x = happyTcHack x happyFail--action_378 (191#) = happyShift action_392-action_378 (60#) = happyGoto action_391-action_378 x = happyTcHack x happyReduce_134--action_379 (135#) = happyShift action_98-action_379 (136#) = happyShift action_99-action_379 (127#) = happyGoto action_390-action_379 x = happyTcHack x happyFail--action_380 x = happyTcHack x happyReduce_29--action_381 (133#) = happyShift action_21-action_381 (135#) = happyShift action_23-action_381 (136#) = happyShift action_24-action_381 (145#) = happyShift action_196-action_381 (151#) = happyShift action_197-action_381 (169#) = happyShift action_35-action_381 (177#) = happyShift action_38-action_381 (192#) = happyShift action_41-action_381 (32#) = happyGoto action_387-action_381 (39#) = happyGoto action_388-action_381 (40#) = happyGoto action_211-action_381 (41#) = happyGoto action_189-action_381 (42#) = happyGoto action_190-action_381 (45#) = happyGoto action_389-action_381 (113#) = happyGoto action_193-action_381 (114#) = happyGoto action_194-action_381 (115#) = happyGoto action_19-action_381 (132#) = happyGoto action_195-action_381 x = happyTcHack x happyReduce_70--action_382 (159#) = happyShift action_386-action_382 x = happyTcHack x happyFail--action_383 (191#) = happyShift action_385-action_383 (59#) = happyGoto action_384-action_383 x = happyTcHack x happyReduce_131--action_384 x = happyTcHack x happyReduce_64--action_385 (148#) = happyShift action_44-action_385 (36#) = happyGoto action_409-action_385 (125#) = happyGoto action_43-action_385 x = happyTcHack x happyReduce_280--action_386 (48#) = happyGoto action_407-action_386 (49#) = happyGoto action_408-action_386 (124#) = happyGoto action_401-action_386 x = happyTcHack x happyReduce_279--action_387 (146#) = happyShift action_406-action_387 x = happyTcHack x happyFail--action_388 (153#) = happyShift action_273-action_388 x = happyTcHack x happyReduce_69--action_389 (153#) = happyShift action_271-action_389 x = happyTcHack x happyReduce_68--action_390 (169#) = happyShift action_405-action_390 (17#) = happyGoto action_404-action_390 x = happyTcHack x happyReduce_32--action_391 x = happyTcHack x happyReduce_65--action_392 (148#) = happyShift action_403-action_392 (125#) = happyGoto action_402-action_392 x = happyTcHack x happyReduce_280--action_393 (49#) = happyGoto action_400-action_393 (124#) = happyGoto action_401-action_393 x = happyTcHack x happyReduce_279--action_394 (133#) = happyShift action_21-action_394 (169#) = happyShift action_35-action_394 (177#) = happyShift action_38-action_394 (192#) = happyShift action_41-action_394 (113#) = happyGoto action_193-action_394 (132#) = happyGoto action_399-action_394 x = happyTcHack x happyReduce_102--action_395 (133#) = happyShift action_21-action_395 (135#) = happyShift action_23-action_395 (136#) = happyShift action_24-action_395 (145#) = happyShift action_196-action_395 (151#) = happyShift action_197-action_395 (169#) = happyShift action_35-action_395 (177#) = happyShift action_38-action_395 (192#) = happyShift action_41-action_395 (39#) = happyGoto action_398-action_395 (40#) = happyGoto action_211-action_395 (41#) = happyGoto action_189-action_395 (42#) = happyGoto action_190-action_395 (113#) = happyGoto action_193-action_395 (114#) = happyGoto action_194-action_395 (115#) = happyGoto action_19-action_395 (132#) = happyGoto action_195-action_395 x = happyTcHack x happyFail--action_396 (133#) = happyShift action_21-action_396 (134#) = happyShift action_22-action_396 (135#) = happyShift action_23-action_396 (136#) = happyShift action_24-action_396 (141#) = happyShift action_25-action_396 (142#) = happyShift action_26-action_396 (143#) = happyShift action_27-action_396 (144#) = happyShift action_28-action_396 (145#) = happyShift action_29-action_396 (151#) = happyShift action_30-action_396 (154#) = happyShift action_31-action_396 (160#) = happyShift action_32-action_396 (165#) = happyShift action_33-action_396 (167#) = happyShift action_34-action_396 (169#) = happyShift action_35-action_396 (170#) = happyShift action_36-action_396 (175#) = happyShift action_37-action_396 (177#) = happyShift action_38-action_396 (178#) = happyShift action_39-action_396 (185#) = happyShift action_40-action_396 (192#) = happyShift action_41-action_396 (68#) = happyGoto action_397-action_396 (69#) = happyGoto action_4-action_396 (70#) = happyGoto action_5-action_396 (71#) = happyGoto action_6-action_396 (72#) = happyGoto action_7-action_396 (73#) = happyGoto action_8-action_396 (74#) = happyGoto action_9-action_396 (77#) = happyGoto action_10-action_396 (78#) = happyGoto action_11-action_396 (79#) = happyGoto action_12-action_396 (98#) = happyGoto action_13-action_396 (100#) = happyGoto action_14-action_396 (102#) = happyGoto action_15-action_396 (112#) = happyGoto action_16-action_396 (113#) = happyGoto action_17-action_396 (114#) = happyGoto action_18-action_396 (115#) = happyGoto action_19-action_396 (123#) = happyGoto action_20-action_396 x = happyTcHack x happyFail--action_397 x = happyTcHack x happyReduce_210--action_398 x = happyTcHack x happyReduce_61--action_399 x = happyTcHack x happyReduce_103--action_400 (174#) = happyShift action_412-action_400 (57#) = happyGoto action_429-action_400 x = happyTcHack x happyReduce_124--action_401 (133#) = happyShift action_21-action_401 (135#) = happyShift action_23-action_401 (136#) = happyShift action_24-action_401 (145#) = happyShift action_427-action_401 (151#) = happyShift action_197-action_401 (168#) = happyShift action_428-action_401 (169#) = happyShift action_35-action_401 (177#) = happyShift action_38-action_401 (192#) = happyShift action_41-action_401 (40#) = happyGoto action_421-action_401 (41#) = happyGoto action_189-action_401 (42#) = happyGoto action_190-action_401 (50#) = happyGoto action_422-action_401 (51#) = happyGoto action_423-action_401 (53#) = happyGoto action_424-action_401 (101#) = happyGoto action_425-action_401 (113#) = happyGoto action_193-action_401 (114#) = happyGoto action_194-action_401 (115#) = happyGoto action_426-action_401 (132#) = happyGoto action_195-action_401 x = happyTcHack x happyFail--action_402 (7#) = happyGoto action_140-action_402 (8#) = happyGoto action_418-action_402 (61#) = happyGoto action_420-action_402 x = happyTcHack x happyReduce_11--action_403 (7#) = happyGoto action_140-action_403 (8#) = happyGoto action_418-action_403 (61#) = happyGoto action_419-action_403 x = happyTcHack x happyReduce_11--action_404 (145#) = happyReduce_38-action_404 (177#) = happyShift action_417-action_404 (18#) = happyGoto action_414-action_404 (19#) = happyGoto action_415-action_404 (20#) = happyGoto action_416-action_404 x = happyTcHack x happyReduce_34--action_405 (135#) = happyShift action_98-action_405 (136#) = happyShift action_99-action_405 (127#) = happyGoto action_413-action_405 x = happyTcHack x happyFail--action_406 x = happyTcHack x happyReduce_66--action_407 (161#) = happyShift action_411-action_407 (174#) = happyShift action_412-action_407 (57#) = happyGoto action_410-action_407 x = happyTcHack x happyReduce_124--action_408 x = happyTcHack x happyReduce_106--action_409 x = happyTcHack x happyReduce_130--action_410 x = happyTcHack x happyReduce_62--action_411 (49#) = happyGoto action_447-action_411 (124#) = happyGoto action_401-action_411 x = happyTcHack x happyReduce_279--action_412 (135#) = happyShift action_23-action_412 (136#) = happyShift action_24-action_412 (145#) = happyShift action_446-action_412 (114#) = happyGoto action_444-action_412 (115#) = happyGoto action_19-action_412 (131#) = happyGoto action_445-action_412 x = happyTcHack x happyFail--action_413 x = happyTcHack x happyReduce_31--action_414 x = happyTcHack x happyReduce_28--action_415 x = happyTcHack x happyReduce_33--action_416 (145#) = happyShift action_443-action_416 x = happyTcHack x happyFail--action_417 x = happyTcHack x happyReduce_37--action_418 (133#) = happyReduce_279-action_418 (134#) = happyReduce_279-action_418 (135#) = happyReduce_279-action_418 (136#) = happyReduce_279-action_418 (141#) = happyReduce_279-action_418 (142#) = happyReduce_279-action_418 (143#) = happyReduce_279-action_418 (144#) = happyReduce_279-action_418 (145#) = happyReduce_279-action_418 (147#) = happyShift action_156-action_418 (151#) = happyReduce_279-action_418 (154#) = happyReduce_279-action_418 (165#) = happyReduce_279-action_418 (167#) = happyReduce_279-action_418 (169#) = happyReduce_279-action_418 (170#) = happyReduce_279-action_418 (175#) = happyReduce_279-action_418 (177#) = happyReduce_279-action_418 (192#) = happyReduce_279-action_418 (62#) = happyGoto action_440-action_418 (63#) = happyGoto action_441-action_418 (124#) = happyGoto action_442-action_418 x = happyTcHack x happyReduce_136--action_419 (149#) = happyShift action_439-action_419 x = happyTcHack x happyFail--action_420 (1#) = happyShift action_147-action_420 (150#) = happyShift action_148-action_420 (126#) = happyGoto action_438-action_420 x = happyTcHack x happyFail--action_421 (133#) = happyShift action_21-action_421 (135#) = happyShift action_23-action_421 (136#) = happyShift action_24-action_421 (138#) = happyReduce_117-action_421 (145#) = happyShift action_196-action_421 (151#) = happyShift action_197-action_421 (155#) = happyReduce_117-action_421 (168#) = happyShift action_437-action_421 (169#) = happyShift action_35-action_421 (177#) = happyShift action_38-action_421 (192#) = happyShift action_41-action_421 (41#) = happyGoto action_219-action_421 (42#) = happyGoto action_190-action_421 (113#) = happyGoto action_193-action_421 (114#) = happyGoto action_194-action_421 (115#) = happyGoto action_19-action_421 (132#) = happyGoto action_195-action_421 x = happyTcHack x happyReduce_111--action_422 x = happyTcHack x happyReduce_107--action_423 (133#) = happyShift action_21-action_423 (135#) = happyShift action_23-action_423 (136#) = happyShift action_24-action_423 (145#) = happyShift action_196-action_423 (151#) = happyShift action_197-action_423 (168#) = happyShift action_436-action_423 (169#) = happyShift action_35-action_423 (177#) = happyShift action_38-action_423 (192#) = happyShift action_41-action_423 (41#) = happyGoto action_434-action_423 (42#) = happyGoto action_190-action_423 (52#) = happyGoto action_435-action_423 (113#) = happyGoto action_193-action_423 (114#) = happyGoto action_194-action_423 (115#) = happyGoto action_19-action_423 (132#) = happyGoto action_195-action_423 x = happyTcHack x happyReduce_112--action_424 (138#) = happyShift action_73-action_424 (155#) = happyShift action_433-action_424 (106#) = happyGoto action_432-action_424 (117#) = happyGoto action_309-action_424 x = happyTcHack x happyFail--action_425 (148#) = happyShift action_431-action_425 x = happyTcHack x happyFail--action_426 (148#) = happyReduce_231-action_426 x = happyTcHack x happyReduce_259--action_427 (133#) = happyShift action_21-action_427 (135#) = happyShift action_23-action_427 (136#) = happyShift action_24-action_427 (138#) = happyShift action_73-action_427 (145#) = happyShift action_196-action_427 (146#) = happyShift action_216-action_427 (151#) = happyShift action_197-action_427 (153#) = happyShift action_77-action_427 (163#) = happyShift action_217-action_427 (169#) = happyShift action_35-action_427 (177#) = happyShift action_38-action_427 (192#) = happyShift action_41-action_427 (39#) = happyGoto action_213-action_427 (40#) = happyGoto action_211-action_427 (41#) = happyGoto action_189-action_427 (42#) = happyGoto action_190-action_427 (45#) = happyGoto action_214-action_427 (80#) = happyGoto action_215-action_427 (113#) = happyGoto action_193-action_427 (114#) = happyGoto action_194-action_427 (115#) = happyGoto action_19-action_427 (117#) = happyGoto action_343-action_427 (132#) = happyGoto action_195-action_427 x = happyTcHack x happyFail--action_428 (133#) = happyShift action_21-action_428 (135#) = happyShift action_23-action_428 (136#) = happyShift action_24-action_428 (145#) = happyShift action_196-action_428 (151#) = happyShift action_197-action_428 (169#) = happyShift action_35-action_428 (177#) = happyShift action_38-action_428 (192#) = happyShift action_41-action_428 (41#) = happyGoto action_430-action_428 (42#) = happyGoto action_190-action_428 (113#) = happyGoto action_193-action_428 (114#) = happyGoto action_194-action_428 (115#) = happyGoto action_19-action_428 (132#) = happyGoto action_195-action_428 x = happyTcHack x happyFail--action_429 x = happyTcHack x happyReduce_63--action_430 x = happyTcHack x happyReduce_118--action_431 (133#) = happyShift action_21-action_431 (134#) = happyShift action_22-action_431 (145#) = happyShift action_108-action_431 (149#) = happyShift action_467-action_431 (169#) = happyShift action_35-action_431 (177#) = happyShift action_38-action_431 (192#) = happyShift action_41-action_431 (38#) = happyGoto action_463-action_431 (54#) = happyGoto action_464-action_431 (55#) = happyGoto action_465-action_431 (100#) = happyGoto action_466-action_431 (112#) = happyGoto action_16-action_431 (113#) = happyGoto action_17-action_431 x = happyTcHack x happyFail--action_432 (133#) = happyShift action_21-action_432 (135#) = happyShift action_23-action_432 (136#) = happyShift action_24-action_432 (145#) = happyShift action_196-action_432 (151#) = happyShift action_197-action_432 (168#) = happyShift action_428-action_432 (169#) = happyShift action_35-action_432 (177#) = happyShift action_38-action_432 (192#) = happyShift action_41-action_432 (40#) = happyGoto action_461-action_432 (41#) = happyGoto action_189-action_432 (42#) = happyGoto action_190-action_432 (53#) = happyGoto action_462-action_432 (113#) = happyGoto action_193-action_432 (114#) = happyGoto action_194-action_432 (115#) = happyGoto action_19-action_432 (132#) = happyGoto action_195-action_432 x = happyTcHack x happyFail--action_433 (135#) = happyShift action_23-action_433 (115#) = happyGoto action_324-action_433 x = happyTcHack x happyFail--action_434 x = happyTcHack x happyReduce_115--action_435 x = happyTcHack x happyReduce_114--action_436 (133#) = happyShift action_21-action_436 (135#) = happyShift action_23-action_436 (136#) = happyShift action_24-action_436 (145#) = happyShift action_196-action_436 (151#) = happyShift action_197-action_436 (169#) = happyShift action_35-action_436 (177#) = happyShift action_38-action_436 (192#) = happyShift action_41-action_436 (41#) = happyGoto action_460-action_436 (42#) = happyGoto action_190-action_436 (113#) = happyGoto action_193-action_436 (114#) = happyGoto action_194-action_436 (115#) = happyGoto action_19-action_436 (132#) = happyGoto action_195-action_436 x = happyTcHack x happyFail--action_437 (133#) = happyShift action_21-action_437 (135#) = happyShift action_23-action_437 (136#) = happyShift action_24-action_437 (145#) = happyShift action_196-action_437 (151#) = happyShift action_197-action_437 (169#) = happyShift action_35-action_437 (177#) = happyShift action_38-action_437 (192#) = happyShift action_41-action_437 (41#) = happyGoto action_459-action_437 (42#) = happyGoto action_190-action_437 (113#) = happyGoto action_193-action_437 (114#) = happyGoto action_194-action_437 (115#) = happyGoto action_19-action_437 (132#) = happyGoto action_195-action_437 x = happyTcHack x happyFail--action_438 x = happyTcHack x happyReduce_133--action_439 x = happyTcHack x happyReduce_132--action_440 (7#) = happyGoto action_457-action_440 (8#) = happyGoto action_458-action_440 x = happyTcHack x happyReduce_11--action_441 x = happyTcHack x happyReduce_138--action_442 (133#) = happyShift action_21-action_442 (134#) = happyShift action_22-action_442 (135#) = happyShift action_23-action_442 (136#) = happyShift action_24-action_442 (141#) = happyShift action_25-action_442 (142#) = happyShift action_26-action_442 (143#) = happyShift action_27-action_442 (144#) = happyShift action_28-action_442 (145#) = happyShift action_29-action_442 (151#) = happyShift action_30-action_442 (154#) = happyShift action_31-action_442 (165#) = happyShift action_33-action_442 (167#) = happyShift action_34-action_442 (169#) = happyShift action_35-action_442 (170#) = happyShift action_36-action_442 (175#) = happyShift action_37-action_442 (177#) = happyShift action_38-action_442 (192#) = happyShift action_41-action_442 (71#) = happyGoto action_237-action_442 (73#) = happyGoto action_8-action_442 (74#) = happyGoto action_9-action_442 (77#) = happyGoto action_10-action_442 (78#) = happyGoto action_11-action_442 (79#) = happyGoto action_12-action_442 (98#) = happyGoto action_13-action_442 (100#) = happyGoto action_14-action_442 (102#) = happyGoto action_15-action_442 (112#) = happyGoto action_16-action_442 (113#) = happyGoto action_17-action_442 (114#) = happyGoto action_18-action_442 (115#) = happyGoto action_19-action_442 (123#) = happyGoto action_20-action_442 x = happyTcHack x happyFail--action_443 (133#) = happyShift action_21-action_443 (135#) = happyShift action_23-action_443 (145#) = happyShift action_314-action_443 (153#) = happyShift action_207-action_443 (169#) = happyShift action_35-action_443 (177#) = happyShift action_38-action_443 (192#) = happyShift action_41-action_443 (11#) = happyGoto action_451-action_443 (21#) = happyGoto action_452-action_443 (22#) = happyGoto action_453-action_443 (99#) = happyGoto action_454-action_443 (113#) = happyGoto action_289-action_443 (115#) = happyGoto action_455-action_443 (128#) = happyGoto action_456-action_443 x = happyTcHack x happyReduce_17--action_444 x = happyTcHack x happyReduce_288--action_445 x = happyTcHack x happyReduce_125--action_446 (135#) = happyShift action_23-action_446 (136#) = happyShift action_24-action_446 (146#) = happyShift action_450-action_446 (58#) = happyGoto action_448-action_446 (114#) = happyGoto action_444-action_446 (115#) = happyGoto action_19-action_446 (131#) = happyGoto action_449-action_446 x = happyTcHack x happyFail--action_447 x = happyTcHack x happyReduce_105--action_448 (146#) = happyShift action_476-action_448 (153#) = happyShift action_477-action_448 x = happyTcHack x happyFail--action_449 x = happyTcHack x happyReduce_129--action_450 x = happyTcHack x happyReduce_126--action_451 (146#) = happyShift action_475-action_451 x = happyTcHack x happyFail--action_452 (153#) = happyShift action_474-action_452 (11#) = happyGoto action_473-action_452 x = happyTcHack x happyReduce_17--action_453 x = happyTcHack x happyReduce_40--action_454 x = happyTcHack x happyReduce_41--action_455 x = happyTcHack x happyReduce_285--action_456 (145#) = happyShift action_472-action_456 x = happyTcHack x happyReduce_42--action_457 (133#) = happyReduce_279-action_457 (134#) = happyReduce_279-action_457 (135#) = happyReduce_279-action_457 (136#) = happyReduce_279-action_457 (141#) = happyReduce_279-action_457 (142#) = happyReduce_279-action_457 (143#) = happyReduce_279-action_457 (144#) = happyReduce_279-action_457 (145#) = happyReduce_279-action_457 (151#) = happyReduce_279-action_457 (154#) = happyReduce_279-action_457 (165#) = happyReduce_279-action_457 (167#) = happyReduce_279-action_457 (169#) = happyReduce_279-action_457 (170#) = happyReduce_279-action_457 (175#) = happyReduce_279-action_457 (177#) = happyReduce_279-action_457 (192#) = happyReduce_279-action_457 (63#) = happyGoto action_471-action_457 (124#) = happyGoto action_442-action_457 x = happyTcHack x happyReduce_10--action_458 (147#) = happyShift action_156-action_458 x = happyTcHack x happyReduce_135--action_459 x = happyTcHack x happyReduce_113--action_460 x = happyTcHack x happyReduce_116--action_461 (133#) = happyShift action_21-action_461 (135#) = happyShift action_23-action_461 (136#) = happyShift action_24-action_461 (145#) = happyShift action_196-action_461 (151#) = happyShift action_197-action_461 (169#) = happyShift action_35-action_461 (177#) = happyShift action_38-action_461 (192#) = happyShift action_41-action_461 (41#) = happyGoto action_219-action_461 (42#) = happyGoto action_190-action_461 (113#) = happyGoto action_193-action_461 (114#) = happyGoto action_194-action_461 (115#) = happyGoto action_19-action_461 (132#) = happyGoto action_195-action_461 x = happyTcHack x happyReduce_117--action_462 x = happyTcHack x happyReduce_108--action_463 (153#) = happyShift action_251-action_463 (158#) = happyShift action_470-action_463 x = happyTcHack x happyFail--action_464 (149#) = happyShift action_468-action_464 (153#) = happyShift action_469-action_464 x = happyTcHack x happyFail--action_465 x = happyTcHack x happyReduce_120--action_466 x = happyTcHack x happyReduce_82--action_467 x = happyTcHack x happyReduce_109--action_468 x = happyTcHack x happyReduce_110--action_469 (133#) = happyShift action_21-action_469 (134#) = happyShift action_22-action_469 (145#) = happyShift action_108-action_469 (169#) = happyShift action_35-action_469 (177#) = happyShift action_38-action_469 (192#) = happyShift action_41-action_469 (38#) = happyGoto action_463-action_469 (55#) = happyGoto action_487-action_469 (100#) = happyGoto action_466-action_469 (112#) = happyGoto action_16-action_469 (113#) = happyGoto action_17-action_469 x = happyTcHack x happyFail--action_470 (133#) = happyShift action_21-action_470 (135#) = happyShift action_23-action_470 (136#) = happyShift action_24-action_470 (145#) = happyShift action_196-action_470 (151#) = happyShift action_197-action_470 (168#) = happyShift action_486-action_470 (169#) = happyShift action_35-action_470 (177#) = happyShift action_38-action_470 (192#) = happyShift action_41-action_470 (39#) = happyGoto action_484-action_470 (40#) = happyGoto action_211-action_470 (41#) = happyGoto action_189-action_470 (42#) = happyGoto action_190-action_470 (56#) = happyGoto action_485-action_470 (113#) = happyGoto action_193-action_470 (114#) = happyGoto action_194-action_470 (115#) = happyGoto action_19-action_470 (132#) = happyGoto action_195-action_470 x = happyTcHack x happyFail--action_471 x = happyTcHack x happyReduce_137--action_472 (133#) = happyShift action_21-action_472 (135#) = happyShift action_23-action_472 (145#) = happyShift action_291-action_472 (146#) = happyShift action_482-action_472 (156#) = happyShift action_483-action_472 (169#) = happyShift action_35-action_472 (177#) = happyShift action_38-action_472 (192#) = happyShift action_41-action_472 (23#) = happyGoto action_481-action_472 (24#) = happyGoto action_286-action_472 (99#) = happyGoto action_287-action_472 (101#) = happyGoto action_288-action_472 (113#) = happyGoto action_289-action_472 (115#) = happyGoto action_290-action_472 x = happyTcHack x happyFail--action_473 (146#) = happyShift action_480-action_473 x = happyTcHack x happyFail--action_474 (133#) = happyShift action_21-action_474 (135#) = happyShift action_23-action_474 (145#) = happyShift action_314-action_474 (169#) = happyShift action_35-action_474 (177#) = happyShift action_38-action_474 (192#) = happyShift action_41-action_474 (22#) = happyGoto action_479-action_474 (99#) = happyGoto action_454-action_474 (113#) = happyGoto action_289-action_474 (115#) = happyGoto action_455-action_474 (128#) = happyGoto action_456-action_474 x = happyTcHack x happyReduce_16--action_475 x = happyTcHack x happyReduce_36--action_476 x = happyTcHack x happyReduce_127--action_477 (135#) = happyShift action_23-action_477 (136#) = happyShift action_24-action_477 (114#) = happyGoto action_444-action_477 (115#) = happyGoto action_19-action_477 (131#) = happyGoto action_478-action_477 x = happyTcHack x happyFail--action_478 x = happyTcHack x happyReduce_128--action_479 x = happyTcHack x happyReduce_39--action_480 x = happyTcHack x happyReduce_35--action_481 (146#) = happyShift action_490-action_481 (153#) = happyShift action_345-action_481 x = happyTcHack x happyFail--action_482 x = happyTcHack x happyReduce_44--action_483 (146#) = happyShift action_489-action_483 x = happyTcHack x happyFail--action_484 x = happyTcHack x happyReduce_122--action_485 x = happyTcHack x happyReduce_121--action_486 (133#) = happyShift action_21-action_486 (135#) = happyShift action_23-action_486 (136#) = happyShift action_24-action_486 (145#) = happyShift action_196-action_486 (151#) = happyShift action_197-action_486 (169#) = happyShift action_35-action_486 (177#) = happyShift action_38-action_486 (192#) = happyShift action_41-action_486 (41#) = happyGoto action_488-action_486 (42#) = happyGoto action_190-action_486 (113#) = happyGoto action_193-action_486 (114#) = happyGoto action_194-action_486 (115#) = happyGoto action_19-action_486 (132#) = happyGoto action_195-action_486 x = happyTcHack x happyFail--action_487 x = happyTcHack x happyReduce_119--action_488 x = happyTcHack x happyReduce_123--action_489 x = happyTcHack x happyReduce_43--action_490 x = happyTcHack x happyReduce_45--happyReduce_1 = happyReduce 6# 4# happyReduction_1-happyReduction_1 (happy_x_6 `HappyStk`-	happy_x_5 `HappyStk`-	happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOut124 happy_x_1 of { happy_var_1 -> -	case happyOut127 happy_x_3 of { happy_var_3 -> -	case happyOut9 happy_x_4 of { happy_var_4 -> -	case happyOut5 happy_x_6 of { happy_var_6 -> -	happyIn4-		 (HsModule happy_var_1 happy_var_3 happy_var_4 (fst happy_var_6) (snd happy_var_6)-	) `HappyStk` happyRest}}}}--happyReduce_2 = happySpecReduce_2 4# happyReduction_2-happyReduction_2 happy_x_2-	happy_x_1-	 =  case happyOut124 happy_x_1 of { happy_var_1 -> -	case happyOut5 happy_x_2 of { happy_var_2 -> -	happyIn4-		 (HsModule happy_var_1 main_mod (Just [HsEVar (UnQual main_name)])-                                                      (fst happy_var_2) (snd happy_var_2)-	)}}--happyReduce_3 = happySpecReduce_3 5# happyReduction_3-happyReduction_3 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut6 happy_x_2 of { happy_var_2 -> -	happyIn5-		 (happy_var_2-	)}--happyReduce_4 = happySpecReduce_3 5# happyReduction_4-happyReduction_4 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut6 happy_x_2 of { happy_var_2 -> -	happyIn5-		 (happy_var_2-	)}--happyReduce_5 = happyReduce 4# 6# happyReduction_5-happyReduction_5 (happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOut14 happy_x_2 of { happy_var_2 -> -	case happyOut29 happy_x_4 of { happy_var_4 -> -	happyIn6-		 ((reverse happy_var_2, happy_var_4)-	) `HappyStk` happyRest}}--happyReduce_6 = happySpecReduce_2 6# happyReduction_6-happyReduction_6 happy_x_2-	happy_x_1-	 =  case happyOut29 happy_x_2 of { happy_var_2 -> -	happyIn6-		 (([], happy_var_2)-	)}--happyReduce_7 = happySpecReduce_3 6# happyReduction_7-happyReduction_7 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut14 happy_x_2 of { happy_var_2 -> -	happyIn6-		 ((reverse happy_var_2, [])-	)}--happyReduce_8 = happySpecReduce_1 6# happyReduction_8-happyReduction_8 happy_x_1-	 =  happyIn6-		 (([], [])-	)--happyReduce_9 = happySpecReduce_2 7# happyReduction_9-happyReduction_9 happy_x_2-	happy_x_1-	 =  happyIn7-		 (()-	)--happyReduce_10 = happySpecReduce_1 8# happyReduction_10-happyReduction_10 happy_x_1-	 =  happyIn8-		 (()-	)--happyReduce_11 = happySpecReduce_0 8# happyReduction_11-happyReduction_11  =  happyIn8-		 (()-	)--happyReduce_12 = happySpecReduce_1 9# happyReduction_12-happyReduction_12 happy_x_1-	 =  case happyOut10 happy_x_1 of { happy_var_1 -> -	happyIn9-		 (Just happy_var_1-	)}--happyReduce_13 = happySpecReduce_0 9# happyReduction_13-happyReduction_13  =  happyIn9-		 (Nothing-	)--happyReduce_14 = happyReduce 4# 10# happyReduction_14-happyReduction_14 (happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOut12 happy_x_2 of { happy_var_2 -> -	happyIn10-		 (reverse happy_var_2-	) `HappyStk` happyRest}--happyReduce_15 = happySpecReduce_3 10# happyReduction_15-happyReduction_15 happy_x_3-	happy_x_2-	happy_x_1-	 =  happyIn10-		 ([]-	)--happyReduce_16 = happySpecReduce_1 11# happyReduction_16-happyReduction_16 happy_x_1-	 =  happyIn11-		 (()-	)--happyReduce_17 = happySpecReduce_0 11# happyReduction_17-happyReduction_17  =  happyIn11-		 (()-	)--happyReduce_18 = happySpecReduce_3 12# happyReduction_18-happyReduction_18 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut12 happy_x_1 of { happy_var_1 -> -	case happyOut13 happy_x_3 of { happy_var_3 -> -	happyIn12-		 (happy_var_3 : happy_var_1-	)}}--happyReduce_19 = happySpecReduce_1 12# happyReduction_19-happyReduction_19 happy_x_1-	 =  case happyOut13 happy_x_1 of { happy_var_1 -> -	happyIn12-		 ([happy_var_1]-	)}--happyReduce_20 = happySpecReduce_1 13# happyReduction_20-happyReduction_20 happy_x_1-	 =  case happyOut100 happy_x_1 of { happy_var_1 -> -	happyIn13-		 (HsEVar happy_var_1-	)}--happyReduce_21 = happySpecReduce_1 13# happyReduction_21-happyReduction_21 happy_x_1-	 =  case happyOut130 happy_x_1 of { happy_var_1 -> -	happyIn13-		 (HsEAbs happy_var_1-	)}--happyReduce_22 = happyReduce 4# 13# happyReduction_22-happyReduction_22 (happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOut130 happy_x_1 of { happy_var_1 -> -	happyIn13-		 (HsEThingAll happy_var_1-	) `HappyStk` happyRest}--happyReduce_23 = happySpecReduce_3 13# happyReduction_23-happyReduction_23 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut130 happy_x_1 of { happy_var_1 -> -	happyIn13-		 (HsEThingWith happy_var_1 []-	)}--happyReduce_24 = happyReduce 4# 13# happyReduction_24-happyReduction_24 (happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOut130 happy_x_1 of { happy_var_1 -> -	case happyOut23 happy_x_3 of { happy_var_3 -> -	happyIn13-		 (HsEThingWith happy_var_1 (reverse happy_var_3)-	) `HappyStk` happyRest}}--happyReduce_25 = happySpecReduce_2 13# happyReduction_25-happyReduction_25 happy_x_2-	happy_x_1-	 =  case happyOut127 happy_x_2 of { happy_var_2 -> -	happyIn13-		 (HsEModuleContents happy_var_2-	)}--happyReduce_26 = happySpecReduce_3 14# happyReduction_26-happyReduction_26 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut14 happy_x_1 of { happy_var_1 -> -	case happyOut15 happy_x_3 of { happy_var_3 -> -	happyIn14-		 (happy_var_3 : happy_var_1-	)}}--happyReduce_27 = happySpecReduce_1 14# happyReduction_27-happyReduction_27 happy_x_1-	 =  case happyOut15 happy_x_1 of { happy_var_1 -> -	happyIn14-		 ([happy_var_1]-	)}--happyReduce_28 = happyReduce 6# 15# happyReduction_28-happyReduction_28 (happy_x_6 `HappyStk`-	happy_x_5 `HappyStk`-	happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOut124 happy_x_1 of { happy_var_1 -> -	case happyOut16 happy_x_3 of { happy_var_3 -> -	case happyOut127 happy_x_4 of { happy_var_4 -> -	case happyOut17 happy_x_5 of { happy_var_5 -> -	case happyOut18 happy_x_6 of { happy_var_6 -> -	happyIn15-		 (HsImportDecl happy_var_1 happy_var_4 happy_var_3 happy_var_5 happy_var_6-	) `HappyStk` happyRest}}}}}--happyReduce_29 = happySpecReduce_1 16# happyReduction_29-happyReduction_29 happy_x_1-	 =  happyIn16-		 (True-	)--happyReduce_30 = happySpecReduce_0 16# happyReduction_30-happyReduction_30  =  happyIn16-		 (False-	)--happyReduce_31 = happySpecReduce_2 17# happyReduction_31-happyReduction_31 happy_x_2-	happy_x_1-	 =  case happyOut127 happy_x_2 of { happy_var_2 -> -	happyIn17-		 (Just happy_var_2-	)}--happyReduce_32 = happySpecReduce_0 17# happyReduction_32-happyReduction_32  =  happyIn17-		 (Nothing-	)--happyReduce_33 = happySpecReduce_1 18# happyReduction_33-happyReduction_33 happy_x_1-	 =  case happyOut19 happy_x_1 of { happy_var_1 -> -	happyIn18-		 (Just happy_var_1-	)}--happyReduce_34 = happySpecReduce_0 18# happyReduction_34-happyReduction_34  =  happyIn18-		 (Nothing-	)--happyReduce_35 = happyReduce 5# 19# happyReduction_35-happyReduction_35 (happy_x_5 `HappyStk`-	happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOut20 happy_x_1 of { happy_var_1 -> -	case happyOut21 happy_x_3 of { happy_var_3 -> -	happyIn19-		 ((happy_var_1, reverse happy_var_3)-	) `HappyStk` happyRest}}--happyReduce_36 = happyReduce 4# 19# happyReduction_36-happyReduction_36 (happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOut20 happy_x_1 of { happy_var_1 -> -	happyIn19-		 ((happy_var_1, [])-	) `HappyStk` happyRest}--happyReduce_37 = happySpecReduce_1 20# happyReduction_37-happyReduction_37 happy_x_1-	 =  happyIn20-		 (True-	)--happyReduce_38 = happySpecReduce_0 20# happyReduction_38-happyReduction_38  =  happyIn20-		 (False-	)--happyReduce_39 = happySpecReduce_3 21# happyReduction_39-happyReduction_39 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut21 happy_x_1 of { happy_var_1 -> -	case happyOut22 happy_x_3 of { happy_var_3 -> -	happyIn21-		 (happy_var_3 : happy_var_1-	)}}--happyReduce_40 = happySpecReduce_1 21# happyReduction_40-happyReduction_40 happy_x_1-	 =  case happyOut22 happy_x_1 of { happy_var_1 -> -	happyIn21-		 ([happy_var_1]-	)}--happyReduce_41 = happySpecReduce_1 22# happyReduction_41-happyReduction_41 happy_x_1-	 =  case happyOut99 happy_x_1 of { happy_var_1 -> -	happyIn22-		 (HsIVar happy_var_1-	)}--happyReduce_42 = happySpecReduce_1 22# happyReduction_42-happyReduction_42 happy_x_1-	 =  case happyOut128 happy_x_1 of { happy_var_1 -> -	happyIn22-		 (HsIAbs happy_var_1-	)}--happyReduce_43 = happyReduce 4# 22# happyReduction_43-happyReduction_43 (happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOut128 happy_x_1 of { happy_var_1 -> -	happyIn22-		 (HsIThingAll happy_var_1-	) `HappyStk` happyRest}--happyReduce_44 = happySpecReduce_3 22# happyReduction_44-happyReduction_44 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut128 happy_x_1 of { happy_var_1 -> -	happyIn22-		 (HsIThingWith happy_var_1 []-	)}--happyReduce_45 = happyReduce 4# 22# happyReduction_45-happyReduction_45 (happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOut128 happy_x_1 of { happy_var_1 -> -	case happyOut23 happy_x_3 of { happy_var_3 -> -	happyIn22-		 (HsIThingWith happy_var_1 (reverse happy_var_3)-	) `HappyStk` happyRest}}--happyReduce_46 = happySpecReduce_3 23# happyReduction_46-happyReduction_46 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut23 happy_x_1 of { happy_var_1 -> -	case happyOut24 happy_x_3 of { happy_var_3 -> -	happyIn23-		 (happy_var_3 : happy_var_1-	)}}--happyReduce_47 = happySpecReduce_1 23# happyReduction_47-happyReduction_47 happy_x_1-	 =  case happyOut24 happy_x_1 of { happy_var_1 -> -	happyIn23-		 ([happy_var_1]-	)}--happyReduce_48 = happySpecReduce_1 24# happyReduction_48-happyReduction_48 happy_x_1-	 =  case happyOut99 happy_x_1 of { happy_var_1 -> -	happyIn24-		 (HsVarName happy_var_1-	)}--happyReduce_49 = happySpecReduce_1 24# happyReduction_49-happyReduction_49 happy_x_1-	 =  case happyOut101 happy_x_1 of { happy_var_1 -> -	happyIn24-		 (HsConName happy_var_1-	)}--happyReduce_50 = happyReduce 4# 25# happyReduction_50-happyReduction_50 (happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOut124 happy_x_1 of { happy_var_1 -> -	case happyOut27 happy_x_2 of { happy_var_2 -> -	case happyOut26 happy_x_3 of { happy_var_3 -> -	case happyOut28 happy_x_4 of { happy_var_4 -> -	happyIn25-		 (HsInfixDecl happy_var_1 happy_var_2 happy_var_3 (reverse happy_var_4)-	) `HappyStk` happyRest}}}}--happyReduce_51 = happySpecReduce_0 26# happyReduction_51-happyReduction_51  =  happyIn26-		 (9-	)--happyReduce_52 = happyMonadReduce 1# 26# happyReduction_52-happyReduction_52 (happy_x_1 `HappyStk`-	happyRest)-	 = happyThen (case happyOutTok happy_x_1 of { (IntTok happy_var_1) -> -	 checkPrec happy_var_1}-	) (\r -> happyReturn (happyIn26 r))--happyReduce_53 = happySpecReduce_1 27# happyReduction_53-happyReduction_53 happy_x_1-	 =  happyIn27-		 (HsAssocNone-	)--happyReduce_54 = happySpecReduce_1 27# happyReduction_54-happyReduction_54 happy_x_1-	 =  happyIn27-		 (HsAssocLeft-	)--happyReduce_55 = happySpecReduce_1 27# happyReduction_55-happyReduction_55 happy_x_1-	 =  happyIn27-		 (HsAssocRight-	)--happyReduce_56 = happySpecReduce_3 28# happyReduction_56-happyReduction_56 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut28 happy_x_1 of { happy_var_1 -> -	case happyOut108 happy_x_3 of { happy_var_3 -> -	happyIn28-		 (happy_var_3 : happy_var_1-	)}}--happyReduce_57 = happySpecReduce_1 28# happyReduction_57-happyReduction_57 happy_x_1-	 =  case happyOut108 happy_x_1 of { happy_var_1 -> -	happyIn28-		 ([happy_var_1]-	)}--happyReduce_58 = happyMonadReduce 2# 29# happyReduction_58-happyReduction_58 (happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = happyThen (case happyOut30 happy_x_1 of { happy_var_1 -> -	 checkRevDecls happy_var_1}-	) (\r -> happyReturn (happyIn29 r))--happyReduce_59 = happySpecReduce_3 30# happyReduction_59-happyReduction_59 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut30 happy_x_1 of { happy_var_1 -> -	case happyOut31 happy_x_3 of { happy_var_3 -> -	happyIn30-		 (happy_var_3 : happy_var_1-	)}}--happyReduce_60 = happySpecReduce_1 30# happyReduction_60-happyReduction_60 happy_x_1-	 =  case happyOut31 happy_x_1 of { happy_var_1 -> -	happyIn30-		 ([happy_var_1]-	)}--happyReduce_61 = happyReduce 5# 31# happyReduction_61-happyReduction_61 (happy_x_5 `HappyStk`-	happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOut124 happy_x_1 of { happy_var_1 -> -	case happyOut46 happy_x_3 of { happy_var_3 -> -	case happyOut39 happy_x_5 of { happy_var_5 -> -	happyIn31-		 (HsTypeDecl happy_var_1 (fst happy_var_3) (snd happy_var_3) happy_var_5-	) `HappyStk` happyRest}}}--happyReduce_62 = happyMonadReduce 6# 31# happyReduction_62-happyReduction_62 (happy_x_6 `HappyStk`-	happy_x_5 `HappyStk`-	happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = happyThen (case happyOut124 happy_x_1 of { happy_var_1 -> -	case happyOut43 happy_x_3 of { happy_var_3 -> -	case happyOut48 happy_x_5 of { happy_var_5 -> -	case happyOut57 happy_x_6 of { happy_var_6 -> -	 do { (cs,c,t) <- checkDataHeader happy_var_3;-                              return (HsDataDecl happy_var_1 cs c t (reverse happy_var_5) happy_var_6) }}}}}-	) (\r -> happyReturn (happyIn31 r))--happyReduce_63 = happyMonadReduce 6# 31# happyReduction_63-happyReduction_63 (happy_x_6 `HappyStk`-	happy_x_5 `HappyStk`-	happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = happyThen (case happyOut124 happy_x_1 of { happy_var_1 -> -	case happyOut43 happy_x_3 of { happy_var_3 -> -	case happyOut49 happy_x_5 of { happy_var_5 -> -	case happyOut57 happy_x_6 of { happy_var_6 -> -	 do { (cs,c,t) <- checkDataHeader happy_var_3;-                              return (HsNewTypeDecl happy_var_1 cs c t happy_var_5 happy_var_6) }}}}}-	) (\r -> happyReturn (happyIn31 r))--happyReduce_64 = happyMonadReduce 4# 31# happyReduction_64-happyReduction_64 (happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = happyThen (case happyOut124 happy_x_1 of { happy_var_1 -> -	case happyOut43 happy_x_3 of { happy_var_3 -> -	case happyOut59 happy_x_4 of { happy_var_4 -> -	 do { (cs,c,vs) <- checkClassHeader happy_var_3;-                              return (HsClassDecl happy_var_1 cs c vs happy_var_4) }}}}-	) (\r -> happyReturn (happyIn31 r))--happyReduce_65 = happyMonadReduce 4# 31# happyReduction_65-happyReduction_65 (happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = happyThen (case happyOut124 happy_x_1 of { happy_var_1 -> -	case happyOut43 happy_x_3 of { happy_var_3 -> -	case happyOut60 happy_x_4 of { happy_var_4 -> -	 do { (cs,c,ts) <- checkInstHeader happy_var_3;-                              return (HsInstDecl happy_var_1 cs c ts happy_var_4) }}}}-	) (\r -> happyReturn (happyIn31 r))--happyReduce_66 = happyReduce 5# 31# happyReduction_66-happyReduction_66 (happy_x_5 `HappyStk`-	happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOut124 happy_x_1 of { happy_var_1 -> -	case happyOut32 happy_x_4 of { happy_var_4 -> -	happyIn31-		 (HsDefaultDecl happy_var_1 happy_var_4-	) `HappyStk` happyRest}}--happyReduce_67 = happySpecReduce_1 31# happyReduction_67-happyReduction_67 happy_x_1-	 =  case happyOut35 happy_x_1 of { happy_var_1 -> -	happyIn31-		 (happy_var_1-	)}--happyReduce_68 = happySpecReduce_1 32# happyReduction_68-happyReduction_68 happy_x_1-	 =  case happyOut45 happy_x_1 of { happy_var_1 -> -	happyIn32-		 (reverse happy_var_1-	)}--happyReduce_69 = happySpecReduce_1 32# happyReduction_69-happyReduction_69 happy_x_1-	 =  case happyOut39 happy_x_1 of { happy_var_1 -> -	happyIn32-		 ([happy_var_1]-	)}--happyReduce_70 = happySpecReduce_0 32# happyReduction_70-happyReduction_70  =  happyIn32-		 ([]-	)--happyReduce_71 = happyMonadReduce 3# 33# happyReduction_71-happyReduction_71 (happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = happyThen (case happyOut34 happy_x_2 of { happy_var_2 -> -	 checkRevDecls happy_var_2}-	) (\r -> happyReturn (happyIn33 r))--happyReduce_72 = happySpecReduce_1 33# happyReduction_72-happyReduction_72 happy_x_1-	 =  happyIn33-		 ([]-	)--happyReduce_73 = happySpecReduce_3 34# happyReduction_73-happyReduction_73 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut34 happy_x_1 of { happy_var_1 -> -	case happyOut35 happy_x_3 of { happy_var_3 -> -	happyIn34-		 (happy_var_3 : happy_var_1-	)}}--happyReduce_74 = happySpecReduce_1 34# happyReduction_74-happyReduction_74 happy_x_1-	 =  case happyOut35 happy_x_1 of { happy_var_1 -> -	happyIn34-		 ([happy_var_1]-	)}--happyReduce_75 = happySpecReduce_1 35# happyReduction_75-happyReduction_75 happy_x_1-	 =  case happyOut37 happy_x_1 of { happy_var_1 -> -	happyIn35-		 (happy_var_1-	)}--happyReduce_76 = happySpecReduce_1 35# happyReduction_76-happyReduction_76 happy_x_1-	 =  case happyOut25 happy_x_1 of { happy_var_1 -> -	happyIn35-		 (happy_var_1-	)}--happyReduce_77 = happySpecReduce_1 35# happyReduction_77-happyReduction_77 happy_x_1-	 =  case happyOut63 happy_x_1 of { happy_var_1 -> -	happyIn35-		 (happy_var_1-	)}--happyReduce_78 = happySpecReduce_3 36# happyReduction_78-happyReduction_78 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut33 happy_x_2 of { happy_var_2 -> -	happyIn36-		 (happy_var_2-	)}--happyReduce_79 = happySpecReduce_3 36# happyReduction_79-happyReduction_79 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut33 happy_x_2 of { happy_var_2 -> -	happyIn36-		 (happy_var_2-	)}--happyReduce_80 = happyReduce 4# 37# happyReduction_80-happyReduction_80 (happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOut124 happy_x_1 of { happy_var_1 -> -	case happyOut38 happy_x_2 of { happy_var_2 -> -	case happyOut43 happy_x_4 of { happy_var_4 -> -	happyIn37-		 (HsTypeSig happy_var_1 (reverse happy_var_2) happy_var_4-	) `HappyStk` happyRest}}}--happyReduce_81 = happySpecReduce_3 38# happyReduction_81-happyReduction_81 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut38 happy_x_1 of { happy_var_1 -> -	case happyOut99 happy_x_3 of { happy_var_3 -> -	happyIn38-		 (happy_var_3 : happy_var_1-	)}}--happyReduce_82 = happyMonadReduce 1# 38# happyReduction_82-happyReduction_82 (happy_x_1 `HappyStk`-	happyRest)-	 = happyThen (case happyOut100 happy_x_1 of { happy_var_1 -> -	 do { n <- checkUnQual happy_var_1;-                                              return [n] }}-	) (\r -> happyReturn (happyIn38 r))--happyReduce_83 = happySpecReduce_3 39# happyReduction_83-happyReduction_83 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut40 happy_x_1 of { happy_var_1 -> -	case happyOut39 happy_x_3 of { happy_var_3 -> -	happyIn39-		 (HsTyFun happy_var_1 happy_var_3-	)}}--happyReduce_84 = happySpecReduce_1 39# happyReduction_84-happyReduction_84 happy_x_1-	 =  case happyOut40 happy_x_1 of { happy_var_1 -> -	happyIn39-		 (happy_var_1-	)}--happyReduce_85 = happySpecReduce_2 40# happyReduction_85-happyReduction_85 happy_x_2-	happy_x_1-	 =  case happyOut40 happy_x_1 of { happy_var_1 -> -	case happyOut41 happy_x_2 of { happy_var_2 -> -	happyIn40-		 (HsTyApp happy_var_1 happy_var_2-	)}}--happyReduce_86 = happySpecReduce_1 40# happyReduction_86-happyReduction_86 happy_x_1-	 =  case happyOut41 happy_x_1 of { happy_var_1 -> -	happyIn40-		 (happy_var_1-	)}--happyReduce_87 = happySpecReduce_1 41# happyReduction_87-happyReduction_87 happy_x_1-	 =  case happyOut42 happy_x_1 of { happy_var_1 -> -	happyIn41-		 (HsTyCon happy_var_1-	)}--happyReduce_88 = happySpecReduce_1 41# happyReduction_88-happyReduction_88 happy_x_1-	 =  case happyOut132 happy_x_1 of { happy_var_1 -> -	happyIn41-		 (HsTyVar happy_var_1-	)}--happyReduce_89 = happySpecReduce_3 41# happyReduction_89-happyReduction_89 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut45 happy_x_2 of { happy_var_2 -> -	happyIn41-		 (HsTyTuple (reverse happy_var_2)-	)}--happyReduce_90 = happySpecReduce_3 41# happyReduction_90-happyReduction_90 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut39 happy_x_2 of { happy_var_2 -> -	happyIn41-		 (HsTyApp list_tycon happy_var_2-	)}--happyReduce_91 = happySpecReduce_3 41# happyReduction_91-happyReduction_91 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut39 happy_x_2 of { happy_var_2 -> -	happyIn41-		 (happy_var_2-	)}--happyReduce_92 = happySpecReduce_1 42# happyReduction_92-happyReduction_92 happy_x_1-	 =  case happyOut114 happy_x_1 of { happy_var_1 -> -	happyIn42-		 (happy_var_1-	)}--happyReduce_93 = happySpecReduce_2 42# happyReduction_93-happyReduction_93 happy_x_2-	happy_x_1-	 =  happyIn42-		 (unit_tycon_name-	)--happyReduce_94 = happySpecReduce_3 42# happyReduction_94-happyReduction_94 happy_x_3-	happy_x_2-	happy_x_1-	 =  happyIn42-		 (fun_tycon_name-	)--happyReduce_95 = happySpecReduce_2 42# happyReduction_95-happyReduction_95 happy_x_2-	happy_x_1-	 =  happyIn42-		 (list_tycon_name-	)--happyReduce_96 = happySpecReduce_3 42# happyReduction_96-happyReduction_96 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut80 happy_x_2 of { happy_var_2 -> -	happyIn42-		 (tuple_tycon_name happy_var_2-	)}--happyReduce_97 = happySpecReduce_3 43# happyReduction_97-happyReduction_97 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut44 happy_x_1 of { happy_var_1 -> -	case happyOut39 happy_x_3 of { happy_var_3 -> -	happyIn43-		 (HsQualType happy_var_1 happy_var_3-	)}}--happyReduce_98 = happySpecReduce_1 43# happyReduction_98-happyReduction_98 happy_x_1-	 =  case happyOut39 happy_x_1 of { happy_var_1 -> -	happyIn43-		 (HsQualType [] happy_var_1-	)}--happyReduce_99 = happyMonadReduce 1# 44# happyReduction_99-happyReduction_99 (happy_x_1 `HappyStk`-	happyRest)-	 = happyThen (case happyOut40 happy_x_1 of { happy_var_1 -> -	 checkContext happy_var_1}-	) (\r -> happyReturn (happyIn44 r))--happyReduce_100 = happySpecReduce_3 45# happyReduction_100-happyReduction_100 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut45 happy_x_1 of { happy_var_1 -> -	case happyOut39 happy_x_3 of { happy_var_3 -> -	happyIn45-		 (happy_var_3 : happy_var_1-	)}}--happyReduce_101 = happySpecReduce_3 45# happyReduction_101-happyReduction_101 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut39 happy_x_1 of { happy_var_1 -> -	case happyOut39 happy_x_3 of { happy_var_3 -> -	happyIn45-		 ([happy_var_3, happy_var_1]-	)}}--happyReduce_102 = happySpecReduce_2 46# happyReduction_102-happyReduction_102 happy_x_2-	happy_x_1-	 =  case happyOut129 happy_x_1 of { happy_var_1 -> -	case happyOut47 happy_x_2 of { happy_var_2 -> -	happyIn46-		 ((happy_var_1,reverse happy_var_2)-	)}}--happyReduce_103 = happySpecReduce_2 47# happyReduction_103-happyReduction_103 happy_x_2-	happy_x_1-	 =  case happyOut47 happy_x_1 of { happy_var_1 -> -	case happyOut132 happy_x_2 of { happy_var_2 -> -	happyIn47-		 (happy_var_2 : happy_var_1-	)}}--happyReduce_104 = happySpecReduce_0 47# happyReduction_104-happyReduction_104  =  happyIn47-		 ([]-	)--happyReduce_105 = happySpecReduce_3 48# happyReduction_105-happyReduction_105 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut48 happy_x_1 of { happy_var_1 -> -	case happyOut49 happy_x_3 of { happy_var_3 -> -	happyIn48-		 (happy_var_3 : happy_var_1-	)}}--happyReduce_106 = happySpecReduce_1 48# happyReduction_106-happyReduction_106 happy_x_1-	 =  case happyOut49 happy_x_1 of { happy_var_1 -> -	happyIn48-		 ([happy_var_1]-	)}--happyReduce_107 = happySpecReduce_2 49# happyReduction_107-happyReduction_107 happy_x_2-	happy_x_1-	 =  case happyOut124 happy_x_1 of { happy_var_1 -> -	case happyOut50 happy_x_2 of { happy_var_2 -> -	happyIn49-		 (HsConDecl happy_var_1 (fst happy_var_2) (snd happy_var_2)-	)}}--happyReduce_108 = happyReduce 4# 49# happyReduction_108-happyReduction_108 (happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOut124 happy_x_1 of { happy_var_1 -> -	case happyOut53 happy_x_2 of { happy_var_2 -> -	case happyOut106 happy_x_3 of { happy_var_3 -> -	case happyOut53 happy_x_4 of { happy_var_4 -> -	happyIn49-		 (HsConDecl happy_var_1 happy_var_3 [happy_var_2,happy_var_4]-	) `HappyStk` happyRest}}}}--happyReduce_109 = happyReduce 4# 49# happyReduction_109-happyReduction_109 (happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOut124 happy_x_1 of { happy_var_1 -> -	case happyOut101 happy_x_2 of { happy_var_2 -> -	happyIn49-		 (HsRecDecl happy_var_1 happy_var_2 []-	) `HappyStk` happyRest}}--happyReduce_110 = happyReduce 5# 49# happyReduction_110-happyReduction_110 (happy_x_5 `HappyStk`-	happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOut124 happy_x_1 of { happy_var_1 -> -	case happyOut101 happy_x_2 of { happy_var_2 -> -	case happyOut54 happy_x_4 of { happy_var_4 -> -	happyIn49-		 (HsRecDecl happy_var_1 happy_var_2 (reverse happy_var_4)-	) `HappyStk` happyRest}}}--happyReduce_111 = happyMonadReduce 1# 50# happyReduction_111-happyReduction_111 (happy_x_1 `HappyStk`-	happyRest)-	 = happyThen (case happyOut40 happy_x_1 of { happy_var_1 -> -	 do { (c,ts) <- splitTyConApp happy_var_1;-                                              return (c,map HsUnBangedTy ts) }}-	) (\r -> happyReturn (happyIn50 r))--happyReduce_112 = happySpecReduce_1 50# happyReduction_112-happyReduction_112 happy_x_1-	 =  case happyOut51 happy_x_1 of { happy_var_1 -> -	happyIn50-		 (happy_var_1-	)}--happyReduce_113 = happyMonadReduce 3# 51# happyReduction_113-happyReduction_113 (happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = happyThen (case happyOut40 happy_x_1 of { happy_var_1 -> -	case happyOut41 happy_x_3 of { happy_var_3 -> -	 do { (c,ts) <- splitTyConApp happy_var_1;-                                              return (c,map HsUnBangedTy ts++-                                                      [HsBangedTy happy_var_3]) }}}-	) (\r -> happyReturn (happyIn51 r))--happyReduce_114 = happySpecReduce_2 51# happyReduction_114-happyReduction_114 happy_x_2-	happy_x_1-	 =  case happyOut51 happy_x_1 of { happy_var_1 -> -	case happyOut52 happy_x_2 of { happy_var_2 -> -	happyIn51-		 ((fst happy_var_1, snd happy_var_1 ++ [happy_var_2] )-	)}}--happyReduce_115 = happySpecReduce_1 52# happyReduction_115-happyReduction_115 happy_x_1-	 =  case happyOut41 happy_x_1 of { happy_var_1 -> -	happyIn52-		 (HsUnBangedTy happy_var_1-	)}--happyReduce_116 = happySpecReduce_2 52# happyReduction_116-happyReduction_116 happy_x_2-	happy_x_1-	 =  case happyOut41 happy_x_2 of { happy_var_2 -> -	happyIn52-		 (HsBangedTy   happy_var_2-	)}--happyReduce_117 = happySpecReduce_1 53# happyReduction_117-happyReduction_117 happy_x_1-	 =  case happyOut40 happy_x_1 of { happy_var_1 -> -	happyIn53-		 (HsUnBangedTy happy_var_1-	)}--happyReduce_118 = happySpecReduce_2 53# happyReduction_118-happyReduction_118 happy_x_2-	happy_x_1-	 =  case happyOut41 happy_x_2 of { happy_var_2 -> -	happyIn53-		 (HsBangedTy   happy_var_2-	)}--happyReduce_119 = happySpecReduce_3 54# happyReduction_119-happyReduction_119 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut54 happy_x_1 of { happy_var_1 -> -	case happyOut55 happy_x_3 of { happy_var_3 -> -	happyIn54-		 (happy_var_3 : happy_var_1-	)}}--happyReduce_120 = happySpecReduce_1 54# happyReduction_120-happyReduction_120 happy_x_1-	 =  case happyOut55 happy_x_1 of { happy_var_1 -> -	happyIn54-		 ([happy_var_1]-	)}--happyReduce_121 = happySpecReduce_3 55# happyReduction_121-happyReduction_121 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut38 happy_x_1 of { happy_var_1 -> -	case happyOut56 happy_x_3 of { happy_var_3 -> -	happyIn55-		 ((reverse happy_var_1, happy_var_3)-	)}}--happyReduce_122 = happySpecReduce_1 56# happyReduction_122-happyReduction_122 happy_x_1-	 =  case happyOut39 happy_x_1 of { happy_var_1 -> -	happyIn56-		 (HsUnBangedTy happy_var_1-	)}--happyReduce_123 = happySpecReduce_2 56# happyReduction_123-happyReduction_123 happy_x_2-	happy_x_1-	 =  case happyOut41 happy_x_2 of { happy_var_2 -> -	happyIn56-		 (HsBangedTy   happy_var_2-	)}--happyReduce_124 = happySpecReduce_0 57# happyReduction_124-happyReduction_124  =  happyIn57-		 ([]-	)--happyReduce_125 = happySpecReduce_2 57# happyReduction_125-happyReduction_125 happy_x_2-	happy_x_1-	 =  case happyOut131 happy_x_2 of { happy_var_2 -> -	happyIn57-		 ([happy_var_2]-	)}--happyReduce_126 = happySpecReduce_3 57# happyReduction_126-happyReduction_126 happy_x_3-	happy_x_2-	happy_x_1-	 =  happyIn57-		 ([]-	)--happyReduce_127 = happyReduce 4# 57# happyReduction_127-happyReduction_127 (happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOut58 happy_x_3 of { happy_var_3 -> -	happyIn57-		 (reverse happy_var_3-	) `HappyStk` happyRest}--happyReduce_128 = happySpecReduce_3 58# happyReduction_128-happyReduction_128 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut58 happy_x_1 of { happy_var_1 -> -	case happyOut131 happy_x_3 of { happy_var_3 -> -	happyIn58-		 (happy_var_3 : happy_var_1-	)}}--happyReduce_129 = happySpecReduce_1 58# happyReduction_129-happyReduction_129 happy_x_1-	 =  case happyOut131 happy_x_1 of { happy_var_1 -> -	happyIn58-		 ([happy_var_1]-	)}--happyReduce_130 = happyMonadReduce 2# 59# happyReduction_130-happyReduction_130 (happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = happyThen (case happyOut36 happy_x_2 of { happy_var_2 -> -	 checkClassBody happy_var_2}-	) (\r -> happyReturn (happyIn59 r))--happyReduce_131 = happySpecReduce_0 59# happyReduction_131-happyReduction_131  =  happyIn59-		 ([]-	)--happyReduce_132 = happyMonadReduce 4# 60# happyReduction_132-happyReduction_132 (happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = happyThen (case happyOut61 happy_x_3 of { happy_var_3 -> -	 checkClassBody happy_var_3}-	) (\r -> happyReturn (happyIn60 r))--happyReduce_133 = happyMonadReduce 4# 60# happyReduction_133-happyReduction_133 (happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = happyThen (case happyOut61 happy_x_3 of { happy_var_3 -> -	 checkClassBody happy_var_3}-	) (\r -> happyReturn (happyIn60 r))--happyReduce_134 = happySpecReduce_0 60# happyReduction_134-happyReduction_134  =  happyIn60-		 ([]-	)--happyReduce_135 = happyMonadReduce 3# 61# happyReduction_135-happyReduction_135 (happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = happyThen (case happyOut62 happy_x_2 of { happy_var_2 -> -	 checkRevDecls happy_var_2}-	) (\r -> happyReturn (happyIn61 r))--happyReduce_136 = happySpecReduce_1 61# happyReduction_136-happyReduction_136 happy_x_1-	 =  happyIn61-		 ([]-	)--happyReduce_137 = happySpecReduce_3 62# happyReduction_137-happyReduction_137 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut62 happy_x_1 of { happy_var_1 -> -	case happyOut63 happy_x_3 of { happy_var_3 -> -	happyIn62-		 (happy_var_3 : happy_var_1-	)}}--happyReduce_138 = happySpecReduce_1 62# happyReduction_138-happyReduction_138 happy_x_1-	 =  case happyOut63 happy_x_1 of { happy_var_1 -> -	happyIn62-		 ([happy_var_1]-	)}--happyReduce_139 = happyMonadReduce 4# 63# happyReduction_139-happyReduction_139 (happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = happyThen (case happyOut124 happy_x_1 of { happy_var_1 -> -	case happyOut71 happy_x_2 of { happy_var_2 -> -	case happyOut65 happy_x_3 of { happy_var_3 -> -	case happyOut64 happy_x_4 of { happy_var_4 -> -	 checkValDef happy_var_1 happy_var_2 happy_var_3 happy_var_4}}}}-	) (\r -> happyReturn (happyIn63 r))--happyReduce_140 = happySpecReduce_2 64# happyReduction_140-happyReduction_140 happy_x_2-	happy_x_1-	 =  case happyOut36 happy_x_2 of { happy_var_2 -> -	happyIn64-		 (happy_var_2-	)}--happyReduce_141 = happySpecReduce_0 64# happyReduction_141-happyReduction_141  =  happyIn64-		 ([]-	)--happyReduce_142 = happyMonadReduce 2# 65# happyReduction_142-happyReduction_142 (happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = happyThen (case happyOut68 happy_x_2 of { happy_var_2 -> -	 do { e <- checkExpr happy_var_2;-                                              return (HsUnGuardedRhs e) }}-	) (\r -> happyReturn (happyIn65 r))--happyReduce_143 = happySpecReduce_1 65# happyReduction_143-happyReduction_143 happy_x_1-	 =  case happyOut66 happy_x_1 of { happy_var_1 -> -	happyIn65-		 (HsGuardedRhss  (reverse happy_var_1)-	)}--happyReduce_144 = happySpecReduce_2 66# happyReduction_144-happyReduction_144 happy_x_2-	happy_x_1-	 =  case happyOut66 happy_x_1 of { happy_var_1 -> -	case happyOut67 happy_x_2 of { happy_var_2 -> -	happyIn66-		 (happy_var_2 : happy_var_1-	)}}--happyReduce_145 = happySpecReduce_1 66# happyReduction_145-happyReduction_145 happy_x_1-	 =  case happyOut67 happy_x_1 of { happy_var_1 -> -	happyIn66-		 ([happy_var_1]-	)}--happyReduce_146 = happyMonadReduce 5# 67# happyReduction_146-happyReduction_146 (happy_x_5 `HappyStk`-	happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = happyThen (case happyOut124 happy_x_1 of { happy_var_1 -> -	case happyOut69 happy_x_3 of { happy_var_3 -> -	case happyOut68 happy_x_5 of { happy_var_5 -> -	 do { g <- checkExpr happy_var_3;-                                              e <- checkExpr happy_var_5;-                                              return (HsGuardedRhs happy_var_1 g e) }}}}-	) (\r -> happyReturn (happyIn67 r))--happyReduce_147 = happyReduce 4# 68# happyReduction_147-happyReduction_147 (happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOut71 happy_x_1 of { happy_var_1 -> -	case happyOut124 happy_x_3 of { happy_var_3 -> -	case happyOut43 happy_x_4 of { happy_var_4 -> -	happyIn68-		 (HsExpTypeSig happy_var_3 happy_var_1 happy_var_4-	) `HappyStk` happyRest}}}--happyReduce_148 = happySpecReduce_1 68# happyReduction_148-happyReduction_148 happy_x_1-	 =  case happyOut69 happy_x_1 of { happy_var_1 -> -	happyIn68-		 (happy_var_1-	)}--happyReduce_149 = happySpecReduce_1 69# happyReduction_149-happyReduction_149 happy_x_1-	 =  case happyOut70 happy_x_1 of { happy_var_1 -> -	happyIn69-		 (happy_var_1-	)}--happyReduce_150 = happySpecReduce_1 69# happyReduction_150-happyReduction_150 happy_x_1-	 =  case happyOut71 happy_x_1 of { happy_var_1 -> -	happyIn69-		 (happy_var_1-	)}--happyReduce_151 = happySpecReduce_3 70# happyReduction_151-happyReduction_151 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut71 happy_x_1 of { happy_var_1 -> -	case happyOut109 happy_x_2 of { happy_var_2 -> -	case happyOut72 happy_x_3 of { happy_var_3 -> -	happyIn70-		 (HsInfixApp happy_var_1 happy_var_2 happy_var_3-	)}}}--happyReduce_152 = happySpecReduce_1 70# happyReduction_152-happyReduction_152 happy_x_1-	 =  case happyOut72 happy_x_1 of { happy_var_1 -> -	happyIn70-		 (happy_var_1-	)}--happyReduce_153 = happySpecReduce_3 71# happyReduction_153-happyReduction_153 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut71 happy_x_1 of { happy_var_1 -> -	case happyOut109 happy_x_2 of { happy_var_2 -> -	case happyOut73 happy_x_3 of { happy_var_3 -> -	happyIn71-		 (HsInfixApp happy_var_1 happy_var_2 happy_var_3-	)}}}--happyReduce_154 = happySpecReduce_1 71# happyReduction_154-happyReduction_154 happy_x_1-	 =  case happyOut73 happy_x_1 of { happy_var_1 -> -	happyIn71-		 (happy_var_1-	)}--happyReduce_155 = happyReduce 5# 72# happyReduction_155-happyReduction_155 (happy_x_5 `HappyStk`-	happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOut124 happy_x_2 of { happy_var_2 -> -	case happyOut75 happy_x_3 of { happy_var_3 -> -	case happyOut68 happy_x_5 of { happy_var_5 -> -	happyIn72-		 (HsLambda happy_var_2 (reverse happy_var_3) happy_var_5-	) `HappyStk` happyRest}}}--happyReduce_156 = happyReduce 4# 72# happyReduction_156-happyReduction_156 (happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOut36 happy_x_2 of { happy_var_2 -> -	case happyOut68 happy_x_4 of { happy_var_4 -> -	happyIn72-		 (HsLet happy_var_2 happy_var_4-	) `HappyStk` happyRest}}--happyReduce_157 = happyReduce 6# 72# happyReduction_157-happyReduction_157 (happy_x_6 `HappyStk`-	happy_x_5 `HappyStk`-	happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOut68 happy_x_2 of { happy_var_2 -> -	case happyOut68 happy_x_4 of { happy_var_4 -> -	case happyOut68 happy_x_6 of { happy_var_6 -> -	happyIn72-		 (HsIf happy_var_2 happy_var_4 happy_var_6-	) `HappyStk` happyRest}}}--happyReduce_158 = happyReduce 4# 73# happyReduction_158-happyReduction_158 (happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOut68 happy_x_2 of { happy_var_2 -> -	case happyOut86 happy_x_4 of { happy_var_4 -> -	happyIn73-		 (HsCase happy_var_2 happy_var_4-	) `HappyStk` happyRest}}--happyReduce_159 = happySpecReduce_2 73# happyReduction_159-happyReduction_159 happy_x_2-	happy_x_1-	 =  case happyOut74 happy_x_2 of { happy_var_2 -> -	happyIn73-		 (HsNegApp happy_var_2-	)}--happyReduce_160 = happySpecReduce_2 73# happyReduction_160-happyReduction_160 happy_x_2-	happy_x_1-	 =  case happyOut94 happy_x_2 of { happy_var_2 -> -	happyIn73-		 (HsDo happy_var_2-	)}--happyReduce_161 = happySpecReduce_1 73# happyReduction_161-happyReduction_161 happy_x_1-	 =  case happyOut74 happy_x_1 of { happy_var_1 -> -	happyIn73-		 (happy_var_1-	)}--happyReduce_162 = happySpecReduce_2 74# happyReduction_162-happyReduction_162 happy_x_2-	happy_x_1-	 =  case happyOut74 happy_x_1 of { happy_var_1 -> -	case happyOut77 happy_x_2 of { happy_var_2 -> -	happyIn74-		 (HsApp happy_var_1 happy_var_2-	)}}--happyReduce_163 = happySpecReduce_1 74# happyReduction_163-happyReduction_163 happy_x_1-	 =  case happyOut77 happy_x_1 of { happy_var_1 -> -	happyIn74-		 (happy_var_1-	)}--happyReduce_164 = happySpecReduce_2 75# happyReduction_164-happyReduction_164 happy_x_2-	happy_x_1-	 =  case happyOut75 happy_x_1 of { happy_var_1 -> -	case happyOut76 happy_x_2 of { happy_var_2 -> -	happyIn75-		 (happy_var_2 : happy_var_1-	)}}--happyReduce_165 = happySpecReduce_1 75# happyReduction_165-happyReduction_165 happy_x_1-	 =  case happyOut76 happy_x_1 of { happy_var_1 -> -	happyIn75-		 ([happy_var_1]-	)}--happyReduce_166 = happyMonadReduce 1# 76# happyReduction_166-happyReduction_166 (happy_x_1 `HappyStk`-	happyRest)-	 = happyThen (case happyOut77 happy_x_1 of { happy_var_1 -> -	 checkPattern happy_var_1}-	) (\r -> happyReturn (happyIn76 r))--happyReduce_167 = happyMonadReduce 3# 77# happyReduction_167-happyReduction_167 (happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = happyThen (case happyOut100 happy_x_1 of { happy_var_1 -> -	case happyOut77 happy_x_3 of { happy_var_3 -> -	 do { n <- checkUnQual happy_var_1;-                                              return (HsAsPat n happy_var_3) }}}-	) (\r -> happyReturn (happyIn77 r))--happyReduce_168 = happySpecReduce_2 77# happyReduction_168-happyReduction_168 happy_x_2-	happy_x_1-	 =  case happyOut77 happy_x_2 of { happy_var_2 -> -	happyIn77-		 (HsIrrPat happy_var_2-	)}--happyReduce_169 = happySpecReduce_1 77# happyReduction_169-happyReduction_169 happy_x_1-	 =  case happyOut78 happy_x_1 of { happy_var_1 -> -	happyIn77-		 (happy_var_1-	)}--happyReduce_170 = happyMonadReduce 3# 78# happyReduction_170-happyReduction_170 (happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = happyThen (case happyOut78 happy_x_1 of { happy_var_1 -> -	 mkRecConstrOrUpdate happy_var_1 []}-	) (\r -> happyReturn (happyIn78 r))--happyReduce_171 = happyMonadReduce 4# 78# happyReduction_171-happyReduction_171 (happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = happyThen (case happyOut78 happy_x_1 of { happy_var_1 -> -	case happyOut96 happy_x_3 of { happy_var_3 -> -	 mkRecConstrOrUpdate happy_var_1 (reverse happy_var_3)}}-	) (\r -> happyReturn (happyIn78 r))--happyReduce_172 = happySpecReduce_1 78# happyReduction_172-happyReduction_172 happy_x_1-	 =  case happyOut79 happy_x_1 of { happy_var_1 -> -	happyIn78-		 (happy_var_1-	)}--happyReduce_173 = happySpecReduce_1 79# happyReduction_173-happyReduction_173 happy_x_1-	 =  case happyOut100 happy_x_1 of { happy_var_1 -> -	happyIn79-		 (HsVar happy_var_1-	)}--happyReduce_174 = happySpecReduce_1 79# happyReduction_174-happyReduction_174 happy_x_1-	 =  case happyOut98 happy_x_1 of { happy_var_1 -> -	happyIn79-		 (happy_var_1-	)}--happyReduce_175 = happySpecReduce_1 79# happyReduction_175-happyReduction_175 happy_x_1-	 =  case happyOut123 happy_x_1 of { happy_var_1 -> -	happyIn79-		 (HsLit happy_var_1-	)}--happyReduce_176 = happySpecReduce_3 79# happyReduction_176-happyReduction_176 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut68 happy_x_2 of { happy_var_2 -> -	happyIn79-		 (HsParen happy_var_2-	)}--happyReduce_177 = happySpecReduce_3 79# happyReduction_177-happyReduction_177 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut81 happy_x_2 of { happy_var_2 -> -	happyIn79-		 (HsTuple (reverse happy_var_2)-	)}--happyReduce_178 = happySpecReduce_3 79# happyReduction_178-happyReduction_178 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut82 happy_x_2 of { happy_var_2 -> -	happyIn79-		 (happy_var_2-	)}--happyReduce_179 = happyReduce 4# 79# happyReduction_179-happyReduction_179 (happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOut71 happy_x_2 of { happy_var_2 -> -	case happyOut109 happy_x_3 of { happy_var_3 -> -	happyIn79-		 (HsLeftSection happy_var_2 happy_var_3-	) `HappyStk` happyRest}}--happyReduce_180 = happyReduce 4# 79# happyReduction_180-happyReduction_180 (happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOut110 happy_x_2 of { happy_var_2 -> -	case happyOut69 happy_x_3 of { happy_var_3 -> -	happyIn79-		 (HsRightSection happy_var_2 happy_var_3-	) `HappyStk` happyRest}}--happyReduce_181 = happySpecReduce_1 79# happyReduction_181-happyReduction_181 happy_x_1-	 =  happyIn79-		 (HsWildCard-	)--happyReduce_182 = happySpecReduce_2 80# happyReduction_182-happyReduction_182 happy_x_2-	happy_x_1-	 =  case happyOut80 happy_x_1 of { happy_var_1 -> -	happyIn80-		 (happy_var_1 + 1-	)}--happyReduce_183 = happySpecReduce_1 80# happyReduction_183-happyReduction_183 happy_x_1-	 =  happyIn80-		 (1-	)--happyReduce_184 = happySpecReduce_3 81# happyReduction_184-happyReduction_184 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut81 happy_x_1 of { happy_var_1 -> -	case happyOut68 happy_x_3 of { happy_var_3 -> -	happyIn81-		 (happy_var_3 : happy_var_1-	)}}--happyReduce_185 = happySpecReduce_3 81# happyReduction_185-happyReduction_185 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut68 happy_x_1 of { happy_var_1 -> -	case happyOut68 happy_x_3 of { happy_var_3 -> -	happyIn81-		 ([happy_var_3,happy_var_1]-	)}}--happyReduce_186 = happySpecReduce_1 82# happyReduction_186-happyReduction_186 happy_x_1-	 =  case happyOut68 happy_x_1 of { happy_var_1 -> -	happyIn82-		 (HsList [happy_var_1]-	)}--happyReduce_187 = happySpecReduce_1 82# happyReduction_187-happyReduction_187 happy_x_1-	 =  case happyOut83 happy_x_1 of { happy_var_1 -> -	happyIn82-		 (HsList (reverse happy_var_1)-	)}--happyReduce_188 = happySpecReduce_2 82# happyReduction_188-happyReduction_188 happy_x_2-	happy_x_1-	 =  case happyOut68 happy_x_1 of { happy_var_1 -> -	happyIn82-		 (HsEnumFrom happy_var_1-	)}--happyReduce_189 = happyReduce 4# 82# happyReduction_189-happyReduction_189 (happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOut68 happy_x_1 of { happy_var_1 -> -	case happyOut68 happy_x_3 of { happy_var_3 -> -	happyIn82-		 (HsEnumFromThen happy_var_1 happy_var_3-	) `HappyStk` happyRest}}--happyReduce_190 = happySpecReduce_3 82# happyReduction_190-happyReduction_190 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut68 happy_x_1 of { happy_var_1 -> -	case happyOut68 happy_x_3 of { happy_var_3 -> -	happyIn82-		 (HsEnumFromTo happy_var_1 happy_var_3-	)}}--happyReduce_191 = happyReduce 5# 82# happyReduction_191-happyReduction_191 (happy_x_5 `HappyStk`-	happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOut68 happy_x_1 of { happy_var_1 -> -	case happyOut68 happy_x_3 of { happy_var_3 -> -	case happyOut68 happy_x_5 of { happy_var_5 -> -	happyIn82-		 (HsEnumFromThenTo happy_var_1 happy_var_3 happy_var_5-	) `HappyStk` happyRest}}}--happyReduce_192 = happySpecReduce_3 82# happyReduction_192-happyReduction_192 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut68 happy_x_1 of { happy_var_1 -> -	case happyOut84 happy_x_3 of { happy_var_3 -> -	happyIn82-		 (HsListComp happy_var_1 (reverse happy_var_3)-	)}}--happyReduce_193 = happySpecReduce_3 83# happyReduction_193-happyReduction_193 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut83 happy_x_1 of { happy_var_1 -> -	case happyOut68 happy_x_3 of { happy_var_3 -> -	happyIn83-		 (happy_var_3 : happy_var_1-	)}}--happyReduce_194 = happySpecReduce_3 83# happyReduction_194-happyReduction_194 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut68 happy_x_1 of { happy_var_1 -> -	case happyOut68 happy_x_3 of { happy_var_3 -> -	happyIn83-		 ([happy_var_3,happy_var_1]-	)}}--happyReduce_195 = happySpecReduce_3 84# happyReduction_195-happyReduction_195 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut84 happy_x_1 of { happy_var_1 -> -	case happyOut85 happy_x_3 of { happy_var_3 -> -	happyIn84-		 (happy_var_3 : happy_var_1-	)}}--happyReduce_196 = happySpecReduce_1 84# happyReduction_196-happyReduction_196 happy_x_1-	 =  case happyOut85 happy_x_1 of { happy_var_1 -> -	happyIn84-		 ([happy_var_1]-	)}--happyReduce_197 = happyReduce 4# 85# happyReduction_197-happyReduction_197 (happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOut93 happy_x_1 of { happy_var_1 -> -	case happyOut124 happy_x_2 of { happy_var_2 -> -	case happyOut68 happy_x_4 of { happy_var_4 -> -	happyIn85-		 (HsGenerator happy_var_2 happy_var_1 happy_var_4-	) `HappyStk` happyRest}}}--happyReduce_198 = happySpecReduce_1 85# happyReduction_198-happyReduction_198 happy_x_1-	 =  case happyOut68 happy_x_1 of { happy_var_1 -> -	happyIn85-		 (HsQualifier happy_var_1-	)}--happyReduce_199 = happySpecReduce_2 85# happyReduction_199-happyReduction_199 happy_x_2-	happy_x_1-	 =  case happyOut36 happy_x_2 of { happy_var_2 -> -	happyIn85-		 (HsLetStmt happy_var_2-	)}--happyReduce_200 = happySpecReduce_3 86# happyReduction_200-happyReduction_200 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut87 happy_x_2 of { happy_var_2 -> -	happyIn86-		 (happy_var_2-	)}--happyReduce_201 = happySpecReduce_3 86# happyReduction_201-happyReduction_201 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut87 happy_x_2 of { happy_var_2 -> -	happyIn86-		 (happy_var_2-	)}--happyReduce_202 = happySpecReduce_3 87# happyReduction_202-happyReduction_202 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut88 happy_x_2 of { happy_var_2 -> -	happyIn87-		 (reverse happy_var_2-	)}--happyReduce_203 = happySpecReduce_3 88# happyReduction_203-happyReduction_203 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut88 happy_x_1 of { happy_var_1 -> -	case happyOut89 happy_x_3 of { happy_var_3 -> -	happyIn88-		 (happy_var_3 : happy_var_1-	)}}--happyReduce_204 = happySpecReduce_1 88# happyReduction_204-happyReduction_204 happy_x_1-	 =  case happyOut89 happy_x_1 of { happy_var_1 -> -	happyIn88-		 ([happy_var_1]-	)}--happyReduce_205 = happyReduce 4# 89# happyReduction_205-happyReduction_205 (happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOut124 happy_x_1 of { happy_var_1 -> -	case happyOut93 happy_x_2 of { happy_var_2 -> -	case happyOut90 happy_x_3 of { happy_var_3 -> -	case happyOut64 happy_x_4 of { happy_var_4 -> -	happyIn89-		 (HsAlt happy_var_1 happy_var_2 happy_var_3 happy_var_4-	) `HappyStk` happyRest}}}}--happyReduce_206 = happySpecReduce_2 90# happyReduction_206-happyReduction_206 happy_x_2-	happy_x_1-	 =  case happyOut68 happy_x_2 of { happy_var_2 -> -	happyIn90-		 (HsUnGuardedAlt happy_var_2-	)}--happyReduce_207 = happySpecReduce_1 90# happyReduction_207-happyReduction_207 happy_x_1-	 =  case happyOut91 happy_x_1 of { happy_var_1 -> -	happyIn90-		 (HsGuardedAlts (reverse happy_var_1)-	)}--happyReduce_208 = happySpecReduce_2 91# happyReduction_208-happyReduction_208 happy_x_2-	happy_x_1-	 =  case happyOut91 happy_x_1 of { happy_var_1 -> -	case happyOut92 happy_x_2 of { happy_var_2 -> -	happyIn91-		 (happy_var_2 : happy_var_1-	)}}--happyReduce_209 = happySpecReduce_1 91# happyReduction_209-happyReduction_209 happy_x_1-	 =  case happyOut92 happy_x_1 of { happy_var_1 -> -	happyIn91-		 ([happy_var_1]-	)}--happyReduce_210 = happyReduce 5# 92# happyReduction_210-happyReduction_210 (happy_x_5 `HappyStk`-	happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOut124 happy_x_1 of { happy_var_1 -> -	case happyOut69 happy_x_3 of { happy_var_3 -> -	case happyOut68 happy_x_5 of { happy_var_5 -> -	happyIn92-		 (HsGuardedAlt happy_var_1 happy_var_3 happy_var_5-	) `HappyStk` happyRest}}}--happyReduce_211 = happyMonadReduce 1# 93# happyReduction_211-happyReduction_211 (happy_x_1 `HappyStk`-	happyRest)-	 = happyThen (case happyOut71 happy_x_1 of { happy_var_1 -> -	 checkPattern happy_var_1}-	) (\r -> happyReturn (happyIn93 r))--happyReduce_212 = happySpecReduce_3 94# happyReduction_212-happyReduction_212 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut95 happy_x_2 of { happy_var_2 -> -	happyIn94-		 (happy_var_2-	)}--happyReduce_213 = happySpecReduce_3 94# happyReduction_213-happyReduction_213 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut95 happy_x_2 of { happy_var_2 -> -	happyIn94-		 (happy_var_2-	)}--happyReduce_214 = happyReduce 4# 95# happyReduction_214-happyReduction_214 (happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOut36 happy_x_2 of { happy_var_2 -> -	case happyOut95 happy_x_4 of { happy_var_4 -> -	happyIn95-		 (HsLetStmt happy_var_2 : happy_var_4-	) `HappyStk` happyRest}}--happyReduce_215 = happyReduce 6# 95# happyReduction_215-happyReduction_215 (happy_x_6 `HappyStk`-	happy_x_5 `HappyStk`-	happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOut93 happy_x_1 of { happy_var_1 -> -	case happyOut124 happy_x_2 of { happy_var_2 -> -	case happyOut68 happy_x_4 of { happy_var_4 -> -	case happyOut95 happy_x_6 of { happy_var_6 -> -	happyIn95-		 (HsGenerator happy_var_2 happy_var_1 happy_var_4 : happy_var_6-	) `HappyStk` happyRest}}}}--happyReduce_216 = happySpecReduce_3 95# happyReduction_216-happyReduction_216 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut68 happy_x_1 of { happy_var_1 -> -	case happyOut95 happy_x_3 of { happy_var_3 -> -	happyIn95-		 (HsQualifier happy_var_1 : happy_var_3-	)}}--happyReduce_217 = happySpecReduce_2 95# happyReduction_217-happyReduction_217 happy_x_2-	happy_x_1-	 =  case happyOut95 happy_x_2 of { happy_var_2 -> -	happyIn95-		 (happy_var_2-	)}--happyReduce_218 = happySpecReduce_2 95# happyReduction_218-happyReduction_218 happy_x_2-	happy_x_1-	 =  case happyOut68 happy_x_1 of { happy_var_1 -> -	happyIn95-		 ([HsQualifier happy_var_1]-	)}--happyReduce_219 = happySpecReduce_1 95# happyReduction_219-happyReduction_219 happy_x_1-	 =  case happyOut68 happy_x_1 of { happy_var_1 -> -	happyIn95-		 ([HsQualifier happy_var_1]-	)}--happyReduce_220 = happySpecReduce_3 96# happyReduction_220-happyReduction_220 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut96 happy_x_1 of { happy_var_1 -> -	case happyOut97 happy_x_3 of { happy_var_3 -> -	happyIn96-		 (happy_var_3 : happy_var_1-	)}}--happyReduce_221 = happySpecReduce_1 96# happyReduction_221-happyReduction_221 happy_x_1-	 =  case happyOut97 happy_x_1 of { happy_var_1 -> -	happyIn96-		 ([happy_var_1]-	)}--happyReduce_222 = happySpecReduce_3 97# happyReduction_222-happyReduction_222 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut100 happy_x_1 of { happy_var_1 -> -	case happyOut68 happy_x_3 of { happy_var_3 -> -	happyIn97-		 (HsFieldUpdate happy_var_1 happy_var_3-	)}}--happyReduce_223 = happySpecReduce_2 98# happyReduction_223-happyReduction_223 happy_x_2-	happy_x_1-	 =  happyIn98-		 (unit_con-	)--happyReduce_224 = happySpecReduce_2 98# happyReduction_224-happyReduction_224 happy_x_2-	happy_x_1-	 =  happyIn98-		 (HsList []-	)--happyReduce_225 = happySpecReduce_3 98# happyReduction_225-happyReduction_225 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut80 happy_x_2 of { happy_var_2 -> -	happyIn98-		 (tuple_con happy_var_2-	)}--happyReduce_226 = happySpecReduce_1 98# happyReduction_226-happyReduction_226 happy_x_1-	 =  case happyOut102 happy_x_1 of { happy_var_1 -> -	happyIn98-		 (HsCon happy_var_1-	)}--happyReduce_227 = happySpecReduce_1 99# happyReduction_227-happyReduction_227 happy_x_1-	 =  case happyOut113 happy_x_1 of { happy_var_1 -> -	happyIn99-		 (happy_var_1-	)}--happyReduce_228 = happySpecReduce_3 99# happyReduction_228-happyReduction_228 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut120 happy_x_2 of { happy_var_2 -> -	happyIn99-		 (happy_var_2-	)}--happyReduce_229 = happySpecReduce_1 100# happyReduction_229-happyReduction_229 happy_x_1-	 =  case happyOut112 happy_x_1 of { happy_var_1 -> -	happyIn100-		 (happy_var_1-	)}--happyReduce_230 = happySpecReduce_3 100# happyReduction_230-happyReduction_230 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut118 happy_x_2 of { happy_var_2 -> -	happyIn100-		 (happy_var_2-	)}--happyReduce_231 = happySpecReduce_1 101# happyReduction_231-happyReduction_231 happy_x_1-	 =  case happyOut115 happy_x_1 of { happy_var_1 -> -	happyIn101-		 (happy_var_1-	)}--happyReduce_232 = happySpecReduce_3 101# happyReduction_232-happyReduction_232 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut117 happy_x_2 of { happy_var_2 -> -	happyIn101-		 (happy_var_2-	)}--happyReduce_233 = happySpecReduce_1 102# happyReduction_233-happyReduction_233 happy_x_1-	 =  case happyOut114 happy_x_1 of { happy_var_1 -> -	happyIn102-		 (happy_var_1-	)}--happyReduce_234 = happySpecReduce_3 102# happyReduction_234-happyReduction_234 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut111 happy_x_2 of { happy_var_2 -> -	happyIn102-		 (happy_var_2-	)}--happyReduce_235 = happySpecReduce_1 103# happyReduction_235-happyReduction_235 happy_x_1-	 =  case happyOut120 happy_x_1 of { happy_var_1 -> -	happyIn103-		 (happy_var_1-	)}--happyReduce_236 = happySpecReduce_3 103# happyReduction_236-happyReduction_236 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut113 happy_x_2 of { happy_var_2 -> -	happyIn103-		 (happy_var_2-	)}--happyReduce_237 = happySpecReduce_1 104# happyReduction_237-happyReduction_237 happy_x_1-	 =  case happyOut118 happy_x_1 of { happy_var_1 -> -	happyIn104-		 (happy_var_1-	)}--happyReduce_238 = happySpecReduce_3 104# happyReduction_238-happyReduction_238 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut112 happy_x_2 of { happy_var_2 -> -	happyIn104-		 (happy_var_2-	)}--happyReduce_239 = happySpecReduce_1 105# happyReduction_239-happyReduction_239 happy_x_1-	 =  case happyOut119 happy_x_1 of { happy_var_1 -> -	happyIn105-		 (happy_var_1-	)}--happyReduce_240 = happySpecReduce_3 105# happyReduction_240-happyReduction_240 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut112 happy_x_2 of { happy_var_2 -> -	happyIn105-		 (happy_var_2-	)}--happyReduce_241 = happySpecReduce_1 106# happyReduction_241-happyReduction_241 happy_x_1-	 =  case happyOut117 happy_x_1 of { happy_var_1 -> -	happyIn106-		 (happy_var_1-	)}--happyReduce_242 = happySpecReduce_3 106# happyReduction_242-happyReduction_242 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut115 happy_x_2 of { happy_var_2 -> -	happyIn106-		 (happy_var_2-	)}--happyReduce_243 = happySpecReduce_1 107# happyReduction_243-happyReduction_243 happy_x_1-	 =  case happyOut111 happy_x_1 of { happy_var_1 -> -	happyIn107-		 (happy_var_1-	)}--happyReduce_244 = happySpecReduce_3 107# happyReduction_244-happyReduction_244 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut114 happy_x_2 of { happy_var_2 -> -	happyIn107-		 (happy_var_2-	)}--happyReduce_245 = happySpecReduce_1 108# happyReduction_245-happyReduction_245 happy_x_1-	 =  case happyOut103 happy_x_1 of { happy_var_1 -> -	happyIn108-		 (HsVarOp happy_var_1-	)}--happyReduce_246 = happySpecReduce_1 108# happyReduction_246-happyReduction_246 happy_x_1-	 =  case happyOut106 happy_x_1 of { happy_var_1 -> -	happyIn108-		 (HsConOp happy_var_1-	)}--happyReduce_247 = happySpecReduce_1 109# happyReduction_247-happyReduction_247 happy_x_1-	 =  case happyOut104 happy_x_1 of { happy_var_1 -> -	happyIn109-		 (HsQVarOp happy_var_1-	)}--happyReduce_248 = happySpecReduce_1 109# happyReduction_248-happyReduction_248 happy_x_1-	 =  case happyOut107 happy_x_1 of { happy_var_1 -> -	happyIn109-		 (HsQConOp happy_var_1-	)}--happyReduce_249 = happySpecReduce_1 110# happyReduction_249-happyReduction_249 happy_x_1-	 =  case happyOut105 happy_x_1 of { happy_var_1 -> -	happyIn110-		 (HsQVarOp happy_var_1-	)}--happyReduce_250 = happySpecReduce_1 110# happyReduction_250-happyReduction_250 happy_x_1-	 =  case happyOut107 happy_x_1 of { happy_var_1 -> -	happyIn110-		 (HsQConOp happy_var_1-	)}--happyReduce_251 = happySpecReduce_1 111# happyReduction_251-happyReduction_251 happy_x_1-	 =  happyIn111-		 (list_cons_name-	)--happyReduce_252 = happySpecReduce_1 111# happyReduction_252-happyReduction_252 happy_x_1-	 =  case happyOut116 happy_x_1 of { happy_var_1 -> -	happyIn111-		 (happy_var_1-	)}--happyReduce_253 = happySpecReduce_1 112# happyReduction_253-happyReduction_253 happy_x_1-	 =  case happyOut113 happy_x_1 of { happy_var_1 -> -	happyIn112-		 (UnQual happy_var_1-	)}--happyReduce_254 = happySpecReduce_1 112# happyReduction_254-happyReduction_254 happy_x_1-	 =  case happyOutTok happy_x_1 of { (QVarId happy_var_1) -> -	happyIn112-		 (Qual (Module (fst happy_var_1)) (HsIdent (snd happy_var_1))-	)}--happyReduce_255 = happySpecReduce_1 113# happyReduction_255-happyReduction_255 happy_x_1-	 =  case happyOutTok happy_x_1 of { (VarId happy_var_1) -> -	happyIn113-		 (HsIdent happy_var_1-	)}--happyReduce_256 = happySpecReduce_1 113# happyReduction_256-happyReduction_256 happy_x_1-	 =  happyIn113-		 (as_name-	)--happyReduce_257 = happySpecReduce_1 113# happyReduction_257-happyReduction_257 happy_x_1-	 =  happyIn113-		 (qualified_name-	)--happyReduce_258 = happySpecReduce_1 113# happyReduction_258-happyReduction_258 happy_x_1-	 =  happyIn113-		 (hiding_name-	)--happyReduce_259 = happySpecReduce_1 114# happyReduction_259-happyReduction_259 happy_x_1-	 =  case happyOut115 happy_x_1 of { happy_var_1 -> -	happyIn114-		 (UnQual happy_var_1-	)}--happyReduce_260 = happySpecReduce_1 114# happyReduction_260-happyReduction_260 happy_x_1-	 =  case happyOutTok happy_x_1 of { (QConId happy_var_1) -> -	happyIn114-		 (Qual (Module (fst happy_var_1)) (HsIdent (snd happy_var_1))-	)}--happyReduce_261 = happySpecReduce_1 115# happyReduction_261-happyReduction_261 happy_x_1-	 =  case happyOutTok happy_x_1 of { (ConId happy_var_1) -> -	happyIn115-		 (HsIdent happy_var_1-	)}--happyReduce_262 = happySpecReduce_1 116# happyReduction_262-happyReduction_262 happy_x_1-	 =  case happyOut117 happy_x_1 of { happy_var_1 -> -	happyIn116-		 (UnQual happy_var_1-	)}--happyReduce_263 = happySpecReduce_1 116# happyReduction_263-happyReduction_263 happy_x_1-	 =  case happyOutTok happy_x_1 of { (QConSym happy_var_1) -> -	happyIn116-		 (Qual (Module (fst happy_var_1)) (HsSymbol (snd happy_var_1))-	)}--happyReduce_264 = happySpecReduce_1 117# happyReduction_264-happyReduction_264 happy_x_1-	 =  case happyOutTok happy_x_1 of { (ConSym happy_var_1) -> -	happyIn117-		 (HsSymbol happy_var_1-	)}--happyReduce_265 = happySpecReduce_1 118# happyReduction_265-happyReduction_265 happy_x_1-	 =  case happyOut120 happy_x_1 of { happy_var_1 -> -	happyIn118-		 (UnQual happy_var_1-	)}--happyReduce_266 = happySpecReduce_1 118# happyReduction_266-happyReduction_266 happy_x_1-	 =  case happyOut122 happy_x_1 of { happy_var_1 -> -	happyIn118-		 (happy_var_1-	)}--happyReduce_267 = happySpecReduce_1 119# happyReduction_267-happyReduction_267 happy_x_1-	 =  case happyOut121 happy_x_1 of { happy_var_1 -> -	happyIn119-		 (UnQual happy_var_1-	)}--happyReduce_268 = happySpecReduce_1 119# happyReduction_268-happyReduction_268 happy_x_1-	 =  case happyOut122 happy_x_1 of { happy_var_1 -> -	happyIn119-		 (happy_var_1-	)}--happyReduce_269 = happySpecReduce_1 120# happyReduction_269-happyReduction_269 happy_x_1-	 =  case happyOutTok happy_x_1 of { (VarSym happy_var_1) -> -	happyIn120-		 (HsSymbol happy_var_1-	)}--happyReduce_270 = happySpecReduce_1 120# happyReduction_270-happyReduction_270 happy_x_1-	 =  happyIn120-		 (minus_name-	)--happyReduce_271 = happySpecReduce_1 120# happyReduction_271-happyReduction_271 happy_x_1-	 =  happyIn120-		 (pling_name-	)--happyReduce_272 = happySpecReduce_1 121# happyReduction_272-happyReduction_272 happy_x_1-	 =  case happyOutTok happy_x_1 of { (VarSym happy_var_1) -> -	happyIn121-		 (HsSymbol happy_var_1-	)}--happyReduce_273 = happySpecReduce_1 121# happyReduction_273-happyReduction_273 happy_x_1-	 =  happyIn121-		 (pling_name-	)--happyReduce_274 = happySpecReduce_1 122# happyReduction_274-happyReduction_274 happy_x_1-	 =  case happyOutTok happy_x_1 of { (QVarSym happy_var_1) -> -	happyIn122-		 (Qual (Module (fst happy_var_1)) (HsSymbol (snd happy_var_1))-	)}--happyReduce_275 = happySpecReduce_1 123# happyReduction_275-happyReduction_275 happy_x_1-	 =  case happyOutTok happy_x_1 of { (IntTok happy_var_1) -> -	happyIn123-		 (HsInt happy_var_1-	)}--happyReduce_276 = happySpecReduce_1 123# happyReduction_276-happyReduction_276 happy_x_1-	 =  case happyOutTok happy_x_1 of { (Character happy_var_1) -> -	happyIn123-		 (HsChar happy_var_1-	)}--happyReduce_277 = happySpecReduce_1 123# happyReduction_277-happyReduction_277 happy_x_1-	 =  case happyOutTok happy_x_1 of { (FloatTok happy_var_1) -> -	happyIn123-		 (HsFrac happy_var_1-	)}--happyReduce_278 = happySpecReduce_1 123# happyReduction_278-happyReduction_278 happy_x_1-	 =  case happyOutTok happy_x_1 of { (StringTok happy_var_1) -> -	happyIn123-		 (HsString happy_var_1-	)}--happyReduce_279 = happyMonadReduce 0# 124# happyReduction_279-happyReduction_279 (happyRest)-	 = happyThen ( getSrcLoc-	) (\r -> happyReturn (happyIn124 r))--happyReduce_280 = happyMonadReduce 0# 125# happyReduction_280-happyReduction_280 (happyRest)-	 = happyThen ( pushCurrentContext-	) (\r -> happyReturn (happyIn125 r))--happyReduce_281 = happySpecReduce_1 126# happyReduction_281-happyReduction_281 happy_x_1-	 =  happyIn126-		 (()-	)--happyReduce_282 = happyMonadReduce 1# 126# happyReduction_282-happyReduction_282 (happy_x_1 `HappyStk`-	happyRest)-	 = happyThen ( popContext-	) (\r -> happyReturn (happyIn126 r))--happyReduce_283 = happySpecReduce_1 127# happyReduction_283-happyReduction_283 happy_x_1-	 =  case happyOutTok happy_x_1 of { (ConId happy_var_1) -> -	happyIn127-		 (Module happy_var_1-	)}--happyReduce_284 = happySpecReduce_1 127# happyReduction_284-happyReduction_284 happy_x_1-	 =  case happyOutTok happy_x_1 of { (QConId happy_var_1) -> -	happyIn127-		 (Module (fst happy_var_1 ++ '.':snd happy_var_1)-	)}--happyReduce_285 = happySpecReduce_1 128# happyReduction_285-happyReduction_285 happy_x_1-	 =  case happyOut115 happy_x_1 of { happy_var_1 -> -	happyIn128-		 (happy_var_1-	)}--happyReduce_286 = happySpecReduce_1 129# happyReduction_286-happyReduction_286 happy_x_1-	 =  case happyOut115 happy_x_1 of { happy_var_1 -> -	happyIn129-		 (happy_var_1-	)}--happyReduce_287 = happySpecReduce_1 130# happyReduction_287-happyReduction_287 happy_x_1-	 =  case happyOut114 happy_x_1 of { happy_var_1 -> -	happyIn130-		 (happy_var_1-	)}--happyReduce_288 = happySpecReduce_1 131# happyReduction_288-happyReduction_288 happy_x_1-	 =  case happyOut114 happy_x_1 of { happy_var_1 -> -	happyIn131-		 (happy_var_1-	)}--happyReduce_289 = happySpecReduce_1 132# happyReduction_289-happyReduction_289 happy_x_1-	 =  case happyOut113 happy_x_1 of { happy_var_1 -> -	happyIn132-		 (happy_var_1-	)}--happyNewToken action sts stk-	= lexer(\tk -> -	let cont i = action i i tk (HappyState action) sts stk in-	case tk of {-	EOF -> action 193# 193# (error "reading EOF!") (HappyState action) sts stk;-	VarId happy_dollar_dollar -> cont 133#;-	QVarId happy_dollar_dollar -> cont 134#;-	ConId happy_dollar_dollar -> cont 135#;-	QConId happy_dollar_dollar -> cont 136#;-	VarSym happy_dollar_dollar -> cont 137#;-	ConSym happy_dollar_dollar -> cont 138#;-	QVarSym happy_dollar_dollar -> cont 139#;-	QConSym happy_dollar_dollar -> cont 140#;-	IntTok happy_dollar_dollar -> cont 141#;-	FloatTok happy_dollar_dollar -> cont 142#;-	Character happy_dollar_dollar -> cont 143#;-	StringTok happy_dollar_dollar -> cont 144#;-	LeftParen -> cont 145#;-	RightParen -> cont 146#;-	SemiColon -> cont 147#;-	LeftCurly -> cont 148#;-	RightCurly -> cont 149#;-	VRightCurly -> cont 150#;-	LeftSquare -> cont 151#;-	RightSquare -> cont 152#;-	Comma -> cont 153#;-	Underscore -> cont 154#;-	BackQuote -> cont 155#;-	DotDot -> cont 156#;-	Colon -> cont 157#;-	DoubleColon -> cont 158#;-	Equals -> cont 159#;-	Backslash -> cont 160#;-	Bar -> cont 161#;-	LeftArrow -> cont 162#;-	RightArrow -> cont 163#;-	At -> cont 164#;-	Tilde -> cont 165#;-	DoubleArrow -> cont 166#;-	Minus -> cont 167#;-	Exclamation -> cont 168#;-	KW_As -> cont 169#;-	KW_Case -> cont 170#;-	KW_Class -> cont 171#;-	KW_Data -> cont 172#;-	KW_Default -> cont 173#;-	KW_Deriving -> cont 174#;-	KW_Do -> cont 175#;-	KW_Else -> cont 176#;-	KW_Hiding -> cont 177#;-	KW_If -> cont 178#;-	KW_Import -> cont 179#;-	KW_In -> cont 180#;-	KW_Infix -> cont 181#;-	KW_InfixL -> cont 182#;-	KW_InfixR -> cont 183#;-	KW_Instance -> cont 184#;-	KW_Let -> cont 185#;-	KW_Module -> cont 186#;-	KW_NewType -> cont 187#;-	KW_Of -> cont 188#;-	KW_Then -> cont 189#;-	KW_Type -> cont 190#;-	KW_Where -> cont 191#;-	KW_Qualified -> cont 192#;-	_ -> happyError'-	})--happyError_ tk = happyError'--happyThen :: () => P a -> (a -> P b) -> P b-happyThen = (>>=)-happyReturn :: () => a -> P a-happyReturn = (return)-happyThen1 = happyThen-happyReturn1 :: () => a -> P a-happyReturn1 = happyReturn-happyError' :: () => P a-happyError' = happyError--parse = happySomeParser where-  happySomeParser = happyThen (happyParse action_0) (\x -> happyReturn (happyOut68 x))--happySeq = happyDoSeq--happyError :: P a-happyError = fail "Parse error"---- | Parse of a string, which should contain a complete Haskell 98 expression-parseExpr :: String -> ParseResult HsExp-parseExpr = runParser parse-{-# LINE 1 "GenericTemplate.hs" #-}-{-# LINE 1 "<built-in>" #-}-{-# LINE 1 "<command line>" #-}-{-# LINE 1 "GenericTemplate.hs" #-}--- Id: GenericTemplate.hs,v 1.26 2005/01/14 14:47:22 simonmar Exp ---{-# LINE 28 "GenericTemplate.hs" #-}------------------------{-# LINE 59 "GenericTemplate.hs" #-}-----------infixr 9 `HappyStk`-data HappyStk a = HappyStk a (HappyStk a)---------------------------------------------------------------------------------- starting the parse--happyParse start_state = happyNewToken start_state notHappyAtAll notHappyAtAll---------------------------------------------------------------------------------- Accepting the parse---- If the current token is 1#, it means we've just accepted a partial--- parse (a %partial parser).  We must ignore the saved token on the top of--- the stack in this case.-happyAccept 1# tk st sts (_ `HappyStk` ans `HappyStk` _) =-	happyReturn1 ans-happyAccept j tk st sts (HappyStk ans _) = -	(happyTcHack j ) (happyReturn1 ans)---------------------------------------------------------------------------------- Arrays only: do the next action--{-# LINE 155 "GenericTemplate.hs" #-}---------------------------------------------------------------------------------- HappyState data type (not arrays)----newtype HappyState b c = HappyState-        (Int# ->                    -- token number-         Int# ->                    -- token number (yes, again)-         b ->                           -- token semantic value-         HappyState b c ->              -- current state-         [HappyState b c] ->            -- state stack-         c)------------------------------------------------------------------------------------ Shifting a token--happyShift new_state 1# tk st sts stk@(x `HappyStk` _) =-     let i = (case unsafeCoerce# x of { (I# (i)) -> i }) in---     trace "shifting the error token" $-     new_state i i tk (HappyState (new_state)) ((st):(sts)) (stk)--happyShift new_state i tk st sts stk =-     happyNewToken new_state ((st):(sts)) ((happyInTok (tk))`HappyStk`stk)---- happyReduce is specialised for the common cases.--happySpecReduce_0 i fn 1# tk st sts stk-     = happyFail 1# tk st sts stk-happySpecReduce_0 nt fn j tk st@((HappyState (action))) sts stk-     = action nt j tk st ((st):(sts)) (fn `HappyStk` stk)--happySpecReduce_1 i fn 1# tk st sts stk-     = happyFail 1# tk st sts stk-happySpecReduce_1 nt fn j tk _ sts@(((st@(HappyState (action))):(_))) (v1`HappyStk`stk')-     = let r = fn v1 in-       happySeq r (action nt j tk st sts (r `HappyStk` stk'))--happySpecReduce_2 i fn 1# tk st sts stk-     = happyFail 1# tk st sts stk-happySpecReduce_2 nt fn j tk _ ((_):(sts@(((st@(HappyState (action))):(_))))) (v1`HappyStk`v2`HappyStk`stk')-     = let r = fn v1 v2 in-       happySeq r (action nt j tk st sts (r `HappyStk` stk'))--happySpecReduce_3 i fn 1# tk st sts stk-     = happyFail 1# tk st sts stk-happySpecReduce_3 nt fn j tk _ ((_):(((_):(sts@(((st@(HappyState (action))):(_))))))) (v1`HappyStk`v2`HappyStk`v3`HappyStk`stk')-     = let r = fn v1 v2 v3 in-       happySeq r (action nt j tk st sts (r `HappyStk` stk'))--happyReduce k i fn 1# tk st sts stk-     = happyFail 1# tk st sts stk-happyReduce k nt fn j tk st sts stk-     = case happyDrop (k -# (1# :: Int#)) sts of-	 sts1@(((st1@(HappyState (action))):(_))) ->-        	let r = fn stk in  -- it doesn't hurt to always seq here...-       		happyDoSeq r (action nt j tk st1 sts1 r)--happyMonadReduce k nt fn 1# tk st sts stk-     = happyFail 1# tk st sts stk-happyMonadReduce k nt fn j tk st sts stk =-        happyThen1 (fn stk) (\r -> action nt j tk st1 sts1 (r `HappyStk` drop_stk))-       where sts1@(((st1@(HappyState (action))):(_))) = happyDrop k ((st):(sts))-             drop_stk = happyDropStk k stk--happyDrop 0# l = l-happyDrop n ((_):(t)) = happyDrop (n -# (1# :: Int#)) t--happyDropStk 0# l = l-happyDropStk n (x `HappyStk` xs) = happyDropStk (n -# (1#::Int#)) xs---------------------------------------------------------------------------------- Moving to a new state after a reduction--{-# LINE 239 "GenericTemplate.hs" #-}-happyGoto action j tk st = action j j tk (HappyState action)----------------------------------------------------------------------------------- Error recovery (1# is the error token)---- parse error if we are in recovery and we fail again-happyFail  1# tk old_st _ stk =---	trace "failing" $ -    	happyError_ tk--{-  We don't need state discarding for our restricted implementation of-    "error".  In fact, it can cause some bogus parses, so I've disabled it-    for now --SDM---- discard a state-happyFail  1# tk old_st (((HappyState (action))):(sts)) -						(saved_tok `HappyStk` _ `HappyStk` stk) =---	trace ("discarding state, depth " ++ show (length stk))  $-	action 1# 1# tk (HappyState (action)) sts ((saved_tok`HappyStk`stk))--}---- Enter error recovery: generate an error token,---                       save the old token and carry on.-happyFail  i tk (HappyState (action)) sts stk =---      trace "entering error recovery" $-	action 1# 1# tk (HappyState (action)) sts ( (unsafeCoerce# (I# (i))) `HappyStk` stk)---- Internal happy errors:--notHappyAtAll = error "Internal Happy error\n"---------------------------------------------------------------------------------- Hack to get the typechecker to accept our action functions---happyTcHack :: Int# -> a -> a-happyTcHack x y = y-{-# INLINE happyTcHack #-}----------------------------------------------------------------------------------- Seq-ing.  If the --strict flag is given, then Happy emits ---	happySeq = happyDoSeq--- otherwise it emits--- 	happySeq = happyDontSeq--happyDoSeq, happyDontSeq :: a -> b -> b-happyDoSeq   a b = a `seq` b-happyDontSeq a b = b---------------------------------------------------------------------------------- Don't inline any functions from the template.  GHC has a nasty habit--- of deciding to inline happyGoto everywhere, which increases the size of--- the generated parser quite a bit.--{-# LINE 303 "GenericTemplate.hs" #-}-{-# NOINLINE happyShift #-}-{-# NOINLINE happySpecReduce_0 #-}-{-# NOINLINE happySpecReduce_1 #-}-{-# NOINLINE happySpecReduce_2 #-}-{-# NOINLINE happySpecReduce_3 #-}-{-# NOINLINE happyReduce #-}-{-# NOINLINE happyMonadReduce #-}-{-# NOINLINE happyGoto #-}-{-# NOINLINE happyFail #-}---- end of Happy Template.+-- Haskell expression parser.  Big hack, but only uses documented APIs so it+-- should be more robust than the previous hack.+module Lib.Parser (parseExpr, parseDecl, withParsed, prettyPrintInLine) where++import Control.Monad.Error () -- Monad Either instance+import Data.Char+import Data.Generics+import Language.Haskell.Syntax+import Language.Haskell.Parser+import Language.Haskell.Pretty+import Lib.FixPrecedence++parseExpr :: String -> Either String HsExp+parseExpr s+    | not (balanced 0 ' ' s) = Left "Unbalanced parentheses"+    | otherwise          = case parseModule wrapped of+        ParseOk (HsModule _ _ _ _ [HsPatBind _ _ (HsUnGuardedRhs e) _])+            -> Right $ fixPrecedence $ unparen e+        ParseFailed (SrcLoc _ _ col) msg+            -> Left $ showParseError msg (col - length prefix) s+  where+    prefix  = "module Main where { main = ("+    wrapped = prefix ++ s ++ "\n)}"+    +    unparen (HsParen e) = e+    unparen e           = e+    +    -- balanced (open-parentheses) (previous-character) (remaining-string)+    balanced :: Int -> Char -> String -> Bool+    balanced n _ ""           = n == 0+    balanced n _ ('(':cs)     =           balanced (n+1) '(' cs+    balanced n _ (')':cs)     = n > 0  && balanced (n-1) ')' cs+    balanced n p (c  :cs)+      | c `elem` "\"'" && (not  (isAlphaNum p) || c /= '\'')+                              =           balancedString c n cs+    balanced n p ('-':'-':_)+      | not (isSymbol p)      = n == 0+    balanced n _ ('{':'-':cs) =           balancedComment 1 n cs+    balanced n _ (c  :cs)     =           balanced n     c   cs+    +    balancedString :: Char -> Int -> String -> Bool+    balancedString _     n ""          = n == 0 -- the parse error will be reported by L.H.Parser+    balancedString delim n ('\\':c:cs)+      | isSpace c                      = case dropWhile isSpace cs of+                                            '\\':cs' -> balancedString delim n cs'+                                            cs'      -> balancedString delim n cs'+      | otherwise                      = balancedString delim n cs+    balancedString delim n (c     :cs)+      | delim == c                     = balanced n c cs+      | otherwise                      = balancedString delim n cs+   +    balancedComment :: Int -> Int -> String -> Bool+    balancedComment 0 n cs           = balanced n ' ' cs+    balancedComment _ _ ""           = True -- the parse error will be reported by L.H.Parser+    balancedComment m n ('{':'-':cs) = balancedComment (m+1) n cs+    balancedComment m n ('-':'}':cs) = balancedComment (m-1) n cs+    balancedComment m n (_      :cs) = balancedComment m     n cs+++parseDecl :: String -> Either String HsDecl+parseDecl s = case parseModule s of+        ParseOk (HsModule _ _ _ _ [d])   -> Right $ fixPrecedence d+        ParseFailed (SrcLoc _ _ col) msg -> Left $ showParseError msg col s++showParseError :: String -> Int -> String -> String+showParseError msg col s = " " ++ msg+                       ++ case (col < 0, drop (col - 1) s) of+                            (True, _) -> " at end of input" -- on the next line, which has no prefix+                            (_,[]   ) -> " at end of input"+                            (_,ctx  ) -> let ctx' = takeWhile (/= ' ') ctx+                                         in " at \"" ++ (take 5 ctx')+                                         ++ (if length ctx' > 5 then "..." else "")+                                         ++ "\" (column " ++ show col ++ ")"++-- Not really parsing++withParsed :: (forall a. (Data a, Eq a) => a -> a) -> String -> String+withParsed f s = case (parseExpr s, parseDecl s) of+                    (Right a, _) -> prettyPrintInLine $ f a+                    (_, Right a) -> prettyPrintInLine $ f a+                    (Left e,  _) -> e++prettyPrintInLine :: Pretty a => a -> String+prettyPrintInLine = prettyPrintWithMode (defaultMode { layout = PPInLine })
− Lib/Parser.ly
@@ -1,817 +0,0 @@-> {-> {-# OPTIONS -w #-}-> ------------------------------------------------------------------------------> -- |-> -- Module      :  Lib.Haskell.Parser-> -- Copyright   :  (c) Simon Marlow, Sven Panne 1997-2000-> -- License     :  BSD-style (see the file libraries/base/LICENSE)-> ---> -- Maintainer  :  libraries@haskell.org-> -- Stability   :  experimental-> -- Portability :  portable-> ---> -- Haskell parser, modified to be provide an expression parser.-> ---> ------------------------------------------------------------------------------>-> module Lib.Parser (->               parseExpr,->               ParseMode(..), defaultParseMode, ParseResult(..)) where->-> import Language.Haskell.Syntax-> import Language.Haskell.ParseMonad-> import Language.Haskell.Lexer-> import Language.Haskell.ParseUtils-> }--ToDo: Check exactly which names must be qualified with Prelude (commas and friends)-ToDo: Inst (MPCs?)-ToDo: Polish constr a bit-ToDo: Ugly: exp0b is used for lhs, pat, exp0, ...-ToDo: Differentiate between record updates and labeled construction.--------------------------------------------------------------------------------Conflicts: 2 shift/reduce--2 for ambiguity in 'case x of y | let z = y in z :: Bool -> b'-        (don't know whether to reduce 'Bool' as a btype or shift the '->'.-         Similarly lambda and if.  The default resolution in favour of the-         shift means that a guard can never end with a type signature.-         In mitigation: it's a rare case and no Haskell implementation-         allows these, because it would require unbounded lookahead.)-        There are 2 conflicts rather than one because contexts are parsed-        as btypes (cf ctype).---------------------------------------------------------------------------------> %token->       VARID    { VarId $$ }->       QVARID   { QVarId $$ }->       CONID    { ConId $$ }->       QCONID   { QConId $$ }->       VARSYM   { VarSym $$ }->       CONSYM   { ConSym $$ }->       QVARSYM  { QVarSym $$ }->       QCONSYM  { QConSym $$ }->       INT      { IntTok $$ }->       RATIONAL { FloatTok $$ }->       CHAR     { Character $$ }->       STRING   { StringTok $$ }--Symbols-->       '('     { LeftParen }->       ')'     { RightParen }->       ';'     { SemiColon }->       '{'     { LeftCurly }->       '}'     { RightCurly }->       vccurly { VRightCurly }                 -- a virtual close brace->       '['     { LeftSquare }->       ']'     { RightSquare }->       ','     { Comma }->       '_'     { Underscore }->       '`'     { BackQuote }--Reserved operators-->       '..'    { DotDot }->       ':'     { Colon }->       '::'    { DoubleColon }->       '='     { Equals }->       '\\'    { Backslash }->       '|'     { Bar }->       '<-'    { LeftArrow }->       '->'    { RightArrow }->       '@'     { At }->       '~'     { Tilde }->       '=>'    { DoubleArrow }->       '-'     { Minus }->       '!'     { Exclamation }--Reserved Ids-->       'as'            { KW_As }->       'case'          { KW_Case }->       'class'         { KW_Class }->       'data'          { KW_Data }->       'default'       { KW_Default }->       'deriving'      { KW_Deriving }->       'do'            { KW_Do }->       'else'          { KW_Else }->       'hiding'        { KW_Hiding }->       'if'            { KW_If }->       'import'        { KW_Import }->       'in'            { KW_In }->       'infix'         { KW_Infix }->       'infixl'        { KW_InfixL }->       'infixr'        { KW_InfixR }->       'instance'      { KW_Instance }->       'let'           { KW_Let }->       'module'        { KW_Module }->       'newtype'       { KW_NewType }->       'of'            { KW_Of }->       'then'          { KW_Then }->       'type'          { KW_Type }->       'where'         { KW_Where }->       'qualified'     { KW_Qualified }--> %monad { P }-> %lexer { lexer } { EOF }-> %name parse exp-> %tokentype { Token }-> %%--------------------------------------------------------------------------------Module Header--> module :: { HsModule }->       : srcloc 'module' modid maybeexports 'where' body->               { HsModule $1 $3 $4 (fst $6) (snd $6) }->       | srcloc body->               { HsModule $1 main_mod (Just [HsEVar (UnQual main_name)])->                                                       (fst $2) (snd $2) }--> body :: { ([HsImportDecl],[HsDecl]) }->       : '{'  bodyaux '}'                      { $2 }->       | open bodyaux close                    { $2 }--> bodyaux :: { ([HsImportDecl],[HsDecl]) }->       : optsemis impdecls semis topdecls      { (reverse $2, $4) }->       | optsemis                topdecls      { ([], $2) }->       | optsemis impdecls optsemis            { (reverse $2, []) }->       | optsemis                              { ([], []) }--> semis :: { () }->       : optsemis ';'                          { () }--> optsemis :: { () }->       : semis                                 { () }->       | {- empty -}                           { () }--------------------------------------------------------------------------------The Export List--> maybeexports :: { Maybe [HsExportSpec] }->       :  exports                              { Just $1 }->       |  {- empty -}                          { Nothing }--> exports :: { [HsExportSpec] }->       : '(' exportlist optcomma ')'           { reverse $2 }->       | '(' optcomma ')'                      { [] }--> optcomma :: { () }->       : ','                                   { () }->       | {- empty -}                           { () }--> exportlist :: { [HsExportSpec] }->       :  exportlist ',' export                { $3 : $1 }->       |  export                               { [$1]  }--> export :: { HsExportSpec }->       :  qvar                                 { HsEVar $1 }->       |  qtyconorcls                          { HsEAbs $1 }->       |  qtyconorcls '(' '..' ')'             { HsEThingAll $1 }->       |  qtyconorcls '(' ')'                  { HsEThingWith $1 [] }->       |  qtyconorcls '(' cnames ')'           { HsEThingWith $1 (reverse $3) }->       |  'module' modid                       { HsEModuleContents $2 }--------------------------------------------------------------------------------Import Declarations--> impdecls :: { [HsImportDecl] }->       : impdecls semis impdecl                { $3 : $1 }->       | impdecl                               { [$1] }--> impdecl :: { HsImportDecl }->       : srcloc 'import' optqualified modid maybeas maybeimpspec->                               { HsImportDecl $1 $4 $3 $5 $6 }--> optqualified :: { Bool }->       : 'qualified'                           { True  }->       | {- empty -}                           { False }--> maybeas :: { Maybe Module }->       : 'as' modid                            { Just $2 }->       | {- empty -}                           { Nothing }---> maybeimpspec :: { Maybe (Bool, [HsImportSpec]) }->       : impspec                               { Just $1 }->       | {- empty -}                           { Nothing }--> impspec :: { (Bool, [HsImportSpec]) }->       : opthiding '(' importlist optcomma ')' { ($1, reverse $3) }->       | opthiding '(' optcomma ')'            { ($1, []) }--> opthiding :: { Bool }->       : 'hiding'                              { True }->       | {- empty -}                           { False }--> importlist :: { [HsImportSpec] }->       :  importlist ',' importspec            { $3 : $1 }->       |  importspec                           { [$1]  }--> importspec :: { HsImportSpec }->       :  var                                  { HsIVar $1 }->       |  tyconorcls                           { HsIAbs $1 }->       |  tyconorcls '(' '..' ')'              { HsIThingAll $1 }->       |  tyconorcls '(' ')'                   { HsIThingWith $1 [] }->       |  tyconorcls '(' cnames ')'            { HsIThingWith $1 (reverse $3) }--> cnames :: { [HsCName] }->       :  cnames ',' cname                     { $3 : $1 }->       |  cname                                { [$1]  }--> cname :: { HsCName }->       :  var                                  { HsVarName $1 }->       |  con                                  { HsConName $1 }--------------------------------------------------------------------------------Fixity Declarations--> fixdecl :: { HsDecl }->       : srcloc infix prec ops                 { HsInfixDecl $1 $2 $3 (reverse $4) }--> prec :: { Int }->       : {- empty -}                           { 9 }->       | INT                                   {% checkPrec $1 }--> infix :: { HsAssoc }->       : 'infix'                               { HsAssocNone  }->       | 'infixl'                              { HsAssocLeft  }->       | 'infixr'                              { HsAssocRight }--> ops   :: { [HsOp] }->       : ops ',' op                            { $3 : $1 }->       | op                                    { [$1] }--------------------------------------------------------------------------------Top-Level Declarations--Note: The report allows topdecls to be empty. This would result in another-shift/reduce-conflict, so we don't handle this case here, but in bodyaux.--> topdecls :: { [HsDecl] }->       : topdecls1 optsemis            {% checkRevDecls $1 }--> topdecls1 :: { [HsDecl] }->       : topdecls1 semis topdecl       { $3 : $1 }->       | topdecl                       { [$1] }--> topdecl :: { HsDecl }->       : srcloc 'type' simpletype '=' type->                       { HsTypeDecl $1 (fst $3) (snd $3) $5 }->       | srcloc 'data' ctype '=' constrs deriving->                       {% do { (cs,c,t) <- checkDataHeader $3;->                               return (HsDataDecl $1 cs c t (reverse $5) $6) } }->       | srcloc 'newtype' ctype '=' constr deriving->                       {% do { (cs,c,t) <- checkDataHeader $3;->                               return (HsNewTypeDecl $1 cs c t $5 $6) } }->       | srcloc 'class' ctype optcbody->                       {% do { (cs,c,vs) <- checkClassHeader $3;->                               return (HsClassDecl $1 cs c vs $4) } }->       | srcloc 'instance' ctype optvaldefs->                       {% do { (cs,c,ts) <- checkInstHeader $3;->                               return (HsInstDecl $1 cs c ts $4) } }->       | srcloc 'default' '(' typelist ')'->                       { HsDefaultDecl $1 $4 }->       | decl          { $1 }--> typelist :: { [HsType] }->       : types                         { reverse $1 }->       | type                          { [$1] }->       | {- empty -}                   { [] }--> decls :: { [HsDecl] }->       : optsemis decls1 optsemis      {% checkRevDecls $2 }->       | optsemis                      { [] }--> decls1 :: { [HsDecl] }->       : decls1 semis decl             { $3 : $1 }->       | decl                          { [$1] }--> decl :: { HsDecl }->       : signdecl                      { $1 }->       | fixdecl                       { $1 }->       | valdef                        { $1 }--> decllist :: { [HsDecl] }->       : '{'  decls '}'                { $2 }->       | open decls close              { $2 }--> signdecl :: { HsDecl }->       : srcloc vars '::' ctype        { HsTypeSig $1 (reverse $2) $4 }--ATTENTION: Dirty Hackery Ahead! If the second alternative of vars is var-instead of qvar, we get another shift/reduce-conflict. Consider the-following programs:--   { (+) :: ... }          only var-   { (+) x y  = ... }      could (incorrectly) be qvar--We re-use expressions for patterns, so a qvar would be allowed in patterns-instead of a var only (which would be correct). But deciding what the + is,-would require more lookahead. So let's check for ourselves...--> vars  :: { [HsName] }->       : vars ',' var                  { $3 : $1 }->       | qvar                          {% do { n <- checkUnQual $1;->                                               return [n] } }--------------------------------------------------------------------------------Types--> type :: { HsType }->       : btype '->' type               { HsTyFun $1 $3 }->       | btype                         { $1 }--> btype :: { HsType }->       : btype atype                   { HsTyApp $1 $2 }->       | atype                         { $1 }--> atype :: { HsType }->       : gtycon                        { HsTyCon $1 }->       | tyvar                         { HsTyVar $1 }->       | '(' types ')'                 { HsTyTuple (reverse $2) }->       | '[' type ']'                  { HsTyApp list_tycon $2 }->       | '(' type ')'                  { $2 }--> gtycon :: { HsQName }->       : qconid                        { $1 }->       | '(' ')'                       { unit_tycon_name }->       | '(' '->' ')'                  { fun_tycon_name }->       | '[' ']'                       { list_tycon_name }->       | '(' commas ')'                { tuple_tycon_name $2 }---(Slightly edited) Comment from GHC's hsparser.y:-"context => type" vs  "type" is a problem, because you can't distinguish between--        foo :: (Baz a, Baz a)-        bar :: (Baz a, Baz a) => [a] -> [a] -> [a]--with one token of lookahead.  The HACK is to parse the context as a btype-(more specifically as a tuple type), then check that it has the right form-C a, or (C1 a, C2 b, ... Cn z) and convert it into a context.  Blaach!--> ctype :: { HsQualType }->       : context '=>' type             { HsQualType $1 $3 }->       | type                          { HsQualType [] $1 }--> context :: { HsContext }->       : btype                         {% checkContext $1 }--> types :: { [HsType] }->       : types ',' type                { $3 : $1 }->       | type  ',' type                { [$3, $1] }--> simpletype :: { (HsName, [HsName]) }->       : tycon tyvars                  { ($1,reverse $2) }--> tyvars :: { [HsName] }->       : tyvars tyvar                  { $2 : $1 }->       | {- empty -}                   { [] }--------------------------------------------------------------------------------Datatype declarations--> constrs :: { [HsConDecl] }->       : constrs '|' constr            { $3 : $1 }->       | constr                        { [$1] }--> constr :: { HsConDecl }->       : srcloc scontype               { HsConDecl $1 (fst $2) (snd $2) }->       | srcloc sbtype conop sbtype    { HsConDecl $1 $3 [$2,$4] }->       | srcloc con '{' '}'            { HsRecDecl $1 $2 [] }->       | srcloc con '{' fielddecls '}' { HsRecDecl $1 $2 (reverse $4) }--> scontype :: { (HsName, [HsBangType]) }->       : btype                         {% do { (c,ts) <- splitTyConApp $1;->                                               return (c,map HsUnBangedTy ts) } }->       | scontype1                     { $1 }--> scontype1 :: { (HsName, [HsBangType]) }->       : btype '!' atype               {% do { (c,ts) <- splitTyConApp $1;->                                               return (c,map HsUnBangedTy ts++->                                                       [HsBangedTy $3]) } }->       | scontype1 satype              { (fst $1, snd $1 ++ [$2] ) }--> satype :: { HsBangType }->       : atype                         { HsUnBangedTy $1 }->       | '!' atype                     { HsBangedTy   $2 }--> sbtype :: { HsBangType }->       : btype                         { HsUnBangedTy $1 }->       | '!' atype                     { HsBangedTy   $2 }--> fielddecls :: { [([HsName],HsBangType)] }->       : fielddecls ',' fielddecl      { $3 : $1 }->       | fielddecl                     { [$1] }--> fielddecl :: { ([HsName],HsBangType) }->       : vars '::' stype               { (reverse $1, $3) }--> stype :: { HsBangType }->       : type                          { HsUnBangedTy $1 }     ->       | '!' atype                     { HsBangedTy   $2 }--> deriving :: { [HsQName] }->       : {- empty -}                   { [] }->       | 'deriving' qtycls             { [$2] }->       | 'deriving' '('          ')'   { [] }->       | 'deriving' '(' dclasses ')'   { reverse $3 }--> dclasses :: { [HsQName] }->       : dclasses ',' qtycls           { $3 : $1 }->       | qtycls                        { [$1] }--------------------------------------------------------------------------------Class declarations--> optcbody :: { [HsDecl] }->       : 'where' decllist              {% checkClassBody $2 }->       | {- empty -}                   { [] }--------------------------------------------------------------------------------Instance declarations--> optvaldefs :: { [HsDecl] }->       : 'where' '{'  valdefs '}'      {% checkClassBody $3 }->       | 'where' open valdefs close    {% checkClassBody $3 }->       | {- empty -}                   { [] }--> valdefs :: { [HsDecl] }->       : optsemis valdefs1 optsemis    {% checkRevDecls $2 }->       | optsemis                      { [] }--> valdefs1 :: { [HsDecl] }->       : valdefs1 semis valdef         { $3 : $1 }->       | valdef                        { [$1] }--------------------------------------------------------------------------------Value definitions--> valdef :: { HsDecl }->       : srcloc exp0b rhs optwhere     {% checkValDef $1 $2 $3 $4 }--> optwhere :: { [HsDecl] }->       : 'where' decllist              { $2 }->       | {- empty -}                   { [] }--> rhs   :: { HsRhs }->       : '=' exp                       {% do { e <- checkExpr $2;->                                               return (HsUnGuardedRhs e) } }->       | gdrhs                         { HsGuardedRhss  (reverse $1) }--> gdrhs :: { [HsGuardedRhs] }->       : gdrhs gdrh                    { $2 : $1 }->       | gdrh                          { [$1] }--> gdrh :: { HsGuardedRhs }->       : srcloc '|' exp0 '=' exp       {% do { g <- checkExpr $3;->                                               e <- checkExpr $5;->                                               return (HsGuardedRhs $1 g e) } }--------------------------------------------------------------------------------Expressions--Note: The Report specifies a meta-rule for lambda, let and if expressions-(the exp's that end with a subordinate exp): they extend as far to-the right as possible.  That means they cannot be followed by a type-signature or infix application.  To implement this without shift/reduce-conflicts, we split exp10 into these expressions (exp10a) and the others-(exp10b).  That also means that only an exp0 ending in an exp10b (an exp0b)-can followed by a type signature or infix application.  So we duplicate-the exp0 productions to distinguish these from the others (exp0a).--> exp   :: { HsExp }->       : exp0b '::' srcloc ctype       { HsExpTypeSig $3 $1 $4 }->       | exp0                          { $1 }--> exp0 :: { HsExp }->       : exp0a                         { $1 }->       | exp0b                         { $1 }--> exp0a :: { HsExp }->       : exp0b qop exp10a              { HsInfixApp $1 $2 $3 }->       | exp10a                        { $1 }--> exp0b :: { HsExp }->       : exp0b qop exp10b              { HsInfixApp $1 $2 $3 }->       | exp10b                        { $1 }--> exp10a :: { HsExp }->       : '\\' srcloc apats '->' exp    { HsLambda $2 (reverse $3) $5 }->       | 'let' decllist 'in' exp       { HsLet $2 $4 }->       | 'if' exp 'then' exp 'else' exp { HsIf $2 $4 $6 }--> exp10b :: { HsExp }->       : 'case' exp 'of' altslist      { HsCase $2 $4 }->       | '-' fexp                      { HsNegApp $2 }->       | 'do' stmtlist                 { HsDo $2 }->       | fexp                          { $1 }--> fexp :: { HsExp }->       : fexp aexp                     { HsApp $1 $2 }->       | aexp                          { $1 }--> apats :: { [HsPat] }->       : apats apat                    { $2 : $1 }->       | apat                          { [$1] }--> apat :: { HsPat }->       : aexp                          {% checkPattern $1 }--UGLY: Because patterns and expressions are mixed, aexp has to be split into-two rules: One right-recursive and one left-recursive. Otherwise we get two-reduce/reduce-errors (for as-patterns and irrefutable patters).--Even though the variable in an as-pattern cannot be qualified, we use-qvar here to avoid a shift/reduce conflict, and then check it ourselves-(as for vars above).--> aexp  :: { HsExp }->       : qvar '@' aexp                 {% do { n <- checkUnQual $1;->                                               return (HsAsPat n $3) } }->       | '~' aexp                      { HsIrrPat $2 }->       | aexp1                         { $1 }--Note: The first two alternatives of aexp1 are not necessarily record-updates: they could be labeled constructions.--> aexp1 :: { HsExp }->       : aexp1 '{' '}'                 {% mkRecConstrOrUpdate $1 [] }->       | aexp1 '{' fbinds '}'          {% mkRecConstrOrUpdate $1 (reverse $3) }->       | aexp2                         { $1 }--According to the Report, the left section (e op) is legal iff (e op x)-parses equivalently to ((e) op x).  Thus e must be an exp0b.--> aexp2 :: { HsExp }->       : qvar                          { HsVar $1 }->       | gcon                          { $1 }->       | literal                       { HsLit $1 }->       | '(' exp ')'                   { HsParen $2 }->       | '(' texps ')'                 { HsTuple (reverse $2) }->       | '[' list ']'                  { $2 }->       | '(' exp0b qop ')'             { HsLeftSection $2 $3  }->       | '(' qopm exp0 ')'             { HsRightSection $2 $3 }->       | '_'                           { HsWildCard }--> commas :: { Int }->       : commas ','                    { $1 + 1 }->       | ','                           { 1 }--> texps :: { [HsExp] }->       : texps ',' exp                 { $3 : $1 }->       | exp ',' exp                   { [$3,$1] }--------------------------------------------------------------------------------List expressions--The rules below are little bit contorted to keep lexps left-recursive while-avoiding another shift/reduce-conflict.--> list :: { HsExp }->       : exp                           { HsList [$1] }->       | lexps                         { HsList (reverse $1) }->       | exp '..'                      { HsEnumFrom $1 }->       | exp ',' exp '..'              { HsEnumFromThen $1 $3 }->       | exp '..' exp                  { HsEnumFromTo $1 $3 }->       | exp ',' exp '..' exp          { HsEnumFromThenTo $1 $3 $5 }->       | exp '|' quals                 { HsListComp $1 (reverse $3) }--> lexps :: { [HsExp] }->       : lexps ',' exp                 { $3 : $1 }->       | exp ',' exp                   { [$3,$1] }--------------------------------------------------------------------------------List comprehensions--> quals :: { [HsStmt] }->       : quals ',' qual                { $3 : $1 }->       | qual                          { [$1] }--> qual  :: { HsStmt }->       : pat srcloc '<-' exp           { HsGenerator $2 $1 $4 }->       | exp                           { HsQualifier $1 }->       | 'let' decllist                { HsLetStmt $2 }--------------------------------------------------------------------------------Case alternatives--> altslist :: { [HsAlt] }->       : '{'  alts '}'                 { $2 }->       | open alts close               { $2 }--> alts :: { [HsAlt] }->       : optsemis alts1 optsemis       { reverse $2 }--> alts1 :: { [HsAlt] }->       : alts1 semis alt               { $3 : $1 }->       | alt                           { [$1] }--> alt :: { HsAlt }->       : srcloc pat ralt optwhere      { HsAlt $1 $2 $3 $4 }--> ralt :: { HsGuardedAlts }->       : '->' exp                      { HsUnGuardedAlt $2 }->       | gdpats                        { HsGuardedAlts (reverse $1) }--> gdpats :: { [HsGuardedAlt] }->       : gdpats gdpat                  { $2 : $1 }->       | gdpat                         { [$1] }--> gdpat :: { HsGuardedAlt }->       : srcloc '|' exp0 '->' exp      { HsGuardedAlt $1 $3 $5 }--> pat :: { HsPat }->       : exp0b                         {% checkPattern $1 }--------------------------------------------------------------------------------Statement sequences--As per the Report, but with stmt expanded to simplify building the list-without introducing conflicts.  This also ensures that the last stmt is-an expression.--> stmtlist :: { [HsStmt] }->       : '{'  stmts '}'                { $2 }->       | open stmts close              { $2 }--> stmts :: { [HsStmt] }->       : 'let' decllist ';' stmts      { HsLetStmt $2 : $4 }->       | pat srcloc '<-' exp ';' stmts { HsGenerator $2 $1 $4 : $6 }->       | exp ';' stmts                 { HsQualifier $1 : $3 }->       | ';' stmts                     { $2 }->       | exp ';'                       { [HsQualifier $1] }->       | exp                           { [HsQualifier $1] }--------------------------------------------------------------------------------Record Field Update/Construction--> fbinds :: { [HsFieldUpdate] }->       : fbinds ',' fbind              { $3 : $1 }->       | fbind                         { [$1] }--> fbind :: { HsFieldUpdate }->       : qvar '=' exp                  { HsFieldUpdate $1 $3 }--------------------------------------------------------------------------------Variables, Constructors and Operators.--> gcon :: { HsExp }->       : '(' ')'               { unit_con }->       | '[' ']'               { HsList [] }->       | '(' commas ')'        { tuple_con $2 }->       | qcon                  { HsCon $1 }--> var   :: { HsName }->       : varid                 { $1 }->       | '(' varsym ')'        { $2 }--> qvar  :: { HsQName }->       : qvarid                { $1 }->       | '(' qvarsym ')'       { $2 }--> con   :: { HsName }->       : conid                 { $1 }->       | '(' consym ')'        { $2 }--> qcon  :: { HsQName }->       : qconid                { $1 }->       | '(' gconsym ')'       { $2 }--> varop :: { HsName }->       : varsym                { $1 }->       | '`' varid '`'         { $2 }--> qvarop :: { HsQName }->       : qvarsym               { $1 }->       | '`' qvarid '`'        { $2 }--> qvaropm :: { HsQName }->       : qvarsymm              { $1 }->       | '`' qvarid '`'        { $2 }--> conop :: { HsName }->       : consym                { $1 }  ->       | '`' conid '`'         { $2 }--> qconop :: { HsQName }->       : gconsym               { $1 }->       | '`' qconid '`'        { $2 }--> op    :: { HsOp }->       : varop                 { HsVarOp $1 }->       | conop                 { HsConOp $1 }--> qop   :: { HsQOp }->       : qvarop                { HsQVarOp $1 }->       | qconop                { HsQConOp $1 }--> qopm  :: { HsQOp }->       : qvaropm               { HsQVarOp $1 }->       | qconop                { HsQConOp $1 }--> gconsym :: { HsQName }->       : ':'                   { list_cons_name }->       | qconsym               { $1 }--------------------------------------------------------------------------------Identifiers and Symbols--> qvarid :: { HsQName }->       : varid                 { UnQual $1 }->       | QVARID                { Qual (Module (fst $1)) (HsIdent (snd $1)) }--> varid :: { HsName }->       : VARID                 { HsIdent $1 }->       | 'as'                  { as_name }->       | 'qualified'           { qualified_name }->       | 'hiding'              { hiding_name }--> qconid :: { HsQName }->       : conid                 { UnQual $1 }->       | QCONID                { Qual (Module (fst $1)) (HsIdent (snd $1)) }--> conid :: { HsName }->       : CONID                 { HsIdent $1 }--> qconsym :: { HsQName }->       : consym                { UnQual $1 }->       | QCONSYM               { Qual (Module (fst $1)) (HsSymbol (snd $1)) }--> consym :: { HsName }->       : CONSYM                { HsSymbol $1 }--> qvarsym :: { HsQName }->       : varsym                { UnQual $1 }->       | qvarsym1              { $1 }--> qvarsymm :: { HsQName }->       : varsymm               { UnQual $1 }->       | qvarsym1              { $1 }--> varsym :: { HsName }->       : VARSYM                { HsSymbol $1 }->       | '-'                   { minus_name }->       | '!'                   { pling_name }--> varsymm :: { HsName } -- varsym not including '-'->       : VARSYM                { HsSymbol $1 }->       | '!'                   { pling_name }--> qvarsym1 :: { HsQName }->       : QVARSYM               { Qual (Module (fst $1)) (HsSymbol (snd $1)) }--> literal :: { HsLiteral }->       : INT                   { HsInt $1 }->       | CHAR                  { HsChar $1 }->       | RATIONAL              { HsFrac $1 }->       | STRING                { HsString $1 }--> srcloc :: { SrcLoc }  :       {% getSrcLoc }- -------------------------------------------------------------------------------Layout--> open  :: { () }       :       {% pushCurrentContext }--> close :: { () }->       : vccurly               { () } -- context popped in lexer.->       | error                 {% popContext }--------------------------------------------------------------------------------Miscellaneous (mostly renamings)--> modid :: { Module }->       : CONID                 { Module $1 }->       | QCONID                { Module (fst $1 ++ '.':snd $1) }--> tyconorcls :: { HsName }->       : conid                 { $1 }--> tycon :: { HsName }->       : conid                 { $1 }--> qtyconorcls :: { HsQName }->       : qconid                { $1 }--> qtycls :: { HsQName }->       : qconid                { $1 }--> tyvar :: { HsName }->       : varid                 { $1 }---------------------------------------------------------------------------------> {-> happyError :: P a-> happyError = fail "Parse error"--> -- | Parse of a string, which should contain a complete Haskell 98 expression-> parseExpr :: String -> ParseResult HsExp-> parseExpr = runParser parse--> }
+ Lib/Pointful.hs view
@@ -0,0 +1,172 @@+{-# OPTIONS -fno-warn-missing-signatures #-}+module Lib.Pointful (pointful, ParseResult(..), test, main, combinatorModule) where++import Lib.Parser+import Language.Haskell.Parser+import Language.Haskell.Syntax+import Data.Generics+import Control.Monad.State+import Data.Maybe+import qualified Data.Map as M++---- Utilities ----++extT' :: (Typeable a, Typeable b) => (a -> a) -> (b -> b) -> a -> a+extT' = extT+infixl `extT'`++unkLoc = SrcLoc "<new>" 1 1++stabilize f x = let x' = f x in if x' == x then x else stabilize f x'++namesIn h = everything (++) (mkQ [] (\x -> case x of UnQual name -> [name]; _ -> [])) h+pVarsIn h = everything (++) (mkQ [] (\x -> case x of HsPVar name -> [name]; _ -> [])) h++succName (HsIdent s) = HsIdent . reverse . succAlpha . reverse $ s++succAlpha ('z':xs) = 'a' : succAlpha xs+succAlpha (x  :xs) = succ x : xs+succAlpha []       = "a"++---- Optimization (removing explicit lambdas) and restoration of infix ops ----++-- move lambda patterns into LHS+optimizeD (HsPatBind loc (HsPVar fname) (HsUnGuardedRhs (HsLambda _ pats rhs)) [])+        =  HsFunBind [HsMatch loc fname pats (HsUnGuardedRhs rhs) []]+---- combine function binding and lambda+optimizeD (HsFunBind [HsMatch loc fname pats1 (HsUnGuardedRhs (HsLambda _ pats2 rhs)) []])+        =  HsFunBind [HsMatch loc fname (pats1 ++ pats2) (HsUnGuardedRhs rhs) []]+optimizeD x = x++-- remove parens+optimizeRhs (HsUnGuardedRhs (HsParen x))+          =  HsUnGuardedRhs x+optimizeRhs x = x++optimizeE :: HsExp -> HsExp+-- apply ((\x z -> ...x...) y) yielding (\z -> ...y...) if there is only one x or y is simple+optimizeE (HsApp (HsParen (HsLambda loc (HsPVar ident : pats) body)) arg) | single || simple+        = HsParen (HsLambda loc pats (everywhere (mkT (\x -> if x == (HsVar (UnQual ident)) then arg else x)) body))+  where single = gcount (mkQ False (== ident)) body == 1+        simple = case arg of HsVar _ -> True; _ -> False+-- apply ((\_ z -> ...) y) yielding (\z -> ...)+optimizeE (HsApp (HsParen (HsLambda loc (HsPWildCard : pats) body)) _)+        = HsParen (HsLambda loc pats body)+-- remove 0-arg lambdas resulting from application rules+optimizeE (HsLambda _ [] b)+        = b+-- replace (\x -> \y -> z) with (\x y -> z)+optimizeE (HsLambda loc p1 (HsLambda _ p2 body))+        = HsLambda loc (p1 ++ p2) body+-- remove double parens+optimizeE (HsParen (HsParen x))+        = HsParen x+-- remove lambda body parens+optimizeE (HsLambda l p (HsParen x))+        = HsLambda l p x+-- remove var, lit parens+optimizeE (HsParen x@(HsVar _))+        = x+optimizeE (HsParen x@(HsLit _))+        = x+-- remove infix+lambda parens+optimizeE (HsInfixApp a o (HsParen l@(HsLambda _ _ _)))+        = HsInfixApp a o l+-- remove left-assoc application parens+optimizeE (HsApp (HsParen (HsApp a b)) c)+        = HsApp (HsApp a b) c+-- restore infix+optimizeE (HsApp (HsApp (HsVar name@(UnQual (HsSymbol _))) l) r)+        = (HsInfixApp l (HsQVarOp name) r)+-- fail+optimizeE x = x++---- Decombinatorization ----++-- fresh name generation. TODO: prettify this+fresh = do (_,    used) <- get+           modify (\(v,u) -> (until (not . (`elem` used)) succName (succName v), u))+           (name, _) <- get+           return name++-- rename all lambda-bound variables. TODO: rewrite lets as well+rename = do everywhereM (mkM (\e -> case e of +              (HsLambda _ ps _) -> do+                let pVars = concatMap pVarsIn ps+                newVars <- mapM (const fresh) pVars+                let replacements = zip pVars newVars+                return (everywhere (mkT (\n -> fromMaybe n (lookup n replacements))) e)+              _ -> return e))++uncomb' :: HsExp -> State (HsName, [HsName]) HsExp++-- expand plain combinators+uncomb' (HsVar qname) | isJust maybeDef = rename (fromJust maybeDef)+  where maybeDef = M.lookup qname combinators++-- eliminate sections+uncomb' (HsRightSection op arg)+  = do a <- fresh+       return (HsParen (HsLambda unkLoc [HsPVar a] (HsInfixApp (HsVar (UnQual a)) op arg)))+uncomb' (HsLeftSection arg op)+  = do a <- fresh+       return (HsParen (HsLambda unkLoc [HsPVar a] (HsInfixApp arg op (HsVar (UnQual a)))))+-- infix to prefix for canonicality+uncomb' (HsInfixApp lf (HsQVarOp name) rf)+  = return (HsParen (HsApp (HsApp (HsVar name) (HsParen lf)) (HsParen rf)))++-- fail+uncomb' expr = return expr++---- Simple combinator definitions ---++combinators = M.fromList $ map declToTuple defs+  where defs = case parseModule combinatorModule of+          ParseOk (HsModule _ _ _ _ d) -> d+          f@(ParseFailed _ _) -> error ("Combinator loading: " ++ show f)+        declToTuple (HsPatBind _ (HsPVar fname) (HsUnGuardedRhs body) [])+          = (UnQual fname, HsParen body)++-- the names we recognize as combinators, so we don't generate them as temporaries then substitute them.+-- TODO: more generally correct would be to not substitute any variable which is bound by a pattern+recognizedNames = map (\(UnQual n) -> n) $ M.keys combinators++combinatorModule = unlines [+  "(.)    = \\f g x -> f (g x)                                          ",+  "($)    = \\f x   -> f x                                              ",+  "flip   = \\f x y -> f y x                                            ",+  "const  = \\x _ -> x                                                  ",+  "id     = \\x -> x                                                    ",+  "(=<<)  = flip (>>=)                                                  ",+  "liftM2 = \\f m1 m2 -> m1 >>= \\x1 -> m2 >>= \\x2 -> return (f x1 x2) ",+  "join   = (>>= id)                                                    ",+  "ap     = liftM2 id                                                   ",+  "                                                                     ",+  "-- ASSUMED reader monad                                              ",+  "-- (>>=)  = (\\f k r -> k (f r) r)                                   ",+  "-- return = const                                                    ",+  ""]++---- Top level ----++uncombOnce :: (Data a) => a -> a+uncombOnce x = evalState (everywhereM (mkM uncomb') x) (HsIdent "`", namesIn x ++ recognizedNames)+uncomb :: (Eq a, Data a) => a -> a+uncomb = stabilize uncombOnce++optimizeOnce :: (Data a) => a -> a+optimizeOnce x = everywhere (mkT optimizeD `extT'` optimizeRhs `extT'` optimizeE) x+optimize :: (Eq a, Data a) => a -> a+optimize = stabilize optimizeOnce++pointful = withParsed (optimize . uncomb)++test s = case parseModule s of+  f@(ParseFailed _ _) -> fail (show f)+  ParseOk (HsModule _ _ _ _ defs) -> +    flip mapM_ defs $ \def -> do+      putStrLn . prettyPrintInLine  $ def+      putStrLn . prettyPrintInLine  . uncomb $ def+      putStrLn . prettyPrintInLine  . optimize . uncomb $ def++main = test "f = tail . head; g = head . tail; h = tail + tail; three = g . h . i; dontSub = (\\x -> x + x) 1; ofHead f = f . head; fm = flip mapM_ xs (\\x -> g x); po = (+1); op = (1+); g = (. f); stabilize = fix (ap . flip (ap . (flip =<< (if' .) . (==))) =<<)"
Lib/Process.hs view
@@ -4,15 +4,26 @@ -- -- | A Posix.popen compatibility mapping. ---module Lib.Process (popen) where+module Lib.Process (popen, run) where  import System.Exit import System.IO import System.Process-import Control.Concurrent       (forkIO)+import Control.Concurrent       (forkIO, newEmptyMVar, putMVar, takeMVar)  import qualified Control.Exception +run :: FilePath -> String -> (String -> String) -> IO String+run binary src scrub = do+    (out,err,_) <- popen binary [] (Just src)+    let o = scrub out+        e = scrub err+    return $ case () of {_+        | null o && null e -> "Done."+        | null o           -> e+        | otherwise        -> o+    }+ -- -- Ignoring exit status for now. --@@ -44,8 +55,19 @@     -- data gets pulled as it becomes available. you have to force the     -- output strings before waiting for the process to terminate.     ---    forkIO (Control.Exception.evaluate (length output) >> return ())-    forkIO (Control.Exception.evaluate (length errput) >> return ())++    -- Samb says:+    -- Might as well try to avoid hanging my system...+    -- make sure it happens FIRST.++    outMVar <- newEmptyMVar+    errMVar <- newEmptyMVar++    forkIO (Control.Exception.evaluate (length output) >> putMVar outMVar ())+    forkIO (Control.Exception.evaluate (length errput) >> putMVar errMVar ())++    takeMVar outMVar+    takeMVar errMVar      -- And now we wait. We must wait after we read, unsurprisingly.     -- blocks without -threaded, you're warned.
+ Lib/Regex.hs view
@@ -0,0 +1,94 @@+-----------------------------------------------------------------------------+-- |+-- Module      :  Lib.Regex+-- Copyright   :  (c) Don Stewart 2007+-- License     :  GPL (see LICENSE)+-- +-- Maintainer  :  dons@cse.unsw.edu.au+--+-----------------------------------------------------------------------------++module Lib.Regex (+        -- ByteString interface+        regex,      -- :: ByteString -> Regex +        matches,    -- :: Regex -> ByteString -> Bool++        -- String interface+        regex',     -- :: String -> Regex +        matches',   -- :: Regex -> String -> Bool++        -- and the underlying module+#if __GLASGOW_HASKELL__ >= 606+        module Text.Regex.Posix.ByteString+#else+        module Text.Regex+#endif++    ) where++import Data.ByteString.Char8++#if __GLASGOW_HASKELL__ >= 606+import Text.Regex.Posix.ByteString+import System.IO.Unsafe (unsafePerformIO)+#else+import Text.Regex+#endif++------------------------------------------------------------------------+--+-- convenient regex wrappers:+--++regex'   ::     String -> Regex+regex    :: ByteString -> Regex++matches' :: Regex ->     String -> Bool+matches  :: Regex -> ByteString -> Bool++------------------------------------------------------------------------++#if __GLASGOW_HASKELL__ >= 606++--+-- For ghc 6.6 we use the regex-posix bytestring library+--++regex' s = regex (pack s)++regex p = unsafePerformIO $ do+    res <- compile compileFlags execFlags p+    case res of+        Left  err -> error $ "regex failed: " ++ show err+        Right r   -> return r+  where+    compileFlags = compExtended+    execFlags    = 0++--+-- match a regex against a string or bytestring+--+matches' r s = matches r (pack s)++matches r p = unsafePerformIO $ do+    res <- execute r p+    case res of+        Left err       -> error $ "regex execute failed: " ++ show err+        Right Nothing  -> return False+        Right (Just _) -> return True++#else++--+-- ghc 6.4.x Text.Regex compat:+--++regex'  = mkRegex+regex   = regex' . unpack++matches' r s | Just _ <- matchRegex r s = True+             | otherwise                = False++matches  r s = matches' r (unpack s)++#endif
− Lib/Regex.hsc
@@ -1,151 +0,0 @@-{-# OPTIONS -w #-}--------- Module      :  Text.Regex.Posix------ Copyright   :  (c) The University of Glasgow 2002---                (c) Don Stewart 2004------ License     :  BSD-style (see the file libraries/base/LICENSE)--- --- Maintainer  :  libraries@haskell.org--- Stability   :  experimental--- Portability :  portable-------  --- | Interface to the POSIX regular expression library.-----module Lib.Regex (--    -- * The @Regex@ type-    Regex,      -- abstract--    -- * Compiling a regular expression-    regcomp,    -- :: ByteString -> Int -> IO Regex--    -- ** Flags for regcomp-    regExtended,    -- (flag to regcomp) use extended regex syntax-    regIgnoreCase,  -- (flag to regcomp) ignore case when matching-    regNewline,     -- (flag to regcomp) '.' doesn't match newline-    regNosub,       -- unused--    -- * Matching a regular expression-    regexec,        -- :: Regex -> Ptr CChar -> Int-                    -- -> IO (Maybe ((Int,Int), [(Int,Int)]))-    matchRegex--  ) where--# include <sys/types.h>-# include <regex.h>--import Foreign.C-import Foreign.C.String-import Foreign.ForeignPtr-import qualified Foreign.Concurrent as FC-import Foreign-import System.IO.Unsafe     (unsafePerformIO)--import qualified Data.ByteString as P-import qualified Data.ByteString.Base as P (unsafeUseAsCString)--type CRegex = ()---- | A compiled regular expression-newtype Regex = Regex (ForeignPtr CRegex)---- ------------------------------------------------------------------------ | Compiles a regular expression----regcomp :: P.ByteString    -- ^ The regular expression to compile-        -> Int        -- ^ Flags (summed together)-        -> IO Regex   -- ^ Returns: the compiled regular expression--regcomp ps flags = do-    regex_fptr <- mallocForeignPtrBytes (#const sizeof(regex_t))-    r <- P.unsafeUseAsCString ps $ \cstr ->-            withForeignPtr regex_fptr $ \p ->-                c_regcomp p cstr (fromIntegral flags)-    if (r == 0)-        then do-             FC.addForeignPtrFinalizer regex_fptr $ regfree regex_fptr-             return (Regex regex_fptr)-        else ioError $ userError $ "Error in pattern: " ++ (show ps)---- ------------------------------------------------------------------------ | Matches a regular expression against a buffer, returning the buffer--- indicies of the match, and any submatches----regexec :: Regex                -- ^ Compiled regular expression-        -> Ptr CChar            -- ^ The buffer to match against-        -> Int                  -- ^ Offset in buffer to start searching from-        -> IO (Maybe ((Int,Int), [(Int,Int)]))-        -- ^ Returns: 'Nothing' if the regex did not match the-        -- or Just the start and end indicies of the match and submatches--regexec (Regex regex_fptr) ptr i = do-    withForeignPtr regex_fptr $ \regex_ptr -> do-        nsub <- (#peek regex_t, re_nsub) regex_ptr-        let nsub_int = fromIntegral (nsub :: CSize)-        allocaBytes ((1 + nsub_int)*(#const sizeof(regmatch_t))) $ \p_match-> do-            -- add one because index zero covers the whole match-            r <- cregexec regex_ptr (ptr `plusPtr` i) -                                    (1 + nsub) p_match 0{-no flags -}--            if (r /= 0) then return Nothing else do -                match       <- indexOfMatch p_match-                sub_matches <- mapM (indexOfMatch) $ take nsub_int $ tail $-                        iterate (`plusPtr` (#const sizeof(regmatch_t))) p_match--                return (Just (match, sub_matches))--indexOfMatch :: Ptr CRegMatch -> IO (Int, Int)-indexOfMatch p_match = do-    start <- (#peek regmatch_t, rm_so) p_match :: IO (#type regoff_t)-    end   <- (#peek regmatch_t, rm_eo) p_match :: IO (#type regoff_t)-    let s = fromIntegral start; e = fromIntegral end-    return (s, e)---- -------------------------------------------------------------------------------- The POSIX regex C interface--regExtended :: Int-regExtended =  1-regIgnoreCase  :: Int-regIgnoreCase  =  2-regNosub :: Int-regNosub =  4-regNewline :: Int-regNewline =  8--type CRegMatch = ()--foreign import ccall unsafe "regex.h regcomp"-    c_regcomp :: Ptr CRegex -> CString -> CInt -> IO CInt--foreign import ccall  unsafe "regex.h regfree"-    c_regfree :: Ptr CRegex -> IO ()--foreign import ccall unsafe "regex.h regexec"-    cregexec :: Ptr CRegex-             -> Ptr CChar-             -> CSize -> Ptr CRegMatch -> CInt -> IO CInt--regfree :: ForeignPtr CRegex -> IO ()-regfree fp = withForeignPtr fp $ c_regfree------------------------------------------------------------------------------ | Match a regular expression against a string-matchRegex-   :: Regex     -- ^ The regular expression-   -> String    -- ^ The string to match against-   -> Bool-matchRegex p str = unsafePerformIO $ withCString str $ \cstr -> do-    m <- regexec p cstr 0-    return $ case m of-        Nothing -> False-        Just  _ -> True-
Lib/Serial.hs view
@@ -25,6 +25,7 @@         mapPackedSerial, assocListPackedSerial, mapListPackedSerial,         readM, Packable(..), {- instances of Packable -}         packedListSerial,+        readOnly, gzip, gunzip     ) where  import Data.Maybe               (mapMaybe)@@ -35,6 +36,13 @@ import qualified Data.ByteString.Char8 as P import Data.ByteString.Char8 (ByteString) +#ifndef mingw32_HOST_OS+import Data.ByteString.Lazy (fromChunks,toChunks)++import Codec.Compression.GZip+#endif++ ------------------------------------------------------------------------  -- A flexible (moreso than a typeclass) way to define introduction and@@ -45,6 +53,28 @@         deserialize :: ByteString -> Maybe s      } +#ifdef mingw32_HOST_OS+-- XXX I haven't built a gzip library yet.+gzip   :: ByteString -> ByteString+gzip = id++gunzip :: ByteString -> ByteString+gunzip = id++#else+gzip   :: ByteString -> ByteString+gzip   = P.concat . toChunks . compress . fromChunks . (:[])++gunzip :: ByteString -> ByteString+gunzip = P.concat . toChunks . decompress .fromChunks . (:[])+#endif++--+-- read-only serialisation+--+readOnly :: (ByteString -> b) -> Serial b+readOnly f = Serial (const Nothing) (Just . f)+ -- | Default `instance' for a Serial stdSerial :: (Show s, Read s) => Serial s stdSerial = Serial (Just. P.pack.show) (readM.P.unpack)@@ -90,37 +120,40 @@         showPacked :: t -> ByteString  -- | An instance for Map Packed [Packed]+-- uses gzip compression instance Packable (Map ByteString [ByteString]) where-        readPacked ps = M.fromList (readKV (P.lines ps))-                where+        readPacked ps = M.fromList (readKV ( P.lines . gunzip $ ps))+             where                 readKV :: [ByteString] -> [(ByteString,[ByteString])]                 readKV []       =  []-                readKV (k:rest) = -                        let (vs, rest') = break (== P.empty) rest-                        in  (k,vs) : readKV (drop 1 rest')+                readKV (k:rest) = let (vs, rest') = break (== P.empty) rest+                                  in  (k,vs) : readKV (drop 1 rest')  -        showPacked m = P.unlines . concatMap (\(k,vs) -> k : vs ++ [P.empty]) $ M.toList m+        showPacked m = gzip+                     . P.unlines+                     . concatMap (\(k,vs) -> k : vs ++ [P.empty]) $ M.toList m +-- assumes single line second strings instance Packable (Map ByteString ByteString) where-        readPacked ps = M.fromList (readKV (P.lines ps))+        readPacked ps = M.fromList (readKV (P.lines . gunzip $ ps))                 where                   readKV :: [ByteString] -> [(ByteString,ByteString)]                   readKV []         = []                   readKV (k:v:rest) = (k,v) : readKV rest                   readKV _      = error "Serial.readPacked: parse failed" -        showPacked m  = P.unlines . concatMap (\(k,v) -> [k,v]) $ M.toList m+        showPacked m  = gzip. P.unlines . concatMap (\(k,v) -> [k,v]) $ M.toList m  instance Packable ([(ByteString,ByteString)]) where-        readPacked ps = readKV (P.lines ps)+        readPacked ps = readKV (P.lines . gunzip $ ps)                 where                   readKV :: [ByteString] -> [(ByteString,ByteString)]                   readKV []         = []                   readKV (k:v:rest) = (k,v) : readKV rest                   readKV _          = error "Serial.readPacked: parse failed" -        showPacked = P.unlines . concatMap (\(k,v) -> [k,v])+        showPacked = gzip . P.unlines . concatMap (\(k,v) -> [k,v])  instance Packable (M.Map P.ByteString (Bool, [(String, Int)])) where     readPacked = M.fromList . readKV . P.lines
Lib/Signals.hs view
@@ -12,6 +12,20 @@ -- module Lib.Signals where +#ifdef mingw32_HOST_OS+import Data.Typeable+import Control.Monad.Error++type Signal = String+newtype SignalException = SignalException Signal deriving Typeable++ircSignalMessage :: Signal -> [Char]+ircSignalMessage s = s++withIrcSignalCatch :: (MonadError e m,MonadIO m) => m () -> m ()+withIrcSignalCatch m = m++#else import Lib.Error import Lib.Util @@ -32,14 +46,10 @@ -- A bit of sugar for installing a new handler --  withHandler :: (MonadIO m,MonadError e m) => Signal -> Handler -> m () -> m ()-#ifdef mingw32_HOST_OS-withHandler s h m = return ()-#else withHandler s h m   = bracketError (io (installHandler s h Nothing))                  (io . flip (installHandler s) Nothing)                  (const m)-#endif  -- And more sugar for installing a list of handlers withHandlerList :: (MonadError e m,MonadIO m)@@ -54,7 +64,6 @@ -- ircSignalsToCatch :: [Signal] ircSignalsToCatch = [-#ifndef mingw32_HOST_OS     busError,     segmentationViolation,     keyboardSignal,@@ -62,7 +71,6 @@     keyboardTermination,     lostConnection,     internalAbort-#endif     ]  --@@ -70,7 +78,6 @@ -- ircSignalMessage :: Signal -> [Char] ircSignalMessage s-#ifndef mingw32_HOST_OS    | s==busError              = "SIGBUS"    | s==segmentationViolation = "SIGSEGV"    | s==keyboardSignal        = "SIGINT"@@ -78,7 +85,6 @@    | s==keyboardTermination   = "SIGQUIT"    | s==lostConnection        = "SIGHUP"    | s==internalAbort         = "SIGABRT"-#endif -- this case shouldn't happen if the list of messages is kept up to date -- with the list of signals caught    | otherwise                  = "killed by unknown signal"@@ -92,9 +98,6 @@ -- ircSignalHandler :: ThreadId -> Signal -> Handler ircSignalHandler threadid s-#ifdef mingw32_HOST_OS-  = ()-#else   = CatchOnce $ do         putMVar catchLock ()         releaseSignals@@ -118,7 +121,6 @@ {-# NOINLINE catchLock #-} catchLock :: MVar () catchLock = unsafePerformIO newEmptyMVar-#endif  -- -- | Register signal handlers to catch external signals@@ -129,3 +131,4 @@     io $ installHandler sigALRM Ignore Nothing     threadid <- io myThreadId     withHandlerList ircSignalsToCatch (ircSignalHandler threadid) m+#endif
Lib/Url.hs view
@@ -15,9 +15,10 @@  import Data.List import Data.Maybe-import Text.Regex import Lib.MiniHTTP +import Text.Regex+ -- | The string that I prepend to the quoted page title. urlTitlePrompt :: String urlTitlePrompt = "Title: "@@ -27,6 +28,16 @@ maxTitleLength :: Int maxTitleLength = 80 ++-- | Replace occurences in a string.+-- e.g. replace [("foo", "1"), ("bar", "000")] "foo bar baz" => "1 000 baz"+replace :: [(String, String)] -> String -> String+replace [] s = s+replace (pair:pairs) s = replace pairs (f pair)+    where +      f :: (String, String) -> String+      f (from, to) = subRegex (mkRegex from) s to+ -- | Fetches a page title suitable for display.  Ideally, other -- plugins should make use of this function if the result is to be -- displayed in an IRC channel because it ensures that a consistent@@ -36,13 +47,26 @@ urlPageTitle :: String -> Proxy -> IO (Maybe String) urlPageTitle url proxy = do     title <- rawPageTitle url proxy-    return $ maybe Nothing (return . prettyTitle . urlDecode) title+    return $ maybe Nothing (return . prettyTitle . unhtml . urlDecode) title      where       limitLength s           | length s > maxTitleLength = (take maxTitleLength s) ++ " ..."           | otherwise                 = s -      prettyTitle s = urlTitlePrompt ++ "\"" ++ limitLength s ++ "\""+      prettyTitle s = urlTitlePrompt ++ limitLength s+      unhtml = replace [("&raquo;", "»"),+                        ("&iexcl;", "¡"),+                        ("&cent;",  "¢"),+                        ("&copy;",  "©"),+                        ("&laquo;", "«"),+                        ("&deg;",   "°"),+                        ("&sup2;",  "²"),+                        ("&micro;", "µ"),+                        ("&quot;",  "\""),+                        ("&lt;",    "<"),+                        ("&gt;",    ">"),+                        ("&amp;",   "&")+                       ] -- partial list of html entity pairs  -- | Fetches a page title for the specified URL.  This function should -- only be used by other plugins if and only if the result is not to@@ -58,11 +82,15 @@ -- a list of strings comprising the server response which includes the -- status line, response headers, and body. getHtmlPage :: URI -> Proxy -> IO [String]-getHtmlPage uri proxy = do+getHtmlPage u p = getHtmlPage' u p 5+  where+  getHtmlPage' :: URI -> Proxy -> Int -> IO [String]+  getHtmlPage' _   _     0 = return []+  getHtmlPage' uri proxy n = do      contents <- getURIContents uri proxy     case responseStatus contents of-      301       -> getHtmlPage (redirectedUrl contents) proxy-      302       -> getHtmlPage (redirectedUrl contents) proxy+      301       -> getHtmlPage' (redirectedUrl contents) proxy (n-1)+      302       -> getHtmlPage' (redirectedUrl contents) proxy (n-1)       200       -> return contents       _         -> return []     where@@ -92,7 +120,7 @@ -- comprising the server response which includes the status line, -- response headers, and body. getURIContents :: URI -> Proxy -> IO [String]-getURIContents uri proxy = readNBytes 1024 proxy uri request ""+getURIContents uri proxy = readNBytes 2048 proxy uri request ""     where       request  = case proxy of                    Nothing -> ["GET " ++ abs_path ++ " HTTP/1.1",@@ -128,8 +156,10 @@ isTextHtml []       = False isTextHtml contents = val == "text/html"     where-      val        = takeWhile (/=';') ctype-      Just ctype = getHeader "Content-Type" contents+      val   = takeWhile (/=';') ctype+      ctype = case getHeader "Content-Type" contents of+                    Nothing -> error "Lib.URL.isTextHTML: getHeader failed"+                    Just c  -> c  -- | Retrieve the specified header from the server response being -- careful to strip the trailing carriage return.  I swiped this code
Lib/Util.hs view
@@ -20,8 +20,8 @@         debugStrLn,         lowerCaseString, upperCaseString,         upperize, lowerize,-        quote,-        listToStr,+        quote, timeStamp,+        listToStr, showWidth,         listToMaybeWith, listToMaybeAll,         getRandItem, stdGetRandItem, randomElem,         showClean,@@ -40,7 +40,9 @@          isLeft, isRight, unEither, -        io+        io,++        random, insult, confirmation     ) where  import Data.List                (intersperse, isPrefixOf)@@ -55,9 +57,11 @@                                  forkIO, killThread, threadDelay) import Control.Exception        (bracket) -import System.Random hiding (split)+-- getStdRandom has a bug, see safeGetStdRandom below.+import System.Random hiding (split,random,getStdRandom)  import System.IO+import qualified System.Time as T  ------------------------------------------------------------------------ @@ -214,6 +218,15 @@  ------------------------------------------------------------------------ +-- | getStdRandom has a bug when 'f' returns bottom, we strictly evaluate the+-- new generator before calling setStdGen.+safeGetStdRandom :: (StdGen -> (a,StdGen)) -> IO a+safeGetStdRandom f = do+    g <- getStdGen+    let (x, g') = f g+    setStdGen $! g'+    return x+ -- | 'getRandItem' takes as input a list and a random number generator. It --   then returns a random element from the list, paired with the altered --   state of the RNG@@ -221,7 +234,7 @@                [a] -- ^ The list to pick a random item from             -> g   -- ^ The RNG to use             -> (a, g) -- ^ A pair of the item, and the new RNG seed-getRandItem [] _       = error "getRandItem: empty list"+getRandItem [] g       = (error "getRandItem: empty list", g) getRandItem mylist rng = (mylist !! index,newRng)                          where                          llen = length mylist@@ -233,11 +246,14 @@ --   and the state of the RNG is hidden, so one don't need to pass it --   explicitly. stdGetRandItem :: [a] -> IO a-stdGetRandItem = getStdRandom . getRandItem+stdGetRandItem = safeGetStdRandom . getRandItem  randomElem :: [a] -> IO a randomElem = stdGetRandItem +random :: MonadIO m => [a] -> m a+random = liftIO . randomElem+ ------------------------------------------------------------------------  -- | 'dropSpace' takes as input a String and strips spaces from the@@ -358,8 +374,10 @@   c1 <- forkIO $ putMVar m =<< a1   c2 <- forkIO $ putMVar m =<< a2   r <- takeMVar m-  killThread c1-  killThread c2+  -- killThread blocks until the thread has been killed.  Therefore, we call+  -- killThread asynchronously in case one thread is blocked in a foreign+  -- call.+  forkIO $ killThread c1 >> killThread c2   return r  -- | run an action with a timeout@@ -453,7 +471,7 @@   -- convenience:-io :: forall a (m :: * -> *). (MonadIO m) => IO a -> m a+io :: MonadIO m => IO a -> m a io = liftIO {-# INLINE io #-} @@ -463,3 +481,81 @@  arePrefixesOf :: [String] -> String -> Bool arePrefixesOf = flip (any . flip isPrefixOf)++-- | Show a number, padded to the left with zeroes up to the specified width+showWidth :: Int    -- ^ Width to fill to+          -> Int    -- ^ Number to show+          -> String -- ^ Padded string+showWidth width n = zeroes ++ num+    where num    = show n+          zeroes = replicate (width - length num) '0'++timeStamp :: T.ClockTime -> String+timeStamp ct = let cal = T.toUTCTime ct+               in (showWidth 2 $ T.ctHour cal) ++ ":" +++                  (showWidth 2 $ T.ctMin cal)  ++ ":" +++                  (showWidth 2 $ T.ctSec cal)++++--+-- Amusing insults from OpenBSD sudo+--+insult :: [String]+insult =+   ["Just what do you think you're doing Dave?",+    "It can only be attributed to human error.",+    "That's something I cannot allow to happen.",+    "My mind is going. I can feel it.",+    "Sorry about this, I know it's a bit silly.",+    "Take a stress pill and think things over.",+    "This mission is too important for me to allow you to jeopardize it.",+    "I feel much better now.",++    "Wrong!  You cheating scum!",+    "And you call yourself a Rocket Scientist!",+    "Where did you learn to type?",+    "Are you on drugs?",+    "My pet ferret can type better than you!",+    "You type like i drive.",+    "Do you think like you type?",+    "Your mind just hasn't been the same since the electro-shock, has it?",++    "Maybe if you used more than just two fingers...",+    "BOB says:  You seem to have forgotten your passwd, enter another!",+    "stty: unknown mode: doofus",+    "I can't hear you -- I'm using the scrambler.",+    "The more you drive -- the dumber you get.",+    "Listen, broccoli brains, I don't have time to listen to this trash.",+    "I've seen penguins that can type better than that.",+    "Have you considered trying to match wits with a rutabaga?",+    "You speak an infinite deal of nothing",+    +    -- More haskellish insults+    "You untyped fool!",+    "My brain just exploded",+    +    -- some more friendly replies+    "I am sorry.","Sorry.",+    "Maybe you made a typo?",+    "Just try something else.",+    "There are some things that I just don't know.",+    -- sometimes don't insult at all+    ":(",":(",+    "","",""+    ]++--+-- Some more interesting confirmations for @remember and @where+--+confirmation :: [String]+confirmation =+   ["Done.","Done.",+    "Okay.",+    "I will remember.",+    "Good to know.",+    "It is stored.",+    "I will never forget.",+    "It is forever etched in my memory.",+    "Nice!"+   ]
Main.hs view
@@ -3,80 +3,19 @@ -- module Main where -import Shared+import LMain+import Modules      (modulesInfo) import Lambdabot-import Config-import Modules-import Message -import qualified Data.Map as M--import System.Environment- import Data.Maybe-import Control.Monad.State (get, liftIO, modify) -------------------------------------------------------------------------- -- do argument handling main :: IO ()-main = main' Nothing--dynmain :: DynLoad  -> IO ()-dynmain fn = main' (Just fn)--main' :: Maybe DynLoad -> IO ()-main' dyn = do-    x    <- getArgs-    case x of-        ["--online"] -> runIrc Online  loadStaticModules onlineMain  load-        []           -> runIrc Offline loadStaticModules offlineMain load-        _            -> putStrLn "Usage: lambdabot [--online]"--    where load = fromMaybe (error "no dynamic loading") dyn+main = main' Nothing modulesInfo --- -- special online target for ghci use-online :: IO ()-online = runIrc Online loadStaticModules onlineMain $-            fromMaybe (error "no dynamic loading") Nothing----------------------------------------------------------------------------onlineMain :: LB ()-onlineMain = serverSignOn (protocol config) (name config) (userinfo config) >> mainloop--offlineMain :: LB ()-offlineMain = do -  modify (\st -> let privUsers  = ircPrivilegedUsers st-                     privUsers' = M.insert "null" True privUsers-                 in st { ircPrivilegedUsers = privUsers' })-  mainloop------------------------------------------------------------------------------ it's all asynchronous, remember, the reader and writer threads--- communicating over chans in the LB state. maybe its too much?-mainloop :: LB ()-mainloop = do-    mmsg <- ircRead-    case mmsg of-        Nothing -> return ()-        Just msg -> do-            s   <- get-            case M.lookup (command msg) (ircCallbacks s) of-                 Just cbs -> allCallbacks (map snd cbs) msg-                 _        -> return ()-    mainloop---- If an error reaches allCallbacks, then all we can sensibly do is--- write it on standard out. Hopefully BaseModule will have caught it already--- if it can see a better place to send it--allCallbacks :: Message a => [a -> LB ()] -> a -> LB ()-allCallbacks [] _ = return ()-allCallbacks (f:fs) msg = do-    handleIrc (liftIO . putStrLn . ("Main: caught (and ignoring) "++). show) (f msg)-    allCallbacks fs msg--------------------------------------------------------------------------+online :: [String] -> IO ()+online strs = runIrc strs (fst modulesInfo) ld pl+    where+    ld = fromMaybe (error "no dynamic loading") Nothing+    pl = []
+ Makefile view
@@ -0,0 +1,14 @@+all:+	@echo+	@echo "This Makefile only supports \"make clean\". For build instructions, see README."+	@echo++clean:+	./Setup.hs clean+	rm -f ${CLEANS}+	rm -f *~+    +CLEANS= BotPP bf djinn ft hoogle lambdabot unlambda  \+        L.hi ShowFun.hi ShowQ.hi SmallCheck.hi \+        L.o  ShowFun.o  ShowQ.o  SmallCheck.o  \+        config.h config.log config.status      
Message.hs view
@@ -1,41 +1,110 @@ -- -- Provides interface to messages, message pipes ---module Message where+module Message(Message(..), Nick(..), showNick, readNick, Pipe, packNick, unpackNick) where +import qualified Data.ByteString.Char8 as P import Control.Concurrent+import Data.Char(toUpper) +import Control.Arrow( first )+ -- TODO: probably remove "Show a" later class Show a => Message a where+    -- | extracts the tag of the server involved in a given message+    server      :: a -> String+     -- | extracts the nickname involved in a given message.-    nick        :: a -> String+    nick        :: a -> Nick      -- | 'fullName' extracts the full user name involved in a given message.     fullName    :: a -> String      -- | 'names' builds a NAMES message from a list of channels.-    names       :: [String] -> a+    names       :: String -> [String] -> a      -- | 'channels' extracts the channels a Message operate on.-    channels    :: a -> [String]+    channels    :: a -> [Nick]      -- | 'join' creates a join message. String given is the location (channel) to join-    joinChannel :: String -> a+    joinChannel :: Nick -> a      -- | 'part' parts the channel given.-    partChannel :: String -> a+    partChannel :: Nick -> a      -- | 'getTopic' Returns the topic for a channel, given as a String-    getTopic    :: String -> a+    getTopic    :: Nick -> a      -- | 'setTopic' takes a channel and a topic. It then returns the message     --   which sets the channels topic.-    setTopic :: String -> String -> a+    setTopic :: Nick -> String -> a      -- TODO: recheck this. It's usage heavily relies on the fact that message comes from IRC     body :: a -> [String]      -- TODO: too IRC-specific     command :: a -> String++    -- TODO: there must be a better way of handling this ...+    lambdabotName :: a -> Nick++-- |The type of nicknames isolated from a message.+data Nick+  = Nick {+        nTag :: !String, -- ^The tag of the server this nick is on+        nName :: !String -- ^The server-specific nickname of this nick+  }++-- This definition of canonicalizeName breaks strict RFC rules, but so does+-- freenode+canonicalizeName :: String -> String+canonicalizeName = map toUpper++instance Eq Nick where+  (Nick tag name) == (Nick tag2 name2) =+     (canonicalizeName name == canonicalizeName name2) && (tag == tag2)++instance Ord Nick where+  (Nick tag name) <= (Nick tag2 name2) =+     (tag, canonicalizeName name) <= (tag2, canonicalizeName name2)+  ++-- Helper functions+upckStr :: String -> String -> Nick+upckStr def str | null ac   = Nick def str+                | otherwise = Nick bc (tail ac)+    where (bc, ac) = break (==':') str++pckStr :: Nick -> String+pckStr nck = nTag nck ++ ':' : nName nck++-- |Format a nickname for display.  This will automatically omit the server+-- field if it is the same as the server of the provided message.+showNick :: Message a => a -> Nick -> String+showNick msg nick_ | nTag nick_ == server msg = nName nick_+                   | otherwise                = pckStr nick_++-- |Parse a nickname received in a message.  If the server field is not+-- provided, it defaults to the same as that of the message.+readNick :: Message a => a -> String -> Nick+readNick msg str = upckStr (server msg) str'+	where str' | last str `elem` ":" = init str+	           | otherwise           = str++instance Show Nick where+    show x | nTag x == "freenode" = show $ nName x+           | otherwise            = show $ pckStr x++instance Read Nick where+    readsPrec prec str = map (first (upckStr "freenode")) (readsPrec prec str)++-- |Pack a nickname into a ByteString.  Note that the resulting strings are+-- not optimally formatted for human consumtion.+packNick :: Nick -> P.ByteString+packNick = P.pack . pckStr++-- |Unpack a nickname packed by 'packNick'.+unpackNick :: P.ByteString -> Nick+unpackNick = upckStr "freenode" . P.unpack  type Pipe a = Chan (Maybe a)
Modules.hs view
@@ -1,1 +1,1 @@-MODULES Base System Dict Dummy Karma Quote Seen State Topic Type Eval Babel Version More Pl Help Dice Search Vixen Fact Todo Spell Haddock Hoogle Where Elite Localtime Poll Djinn Pretty Compose Lambda Unlambda Log Slap DrHylo Instances Fresh Tell Url+MODULES Base System Dict Dummy Karma Quote Seen State Topic Type Eval Babel Version More Pl Help Dice Search Vixen Fact Todo Spell Haddock Hoogle Where Elite Localtime Poll Djinn Pretty Compose Unlambda Log Slap Instances Fresh Tell Url Free Undo BF FT Check Small Figlet Pointful Source OfflineRC IRC Activity UnMtl Maya OEIS
+ NickEq.hs view
@@ -0,0 +1,49 @@+--+-- | Nickname equality subsystem.+--+-- This component is responsible for deciding whether two nicknames+-- refer to the same person, for the purposes of @tell et al.  Nickname+-- equality must be monadic because it uses mutable state maintained+-- by the @link and @unlink commands.+--+-- Also provided is a concept of polynicks (by analogy to polytypes);+-- polynicks can refer to an (open) set of nicknames.  For instance '@tell+-- *lambdabot Why does X do Y' could tell a message to anyone who has+-- identified as a lambdabot maintainer.  A polynick consists of a+-- bar-separated list of (nicks or open terms); an open term is like a+-- nick but preceded with a star.++module NickEq ( Polynick, nickMatches, readPolynick, showPolynick, lookupMononickMap, mononickToPolynick ) where++import Message( Message, Nick, readNick, showNick )+import Lambdabot+import Lib.Util (concatWith, split)+import Data.Maybe (mapMaybe)++import qualified Data.Map as M++data Polynick = Polynick [Nick] deriving (Eq) -- for now++-- |Determine if a nick matches a polynick.  The state is read at the+-- point of binding.+nickMatches :: LB (Nick -> Polynick -> Bool)+nickMatches = return m'+    where+      m' nck (Polynick nck2) = nck `elem` nck2++-- | Parse a read polynick.+readPolynick :: Message a => a -> String -> Polynick+readPolynick m = Polynick . map (readNick m) . split "|"++-- | Format a polynick.+showPolynick :: Message a => a -> Polynick -> String+showPolynick m (Polynick n) = concatWith "|" $ map (showNick m) n++-- | Convert a regular mononick into a polynick.+mononickToPolynick :: Nick -> Polynick+mononickToPolynick = Polynick . (:[])++-- | Lookup (using a polynick) in a map keyed on mononicks.+lookupMononickMap :: LB (Polynick -> M.Map Nick a -> [(Nick,a)])+lookupMononickMap = return $ look'+    where look' (Polynick ns) m = mapMaybe (\n -> (,) n `fmap` M.lookup n m) ns
Plugin.hs view
@@ -6,7 +6,7 @@ -- Simplifies import lists, and abstracts over common patterns -- module Plugin (-        ios, list, ios80,+        ios, box, list, ios80,          module Lambdabot,         module LBState,@@ -17,12 +17,12 @@         module Lib.Process,         module Lib.MiniHTTP,         module Lib.Url,+        module Lib.Regex,          module Data.List,         module Data.Char,         module Data.Maybe,         module Data.Either,-        module Text.Regex,         module System.IO,          module Control.Monad.Error@@ -38,12 +38,14 @@ import Lib.Process import Lib.MiniHTTP import Lib.Url+import Lib.Regex +import Message+ import Data.List import Data.Char import Data.Maybe import Data.Either-import Text.Regex  import System.IO @@ -57,11 +59,14 @@ list :: (Functor m, Monad m) => m a -> m [a] list = (return `fmap`) +box :: (Functor m, Monad m) => a -> m [a]+box = return . return+ -- | convenience, similar to ios but also cut output to channel to 80 characters -- usage:  @process _ _ to _ s = ios80 to (plugs s)@-ios80 :: (Functor m, MonadIO m) => String -> IO String -> m [String]+ios80 :: (Functor m, MonadIO m) => Nick -> IO String -> m [String] ios80 to what = list . io $ what >>= return . lim-    where lim = case to of+    where lim = case nName to of                     ('#':_) -> abbr 80 -- message to channel: be nice                     _       -> id      -- private message: get everything           abbr n s = let (b, t) = splitAt n s in
+ Plugin/Activity.hs view
@@ -0,0 +1,42 @@+--+-- | Logging an IRC channel..+--+module Plugin.Activity (theModule) where++import Plugin+import qualified Message as Msg++import Control.Arrow ((&&&))+import Data.Maybe (fromMaybe)+import Control.Exception (evaluate)++import System.Time++PLUGIN Activity++type ActivityState = [(ClockTime,Msg.Nick)]++instance Module ActivityModule ActivityState where+    moduleHelp _ _              = "activity seconds. Find out where/how much the bot is being used"+    moduleCmds   _              = ["activity"]+    modulePrivs  _              = ["activity-full"]+    moduleDefState _            = return []+    moduleInit   _              = bindModule2 activityFilter >>=+                                      ircInstallOutputFilter+    process      _ msg _ cmd rest = do+        TOD secs ps <- io getClockTime+        let cutoff = TOD (secs - (fromMaybe 90 $ readM rest)) ps+        users <- (map (obscure . snd) . takeWhile ((> cutoff) . fst)) `fmap` readMS+        let agg_users = reverse . sort . map (length &&& head) . group . sort $ users+        let fmt_agg = concatWith " " . (:) (show (length users) ++ "*total") .+                      map (\(n,u) -> show n ++ "*" ++ Msg.showNick msg u) $ agg_users+        return [fmt_agg]+      where obscure nm | cmd == "activity-full" || isPrefixOf "#" (Msg.nName nm) = nm+                       | otherwise = Msg.readNick msg "private"++activityFilter :: Msg.Nick -> [String] -> ModuleLB ActivityState+activityFilter target lns = do io $ evaluate $ foldr seq () $ map (foldr seq ()) $ lns+                               withMS $ \ st wr -> do+                                 now <- io getClockTime+                                 wr (map (const (now,target)) lns ++ st)+                               return lns
+ Plugin/BF.hs view
@@ -0,0 +1,40 @@+--+-- Copyright (c) 2006 Jason Dagit - http://www.codersbase.com/+-- GPL version 2 or later (see http://www.gnu.org/copyleft/gpl.html)+--++--+-- | A plugin for the Haskell interpreter for the brainf*ck language+--+-- http://www.muppetlabs.com/~breadbox/bf/+--+module Plugin.BF (theModule) where++import Plugin++PLUGIN BF++instance Module BFModule () where+    moduleCmds   _     = ["bf"]+    moduleHelp _ _     = "bf <expr>. Evaluate a bainf*ck expression"+    process _ _ to _ s = ios80 to (bf s)++binary :: String+binary = "./bf"++bf :: String -> IO String+bf src = run binary src scrub+  where scrub = unlines . take 6 . map (' ':) . filter (not.null) . map cleanit . lines++--+-- Clean up output+--+cleanit :: String -> String+cleanit s | terminated `matches'`    s = "Terminated\n"+          | otherwise                  = filter printable s+    where terminated = regex' "waitForProc"+          -- the printable ascii chars are in the range [32 .. 126]+          -- according to wikipedia:+          -- http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters+          printable x = 31 < ord x && ord x < 127+
Plugin/Babel.hs view
@@ -10,12 +10,13 @@ module Plugin.Babel where  import Plugin+import qualified Text.Regex as R  PLUGIN Babel  instance Module BabelModule () where     moduleCmds _   = ["babel"]-    process_   _ _ = babel+    process_   _ _ = lift . babel     moduleHelp _ _ = unlines ["babel <lang1> <lang2> <phrase>."                              ,"Translate a phrase in lang1 to lang2."                              ,"Language is an element of" ++ showClean supportedLangs]@@ -104,14 +105,14 @@ getBabel lins =  cleanLine (concat (intersperse " " region))     where     region = hd ++ [(head tl)]-    (hd, tl) = span (\x -> (matchRegex reEnd x) == Nothing)-                    (dropWhile (\x -> (matchRegex reStart x) == Nothing) lins)+    (hd, tl) = span (\x -> (not (matches' reEnd x)))+                    (dropWhile (\x -> (not (matches' reStart x))) lins) -    cleanLine x = maybe "can't parse this language" head $ matchRegex reLine x+    cleanLine x = maybe "can't parse this language" head $ R.matchRegex reLine x -    reLine =  mkRegex ".*padding:10px[^>]*>(.*)</div>.*"-    reStart = mkRegex ".*padding:10px[^>]*>"-    reEnd = mkRegex "</div>"+    reLine  = regex' ".*padding:10px[^>]*>(.*)</div>.*"+    reStart = regex' ".*padding:10px[^>]*>"+    reEnd   = regex' "</div>"  babelFish :: String -> String -> String -> IO String babelFish inLang outLang string = do
Plugin/Base.hs view
@@ -5,8 +5,9 @@  import Plugin -import IRC (IrcMessage, timeReply, errShowMsg)-import Message (getTopic, nick, joinChannel, body)+import IRCBase (IrcMessage, timeReply, errShowMsg)+-- import Message (getTopic, nick, joinChannel, body, fullName, channels)+import Message (getTopic, nick, server, body, Nick(..), lambdabotName, showNick, readNick)  import qualified Data.Map as M   (insert, delete) @@ -14,6 +15,9 @@  import GHC.IOBase           (Exception(NoMethodError)) +import qualified Data.ByteString.Char8 as P+import qualified Text.Regex as R+ -- valid command prefixes commands :: [String] commands  = commandPrefixes config@@ -21,19 +25,20 @@ PLUGIN Base  type BaseState = GlobalPrivate () ()+type Base a = ModuleT BaseState LB a  instance Module BaseModule BaseState where     moduleDefState  _ = return $ mkGlobalPrivate 20 ()     moduleInit _ = do              ircSignalConnect "PING"    doPING-             ircSignalConnect "NOTICE"  doNOTICE+             bindModule1 doNOTICE >>= ircSignalConnect "NOTICE"              ircSignalConnect "PART"    doPART              ircSignalConnect "JOIN"    doJOIN              ircSignalConnect "NICK"    doNICK              ircSignalConnect "MODE"    doMODE              ircSignalConnect "TOPIC"   doTOPIC              ircSignalConnect "QUIT"    doQUIT-             ircSignalConnect "PRIVMSG" doPRIVMSG+             bindModule1 doPRIVMSG >>= ircSignalConnect "PRIVMSG"              ircSignalConnect "001"     doRPL_WELCOME            {- ircSignalConnect "002"     doRPL_YOURHOST@@ -71,7 +76,7 @@  -- If this is a "TIME" then we need to pass it over to the localtime plugin -- otherwise, dump it to stdout-doNOTICE :: ModState BaseState Callback+doNOTICE :: IrcMessage -> Base () doNOTICE msg =   if isCTCPTimeReply      then do@@ -90,19 +95,20 @@       isCTCPTimeReply = ":\SOHTIME" `isPrefixOf` (last (body msg))   doJOIN :: Callback-doJOIN msg+doJOIN msg | lambdabotName msg /= nick msg = doIGNORE msg+           | otherwise   = do s <- get        put (s { ircChannels = M.insert  (mkCN loc) "[currently unknown]" (ircChannels s)}) -- the empty topic causes problems-       send_ $ getTopic loc -- initialize topic+       send $ getTopic loc -- initialize topic    where (_, aloc) = breakOnGlue ":" (head (body msg))          loc       = case aloc of -                        [] -> [] -                        _  -> tail aloc+                        [] -> Nick "freenode" "weird#" +                        _  -> Nick (server msg) (tail aloc)  doPART :: Callback doPART msg-  = when (name config == nick msg) $ do  -        let loc = head (body msg)+  = when (lambdabotName msg == nick msg) $ do  +        let loc = Nick (server msg) (head (body msg))         s <- get         put (s { ircChannels = M.delete (mkCN loc) (ircChannels s) }) @@ -117,12 +123,12 @@  doTOPIC :: Callback doTOPIC msg-    = do let loc = (head (body msg))+    = do let loc = Nick (server msg) ((head (body msg)))          s <- get          put (s { ircChannels = M.insert (mkCN loc) (tail $ head $ tail $ body msg) (ircChannels s)})  doRPL_WELCOME :: Callback-doRPL_WELCOME _msg = mapM_ (send_ . joinChannel) (autojoin config)+doRPL_WELCOME = doIGNORE  doQUIT :: Callback doQUIT msg = doIGNORE msg@@ -132,60 +138,63 @@  doRPL_TOPIC :: Callback doRPL_TOPIC msg -- nearly the same as doTOPIC but has our nick on the front of body-    = do let loc = (body msg) !! 1+    = do let loc = Nick (server msg) ((body msg) !! 1)          s <- get          put (s { ircChannels = M.insert (mkCN loc) (tail $ last $ body msg) (ircChannels s) }) -doPRIVMSG :: ModState BaseState Callback+doPRIVMSG :: IrcMessage -> Base () doPRIVMSG msg = do-    debugStrLn (show msg)-    doPRIVMSG' (name config) msg+--  now <- io getClockTime+--  io $ appendFile "State/log" $ ppr now+    ignored <- lift $ checkIgnore msg+    if ignored+      then lift $ doIGNORE msg+      else mapM_ (doPRIVMSG' (lambdabotName msg) msg) targets+  where+    alltargets = head (body msg)+    targets = map (readNick msg) $ split "," alltargets+--  where+--    ppr now = concat [ timeStamp now, " ", "<", (nick msg), " ", (fullName msg), " #"+--                     , (concat . intersperse ","  $ channels msg) ,  "> "+--                     , (tail . concat . intersperse " " . tail) (body msg), "\n"]  -- -- | What does the bot respond to? ---doPRIVMSG' :: String -> IRC.IrcMessage -> ModuleT BaseState LB ()-doPRIVMSG' myname msg-  | myname `elem` targets+doPRIVMSG' :: Nick -> IrcMessage -> Nick -> Base ()+doPRIVMSG' myname msg target+  | myname == target     = let (cmd, params) = breakOnGlue " " text       in doPersonalMsg cmd (dropWhile (== ' ') params) -  | flip any ":," $ \c -> (myname ++ [c]) `isPrefixOf` text-    = let Just wholeCmd = maybeCommand myname text+  | flip any ":," $ \c -> (showNick msg myname ++ [c]) `isPrefixOf` text+    = let Just wholeCmd = maybeCommand (showNick msg myname) text           (cmd, params) = breakOnGlue " " wholeCmd       in doPublicMsg cmd (dropWhile (==' ') params) -  | (commands `arePrefixesOf` text) && length text > 1-                                    && (text !! 1 /= ' ') -- elem of prefixes-                                    && (not (commands `arePrefixesOf` [text !! 1]))+  | (commands `arePrefixesOf` text)+  && length text > 1+  && (text !! 1 /= ' ') -- elem of prefixes+  && (not (commands `arePrefixesOf` [text !! 1]) ||+      (length text > 2 && text !! 2 == ' ')) -- ignore @@ prefix, but not the @@ command itself     = let (cmd, params) = breakOnGlue " " (dropWhile (==' ') text)       in doPublicMsg cmd (dropWhile (==' ') params) -{--  -- special syntax for @run-  | evals `arePrefixesWithSpaceOf` text-    = let expr = drop 2 text-      in doPublicMsg "@run" (dropWhile (==' ') expr)--}--  -- send to all modules for contextual processing-  | otherwise = doContextualMsg text+  | otherwise =  doContextualMsg text    where-    alltargets = head (body msg)-    targets = split "," alltargets     text = tail (head (tail (body msg)))     who = nick msg      doPersonalMsg s r-        | commands `arePrefixesOf` s = doMsg (tail s) r who-        | s `elem` (evalPrefixes config)    = doMsg "run"   r who -- TODO-        | otherwise                  = doIGNORE msg -- contextual?+        | commands `arePrefixesOf` s        = doMsg (tail s) r who+        | s `elem` (evalPrefixes config)    = doMsg "run"    r who+        | otherwise                         = (lift $ doIGNORE msg)      doPublicMsg s r-        | commands `arePrefixesOf` s                = doMsg (tail s)        r alltargets-        | (evalPrefixes config) `arePrefixesWithSpaceOf` s = doMsg "run" r alltargets -- TODO-        | otherwise                                 = doIGNORE msg -- contextual?+        | commands `arePrefixesOf` s        = doMsg (tail s) r target+        | (evalPrefixes config) `arePrefixesWithSpaceOf` s = doMsg "run" r target -- TODO+        | otherwise                         = (lift $ doIGNORE msg)      --     -- normal commands.@@ -205,34 +214,48 @@             _ | otherwise     -> case closests cmd allcmds of                   (n,[s]) | n < e ,  ms == [] -> docmd s -- unique edit match                   (n,ss)  | n < e || ms /= []            -- some possibilities-                          -> ircmsg . Just $ "Maybe you meant: "++showClean(nub(ms++ss))+                          -> lift . ircmsg $ "Maybe you meant: "++showClean(nub(ms++ss))                   _ -> docmd cmd         -- no prefix, edit distance too far         where             e = 3   -- edit distance cut off. Seems reasonable for small words -            docmd cmd' =-              forkLB $ withPS towhere $ \_ _ -> do+            fcmd  = P.pack cmd      -- TODO+            frest = P.pack rest++            docmd cmd' = do+              act <- bindModule0 . withPS towhere $ \_ _ -> do                 withModule ircCommands cmd'   -- Important. -                    (ircPrivmsg towhere (Just "Unknown command, try @list"))+                    (ircPrivmsg towhere "Unknown command, try @list")                     (\m -> do-                        privs <- gets ircPrivCommands-                        ok    <- liftM2 (||) (return $ cmd' `notElem` privs)-                                             (checkPrivs msg)+                        name'   <- getName+                        privs   <- gets ircPrivCommands+                        let illegal = disabledCommands config+                        ok      <- liftM2 (||) (return $ cmd' `notElem` (privs ++ illegal))+                                               (lift $ checkPrivs msg)                         if not ok-                          then ircPrivmsg towhere $ Just "Not enough privileges"+                          then lift $ ircPrivmsg towhere "Not enough privileges"                           else catchIrc+                             (do mstrs <- catchError-                                    (process m msg towhere cmd' rest)-                                    (\ex -> case (ex :: IRCError) of -- dispatch-                                                (IRCRaised (NoMethodError _)) ->-                                                    process_ m cmd' rest-                                                _ -> throwError ex)+                                 (Right `fmap` fprocess_ m fcmd frest)+                                 (\ex -> case (ex :: IRCError) of -- dispatch+                                   (IRCRaised (NoMethodError _)) -> catchError+                                        (Left `fmap` process m msg towhere cmd' rest)+                                        (\ey -> case (ey :: IRCError) of -- dispatch+                                            (IRCRaised (NoMethodError _)) ->+                                                Left `fmap` process_ m cmd' rest+                                            _ -> throwError ey)+                                   _ -> throwError ex)++                                -- send off our strings/bytestrings                                 case mstrs of-                                    [] -> ircPrivmsg towhere Nothing-                                    _  -> mapM_ (ircPrivmsg towhere . Just) mstrs)+                                    Right ps -> lift $ mapM_ (ircPrivmsgF towhere) ps -                            (ircPrivmsg towhere . Just .((?name++" module failed: ")++).show))+                                    Left  ms -> lift $ mapM_ (ircPrivmsg towhere) ms) +                            (lift . ircPrivmsg towhere .+                                (("Plugin `" ++ name' ++ "' failed with: ") ++) . show))+              lift $ act     --     -- contextual messages are all input that isn't an explicit command.     -- they're passed to all modules (todo, sounds inefficient) for@@ -244,22 +267,25 @@     -- Note how we catch any plugin errors here, rather than letting     -- them bubble back up to the mainloop     ---    doContextualMsg r = do-        withAllModules (\m ->-            forkLB $ catchIrc-                (do ms <- contextual m msg alltargets r-                    mapM_ (ircPrivmsg alltargets . Just) ms)-                (\e -> debugStrLn-                    (?name++" module failed in contextual handler: "++show e)) )+    doContextualMsg r = lift $ do+        withAllModules ( \m -> do+            act <- bindModule0 ( do+                            ms <- contextual m msg target r+                            lift $ mapM_ (ircPrivmsg target) ms+                   )+            name' <- getName+            lift $ catchIrc act (debugStrLn . (name' ++) .+                (" module failed in contextual handler: " ++) . show)+            )         return ()  ------------------------------------------------------------------------  maybeCommand :: String -> String -> Maybe String-maybeCommand nm text = case matchRegexAll re text of+maybeCommand nm text = case R.matchRegexAll re text of       Nothing -> Nothing       Just (_, _, cmd, _) -> Just cmd-    where re = mkRegex (nm ++ "[.:,]*[[:space:]]*")+    where re = regex' (nm ++ "[.:,]*[[:space:]]*")  -- -- And stuff we don't care about
+ Plugin/Check.hs view
@@ -0,0 +1,94 @@+--+-- Copyright (c) 6 DonStewart - http://www.cse.unsw.edu.au/~dons+-- GPL version 2 or later (see http://www.gnu.org/copyleft/gpl.html)+--++--+-- | Test a property with QuickCheck+--+module Plugin.Check where++import Plugin+import Lib.Parser+import qualified Text.Regex as R++PLUGIN Check++instance Module CheckModule () where+    moduleCmds   _     = ["check"]+    moduleHelp _ _     = "check <expr>\nYou have QuickCheck and 3 seconds. Prove something."+    process _ _ to _ s = ios80 to (check s)++binary :: String+binary = "./quickcheck"++check :: String -> IO String+check src = do+    case parseExpr src of+        Left e  -> return e+        Right _ -> do+            (out,err,_) <- popen binary [] (Just src)+            let o = munge out+                e = munge err+            return $ case () of {_+                | null o && null e -> "Terminated\n"+                | null o           -> " " ++ e+                | otherwise        -> " " ++ o+            }+            where munge = unlines+                        . f+                        . lines+                        . expandTab+                        . dropWhile (=='\n')+                        . dropNL+                        . clean_+                  f []   = []+                  f [x]  = [x]+                  f (x:y)= [x ++ " " ++ (concat . intersperse ", ") y]++--+-- Clean up runplugs' output+--+clean_ :: String -> String+clean_ s|  no_io      `matches'`    s = "No IO allowed\n"+        |  terminated `matches'`    s = "Terminated\n"+        |  hput       `matches'`    s = "Terminated\n"+        |  stack_o_f  `matches'`    s = "Stack overflow\n"+        |  loop       `matches'`    s = "Loop\n"+        |  undef      `matches'`    s = "Undefined\n"+        |  type_sig   `matches'`    s = "Add a type signature\n"++        | Just (_,m,_,_) <- ambiguous  `R.matchRegexAll` s = m+        | Just (_,_,b,_) <- inaninst   `R.matchRegexAll` s = clean_ b+        | Just (_,_,b,_) <- irc        `R.matchRegexAll` s = clean_ b+        | Just (_,m,_,_) <- nomatch    `R.matchRegexAll` s = m+        | Just (_,m,_,_) <- notinscope `R.matchRegexAll` s = m+        | Just (_,m,_,_) <- hsplugins  `R.matchRegexAll`  s = m+        | Just (a,_,_,_) <- columnnum  `R.matchRegexAll`  s = a+        | Just (a,_,_,_) <- extraargs  `R.matchRegexAll`  s = a+        | Just (_,_,b,_) <- filename'  `R.matchRegexAll`  s = clean_ b+        | Just (a,_,b,_) <- filename   `R.matchRegexAll`  s = a ++ clean_ b+        | Just (a,_,b,_) <- filepath   `R.matchRegexAll`   s = a ++ clean_ b+        | Just (a,_,b,_) <- runplugs   `R.matchRegexAll`  s = a ++ clean_ b+        | otherwise      = s+    where+        -- s/<[^>]*>:[^:]: //+        type_sig   = regex' "add a type signature that fixes these type"+        no_io      = regex' "No instance for \\(Show \\(IO"+        terminated = regex' "waitForProc"+        stack_o_f  = regex' "Stack space overflow"+        loop       = regex' "runplugs: <<loop>>"+        irc        = regex' "\n*<irc>:[^:]*:[^:]*:\n*"+        filename   = regex' "\n*<[^>]*>:[^:]*:\\?[^:]*:\\?\n* *"+        filename'  = regex' "/tmp/.*\\.hs[^\n]*\n"+        filepath   = regex' "\n*/[^\\.]*.hs:[^:]*:\n* *"+        undef      = regex' "Prelude.undefined"+        ambiguous  = regex' "Ambiguous type variable `a\' in the constraints"+        runplugs   = regex' "runplugs: "+        notinscope = regex' "Variable not in scope:[^\n]*"+        hsplugins  = regex' "Compiled, but didn't create object"+        extraargs  = regex' "[ \t\n]*In the [^ ]* argument"+        columnnum  = regex' " at <[^\\.]*\\.[^\\.]*>:[^ ]*"+        nomatch    = regex' "Couldn't match[^\n]*\n"+        inaninst   = regex' "^[ \t]*In a.*$"+        hput       = regex' "<stdout>: hPutStr"
Plugin/Compose.hs view
@@ -13,17 +13,28 @@ import Message  import Control.Monad.State+import Control.Arrow (first) import GHC.IOBase   (Exception(NoMethodError))  PLUGIN Compose  instance Module ComposeModule () where-    moduleCmds _   = [".", "compose"]-    moduleHelp _ _ = unlines [". <cmd1> <cmd2> [args]."+    moduleCmds _   = [".", "compose", "@", "?"]+    moduleHelp _ c = unlines $+                       if c `elem` ["@","?"]+                        then [c++" [args]."+                             ,c++" executes plugin invocations in its arguments, parentheses can be used."+                             ," The commands are right associative."+                             ," For example:    "++c++" "++c++"pl "++c++"undo code"+                             ," is the same as: "++c++" ("++c++"pl ("++c++"undo code))"]+                        else [". <cmd1> <cmd2> [args]."                              ,". [or compose] is the composition of two plugins"                              ," The following semantics are used: . f g xs == g xs >>= f"] -    process    _ a b _ args = case split " " args of+    process    _ a b c args+        | c `elem` ["@","?"] = lift $ evalBracket (a,b) args++    process    _ a b _ args = lift $ case split " " args of         (f:g:xs) -> do             f' <- lookupP (a,b) f             g' <- lookupP (a,b) g@@ -40,15 +51,95 @@ -- | Lookup the `process' method we're after, and apply it to the dummy args -- Fall back to process_ if there's no process. ---lookupP :: Message a => (a, String) -> String -> LB (String -> LB [String])+lookupP :: Message a => (a, Nick) -> String -> LB (String -> LB [String]) lookupP (a,b) cmd = withModule ircCommands cmd-    (error $ "Parse error: " ++ show cmd) +    (error $ "Unknown command: " ++ show cmd)      (\m -> do         privs <- gets ircPrivCommands -- no priv commands can be composed         when (cmd `elem` privs) $ error "Privledged commands cannot be composed"-        return $ \str -> catchError +        bindModule1 $ \str -> catchError                      (process m a b cmd str)                     (\ex -> case (ex :: IRCError) of                                  (IRCRaised (NoMethodError _)) -> process_ m cmd str                                 _ -> throwError ex)) ++------------------------------------------------------------------------++-- | More interesting composition/evaluation+-- @@ @f x y (@g y z)+evalBracket :: Message a => (a, Nick) -> String -> LB [String]+evalBracket a args = liftM (map addSpace . concat') $ mapM (evalExpr a) $ fst $ parseBracket 0 True args+ where concat' ([x]:[y]:xs) = concat' ([x++y]:xs)+       concat' xs           = concat xs+       +       addSpace :: String -> String+       addSpace (' ':xs) = ' ':xs+       addSpace xs       = ' ':xs++evalExpr :: Message a => (a, Nick) -> Expr -> LB [String]+evalExpr _ (Arg s) = return [s]+evalExpr a (Command c args) = do+     args' <- mapM (evalExpr a) args+     let arg = concat $ concat $ map (intersperse " ") args'+     cmd <- lookupP a c+     cmd arg++------------------------------------------------------------------------++data Expr = Command String [Expr]+          | Arg String+    deriving Show++-- | Parse a command invocation that can contain parentheses+--   The Int indicates how many brackets must be closed to end the current argument, or 0+--   The Bool indicates if this is a valid location for a character constant+parseBracket :: Int -> Bool -> String -> ([Expr],String)+parseBracket 0 _ []       = ([],[])+parseBracket _ _ []       = error "Missing ')' in nested command"+parseBracket 1 _ (')':xs) = ([],xs)+parseBracket n _ (')':xs) | n > 0+                          = first (addArg ")") $ parseBracket (n-1) True xs+parseBracket n _ ('(':xs) | Just ys <- isCommand xs       -- (@cmd arg arg)+                          = parseCommand n ys+parseBracket n _ ('(':xs) | n > 0+                          = first (addArg "(") $ parseBracket (n+1) True xs+parseBracket n _ xs       | Just ('(':ys) <- isCommand xs -- @(cmd arg arg)+                          = parseCommand n ys+parseBracket n _ xs       | Just ys <- isCommand xs       -- @cmd arg arg+                          = parseInlineCommand n ys+parseBracket n c (x:xs)   | x `elem` "\"'" && (c || x /= '\'')+                          = let (str, ys) = parseString x xs+                                (rest,zs) = parseBracket n True ys+                            in  (addArg (x:str) rest, zs)+parseBracket n c (x:xs)   = first (addArg [x])+                          $ parseBracket n (not (isAlphaNum x) && (c || x /= '\'')) xs++parseCommand, parseInlineCommand :: Int -> String -> ([Expr],String)+parseCommand n xs = let (cmd, ys) = break (`elem` " )") xs+                        (args,zs) = parseBracket 1 True (dropWhile (==' ') ys)+                        (rest,ws) = parseBracket n True zs+                    in  (Command cmd args:rest, ws)++parseInlineCommand n xs = let (cmd, ys) = break (`elem` " )") xs+                              (rest,zs) = parseBracket n True (dropWhile (==' ') ys)+                          in  (Command cmd rest:[], zs)++parseString :: Char -> String -> (String, String)+parseString _     []          = ([],[])+parseString delim ('\\':x:xs) = first (\ys -> '\\':x:ys) (parseString delim xs)+parseString delim (x:xs)+  | delim == x                = ([x],xs)+  | otherwise                 = first (x:) (parseString delim xs)+++-- | Does xs start with a command prefix?+isCommand :: String -> Maybe String+isCommand xs = msum $ map dropPrefix (commandPrefixes config)+ where dropPrefix p+          | p `isPrefixOf` xs = Just $ drop (length p) xs+          | otherwise         = Nothing++addArg :: String -> [Expr] -> [Expr]+addArg s (Arg a:es) = Arg (s++a):es+addArg s es         = Arg s     :es
Plugin/DarcsPatchWatch.hs view
@@ -19,26 +19,27 @@  import System.Directory import System.Time--newtype DarcsPatchWatch = DarcsPatchWatch ()+import Message -theModule :: MODULE-theModule = MODULE $ DarcsPatchWatch ()+PLUGIN DarcsPatchWatch   -- -- Configuration variables -- -maxNumberOfRepos :: Int-maxNumberOfRepos = 20- debugFlag :: Bool debugFlag = False -announceTarget :: String-announceTarget = "#z123lambdabot"+maxNumberOfRepos :: Int+maxNumberOfRepos = 20 +announceTarget :: Nick+announceTarget = Nick {+  nTag  = "freenode",+  nName = "#lazybottoms-dev"+  }+ inventoryFile :: String inventoryFile = "_darcs/inventory" @@ -114,7 +115,7 @@ -- The plugin itself -- -instance Module DarcsPatchWatch DarcsPatchWatchState where+instance Module DarcsPatchWatchModule DarcsPatchWatchState where      moduleCmds  _ = ["repos", "repo-add", "repo-del"] @@ -127,7 +128,7 @@     moduleSerialize _ = Just stateSerial     moduleDefState  _ = return (DarcsPatchWatchState Nothing [])     moduleInit      _ = do-      tid <- lbIO (\conv -> forkIO $ conv watchRepos)+      tid <- watchRepos -- must return thread ID.       modifyMS (\s -> s { dpw_threadId = Just tid })      moduleExit      _ =@@ -141,6 +142,7 @@                          "repo-add"    -> addRepo rest                          "repo-del"    -> delRepo rest + -- -- Configuration commands --@@ -151,7 +153,7 @@ addRepo :: String -> DPW [String] addRepo rest | null (dropSpace rest) = return ["argument required"] addRepo rest = do-   x <- mkRepo rest+   x <- lift $ mkRepo rest    case x of      Right r -> withRepos $ \repos setRepos -> case () of {_             | length repos >= maxNumberOfRepos ->@@ -168,7 +170,7 @@ delRepo :: String -> DPW [String] delRepo rest | null (dropSpace rest) = return ["argument required"] delRepo rest = do-   x <- mkRepo rest+   x <- lift $ mkRepo rest    case x of      Left s -> return ["cannot delete invalid repository: " ++ s]      Right r -> withRepos $ \repos setRepos -> case findRepo r repos of@@ -202,16 +204,27 @@ -- The heart of the plugin: watching darcs repositories -- -watchRepos :: DPW ()-watchRepos =-    do withRepos $ \repos setRepos ->-           do debug ("checking darcs repositories " ++ showRepos repos)-              repos_ <- mapM checkRepo repos-              setRepos repos_-       io $ threadDelay sleepTime-       watchRepos+watchRepos :: DPW ThreadId+watchRepos = do+      ref <- getRef+      lift . forkForeverLB $ helper ref     where sleepTime :: Int  -- in milliseconds           sleepTime = checkInterval * 1000 * 1000+          helper    :: MVar DarcsPatchWatchState -> LB () -- !+          helper ref = do+              repos <- io . liftM dpw_repos . readMVar $ ref+              debug ("checking darcs repositories " ++ showRepos repos)+              repos_ <- mapM checkRepo repos+              io $ modifyMVar_ ref (\s -> return s{dpw_repos = repos_})+              io $ threadDelay sleepTime+              helper ref+          -- | run an IO action in another thread, with a timeout, lifted into LB+          forkForeverLB :: LB a -> LB ThreadId+          forkForeverLB f = (`liftLB` f) $ \g -> do+                      forkIO $ do+                          g+                          return ()+            -- actually work out if we need to send a message --@@ -234,7 +247,7 @@        return $ r { repo_nlinesAtLastAnnouncement = nlines                   , repo_lastAnnounced = Just ct }     where-       send' = ircPrivmsg announceTarget . Just+       send' = ircPrivmsg announceTarget  mkMsg :: String -> (String,String,Integer) -> String mkMsg r (who,msg,0) = "[" ++ basename r ++ ":" ++ who ++ "] " ++ msg
Plugin/Dice.hs view
@@ -20,27 +20,45 @@  dice :: String -> IO String dice str = case parse expr "dice" (filter (not.isSpace) str) of-            Left err  -> return $ show err+            Left err  -> return . trimError $ err             Right e   -> do res <- eval e-                            return (str++" => "++show res)+                            return (brk 30 str++" => "++brk 45 (show res))+           where+            brk n s | length s <= n = s+                    | otherwise     = take (n-3) s ++ "..."+            trimError = concat . intersperse ": " . tail . lines . show -eval :: [(Int, Int)] -> IO Int+eval :: [(Integer, Integer)] -> IO Integer eval = foldM ef 0     where ef acc (v,1) = return (acc+v)           ef acc (n,d) = if n > 100-                            then return 0-                            else do ls <- replicateM n (randomRIO (1,d))+                            then do x <- ndRandomIO+                                    let e = n*(d+1)`div`2+                                        e' = fromIntegral (n*(d+1)`mod`2)/2+                                        v = fromIntegral (d*d-1)/12+                                        x' = e' + x * sqrt (fromIntegral n * v)+                                    return (acc + e + round x')+                            else do ls <- replicateM (fromIntegral n)+                                                     (randomRIO (1,d))                                     return (acc + sum ls) +-- | get a normally distributed random number+ndRandomIO :: IO Double+ndRandomIO = do r   <- randomRIO (0, 1)+                phi <- randomRIO (0, 2*pi)+                let r' = sqrt (-2 * log r)+                return (r' * sin phi) -expr :: CharParser st [(Int, Int)]-expr = primExp `sepBy1` (char '+')+expr :: CharParser st [(Integer, Integer)]+expr = do res <- primExp `sepBy1` (char '+')+          eof <?> "end"+          return res -primExp :: CharParser st (Int, Int)+primExp :: CharParser st (Integer, Integer) primExp = do v <- number              d <- option 1 (char 'd' >> number)              return (v,d) -number :: CharParser st Int-number = read `fmap` many1 digit+number :: CharParser st Integer+number = read `fmap` many1 digit <?> "number" 
Plugin/Dict.hs view
@@ -18,19 +18,23 @@     process_ _ "dict"      _    = return [quickHelp]     process_ _ "dict-help" rest = return [getHelp (words rest)]     process_ _ cmd         rest = do-        results <- mapM doLookup (parseTerms rest)-        return [concat results]+        let s = parseTerms rest+        results <- mapM doLookup s+        return $ case results of+            [] -> []+            _  -> [concat results]       where         doLookup w = io $ do             result <- lookupFn w             return $ either ("Error: " ++) id result+         lookupFn = uncurry Dict.simpleDictLookup . fst $                    fromJust (lookup cmd dictTable)  -- | Configuration.  dictTable :: [(String, ((Dict.QueryConfig, String), String))]-dictTable = +dictTable =     -- @command   ((server  , database),    description)     [ ("all-dicts",((dict_org, "*")       , "Query all databases on dict.org"))     , ("elements", ((dict_org, "elements"), "Elements database"))@@ -64,8 +68,8 @@  quickHelp :: String quickHelp = unlines [ "Supported dictionary-lookup commands:"-                    , "  " ++ concatWith " " (map ('@':) dictNames)-                    , "Use \"@dict-help [cmd...]\" for more."+                    , "  " ++ concatWith " " dictNames+                    , "Use \"dict-help [cmd...]\" for more."                     ]  getHelp :: [String] -> String@@ -75,11 +79,12 @@  getHelp dicts = unlines . map gH $ dicts     where-    gH dict = case lookup dict' dictTable of-              Just (_, descr) -> pad ('@':dict') ++ " " ++ descr-              Nothing         -> "There is no dictionary database '"-                                 ++ dict' ++ "'."-              where dict' = filter (/='@') dict+    gH dict | Just (_, descr) <- lookup dict dictTable+            = pad dict ++ " " ++ descr++            | otherwise+            = "There is no dictionary database '" ++ dict ++ "'."+     pad xs = take padWidth (xs ++ " " ++ repeat '.')     padWidth = maximum (map length dictNames) + 4 
Plugin/Djinn.hs view
@@ -12,7 +12,12 @@  import Plugin import System.Directory+import Data.Char+import Data.List+import Data.Maybe +import qualified Text.Regex as R+ PLUGIN Djinn  -- | We can accumulate an interesting environment@@ -28,12 +33,14 @@             "djinn-del" -> "djinn-del <ident>.\nRemove a symbol from the environment"             "djinn-clr" -> "djinn-clr.\nReset the djinn environment"             "djinn-env" -> "djinn-env.\nShow the current djinn environment"+            "djinn-names" -> "djinn-names.\nShow the current djinn environment, compactly."             "djinn-ver" -> "djinn-ver.\nShow current djinn version"          moduleCmds      _ = ["djinn"                             ,"djinn-add"                             ,"djinn-del"                             ,"djinn-env"+                            ,"djinn-names"                             ,"djinn-clr"                              ,"djinn-ver"] @@ -51,9 +58,9 @@          -- rule out attempts to do IO, if these get into the env,         -- they'll be executed by djinn-        process_ _ _ s | Just _ <- cmd  `matchRegex` s = end+        process_ _ _ s | cmd  `matches'` s = end           where end  = return ["Invalid command"]-                cmd  = mkRegex "^ *:"+                cmd  = regex' "^ *:"          -- Normal commands         process_ _ "djinn" s = do@@ -62,9 +69,9 @@                 return $ either id (tail . lines) e             where             dropForall t-            	| Just (_, _, x, _) <- matchRegexAll re t = x-            	| otherwise = t-            re = mkRegex "^forall [[:alnum:][:space:]]+\\."+                | Just (_, _, x, _) <- R.matchRegexAll re t = x+                | otherwise = t+            re = regex' "^forall [[:alnum:][:space:]]+\\."          -- Augment environment. Have it checked by djinn.         process_ _ "djinn-add"  s = do@@ -79,6 +86,13 @@             (prelude,st) <- readMS             return $ prelude ++ st +        -- Display the environment's names (quarter-baked)+        process_ _ "djinn-names"  _ = do+            (prelude,st) <- readMS+            let names = concat $ intersperse " " $ concatMap extractNames $ prelude ++ st+            return [names]+          where extractNames = filter (isUpper . head) . unfoldr (\x -> case x of _:_ -> listToMaybe (lex x); _ -> Nothing)+         -- Reset the env         process_ _ "djinn-clr" _ = modifyMS (flip (,) [] . fst) >> return [] @@ -123,20 +137,19 @@     (out,_,_) <- popen binary [] (Just (env <$> src <$> ":q"))     let o = dropNL . clean_ . unlines . init . drop 2 . lines $ out     return $ case () of {_-        | Just _ <- failed `matchRegexAll` o -> Left (lines o)-        | Just _ <- unify  `matchRegexAll` o -> Left (lines o)+        | failed `matches'` o -> Left (lines o)+        | unify  `matches'` o -> Left (lines o)         | otherwise                          -> Right o     }     where-        failed = mkRegex "Cannot parse command"-        unify  = mkRegex "cannot be realized"+        failed = regex' "Cannot parse command"+        unify  = regex' "cannot be realized"  -- -- Clean up djinn output -- clean_ :: String -> String-clean_ s | Just (a,_,b,_) <- prompt `matchRegexAll` s = a ++ clean_ b-        | otherwise      = s-    where-        prompt = mkRegex "Djinn>[^\n]*\n"+clean_ s | Just (a,_,b,_) <- prompt `R.matchRegexAll` s = a ++ clean_ b+         | otherwise      = s+    where prompt = regex' "Djinn>[^\n]*\n" 
− Plugin/DrHylo.hs
@@ -1,379 +0,0 @@-{-# OPTIONS -fno-warn-name-shadowing #-}------ A wrapper over DrHylo, from the UMinho Haskell Software--- DrHylo derives hylomorphisms from restricted Haskell syntax------ The original DrHylo written by alcino@di.uminho.pt.------ See also---     http://wiki.di.uminho.pt/twiki/bin/view/Alcino/PointlessHaskell-----module Plugin.DrHylo where--import Language.Haskell.Syntax-import Language.Haskell.Parser-import Language.Haskell.Pretty-import Control.Monad.State--import Plugin hiding (Module, Config(..))-import qualified Plugin as P (Module)--PLUGIN DrHylo--instance P.Module DrHyloModule () where--    process_ _ _ xs = io (hylo xs)--    moduleCmds _   = ["hylo"]-    moduleHelp _ _ = unlines -       ["hylo <expr>. Derive hylomorphism for <expr>. Based on DrHylo."-       ,"Uses the Pointless.Combinators from:"-       ," http://wiki.di.uminho.pt/twiki/bin/view/Alcino/PointlessHaskell"-       ,"Mirrored:"-       ," http://www.cse.unsw.edu.au/~dons/Pointless/"]--hylo :: String -> IO [String]-hylo = ((drop 4 . lines . prettyPrint . dhModule) `fmap`) . parse------------------------------------------------------------------------------ I'm not collecting the global ids yet--mkHsImportDecl :: String -> HsImportDecl-mkHsImportDecl n = HsImportDecl mkLoc (Module n) False Nothing Nothing--dhModule :: HsModule -> HsModule-dhModule (HsModule loc name exports imports decls) =-    let decls' = map aux decls-        imports' = imports++[ mkHsImportDecl "Pointless.Combinators"-                            , mkHsImportDecl "Pointless.Functors"-                            , mkHsImportDecl "Pointless.RecursionPatterns"]-    in HsModule loc name exports imports' decls'-    where aux d = case (evalStateT (dhDecl d) initialSt)-                  of Just d' -> d'-                     Nothing -> d--dhDecl :: HsDecl -> ST HsDecl-dhDecl (HsFunBind matches) =-    do setNMatches (sum (map aux matches))-       sequence (map dMatch matches)-       functor <- gets functor-       cata <- gets cata-       ana <- gets ana-       name <- gets name-       return (mkHylo (fromJust name)-                    (HsTyApp (HsTyVar (mkName "Mu"))-                       (foldr1 mkSum functor)) ana cata)-    where aux (HsMatch _ _ _ (HsUnGuardedRhs _) _) = 1-          aux (HsMatch _ _ _ (HsGuardedRhss l) _) = length l-dhDecl _ = fail "Hylo derivation is only applied to functions"--mkHylo :: HsName -> HsType -> [HsMatch] -> [HsMatch] -> HsDecl-mkHylo name functor cata ana = -    let rhs = HsUnGuardedRhs (HsApp (HsApp (HsApp (mkVar "hylo") (HsParen (HsExpTypeSig mkLoc (mkVar "_L") (HsQualType [] functor)))) (mkVar "g")) (mkVar "h"))-    in HsFunBind [(HsMatch mkLoc name [] rhs [HsFunBind ana, HsFunBind cata])]--dMatch :: HsMatch -> ST ()-dMatch (HsMatch _loc id pats (HsUnGuardedRhs rhs) wheres) = -    do unless (length pats == 1 && null wheres) (fail "We only accept functions with one parameter and without wheres")-       setName id-       catarhs <- dExp rhs-       recs <- gets recs-       fvars <- gets fvars-       match <- gets match-       nmatches <- gets nmatches-       tyvar <- getFreshVar-       let functorrecs = map (\_ ->  mkId) recs-           catarecs = map (\(HsVar (UnQual v)) -> HsPVar v) (map fst recs)-           functorfvars = if (null fvars) then (if (null recs) then [mkConst (mkName "()")] else []) else [mkConst tyvar]-           anafvars = if (null fvars && not (null recs)) then [] else [HsTuple fvars]-           catafvars = if (null fvars && not (null recs)) then [] else [HsPTuple (map (\(HsVar (UnQual v)) -> HsPVar v) fvars)]-       addFunctor (foldr1 mkProd (functorfvars ++ functorrecs))-       addCata (HsMatch mkLoc (mkName "g") [mkPCons nmatches match (foldr1 mkPTuple (catafvars ++ catarecs))] (HsUnGuardedRhs catarhs) [])-       addAna (HsMatch mkLoc (mkName "h") pats (HsUnGuardedRhs (mkCons nmatches match (foldr1 mkTuple (anafvars ++ (map snd recs))))) [])-       nextMatch-       return ()-dMatch (HsMatch _loc id pats (HsGuardedRhss rhs) wheres) =-    do unless (length pats == 1 && null wheres) (fail "We only accept functions with one parameter and without wheres")-       setName id-       mapM (dGuardedRhs pats) rhs-       return ()--dGuardedRhs :: [HsPat] -> HsGuardedRhs -> ST ()-dGuardedRhs pats (HsGuardedRhs loc guard exp) =-    do catarhs <- dExp exp-       recs <- gets recs-       fvars <- gets fvars-       match <- gets match-       nmatches <- gets nmatches-       tyvar <- getFreshVar-       let functorrecs = map (\_ ->  mkId) recs-           catarecs = map (\(HsVar (UnQual v)) -> HsPVar v) (map fst recs)-           functorfvars = if (null fvars) then (if (null recs) then [mkConst (mkName "()")] else []) else [mkConst tyvar]-           anafvars = if (null fvars && not (null recs)) then [] else [HsTuple fvars]-           catafvars = if (null fvars && not (null recs)) then [] else [HsPTuple (map (\(HsVar (UnQual v)) -> HsPVar v) fvars)]-       addFunctor (foldr1 mkProd (functorfvars ++ functorrecs))-       addCata (HsMatch mkLoc (mkName "g") [mkPCons nmatches match (foldr1 mkPTuple (catafvars ++ catarecs))] (HsUnGuardedRhs catarhs) [])-       addAna (HsMatch mkLoc (mkName "h") pats (HsGuardedRhss [HsGuardedRhs loc guard (mkCons nmatches match (foldr1 mkTuple (anafvars ++ (map snd recs))))]) [])-       nextMatch-       return ()------ Not exactly like in the paper: for the moment, I only consider the function to have 1 parameter-dExp :: HsExp -> ST HsExp-dExp (HsLit x) = return (HsLit x)-dExp (HsApp (HsVar (UnQual f)) e) = -    do f' <- gets name-       if (f == (fromJust f'))-        then (do {u <- getFreshVar;-                  e' <- rLets e;-                  addRec ((HsVar (UnQual u)),e');-                  return (HsVar (UnQual u))})-        else (do {e' <- dExp e;-                  return (HsApp (HsVar (UnQual f)) e')})-dExp (HsApp (HsCon (UnQual c)) e) = -    do e' <- dExp e-       return (HsApp (HsCon (UnQual c)) e')-dExp (HsApp a b) = -    do a' <- dExp a-       b' <- dExp b-       return (HsApp a' b')-dExp (HsList l) =-    do l' <- mapM dExp l-       return (HsList l')-dExp (HsTuple l) =-    do l' <- mapM dExp l-       return (HsTuple l')-dExp (HsInfixApp l o r) = -    do l' <- dExp l-       r' <- dExp r-       return (HsInfixApp l' o r')--- there is an error in the paper concerning lets-dExp (HsLet [HsPatBind loc (HsPVar v) (HsUnGuardedRhs d) []] e) =-    do addLet (v,d)-       e' <- dExp e-       removeLet (v,d)-       d' <- dExp d-       return (HsLet [HsPatBind loc (HsPVar v) (HsUnGuardedRhs d') []] e')-dExp (HsVar (UnQual v)) = -    do lets <- gets lets-       unless (v `elem` (map fst lets)) (addFVar (HsVar (UnQual v)))-       return (HsVar (UnQual v))-dExp (HsCon c) = return (HsCon c)-dExp (HsParen e) =-    do e' <- dExp e-       return (HsParen e')-dExp _ = fail "Can not handle all HsExps"----- Replace lets--rLets :: HsExp -> ST HsExp-rLets (HsLit x) = return (HsLit x)-rLets (HsApp a b) = -    do a' <- rLets a-       b' <- rLets b-       return (HsApp a' b')-rLets (HsList l) =-    do l' <- mapM rLets l-       return (HsList l')-rLets (HsTuple l) =-    do l' <- mapM rLets l-       return (HsTuple l')-rLets (HsInfixApp l o r) = -    do l' <- rLets l-       r' <- rLets r-       return (HsInfixApp l' o r')-rLets (HsLeftSection l o) = -    do l' <- rLets l-       return (HsLeftSection l' o)-rLets (HsRightSection o l) = -    do l' <- rLets l-       return (HsRightSection o l')-rLets (HsVar (UnQual v)) = -    do lets <- gets lets-       case (lookup v lets) -            of Nothing -> do {return (HsVar (UnQual v))}-               Just e  -> do {return (HsParen (HsLet [HsPatBind mkLoc (HsPVar v) (HsUnGuardedRhs e) []] (HsVar (UnQual v))))}-rLets (HsCon c) = return (HsCon c)-rLets (HsParen e) =-    do e' <- rLets e-       return (HsParen e')-rLets _ = fail "Can not handle all HsExps"---- Auxiliary definitions--mkSum :: HsType -> HsType -> HsType-mkSum l r = HsTyApp (HsTyApp l (HsTyVar (mkName ":+:"))) r--mkProd :: HsType -> HsType -> HsType-mkProd l r = HsTyApp (HsTyApp l (HsTyVar (mkName ":*:"))) r--mkId :: HsType-mkId = HsTyVar (mkName "Id")--mkConst :: HsName -> HsType-mkConst n = HsTyApp (HsTyVar (mkName "Const")) (HsTyVar n)--mkLoc :: SrcLoc-mkLoc = SrcLoc "" 0 0--mkVar :: String -> HsExp-mkVar s = HsVar (UnQual (mkName s))--mkName :: String -> HsName-mkName s = (HsIdent s)--mkTuple :: HsExp -> HsExp -> HsExp-mkTuple l r = HsTuple [l,r]--mkPTuple :: HsPat -> HsPat -> HsPat-mkPTuple l r = HsPTuple [l,r]--mkCons :: Int -> Int -> HsExp -> HsExp-mkCons 1 0 e = e-mkCons m n e = -    let aux = (replicate n (HsCon (UnQual (mkName "Right")))) ++ (if (n==(m-1)) then [] else [HsCon (UnQual (mkName "Left"))])-    in foldr1 (\l r -> HsApp l (HsParen r)) (aux++[e])--mkPCons :: Int -> Int -> HsPat -> HsPat-mkPCons 1 0 e = e-mkPCons m n e = -    let aux = (replicate n (HsPVar (mkName "Right"))) ++ (if (n==(m-1)) then [] else [HsPVar (mkName "Left")])-    in HsPParen (foldr1 (\(HsPVar l) r -> HsPApp (UnQual l) [(HsPParen r)]) (aux++[e]))---- The State of our Monad--type ST = StateT St Maybe--data St = St {lets :: [(HsName,HsExp)], -              name :: Maybe HsName,-              seed :: Int,-              fvars :: [HsExp],-              recs :: [(HsExp,HsExp)],-              ana :: [HsMatch],-              cata :: [HsMatch],-              functor :: [HsType],-              match :: Int,-              nmatches :: Int-             }--initialSt :: St-initialSt = St {lets = [], -                name = Nothing,-                seed = 0,-                fvars = [],-                recs = [],-                cata = [],-                ana = [],-                functor = [],-                match = 0,-                nmatches = 0-               }--setName :: HsName -> ST ()-setName n = modify (\s -> s {name = Just n})--nextMatch :: ST ()-nextMatch = modify (\s -> s {fvars = [], recs = [], match = match s + 1})--setNMatches :: Int -> ST ()-setNMatches n = modify (\s -> s {nmatches = n})--getSeed :: ST Int-getSeed = do n <- gets seed-             modify (\s -> s {seed = n+1})-             return n--getFreshVar :: ST HsName-getFreshVar = do s <- getSeed-                 return (HsIdent ("v"++(show s)))--addLet :: (HsName,HsExp) -> ST ()-addLet v = modify (\s -> s {lets = v:(lets s)})--removeLet :: (HsName,HsExp) -> ST ()-removeLet v = modify (\s -> s {lets = delete v (lets s)})--addFVar :: HsExp -> ST ()-addFVar v = modify (\s -> s {fvars = fvars s ++ [v]})--addRec :: (HsExp,HsExp) -> ST ()-addRec r = modify (\s -> s {recs = recs s ++ [r]})--addCata :: HsMatch -> ST ()-addCata v = modify (\s -> s {cata = cata s ++ [v]})--addAna :: HsMatch -> ST ()-addAna v = modify (\s -> s {ana = ana s ++ [v]})--addFunctor :: HsType -> ST ()-addFunctor v = modify (\s -> s {functor = functor s ++ [v]})----------------------------------------------------------------------------parse :: String -> IO HsModule-parse s = case (parseModule s)-          of ParseOk m -> return m-             ParseFailed l d -> fail ((show l)++": "++d)--{---plus :: (Int, Int) -> Int-plus = uncurry (+)--fib :: Int -> Int-fib 0 = 1-fib 1 = 1-fib x = fib (x-1) + fib (x-2)--isort :: Ord a => [a] -> [a]-isort [] = []-isort (x:xs) = insert (x,(isort xs))--insert :: Ord a => (a,[a]) -> [a]-insert (x,[]) = [x]-insert (x,y:ys) | x<=y = x:y:ys-                | otherwise = y:(insert (x,ys))--fact 0 = 1-fact n = n * fact (n-1)--len [] = 0-len (x:xs) = 1+(len xs)--qsort :: (Ord a) => [a] -> [a]-qsort [] = []-qsort (x:xs) = qsort (filter (<=x) xs) ++ [x] ++ qsort (filter (>x) xs)--msort :: (Ord a) => [a] -> [a]-msort [] = []-msort [x] = [x]-msort l = let aux = msplit l-          in merge (msort (fst aux), msort (snd aux))--msplit :: [a] -> ([a],[a])-msplit [] = ([],[])-msplit (x:xs) = let aux = msplit xs-                in (x:snd aux, fst aux)--merge :: (Ord a) => ([a],[a]) -> [a]-merge ([],l) = l-merge (l,[]) = l-merge (x:xs,y:ys) | x<=y = x:merge (xs,y:ys)-                  | otherwise = y:merge (x:xs,ys)--hsort :: (Ord a) => [a] -> [a]-hsort [] = []-hsort l = let aux = hsplit l-           in (fst aux):(merge (hsort (fst (snd aux)), hsort (snd (snd aux))))--hsplit :: (Ord a) => [a] -> (a,([a],[a]))-hsplit [x] = (x,([],[]))-hsplit (h:t) | h < m     = (h,(m:l,r))-             | otherwise = (m,(h:r,l))-             where (m,(l,r)) = hsplit t---}
Plugin/Dummy.hs view
@@ -7,85 +7,103 @@ import Plugin  import Plugin.Dummy.DocAssocs (docAssocs)-import Plugin.Dummy.Moo (cows)  import qualified Data.Map as M import qualified Data.ByteString.Char8 as P  PLUGIN Dummy -instance Module DummyModule [String] where-  moduleDefState = const . return . cycle $ cows+instance Module DummyModule () where -  moduleCmds   _ = "eval" : {-"moo" : -} map fst dummylst+  moduleCmds   _ = "eval" : "choose" : map fst dummylst    moduleHelp _ s = case s of         "dummy"       -> "dummy. Print a string constant"+        "bug"         -> "bug. Submit a bug to GHC's trac"         "eval"        -> "eval. Do nothing (perversely)"          "id"          -> "id <arg>. The identiy plugin"+        "read"        -> "read \"<foo>\". Print <foo>"+        "show"        -> "show <foo>. Print \"<foo>\""         "wiki"        -> "wiki <page>. URLs of Haskell wiki pages"         "oldwiki"     -> "oldwiki <page>. URLs of the old hawiki pages"         "paste"       -> "paste. Paste page url"          "docs"        -> "docs <lib>. Lookup the url for this library's documentation"-        "libsrc"      -> "libsrc <lib>. Lookup the url of fptools libraries"+        "source"      -> "source <lib>. Lookup the url of fptools libraries"         "fptools"     -> "fptools <lib>. Lookup url of ghc base library modules" -        "learn"       -> "learn. The learning page url."-        "eurohaskell" -> "eurohaskell. Historical."-        "moo"         -> "moo. Vegans rock!"+        "learn"       -> "learn. The learning page url"+        "eurohaskell" -> "eurohaskell. Historical"         "map"         -> "map. #haskell user map"-        "botsnack"    -> "botsnakc. Feeds the bot a snack."+        "botsnack"    -> "botsnack. Feeds the bot a snack"         "get-shapr"   -> "get-shapr. Summon shapr instantly"         "shootout"    -> "shootout. The debian language shootout"         "faq"         -> "faq. Answer frequently asked questions about Haskell"-+        "choose"      -> "choose. Lambdabot featuring AI power" -{--  process _ _ src "moo" _ = do-        cow' <- withMS $ \(cow:farm) writer -> do-          writer farm-          return cow-        mapM_ (ircPrivmsg' src) (lines cow')--}-  process_ _ "eval" _ = return []-  process_ _ cmd rest = case lookup cmd dummylst of+  process_ _ "eval"   _    = return []+  process_ _ "choose" []   = return ["Choose between what?"]+  process_ _ "choose" xs   = fmap return . io . randomElem . lines $ xs+  process_ _ cmd      rest = case lookup cmd dummylst of     Nothing -> error "Dummy: invalid command"     Just f  -> return $ lines $ f rest +  contextual _ _ _ "lisppaste2: url" = return [pastebinMsg]+  contextual _ _ _ _                 = return [] +pastebinMsg :: String+pastebinMsg = "Haskell pastebin: http://hpaste.org/new"+ dummylst :: [(String, String -> String)] dummylst = -    [("id",         id)+    [("id",      (' ' :) . id)+    ,("read",    (' ' :) . filter (/= '\n') . read)+    ,("show",       show)      ,("dummy",      const "dummy")+    ,("bug",        const "http://hackage.haskell.org/trac/ghc/newticket?type=bug")     ,("get-shapr",  const "shapr!!")     ,("faq",        const "The answer is: Yes! Haskell can do that.")-    ,("paste",      const "http://paste.lisp.org/new/haskell")+    ,("paste",      const pastebinMsg)     ,("learn",      const "http://www.haskell.org/learning.html")     ,("map",        const "http://www.haskell.org/hawiki/HaskellUserLocations")     ,("shootout",   const "http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=all")     ,("botsnack",   const ":)")+    ,("thanks",     const "you are welcome")+    ,("thx",        const "you are welcome")+    ,("thank you",  const "you are welcome") -    ,("wiki",        ("http://www.haskell.org/haskellwiki/" ++))+    ,("wiki",       lookupWiki)     ,("oldwiki",     ("http://www.haskell.org/hawiki/" ++)) -    ,("docs",        \x -> case x of-       [] -> "http://haskell.org/ghc/docs/latest/html/libraries/index.html"-       _  -> case M.lookup (P.pack x) docAssocs of-             Nothing -> x ++ " not available"-             Just m  -> "http://haskell.org/ghc/docs/latest/html/libraries/" <>-                        (P.unpack m) </> map (choice (=='.') (const '-') id) x <.> "html")+    ,("docs",        \x -> if null x+                            then docPrefix <> "index.html"+                            else lookupPackage docPrefix '-' "html" x) -    -- broken:-    ,("libsrc",      \x -> case M.lookup (P.pack x) docAssocs of-       Nothing -> x ++ " not available"-       Just m  -> "http://darcs.complete.org/fptools/libraries/" <>-                  (P.unpack m) </> map (choice (=='.') (const '/') id) x <.> "hs")+    ,("source",     lookupPackage "http://darcs.haskell.org/packages/" '/' "hs") -    ,("fptools",     \x -> case M.lookup (P.pack x) docAssocs of-       Nothing -> x ++ " not available"-       Just m  -> "http://darcs.haskell.org/packages/" <>-                  (P.unpack m) </> map (choice (=='.') (const '/') id) x <.> "hs")+    ,("fptools",    lookupPackage "http://darcs.haskell.org/packages/" '/' "hs")+    ,("hackage",    lookupHackage)     ]++lookupWiki :: String -> String+lookupWiki page = "http://www.haskell.org/haskellwiki/" ++ spacesToUnderscores page+  where spacesToUnderscores = map (\c -> if c == ' ' then '_' else c)++lookupHackage :: String -> String+lookupHackage "" = "http://hackage.haskell.org"+lookupHackage xs = "http://hackage.haskell.org/cgi-bin/hackage-scripts/package/" ++ xs++docPrefix :: String+docPrefix = "http://haskell.org/ghc/docs/latest/html/libraries/"++lookupPackage :: String -> Char -> String -> String -> String+lookupPackage begin sep end x'+ = case M.lookup (P.pack x) docAssocs of+        Nothing -> x ++ " not available"+        Just m  -> begin+                    <> P.unpack m+                    </> map (choice (=='.') (const sep) id) x+                    <.> end+ where x = dropSpace x'
Plugin/Dummy/DocAssocs.hs view
@@ -2,383 +2,382 @@ module Plugin.Dummy.DocAssocs (docAssocs) where  import qualified Data.Map as M-import qualified Data.ByteString.Base as P-import qualified Data.ByteString      as P  () -- instances+import qualified Data.ByteString.Char8 as P  -- pack all these strings  base :: P.ByteString-base = P.unsafePackAddress 4 "base"#+base = P.pack "4" stm :: P.ByteString-stm  = P.unsafePackAddress 3 "stm"#+stm  = P.pack "3" mtl :: P.ByteString-mtl  = P.unsafePackAddress 3 "mtl"#+mtl  = P.pack "3" fgl :: P.ByteString-fgl  = P.unsafePackAddress 3 "fgl"#+fgl  = P.pack "3" qc  :: P.ByteString-qc   = P.unsafePackAddress 10 "QuickCheck"#+qc   = P.pack "0" hunit  :: P.ByteString-hunit = P.unsafePackAddress 5 "HUnit"#+hunit = P.pack "5" parsec  :: P.ByteString-parsec = P.unsafePackAddress 6 "parsec"#+parsec = P.pack "6" unix  :: P.ByteString-unix   = P.unsafePackAddress 4 "unix"#+unix   = P.pack "4" readline :: P.ByteString-readline = P.unsafePackAddress 8 "readline"#+readline = P.pack "8" network :: P.ByteString-network  = P.unsafePackAddress 7 "network"#+network  = P.pack "7" th :: P.ByteString-th       = P.unsafePackAddress 16 "template-haskell"#+th       = P.pack "6" hs :: P.ByteString-hs       = P.unsafePackAddress 11 "haskell-src"#+hs       = P.pack "1" cabal :: P.ByteString-cabal    = P.unsafePackAddress 5 "Cabal"#+cabal    = P.pack "5" hgl :: P.ByteString-hgl      = P.unsafePackAddress 3 "HGL"#+hgl      = P.pack "3" glut :: P.ByteString-glut     = P.unsafePackAddress 4 "GLUT"#+glut     = P.pack "4" x11 :: P.ByteString-x11      = P.unsafePackAddress 3 "X11"#+x11      = P.pack "3" opengl :: P.ByteString-opengl   = P.unsafePackAddress 6 "OpenGL"#+opengl   = P.pack "6"  docAssocs :: M.Map P.ByteString P.ByteString docAssocs = {-# SCC "Dummy.DocAssocs" #-} M.fromList [-  (P.packAddress "Control.Arrow"#, base),-  (P.packAddress "Control.Concurrent"#, base),-  (P.packAddress "Control.Concurrent.Chan"#, base),-  (P.packAddress "Control.Concurrent.MVar"#, base),-  (P.packAddress "Control.Concurrent.QSem"#, base),-  (P.packAddress "Control.Concurrent.QSemN"#, base),-  (P.packAddress "Control.Concurrent.STM"#, stm),-  (P.packAddress "Control.Concurrent.STM.TChan"#, stm),-  (P.packAddress "Control.Concurrent.STM.TMVar"#, stm),-  (P.packAddress "Control.Concurrent.STM.TVar"#, stm),-  (P.packAddress "Control.Concurrent.SampleVar"#, base),-  (P.packAddress "Control.Exception"#, base),-  (P.packAddress "Control.Monad"#, base),-  (P.packAddress "Control.Monad.Cont"#, mtl),-  (P.packAddress "Control.Monad.Error"#, mtl),-  (P.packAddress "Control.Monad.Fix"#, base),-  (P.packAddress "Control.Monad.Identity"#, mtl),-  (P.packAddress "Control.Monad.List"#, mtl),-  (P.packAddress "Control.Monad.RWS"#, mtl),-  (P.packAddress "Control.Monad.Reader"#, mtl),-  (P.packAddress "Control.Monad.ST"#, base),-  (P.packAddress "Control.Monad.ST.Lazy"#, base),-  (P.packAddress "Control.Monad.ST.Strict"#, base),-  (P.packAddress "Control.Monad.State"#, mtl),-  (P.packAddress "Control.Monad.Trans"#, mtl),-  (P.packAddress "Control.Monad.Writer"#, mtl),-  (P.packAddress "Control.Parallel"#, base),-  (P.packAddress "Control.Parallel.Strategies"#, base),-  (P.packAddress "Data.Array"#, base),-  (P.packAddress "Data.Array.Diff"#, base),-  (P.packAddress "Data.Array.IArray"#, base),-  (P.packAddress "Data.Array.IO"#, base),-  (P.packAddress "Data.Array.MArray"#, base),-  (P.packAddress "Data.Array.ST"#, base),-  (P.packAddress "Data.Array.Storable"#, base),-  (P.packAddress "Data.Array.Unboxed"#, base),-  (P.packAddress "Data.Bits"#, base),-  (P.packAddress "Data.Bool"#, base),-  (P.packAddress "Data.Char"#, base),-  (P.packAddress "Data.Complex"#, base),-  (P.packAddress "Data.Dynamic"#, base),-  (P.packAddress "Data.Either"#, base),-  (P.packAddress "Data.FiniteMap"#, base),-  (P.packAddress "Data.FunctorM"#, base),-  (P.packAddress "Data.Generics"#, base),-  (P.packAddress "Data.Generics.Aliases"#, base),-  (P.packAddress "Data.Generics.Basics"#, base),-  (P.packAddress "Data.Generics.Instances"#, base),-  (P.packAddress "Data.Generics.Schemes"#, base),-  (P.packAddress "Data.Generics.Text"#, base),-  (P.packAddress "Data.Generics.Twins"#, base),-  (P.packAddress "Data.Graph"#, base),-  (P.packAddress "Data.Graph.Inductive"#, fgl),-  (P.packAddress "Data.Graph.Inductive.Basic"#, fgl),-  (P.packAddress "Data.Graph.Inductive.Example"#, fgl),-  (P.packAddress "Data.Graph.Inductive.Graph"#, fgl),-  (P.packAddress "Data.Graph.Inductive.Graphviz"#, fgl),-  (P.packAddress "Data.Graph.Inductive.Internal.FiniteMap"#, fgl),-  (P.packAddress "Data.Graph.Inductive.Internal.Heap"#, fgl),-  (P.packAddress "Data.Graph.Inductive.Internal.Queue"#, fgl),-  (P.packAddress "Data.Graph.Inductive.Internal.RootPath"#, fgl),-  (P.packAddress "Data.Graph.Inductive.Internal.Thread"#, fgl),-  (P.packAddress "Data.Graph.Inductive.Monad"#, fgl),-  (P.packAddress "Data.Graph.Inductive.Monad.IOArray"#, fgl),-  (P.packAddress "Data.Graph.Inductive.NodeMap"#, fgl),-  (P.packAddress "Data.Graph.Inductive.Query"#, fgl),-  (P.packAddress "Data.Graph.Inductive.Query.ArtPoint"#, fgl),-  (P.packAddress "Data.Graph.Inductive.Query.BCC"#, fgl),-  (P.packAddress "Data.Graph.Inductive.Query.BFS"#, fgl),-  (P.packAddress "Data.Graph.Inductive.Query.DFS"#, fgl),-  (P.packAddress "Data.Graph.Inductive.Query.Dominators"#, fgl),-  (P.packAddress "Data.Graph.Inductive.Query.GVD"#, fgl),-  (P.packAddress "Data.Graph.Inductive.Query.Indep"#, fgl),-  (P.packAddress "Data.Graph.Inductive.Query.MST"#, fgl),-  (P.packAddress "Data.Graph.Inductive.Query.MaxFlow"#, fgl),-  (P.packAddress "Data.Graph.Inductive.Query.MaxFlow2"#, fgl),-  (P.packAddress "Data.Graph.Inductive.Query.Monad"#, fgl),-  (P.packAddress "Data.Graph.Inductive.Query.SP"#, fgl),-  (P.packAddress "Data.Graph.Inductive.Query.TransClos"#, fgl),-  (P.packAddress "Data.Graph.Inductive.Tree"#, fgl),-  (P.packAddress "Data.HashTable"#, base),-  (P.packAddress "Data.IORef"#, base),-  (P.packAddress "Data.Int"#, base),-  (P.packAddress "Data.IntMap"#, base),-  (P.packAddress "Data.IntSet"#, base),-  (P.packAddress "Data.Ix"#, base),-  (P.packAddress "Data.List"#, base),-  (P.packAddress "Data.Map"#, base),-  (P.packAddress "Data.Maybe"#, base),-  (P.packAddress "Data.Monoid"#, base),-  (P.packAddress "Data.PackedString"#, base),-  (P.packAddress "Data.Queue"#, base),-  (P.packAddress "Data.Ratio"#, base),-  (P.packAddress "Data.STRef"#, base),-  (P.packAddress "Data.STRef.Lazy"#, base),-  (P.packAddress "Data.STRef.Strict"#, base),-  (P.packAddress "Data.Set"#, base),-  (P.packAddress "Data.Tree"#, base),-  (P.packAddress "Data.Tuple"#, base),-  (P.packAddress "Data.Typeable"#, base),-  (P.packAddress "Data.Unique"#, base),-  (P.packAddress "Data.Version"#, base),-  (P.packAddress "Data.Word"#, base),-  (P.packAddress "Debug.QuickCheck"#, qc),-  (P.packAddress "Debug.QuickCheck.Batch"#, qc),-  (P.packAddress "Debug.QuickCheck.Poly"#, qc),-  (P.packAddress "Debug.QuickCheck.Utils"#, qc),-  (P.packAddress "Debug.Trace"#, base),-  (P.packAddress "Distribution.Compat.Directory"#, cabal),-  (P.packAddress "Distribution.Compat.Exception"#, cabal),-  (P.packAddress "Distribution.Compat.FilePath"#, cabal),-  (P.packAddress "Distribution.Compat.RawSystem"#, cabal),-  (P.packAddress "Distribution.Compat.ReadP"#, cabal),-  (P.packAddress "Distribution.Extension"#, cabal),-  (P.packAddress "Distribution.GetOpt"#, cabal),-  (P.packAddress "Distribution.InstalledPackageInfo"#, cabal),-  (P.packAddress "Distribution.License"#, cabal),-  (P.packAddress "Distribution.Make"#, cabal),-  (P.packAddress "Distribution.Package"#, cabal),-  (P.packAddress "Distribution.PackageDescription"#, cabal),-  (P.packAddress "Distribution.PreProcess"#, cabal),-  (P.packAddress "Distribution.PreProcess.Unlit"#, cabal),-  (P.packAddress "Distribution.Setup"#, cabal),-  (P.packAddress "Distribution.Simple"#, cabal),-  (P.packAddress "Distribution.Simple.Build"#, cabal),-  (P.packAddress "Distribution.Simple.Configure"#, cabal),-  (P.packAddress "Distribution.Simple.GHCPackageConfig"#, cabal),-  (P.packAddress "Distribution.Simple.Install"#, cabal),-  (P.packAddress "Distribution.Simple.LocalBuildInfo"#, cabal),-  (P.packAddress "Distribution.Simple.Register"#, cabal),-  (P.packAddress "Distribution.Simple.SrcDist"#, cabal),-  (P.packAddress "Distribution.Simple.Utils"#, cabal),-  (P.packAddress "Distribution.Version"#, cabal),-  (P.packAddress "Foreign"#, base),-  (P.packAddress "Foreign.C"#, base),-  (P.packAddress "Foreign.C.Error"#, base),-  (P.packAddress "Foreign.C.String"#, base),-  (P.packAddress "Foreign.C.Types"#, base),-  (P.packAddress "Foreign.Concurrent"#, base),-  (P.packAddress "Foreign.ForeignPtr"#, base),-  (P.packAddress "Foreign.Marshal"#, base),-  (P.packAddress "Foreign.Marshal.Alloc"#, base),-  (P.packAddress "Foreign.Marshal.Array"#, base),-  (P.packAddress "Foreign.Marshal.Error"#, base),-  (P.packAddress "Foreign.Marshal.Pool"#, base),-  (P.packAddress "Foreign.Marshal.Utils"#, base),-  (P.packAddress "Foreign.Ptr"#, base),-  (P.packAddress "Foreign.StablePtr"#, base),-  (P.packAddress "Foreign.Storable"#, base),-  (P.packAddress "GHC.Conc"#, base),-  (P.packAddress "GHC.ConsoleHandler"#, base),-  (P.packAddress "GHC.Dotnet"#, base),-  (P.packAddress "GHC.Exts"#, base),-  (P.packAddress "Graphics.HGL"#, hgl),-  (P.packAddress "Graphics.HGL.Core"#, hgl),-  (P.packAddress "Graphics.HGL.Draw"#, hgl),-  (P.packAddress "Graphics.HGL.Draw.Brush"#, hgl),-  (P.packAddress "Graphics.HGL.Draw.Font"#, hgl),-  (P.packAddress "Graphics.HGL.Draw.Monad"#, hgl),-  (P.packAddress "Graphics.HGL.Draw.Pen"#, hgl),-  (P.packAddress "Graphics.HGL.Draw.Picture"#, hgl),-  (P.packAddress "Graphics.HGL.Draw.Region"#, hgl),-  (P.packAddress "Graphics.HGL.Draw.Text"#, hgl),-  (P.packAddress "Graphics.HGL.Key"#, hgl),-  (P.packAddress "Graphics.HGL.Run"#, hgl),-  (P.packAddress "Graphics.HGL.Units"#, hgl),-  (P.packAddress "Graphics.HGL.Utils"#, hgl),-  (P.packAddress "Graphics.HGL.Window"#, hgl),-  (P.packAddress "Graphics.Rendering.OpenGL"#, opengl),-  (P.packAddress "Graphics.Rendering.OpenGL.GL"#, opengl),-  (P.packAddress "Graphics.Rendering.OpenGL.GL.Antialiasing"#, opengl),-  (P.packAddress "Graphics.Rendering.OpenGL.GL.BasicTypes"#, opengl),-  (P.packAddress "Graphics.Rendering.OpenGL.GL.BeginEnd"#, opengl),-  (P.packAddress "Graphics.Rendering.OpenGL.GL.Bitmaps"#, opengl),-  (P.packAddress "Graphics.Rendering.OpenGL.GL.BufferObjects"#, opengl),-  (P.packAddress "Graphics.Rendering.OpenGL.GL.Clipping"#, opengl),-  (P.packAddress "Graphics.Rendering.OpenGL.GL.ColorSum"#, opengl),-  (P.packAddress "Graphics.Rendering.OpenGL.GL.Colors"#, opengl),-  (P.packAddress "Graphics.Rendering.OpenGL.GL.CoordTrans"#, opengl),-  (P.packAddress "Graphics.Rendering.OpenGL.GL.DisplayLists"#, opengl),-  (P.packAddress "Graphics.Rendering.OpenGL.GL.Evaluators"#, opengl),-  (P.packAddress "Graphics.Rendering.OpenGL.GL.Feedback"#, opengl),-  (P.packAddress "Graphics.Rendering.OpenGL.GL.FlushFinish"#, opengl),-  (P.packAddress "Graphics.Rendering.OpenGL.GL.Fog"#, opengl),-  (P.packAddress "Graphics.Rendering.OpenGL.GL.Framebuffer"#, opengl),-  (P.packAddress "Graphics.Rendering.OpenGL.GL.Hints"#, opengl),-  (P.packAddress "Graphics.Rendering.OpenGL.GL.LineSegments"#, opengl),-  (P.packAddress "Graphics.Rendering.OpenGL.GL.PerFragment"#, opengl),-  (P.packAddress "Graphics.Rendering.OpenGL.GL.PixelRectangles"#, opengl),-  (P.packAddress "Graphics.Rendering.OpenGL.GL.PixelRectangles.ColorTable"#, opengl),-  (P.packAddress "Graphics.Rendering.OpenGL.GL.PixelRectangles.Convolution"#, opengl),-  (P.packAddress "Graphics.Rendering.OpenGL.GL.PixelRectangles.Histogram"#, opengl),-  (P.packAddress "Graphics.Rendering.OpenGL.GL.PixelRectangles.Minmax"#, opengl),-  (P.packAddress "Graphics.Rendering.OpenGL.GL.PixelRectangles.PixelMap"#, opengl),-  (P.packAddress "Graphics.Rendering.OpenGL.GL.PixelRectangles.PixelStorage"#, opengl),-  (P.packAddress "Graphics.Rendering.OpenGL.GL.PixelRectangles.PixelTransfer"#, opengl),-  (P.packAddress "Graphics.Rendering.OpenGL.GL.PixelRectangles.Rasterization"#, opengl),-  (P.packAddress "Graphics.Rendering.OpenGL.GL.Points"#, opengl),-  (P.packAddress "Graphics.Rendering.OpenGL.GL.Polygons"#, opengl),-  (P.packAddress "Graphics.Rendering.OpenGL.GL.RasterPos"#, opengl),-  (P.packAddress "Graphics.Rendering.OpenGL.GL.ReadCopyPixels"#, opengl),-  (P.packAddress "Graphics.Rendering.OpenGL.GL.Rectangles"#, opengl),-  (P.packAddress "Graphics.Rendering.OpenGL.GL.SavingState"#, opengl),-  (P.packAddress "Graphics.Rendering.OpenGL.GL.Selection"#, opengl),-  (P.packAddress "Graphics.Rendering.OpenGL.GL.StateVar"#, opengl),-  (P.packAddress "Graphics.Rendering.OpenGL.GL.StringQueries"#, opengl),-  (P.packAddress "Graphics.Rendering.OpenGL.GL.Texturing"#, opengl),-  (P.packAddress "Graphics.Rendering.OpenGL.GL.Texturing.Application"#, opengl),-  (P.packAddress "Graphics.Rendering.OpenGL.GL.Texturing.Environments"#, opengl),-  (P.packAddress "Graphics.Rendering.OpenGL.GL.Texturing.Objects"#, opengl),-  (P.packAddress "Graphics.Rendering.OpenGL.GL.Texturing.Parameters"#, opengl),-  (P.packAddress "Graphics.Rendering.OpenGL.GL.Texturing.Queries"#, opengl),-  (P.packAddress "Graphics.Rendering.OpenGL.GL.Texturing.Specification"#, opengl),-  (P.packAddress "Graphics.Rendering.OpenGL.GL.VertexArrays"#, opengl),-  (P.packAddress "Graphics.Rendering.OpenGL.GL.VertexSpec"#, opengl),-  (P.packAddress "Graphics.Rendering.OpenGL.GLU"#, opengl),-  (P.packAddress "Graphics.Rendering.OpenGL.GLU.Errors"#, opengl),-  (P.packAddress "Graphics.Rendering.OpenGL.GLU.Initialization"#, opengl),-  (P.packAddress "Graphics.Rendering.OpenGL.GLU.Matrix"#, opengl),-  (P.packAddress "Graphics.Rendering.OpenGL.GLU.Mipmapping"#, opengl),-  (P.packAddress "Graphics.Rendering.OpenGL.GLU.NURBS"#, opengl),-  (P.packAddress "Graphics.Rendering.OpenGL.GLU.Quadrics"#, opengl),-  (P.packAddress "Graphics.Rendering.OpenGL.GLU.Tessellation"#, opengl),-  (P.packAddress "Graphics.SOE"#, hgl),-  (P.packAddress "Graphics.UI.GLUT"#, glut),-  (P.packAddress "Graphics.UI.GLUT.Begin"#, glut),-  (P.packAddress "Graphics.UI.GLUT.Callbacks"#, glut),-  (P.packAddress "Graphics.UI.GLUT.Callbacks.Global"#, glut),-  (P.packAddress "Graphics.UI.GLUT.Callbacks.Window"#, glut),-  (P.packAddress "Graphics.UI.GLUT.Colormap"#, glut),-  (P.packAddress "Graphics.UI.GLUT.Debugging"#, glut),-  (P.packAddress "Graphics.UI.GLUT.DeviceControl"#, glut),-  (P.packAddress "Graphics.UI.GLUT.Fonts"#, glut),-  (P.packAddress "Graphics.UI.GLUT.GameMode"#, glut),-  (P.packAddress "Graphics.UI.GLUT.Initialization"#, glut),-  (P.packAddress "Graphics.UI.GLUT.Menu"#, glut),-  (P.packAddress "Graphics.UI.GLUT.Objects"#, glut),-  (P.packAddress "Graphics.UI.GLUT.Overlay"#, glut),-  (P.packAddress "Graphics.UI.GLUT.State"#, glut),-  (P.packAddress "Graphics.UI.GLUT.Window"#, glut),-  (P.packAddress "Graphics.X11.Types"#, x11),-  (P.packAddress "Graphics.X11.Xlib"#, x11),-  (P.packAddress "Graphics.X11.Xlib.Atom"#, x11),-  (P.packAddress "Graphics.X11.Xlib.Color"#, x11),-  (P.packAddress "Graphics.X11.Xlib.Context"#, x11),-  (P.packAddress "Graphics.X11.Xlib.Display"#, x11),-  (P.packAddress "Graphics.X11.Xlib.Event"#, x11),-  (P.packAddress "Graphics.X11.Xlib.Font"#, x11),-  (P.packAddress "Graphics.X11.Xlib.Misc"#, x11),-  (P.packAddress "Graphics.X11.Xlib.Region"#, x11),-  (P.packAddress "Graphics.X11.Xlib.Screen"#, x11),-  (P.packAddress "Graphics.X11.Xlib.Types"#, x11),-  (P.packAddress "Graphics.X11.Xlib.Window"#, x11),-  (P.packAddress "Language.Haskell.Parser"#, hs),-  (P.packAddress "Language.Haskell.Pretty"#, hs),-  (P.packAddress "Language.Haskell.Syntax"#, hs),-  (P.packAddress "Language.Haskell.TH"#, th),-  (P.packAddress "Language.Haskell.TH.Lib"#, th),-  (P.packAddress "Language.Haskell.TH.Ppr"#, th),-  (P.packAddress "Language.Haskell.TH.PprLib"#, th),-  (P.packAddress "Language.Haskell.TH.Syntax"#, th),-  (P.packAddress "Network"#, network),-  (P.packAddress "Network.BSD"#, network),-  (P.packAddress "Network.CGI"#, network),-  (P.packAddress "Network.Socket"#, network),-  (P.packAddress "Network.URI"#, network),-  (P.packAddress "Numeric"#, base),-  (P.packAddress "Prelude"#, base),-  (P.packAddress "System.CPUTime"#, base),-  (P.packAddress "System.Cmd"#, base),-  (P.packAddress "System.Console.GetOpt"#, base),-  (P.packAddress "System.Console.Readline"#, readline),-  (P.packAddress "System.Console.SimpleLineEditor"#, readline),-  (P.packAddress "System.Directory"#, base),-  (P.packAddress "System.Environment"#, base),-  (P.packAddress "System.Exit"#, base),-  (P.packAddress "System.IO"#, base),-  (P.packAddress "System.IO.Error"#, base),-  (P.packAddress "System.IO.Unsafe"#, base),-  (P.packAddress "System.Info"#, base),-  (P.packAddress "System.Locale"#, base),-  (P.packAddress "System.Mem"#, base),-  (P.packAddress "System.Mem.StableName"#, base),-  (P.packAddress "System.Mem.Weak"#, base),-  (P.packAddress "System.Posix"#, unix),-  (P.packAddress "System.Posix.Directory"#, unix),-  (P.packAddress "System.Posix.DynamicLinker"#, unix),-  (P.packAddress "System.Posix.DynamicLinker.Module"#, unix),-  (P.packAddress "System.Posix.DynamicLinker.Prim"#, unix),-  (P.packAddress "System.Posix.Env"#, unix),-  (P.packAddress "System.Posix.Error"#, unix),-  (P.packAddress "System.Posix.Files"#, unix),-  (P.packAddress "System.Posix.IO"#, unix),-  (P.packAddress "System.Posix.Process"#, unix),-  (P.packAddress "System.Posix.Resource"#, unix),-  (P.packAddress "System.Posix.Signals"#, base),-  (P.packAddress "System.Posix.Signals.Exts"#, unix),-  (P.packAddress "System.Posix.Temp"#, unix),-  (P.packAddress "System.Posix.Terminal"#, unix),-  (P.packAddress "System.Posix.Time"#, unix),-  (P.packAddress "System.Posix.Types"#, base),-  (P.packAddress "System.Posix.Unistd"#, unix),-  (P.packAddress "System.Posix.User"#, unix),-  (P.packAddress "System.Process"#, base),-  (P.packAddress "System.Random"#, base),-  (P.packAddress "System.Time"#, base),-  (P.packAddress "Test.HUnit"#, hunit),-  (P.packAddress "Test.HUnit.Base"#, hunit),-  (P.packAddress "Test.HUnit.Lang"#, hunit),-  (P.packAddress "Test.HUnit.Terminal"#, hunit),-  (P.packAddress "Test.HUnit.Text"#, hunit),-  (P.packAddress "Test.QuickCheck"#, qc),-  (P.packAddress "Test.QuickCheck.Batch"#, qc),-  (P.packAddress "Test.QuickCheck.Poly"#, qc),-  (P.packAddress "Test.QuickCheck.Utils"#, qc),-  (P.packAddress "Text.Html"#, base),-  (P.packAddress "Text.Html.BlockTable"#, base),-  (P.packAddress "Text.ParserCombinators.Parsec"#, parsec),-  (P.packAddress "Text.ParserCombinators.Parsec.Char"#, parsec),-  (P.packAddress "Text.ParserCombinators.Parsec.Combinator"#, parsec),-  (P.packAddress "Text.ParserCombinators.Parsec.Error"#, parsec),-  (P.packAddress "Text.ParserCombinators.Parsec.Expr"#, parsec),-  (P.packAddress "Text.ParserCombinators.Parsec.Language"#, parsec),-  (P.packAddress "Text.ParserCombinators.Parsec.Perm"#, parsec),-  (P.packAddress "Text.ParserCombinators.Parsec.Pos"#, parsec),-  (P.packAddress "Text.ParserCombinators.Parsec.Prim"#, parsec),-  (P.packAddress "Text.ParserCombinators.Parsec.Token"#, parsec),-  (P.packAddress "Text.ParserCombinators.ReadP"#, base),-  (P.packAddress "Text.ParserCombinators.ReadPrec"#, base),-  (P.packAddress "Text.PrettyPrint"#, base),-  (P.packAddress "Text.PrettyPrint.HughesPJ"#, base),-  (P.packAddress "Text.Printf"#, base),-  (P.packAddress "Text.Read"#, base),-  (P.packAddress "Text.Read.Lex"#, base),-  (P.packAddress "Text.Regex"#, base),-  (P.packAddress "Text.Regex.Posix"#, base),-  (P.packAddress "Text.Show"#, base),-  (P.packAddress "Text.Show.Functions"#, base)]+  (P.pack "Control.Arrow", base),+  (P.pack "Control.Concurrent", base),+  (P.pack "Control.Concurrent.Chan", base),+  (P.pack "Control.Concurrent.MVar", base),+  (P.pack "Control.Concurrent.QSem", base),+  (P.pack "Control.Concurrent.QSemN", base),+  (P.pack "Control.Concurrent.STM", stm),+  (P.pack "Control.Concurrent.STM.TChan", stm),+  (P.pack "Control.Concurrent.STM.TMVar", stm),+  (P.pack "Control.Concurrent.STM.TVar", stm),+  (P.pack "Control.Concurrent.SampleVar", base),+  (P.pack "Control.Exception", base),+  (P.pack "Control.Monad", base),+  (P.pack "Control.Monad.Cont", mtl),+  (P.pack "Control.Monad.Error", mtl),+  (P.pack "Control.Monad.Fix", base),+  (P.pack "Control.Monad.Identity", mtl),+  (P.pack "Control.Monad.List", mtl),+  (P.pack "Control.Monad.RWS", mtl),+  (P.pack "Control.Monad.Reader", mtl),+  (P.pack "Control.Monad.ST", base),+  (P.pack "Control.Monad.ST.Lazy", base),+  (P.pack "Control.Monad.ST.Strict", base),+  (P.pack "Control.Monad.State", mtl),+  (P.pack "Control.Monad.Trans", mtl),+  (P.pack "Control.Monad.Writer", mtl),+  (P.pack "Control.Parallel", base),+  (P.pack "Control.Parallel.Strategies", base),+  (P.pack "Data.Array", base),+  (P.pack "Data.Array.Diff", base),+  (P.pack "Data.Array.IArray", base),+  (P.pack "Data.Array.IO", base),+  (P.pack "Data.Array.MArray", base),+  (P.pack "Data.Array.ST", base),+  (P.pack "Data.Array.Storable", base),+  (P.pack "Data.Array.Unboxed", base),+  (P.pack "Data.Bits", base),+  (P.pack "Data.Bool", base),+  (P.pack "Data.Char", base),+  (P.pack "Data.Complex", base),+  (P.pack "Data.Dynamic", base),+  (P.pack "Data.Either", base),+  (P.pack "Data.FiniteMap", base),+  (P.pack "Data.FunctorM", base),+  (P.pack "Data.Generics", base),+  (P.pack "Data.Generics.Aliases", base),+  (P.pack "Data.Generics.Basics", base),+  (P.pack "Data.Generics.Instances", base),+  (P.pack "Data.Generics.Schemes", base),+  (P.pack "Data.Generics.Text", base),+  (P.pack "Data.Generics.Twins", base),+  (P.pack "Data.Graph", base),+  (P.pack "Data.Graph.Inductive", fgl),+  (P.pack "Data.Graph.Inductive.Basic", fgl),+  (P.pack "Data.Graph.Inductive.Example", fgl),+  (P.pack "Data.Graph.Inductive.Graph", fgl),+  (P.pack "Data.Graph.Inductive.Graphviz", fgl),+  (P.pack "Data.Graph.Inductive.Internal.FiniteMap", fgl),+  (P.pack "Data.Graph.Inductive.Internal.Heap", fgl),+  (P.pack "Data.Graph.Inductive.Internal.Queue", fgl),+  (P.pack "Data.Graph.Inductive.Internal.RootPath", fgl),+  (P.pack "Data.Graph.Inductive.Internal.Thread", fgl),+  (P.pack "Data.Graph.Inductive.Monad", fgl),+  (P.pack "Data.Graph.Inductive.Monad.IOArray", fgl),+  (P.pack "Data.Graph.Inductive.NodeMap", fgl),+  (P.pack "Data.Graph.Inductive.Query", fgl),+  (P.pack "Data.Graph.Inductive.Query.ArtPoint", fgl),+  (P.pack "Data.Graph.Inductive.Query.BCC", fgl),+  (P.pack "Data.Graph.Inductive.Query.BFS", fgl),+  (P.pack "Data.Graph.Inductive.Query.DFS", fgl),+  (P.pack "Data.Graph.Inductive.Query.Dominators", fgl),+  (P.pack "Data.Graph.Inductive.Query.GVD", fgl),+  (P.pack "Data.Graph.Inductive.Query.Indep", fgl),+  (P.pack "Data.Graph.Inductive.Query.MST", fgl),+  (P.pack "Data.Graph.Inductive.Query.MaxFlow", fgl),+  (P.pack "Data.Graph.Inductive.Query.MaxFlow2", fgl),+  (P.pack "Data.Graph.Inductive.Query.Monad", fgl),+  (P.pack "Data.Graph.Inductive.Query.SP", fgl),+  (P.pack "Data.Graph.Inductive.Query.TransClos", fgl),+  (P.pack "Data.Graph.Inductive.Tree", fgl),+  (P.pack "Data.HashTable", base),+  (P.pack "Data.IORef", base),+  (P.pack "Data.Int", base),+  (P.pack "Data.IntMap", base),+  (P.pack "Data.IntSet", base),+  (P.pack "Data.Ix", base),+  (P.pack "Data.List", base),+  (P.pack "Data.Map", base),+  (P.pack "Data.Maybe", base),+  (P.pack "Data.Monoid", base),+  (P.pack "Data.PackedString", base),+  (P.pack "Data.Queue", base),+  (P.pack "Data.Ratio", base),+  (P.pack "Data.STRef", base),+  (P.pack "Data.STRef.Lazy", base),+  (P.pack "Data.STRef.Strict", base),+  (P.pack "Data.Set", base),+  (P.pack "Data.Tree", base),+  (P.pack "Data.Tuple", base),+  (P.pack "Data.Typeable", base),+  (P.pack "Data.Unique", base),+  (P.pack "Data.Version", base),+  (P.pack "Data.Word", base),+  (P.pack "Debug.QuickCheck", qc),+  (P.pack "Debug.QuickCheck.Batch", qc),+  (P.pack "Debug.QuickCheck.Poly", qc),+  (P.pack "Debug.QuickCheck.Utils", qc),+  (P.pack "Debug.Trace", base),+  (P.pack "Distribution.Compat.Directory", cabal),+  (P.pack "Distribution.Compat.Exception", cabal),+  (P.pack "Distribution.Compat.FilePath", cabal),+  (P.pack "Distribution.Compat.RawSystem", cabal),+  (P.pack "Distribution.Compat.ReadP", cabal),+  (P.pack "Distribution.Extension", cabal),+  (P.pack "Distribution.GetOpt", cabal),+  (P.pack "Distribution.InstalledPackageInfo", cabal),+  (P.pack "Distribution.License", cabal),+  (P.pack "Distribution.Make", cabal),+  (P.pack "Distribution.Package", cabal),+  (P.pack "Distribution.PackageDescription", cabal),+  (P.pack "Distribution.PreProcess", cabal),+  (P.pack "Distribution.PreProcess.Unlit", cabal),+  (P.pack "Distribution.Setup", cabal),+  (P.pack "Distribution.Simple", cabal),+  (P.pack "Distribution.Simple.Build", cabal),+  (P.pack "Distribution.Simple.Configure", cabal),+  (P.pack "Distribution.Simple.GHCPackageConfig", cabal),+  (P.pack "Distribution.Simple.Install", cabal),+  (P.pack "Distribution.Simple.LocalBuildInfo", cabal),+  (P.pack "Distribution.Simple.Register", cabal),+  (P.pack "Distribution.Simple.SrcDist", cabal),+  (P.pack "Distribution.Simple.Utils", cabal),+  (P.pack "Distribution.Version", cabal),+  (P.pack "Foreign", base),+  (P.pack "Foreign.C", base),+  (P.pack "Foreign.C.Error", base),+  (P.pack "Foreign.C.String", base),+  (P.pack "Foreign.C.Types", base),+  (P.pack "Foreign.Concurrent", base),+  (P.pack "Foreign.ForeignPtr", base),+  (P.pack "Foreign.Marshal", base),+  (P.pack "Foreign.Marshal.Alloc", base),+  (P.pack "Foreign.Marshal.Array", base),+  (P.pack "Foreign.Marshal.Error", base),+  (P.pack "Foreign.Marshal.Pool", base),+  (P.pack "Foreign.Marshal.Utils", base),+  (P.pack "Foreign.Ptr", base),+  (P.pack "Foreign.StablePtr", base),+  (P.pack "Foreign.Storable", base),+  (P.pack "GHC.Conc", base),+  (P.pack "GHC.ConsoleHandler", base),+  (P.pack "GHC.Dotnet", base),+  (P.pack "GHC.Exts", base),+  (P.pack "Graphics.HGL", hgl),+  (P.pack "Graphics.HGL.Core", hgl),+  (P.pack "Graphics.HGL.Draw", hgl),+  (P.pack "Graphics.HGL.Draw.Brush", hgl),+  (P.pack "Graphics.HGL.Draw.Font", hgl),+  (P.pack "Graphics.HGL.Draw.Monad", hgl),+  (P.pack "Graphics.HGL.Draw.Pen", hgl),+  (P.pack "Graphics.HGL.Draw.Picture", hgl),+  (P.pack "Graphics.HGL.Draw.Region", hgl),+  (P.pack "Graphics.HGL.Draw.Text", hgl),+  (P.pack "Graphics.HGL.Key", hgl),+  (P.pack "Graphics.HGL.Run", hgl),+  (P.pack "Graphics.HGL.Units", hgl),+  (P.pack "Graphics.HGL.Utils", hgl),+  (P.pack "Graphics.HGL.Window", hgl),+  (P.pack "Graphics.Rendering.OpenGL", opengl),+  (P.pack "Graphics.Rendering.OpenGL.GL", opengl),+  (P.pack "Graphics.Rendering.OpenGL.GL.Antialiasing", opengl),+  (P.pack "Graphics.Rendering.OpenGL.GL.BasicTypes", opengl),+  (P.pack "Graphics.Rendering.OpenGL.GL.BeginEnd", opengl),+  (P.pack "Graphics.Rendering.OpenGL.GL.Bitmaps", opengl),+  (P.pack "Graphics.Rendering.OpenGL.GL.BufferObjects", opengl),+  (P.pack "Graphics.Rendering.OpenGL.GL.Clipping", opengl),+  (P.pack "Graphics.Rendering.OpenGL.GL.ColorSum", opengl),+  (P.pack "Graphics.Rendering.OpenGL.GL.Colors", opengl),+  (P.pack "Graphics.Rendering.OpenGL.GL.CoordTrans", opengl),+  (P.pack "Graphics.Rendering.OpenGL.GL.DisplayLists", opengl),+  (P.pack "Graphics.Rendering.OpenGL.GL.Evaluators", opengl),+  (P.pack "Graphics.Rendering.OpenGL.GL.Feedback", opengl),+  (P.pack "Graphics.Rendering.OpenGL.GL.FlushFinish", opengl),+  (P.pack "Graphics.Rendering.OpenGL.GL.Fog", opengl),+  (P.pack "Graphics.Rendering.OpenGL.GL.Framebuffer", opengl),+  (P.pack "Graphics.Rendering.OpenGL.GL.Hints", opengl),+  (P.pack "Graphics.Rendering.OpenGL.GL.LineSegments", opengl),+  (P.pack "Graphics.Rendering.OpenGL.GL.PerFragment", opengl),+  (P.pack "Graphics.Rendering.OpenGL.GL.PixelRectangles", opengl),+  (P.pack "Graphics.Rendering.OpenGL.GL.PixelRectangles.ColorTable", opengl),+  (P.pack "Graphics.Rendering.OpenGL.GL.PixelRectangles.Convolution", opengl),+  (P.pack "Graphics.Rendering.OpenGL.GL.PixelRectangles.Histogram", opengl),+  (P.pack "Graphics.Rendering.OpenGL.GL.PixelRectangles.Minmax", opengl),+  (P.pack "Graphics.Rendering.OpenGL.GL.PixelRectangles.PixelMap", opengl),+  (P.pack "Graphics.Rendering.OpenGL.GL.PixelRectangles.PixelStorage", opengl),+  (P.pack "Graphics.Rendering.OpenGL.GL.PixelRectangles.PixelTransfer", opengl),+  (P.pack "Graphics.Rendering.OpenGL.GL.PixelRectangles.Rasterization", opengl),+  (P.pack "Graphics.Rendering.OpenGL.GL.Points", opengl),+  (P.pack "Graphics.Rendering.OpenGL.GL.Polygons", opengl),+  (P.pack "Graphics.Rendering.OpenGL.GL.RasterPos", opengl),+  (P.pack "Graphics.Rendering.OpenGL.GL.ReadCopyPixels", opengl),+  (P.pack "Graphics.Rendering.OpenGL.GL.Rectangles", opengl),+  (P.pack "Graphics.Rendering.OpenGL.GL.SavingState", opengl),+  (P.pack "Graphics.Rendering.OpenGL.GL.Selection", opengl),+  (P.pack "Graphics.Rendering.OpenGL.GL.StateVar", opengl),+  (P.pack "Graphics.Rendering.OpenGL.GL.StringQueries", opengl),+  (P.pack "Graphics.Rendering.OpenGL.GL.Texturing", opengl),+  (P.pack "Graphics.Rendering.OpenGL.GL.Texturing.Application", opengl),+  (P.pack "Graphics.Rendering.OpenGL.GL.Texturing.Environments", opengl),+  (P.pack "Graphics.Rendering.OpenGL.GL.Texturing.Objects", opengl),+  (P.pack "Graphics.Rendering.OpenGL.GL.Texturing.Parameters", opengl),+  (P.pack "Graphics.Rendering.OpenGL.GL.Texturing.Queries", opengl),+  (P.pack "Graphics.Rendering.OpenGL.GL.Texturing.Specification", opengl),+  (P.pack "Graphics.Rendering.OpenGL.GL.VertexArrays", opengl),+  (P.pack "Graphics.Rendering.OpenGL.GL.VertexSpec", opengl),+  (P.pack "Graphics.Rendering.OpenGL.GLU", opengl),+  (P.pack "Graphics.Rendering.OpenGL.GLU.Errors", opengl),+  (P.pack "Graphics.Rendering.OpenGL.GLU.Initialization", opengl),+  (P.pack "Graphics.Rendering.OpenGL.GLU.Matrix", opengl),+  (P.pack "Graphics.Rendering.OpenGL.GLU.Mipmapping", opengl),+  (P.pack "Graphics.Rendering.OpenGL.GLU.NURBS", opengl),+  (P.pack "Graphics.Rendering.OpenGL.GLU.Quadrics", opengl),+  (P.pack "Graphics.Rendering.OpenGL.GLU.Tessellation", opengl),+  (P.pack "Graphics.SOE", hgl),+  (P.pack "Graphics.UI.GLUT", glut),+  (P.pack "Graphics.UI.GLUT.Begin", glut),+  (P.pack "Graphics.UI.GLUT.Callbacks", glut),+  (P.pack "Graphics.UI.GLUT.Callbacks.Global", glut),+  (P.pack "Graphics.UI.GLUT.Callbacks.Window", glut),+  (P.pack "Graphics.UI.GLUT.Colormap", glut),+  (P.pack "Graphics.UI.GLUT.Debugging", glut),+  (P.pack "Graphics.UI.GLUT.DeviceControl", glut),+  (P.pack "Graphics.UI.GLUT.Fonts", glut),+  (P.pack "Graphics.UI.GLUT.GameMode", glut),+  (P.pack "Graphics.UI.GLUT.Initialization", glut),+  (P.pack "Graphics.UI.GLUT.Menu", glut),+  (P.pack "Graphics.UI.GLUT.Objects", glut),+  (P.pack "Graphics.UI.GLUT.Overlay", glut),+  (P.pack "Graphics.UI.GLUT.State", glut),+  (P.pack "Graphics.UI.GLUT.Window", glut),+  (P.pack "Graphics.X11.Types", x11),+  (P.pack "Graphics.X11.Xlib", x11),+  (P.pack "Graphics.X11.Xlib.Atom", x11),+  (P.pack "Graphics.X11.Xlib.Color", x11),+  (P.pack "Graphics.X11.Xlib.Context", x11),+  (P.pack "Graphics.X11.Xlib.Display", x11),+  (P.pack "Graphics.X11.Xlib.Event", x11),+  (P.pack "Graphics.X11.Xlib.Font", x11),+  (P.pack "Graphics.X11.Xlib.Misc", x11),+  (P.pack "Graphics.X11.Xlib.Region", x11),+  (P.pack "Graphics.X11.Xlib.Screen", x11),+  (P.pack "Graphics.X11.Xlib.Types", x11),+  (P.pack "Graphics.X11.Xlib.Window", x11),+  (P.pack "Language.Haskell.Parser", hs),+  (P.pack "Language.Haskell.Pretty", hs),+  (P.pack "Language.Haskell.Syntax", hs),+  (P.pack "Language.Haskell.TH", th),+  (P.pack "Language.Haskell.TH.Lib", th),+  (P.pack "Language.Haskell.TH.Ppr", th),+  (P.pack "Language.Haskell.TH.PprLib", th),+  (P.pack "Language.Haskell.TH.Syntax", th),+  (P.pack "Network", network),+  (P.pack "Network.BSD", network),+  (P.pack "Network.CGI", network),+  (P.pack "Network.Socket", network),+  (P.pack "Network.URI", network),+  (P.pack "Numeric", base),+  (P.pack "Prelude", base),+  (P.pack "System.CPUTime", base),+  (P.pack "System.Cmd", base),+  (P.pack "System.Console.GetOpt", base),+  (P.pack "System.Console.Readline", readline),+  (P.pack "System.Console.SimpleLineEditor", readline),+  (P.pack "System.Directory", base),+  (P.pack "System.Environment", base),+  (P.pack "System.Exit", base),+  (P.pack "System.IO", base),+  (P.pack "System.IO.Error", base),+  (P.pack "System.IO.Unsafe", base),+  (P.pack "System.Info", base),+  (P.pack "System.Locale", base),+  (P.pack "System.Mem", base),+  (P.pack "System.Mem.StableName", base),+  (P.pack "System.Mem.Weak", base),+  (P.pack "System.Posix", unix),+  (P.pack "System.Posix.Directory", unix),+  (P.pack "System.Posix.DynamicLinker", unix),+  (P.pack "System.Posix.DynamicLinker.Module", unix),+  (P.pack "System.Posix.DynamicLinker.Prim", unix),+  (P.pack "System.Posix.Env", unix),+  (P.pack "System.Posix.Error", unix),+  (P.pack "System.Posix.Files", unix),+  (P.pack "System.Posix.IO", unix),+  (P.pack "System.Posix.Process", unix),+  (P.pack "System.Posix.Resource", unix),+  (P.pack "System.Posix.Signals", base),+  (P.pack "System.Posix.Signals.Exts", unix),+  (P.pack "System.Posix.Temp", unix),+  (P.pack "System.Posix.Terminal", unix),+  (P.pack "System.Posix.Time", unix),+  (P.pack "System.Posix.Types", base),+  (P.pack "System.Posix.Unistd", unix),+  (P.pack "System.Posix.User", unix),+  (P.pack "System.Process", base),+  (P.pack "System.Random", base),+  (P.pack "System.Time", base),+  (P.pack "Test.HUnit", hunit),+  (P.pack "Test.HUnit.Base", hunit),+  (P.pack "Test.HUnit.Lang", hunit),+  (P.pack "Test.HUnit.Terminal", hunit),+  (P.pack "Test.HUnit.Text", hunit),+  (P.pack "Test.QuickCheck", qc),+  (P.pack "Test.QuickCheck.Batch", qc),+  (P.pack "Test.QuickCheck.Poly", qc),+  (P.pack "Test.QuickCheck.Utils", qc),+  (P.pack "Text.Html", base),+  (P.pack "Text.Html.BlockTable", base),+  (P.pack "Text.ParserCombinators.Parsec", parsec),+  (P.pack "Text.ParserCombinators.Parsec.Char", parsec),+  (P.pack "Text.ParserCombinators.Parsec.Combinator", parsec),+  (P.pack "Text.ParserCombinators.Parsec.Error", parsec),+  (P.pack "Text.ParserCombinators.Parsec.Expr", parsec),+  (P.pack "Text.ParserCombinators.Parsec.Language", parsec),+  (P.pack "Text.ParserCombinators.Parsec.Perm", parsec),+  (P.pack "Text.ParserCombinators.Parsec.Pos", parsec),+  (P.pack "Text.ParserCombinators.Parsec.Prim", parsec),+  (P.pack "Text.ParserCombinators.Parsec.Token", parsec),+  (P.pack "Text.ParserCombinators.ReadP", base),+  (P.pack "Text.ParserCombinators.ReadPrec", base),+  (P.pack "Text.PrettyPrint", base),+  (P.pack "Text.PrettyPrint.HughesPJ", base),+  (P.pack "Text.Printf", base),+  (P.pack "Text.Read", base),+  (P.pack "Text.Read.Lex", base),+  (P.pack "Text.Regex", base),+  (P.pack "Text.Regex.Posix", base),+  (P.pack "Text.Show", base),+  (P.pack "Text.Show.Functions", base)]
− Plugin/Dummy/Moo.hs
@@ -1,887 +0,0 @@------ | Default cows-----module Plugin.Dummy.Moo (cows) where--cows :: [String]-cows = map unlines-        [["         (__)",-          "         (oo)",-          "  /-------\\/",-          " / |     ||",-          "*  ||----||",-          "   ~~    ~~",-          "     Cow"],-         ["         (__)",-          "         (oo)",-          "  /-------\\/",-          " / |     ||",-          "*  ||W---||",-          "   ~~    ~~",-          "  Cow laden",-          "  with milk"],-         ["         (__)",-          "         (oo)",-          "  /-------\\/",-          " / |     ||",-          "*  ||V---||",-          "   ~~    ~~",-          "Betty Ford-type",-          "cow with milk"],-         ["         (___)",-          "         (o o)",-          "  /-------\\ /",-          " / |     ||O",-          "*  ||,---||",-          "   ~~    ~~",-          "     Bull"],-         ["         (__)",-          "         (oo)",-          "  /-------\\/-*",-          " / |     || \\",-          "*  ||----||  *",-          "\\/|(/)(/\\/(,,/",-          "  Cow munching",-          "    on grass"],-         ["         (__)",-          "         (oo)",-          "  /-------\\/",-          " )*)(\\/* /  *",-          "\\ |||/)|/()(",-          "\\)|(/\\/|)(/\\",-          "Grass munching",-          "    on cow"],-         ["          (__)",-          "          (oo)",-          "   /-------\\/",-          "  / |     ||",-          "~~~~~~~~~~~~~~",-          "",-          " Cow in water"],-         ["           (__)",-          "           (oo)",-          "~~~~~~~~~~~~~~~~~~~~~",-          "",-          "",-          "",-          "    Cow in trouble"],-         ["          (__)",-          "          (oo)",-          "  /--------\\/",-          " * o|     ||",-          "    ||----||",-          " ooo^^    ^^",-          "  Cow taking",-          "    a shit"],-         ["           (__)",-          "           (oo)",-          "   /-oooooo-\\/",-          "  * ooooooooo",-          " ooooooooooooo",-          "ooooooooooooooooo",-          "  Cow in deep",-          "      shit"],-         [" *        (__) *      (__)",-          "  \\       (oo) |      (oo)",-          "   \\-------\\/  \\-------\\/",-          "o  o|     ||   /     ||",-          "    ||----||>==/-----||",-          "    ^^    ^^         ^^",-          "    Cow getting the shit",-          "     kicked out of her"],-         ["            U",-          "        /---V",-          "       * |--|",-          "",-          "",-          "Cow at 100 meters."],-         ["          .",-          "",-          "",-          "",-          "Cow at 10,000 meters."],-         ["         )__(",-          "         (oo)",-          "  *-------\\/",-          " / |     ||",-          "/  ||----||",-          "   vv    vv",-          "",-          " Polish Cow"],-         ["      vv    vv",-          "      ||----||  *",-          "      ||     | /",-          "     /\\-------/",-          "    (oo)",-          "    (~~)",-          "",-          "Australian Cow"],-         ["              (__)",-          "         ____ (oo)",-          "       /-    --\\/",-          "      / |     ||",-          "     *  ||___-||",-          "        ^^    ^^",-          "",-          "     Freshman Cow",-          "After the \"Freshman 15\""],-         ["         (__)",-          "         (OO)",-          "  /-------\\/",-          " / |     ||",-          "*  ||----||",-          "   ^^    ^^",-          "",-          "Cow who drank Jolt"],-         ["            (__)",-          "            (@@)",-          "     /-------\\/",-          "    / |     ||",-          "   *  ||----||",-          "      ^^    ^^",-          "",-          "   Cow who ate",-          "psychadelic mushrooms"],-         ["          (__)",-          "          (xx)",-          "   /-------\\/",-          "  / |     ||",-          " *  ||----||",-          "    ^^    ^^",-          "",-          " Cow who used Jolt to wash",-          "down psychadelic mushrooms"],-         ["             (__)",-          "             SooS",-          "      /------S\\/S",-          "     / |     ||",-          "    *  ||----||",-          "       ^^    ^^",-          "    This cow belonged",-          "  to George Washington"],-         ["                /\\",-          "               /  \\",-          "         (__)  \\  /",-          "         (oo)   \\/",-          "  /-------\\/    /S",-          " / |     ||    /  S",-          "*  ||----||___/    S",-          "   ^^    ^^",-          " Ben Franklin owned",-          "    this cow"],-         ["          __",-          "          ||",-          "        (_||_)",-          "         (oo)",-          "  /-------\\/",-          " / |     ||",-          "*  ||----||",-          "   ^^    ^^",-          "Abe Lincoln's",-          "     cow"],-         [" (__)      (__)",-          " (oo)      (oo)",-          "  \\/--------\\/",-          "   |        |",-          "   ||------||",-          "   ^^      ^^",-          "This cow lived with",-          "   Dr. Doolittle"],-         ["             (__)",-          "             (oo)",-          "       /------\\/",-          "      /|  |/  |",-          "     / |  [) ||",-          "    *  ||----||",-          "       ^^    ^^",-          "  This cow was given to",-          "Hugh Hefner for his Birthday"],-         ["    *        (__)",-          "     \\       (oo)",-          "      \\-------\\/",-          "       | ==$ ||",-          "       ||----||",-          "       ^^    ^^",-          "Old \"One Arm\" belonged",-          "  to Ceasar's Palace"],-         ["                  (___)",-          "                  ( O )",-          "           /-------\\ /",-          "          / |     ||V",-          "         *  ||----||",-          "            ^^    ^^",-          "  The cyclops that Jason and",-          "the Argonauts met had this cow"],-         ["             (__)",-          "             [##]",-          "      /-------\\/",-          "     / |     ||",-          "    *  ||----||",-          "       ^^    ^^",-          " This cow belonged",-          "  to Flash Gordon"],-         ["            (__)",-          "            (@o)",-          "     /-------\\/",-          "    / |     ||",-          "   *  ||----||",-          "      ^^    ^^",-          "This cow lived with",-          "the Little Rascals"],-         ["    /-------  (__)",-          "   / |     || (oo)",-          "  *  ||----|---\\/",-          "     ^^    ^",-          "This cow belonged to",-          "the Headless Horseman"],-         ["                 \\_|_/",-          "                  (oo)",-          "           /-------\\/",-          "          / |     ||",-          "         *  ||----||",-          "            ^^    ^^",-          "Cow visiting the Statue of Liberty"],-         ["            (____)",-          "            (o  o)",-          "      /-----\\    /----",-          "     / |   |  \\/   |",-          "     \\ |  |      | | |",-          "      *| | |-----| | |",-          "       /\\ /\\     /\\ /\\",-          "  This was Salvatore",-          " Dali's favorite cow"],-         ["                    (____)",-          "                    ( O O)",-          "         /-----------\\  /",-          "        / ||       |  \\/",-          "       /  ||       ||||",-          "      *   ||||-----||||",-          "          ^^^^     ^^^^",-          "   No one was sure whether",-          " M.C. Escher's cow had four",-          "          legs or eight"],-         ["               (____)",-          "               (oo  )",-          "    /-----------\\  /",-          "   / ||       |  \\/",-          "  /  ||       ||||",-          " *   ||||-----||||",-          "     /\\/\\     /\\/\\",-          "This cow belonged",-          " to Pablo Picasso"],-         ["               O__O",-          "               (oo)",-          "        /-------\\/",-          "       / |     ||",-          "      *  ||----||",-          "         ^^    ^^",-          "    Cow at Disneyland"],-         ["                        (__)",-          "                ^^      (oo)",-          "            ^^^^ /-------\\/",-          "         ^^^^^  / |     ||",-          "       ^^^^^   *  ||----||",-          "    ^^^^^^^^  ====^^====^^====",-          "^^^^^^^^^^^^^/",-          "^^^^^^^^^^^^^^^^^^",-          "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^",-          "     Cow Hanging Ten at Malibu"],-         ["           (__)",-          "           (--)",-          "          /-\\/-\\",-          "         /|    |\\",-          "        ^ |    | ^",-          "          |    |",-          "          /----\\",-          "         /    \\ \\",-          "        ^      * ^",-          "Cow sunning at Fort Lauderdale",-          "    (What a bod, huh guys?)"],-         ["       / / / / / / / / / / /",-          "      / / / / / / / / / / / /",-          "      / / / / / _______   / /",-          "      / / /    /   |   \\  / /",-          "      / / /    (__)|      / /",-          "      / / /    (oo)|      / /",-          "        /-------\\/ |",-          "       / |     ||^_|",-          "      *  ||----|",-          "         ^^    ^",-          "",-          "Cow sheltering from English Weather"],-         ["                (__)",-          "                (DD)",-          "         /-------\\/",-          "        / |     ||_\\_/",-          "       *  ||----|",-          "          ^^    ^",-          "Cow chugging brews and staring at",-          "  sunbathers at Fort Lauderdale"],-         ["               )\\               (__)",-          "              /  \\              (oo)",-          "        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~",-          "           Cow swimming at Amityville",-          "(Where Jaws was filmed, for those less educated)"],-         ["        *",-          "         \\",-          "          \\",-          "          |\\",-          "        \\ | \\ (__)",-          "        \\\\|| \\(oo)",-          "         \\||\\ \\\\/",-          "          ^^ \\||",-          "           \\\\ ||",-          "            \\\\||",-          "             \\||",-          "              ^^",-          "               \\\\_",-          "                \\_",-          " Cow skiing a Black Diamond at Aspen"],-         ["   ( @@@ )",-          "    ( @@ )            (------------)",-          "       @@  (__)       (  *>COUGH<* )",-          "        @@ (oo) . . . (  *>COUGH<* )",-          "     /--UU--\\/        (____________)",-          "    / |    ||",-          "   *  ||---||",-          "",-          "   (New) Jersey Cow"],-         ["                       O O                 O O",-          "                        \\ \\               / /",-          "                         \\ \\          (__) /",-          "          (__)            \\ \\         (xx)/",-          "          (DD)             \\ +--------+\\//",-          "   /-------\\/               \\|        | /",-          "  / |     ||                 +--------+",-          " *  ||----||",-          "    ^^    ^^",-          "Cow fantasizing about \"Riding the Mechanical Bull\"",-          "            at Gillies in Texas"],-         ["                       x",-          "                   xxxx|xxxx",-          "                xxxxxxx|xxxxxxx",-          "                       |",-          "                      //",-          "                (__) //",-          "                (oo)//",-          "         /-------\\//",-          "        / |     |//",-          "       *  ||----|",-          "          ^^    ^^",-          "     Julie Andrews Cow"],-         ["         (__)   (__)",-          "         (oo)===(oo)",-          "  /-------\\/     \\/-------\\",-          " / |     ||       ||     | \\",-          "*  ||----||       ||----||  *",-          "   ^^    ^^       ^^    ^^",-          "         Siamese cows"],-         ["       o        o",-          "        \\      /",-          "         \\    /",-          "          \\__/",-          "   _______(oo)",-          "  /|  ___  \\/",-          " / | {   }||",-          "*  ||{___}||",-          "   ||-----||",-          "   ^^     ^^",-          "",-          "   Television",-          "       Cow",-          "   (Cow-thode",-          "    Ray Tube)"],-         ["             (__)    ^",-          "             (oo)   /",-          "         _____\\/___/",-          "        /  /\\ / /",-          "       ^  /  * /",-          "         / ___/",-          "    *----/\\",-          "        /  \\",-          "       /   /",-          "      ^    ^",-          "",-          "  This cow does Disco",-          " (That's what comes of",-          "  snorting cow-caine)"],-         ["             (__)",-          "             (oo)",-          "    /---------\\/",-          "   / | x=a(b)||",-          "  *  ||------||",-          "     ^^      ^^",-          "",-          "    Mathematical",-          "        Cow",-          "   (developer of",-          "     cow-culus)"],-         ["            o",-          "            | [---]",-          "            |   |",-          "            |   |                              |------========|",-          "       /----|---|\\                             | **** |=======|",-          "      /___/___\\___\\                         o  | **** |=======|",-          "      |            |                     ___|  |==============|",-          "      |           |                ___  {(__)} |==============|",-          "      \\-----------/             [](   )={(oo)} |==============|",-          "       \\  \\   /  /             /---===--{ \\/ } |",-          "    -----------------         / | NASA  |====  |",-          "    |               |        *  ||------||-----^",-          "    -----------------           ||      |      |",-          "      /    /  \\   \\             ^^      ^      |",-          "     /     ----    \\",-          "      ^^         ^^           This cow jumped over the Moon"],-         ["                (__)",-          "               ([][])            \"I have this recurring dream",-          "               __\\/_--U              about golden arches.\"..  (__)",-          "              /\\    \\__                                 ^  :..(\"\")",-          "             /\\\\\\  /  /                         //\\  ____\\_____\\/ //",-          "            /----^/__/\\ /\\                     // \\\\/     \\___ / //",-          "                \\\\\\____/--\\--                 // /-/__________/ //",-          "                 /======   \\/            =======/==============//",-          "              *_/ /    \\   /^              //  /              \\\\",-          "                 /      \\ ^               //                   \\\\",-          "",-          "                     Psycowlogist and patient"],-         ["          \\^^^^^^^^\\   (__)",-          "           \\^^^^^^^^\\\\ (oo)",-          "        *-----\\_______\\/\\/",-          "      ^_______/   ---  \\______^",-          "     ^--------\\   \\S/  /\\_____^",-          "               \\______/",-          "",-          "   It's a bird...",-          "    It's a plane..."],-         ["   (___)",-          "   (o o)",-          "    \\ /",-          "  \\--O--/",-          " // -----\\",-          " \\\\/_^{} /==V===[]",-          "   \\_____\\\\//",-          "    \\__/",-          "    //\\\\         The Boss",-          "    //  \\\\   (Bruce Holstien)",-          "    //   //",-          "    ^^    ^^"],-         ["                                          ==================",-          " _____________________________            H                H",-          " |             |-------------|            H     (__)       H",-          " |             |   ________  |            H     (oo)       H       __",-          " |   COWNTY    |  | (|__|) | |            H    / \\/ \\      H     /    \\",-          " |    JAIL     |  |  |oo|  | |            H   | |  | |     H    | STOP |",-          " |             |  |__|\\/|__| |            H   D===b=-----  H     \\ __ /",-          " |             | o           |            H^^^^^^^^^^^^^^^^H       ||",-          " |             | ^           |            H                H       ||",-          " |             | ]           |            H                H       ||",-          " |             |             |            H                H       ||",-          " |_____________|_____________|            H                H       ||",-          "                                          ^^^^^^^^^^^^^^^^^^     ^^^^^^^",-          " Some cows get in trouble...                 Cattle Guard"],-         ["     (  (    )",-          "   ( (     )   )",-          "   ( (         )",-          "  (           / )",-          " ( ( \\\\       )",-          "     ( |  // )",-          "       |   |    (__)",-          "       |   |    (oo)",-          "       |   | ----\\/",-          "       |   |    ||",-          "     **|   | ---||",-          "    ``'---------^^",-          "        Cow Hide"],-         ["       (__)",-          " ______(oo)_____",-          "( _)_______(__) )",-          "  \\ __________/",-          "",-          "     Cow Pie"],-         ["                   \\  |  /         ___________",-          "    ____________  \\ \\_# /         |  ___      |       _________",-          "   |            |  \\  #/          | |   |     |      | = = = = |",-          "   | |   |   |  |   \\\\#           | |`v'|     |      |         |",-          "   |            |    \\#  //       |  --- ___  |      | |  || | |",-          "   | |   |   |  |     #_//        |     |   | |      |         |",-          "   |            |  \\\\ #_/_______  |     |   | |      | |  || | |",-          "   | |   |   |  |   \\\\# /_____/ \\ |      ---  |      |         |",-          "   |            |    \\# |+ ++|  | |  |^^^^^^| |      | |  || | |",-          "   |            |    \\# |+ ++|  | |  |^^^^^^| |      | |  || | |",-          "^^^|    (^^^^^) |^^^^^#^| H  |_ |^|  | |||| | |^^^^^^|         |",-          "   |    ( ||| ) |     # ^^^^^^    |  | |||| | |      | ||||||| |",-          "   ^^^^^^^^^^^^^________/  /_____ |  | |||| | |      | ||||||| |",-          "        `v'-                      ^^^^^^^^^^^^^      | ||||||| |",-          "         || |`.      (__)    (__)                          ( )",-          "                     (oo)    (oo)                       /---V",-          "              /-------\\/      \\/ --------\\             * |  |",-          "             / |     ||        ||_______| \\",-          "            *  ||W---||        ||      ||  *",-          "               ^^    ^^        ^^      ^^",-          "                        \"Cow Town\""],-         ["              \\ (__)",-          "              \\\\(oo)",-          "         /-----\\\\\\/",-          "        / |    (##)",-          "       *  ||----||\"",-          "          ^^    ^^",-          "    This cow plays bagpipes."],-         ["         (__)",-          "         (\\/)",-          "  /-------\\/",-          " / | 666 ||",-          "*  ||----||",-          "   ^^    ^^",-          "",-          "Satanic cow"],-         ["            (__)",-          "            ($$)",-          "     /-------\\/",-          "    / |=====||",-          "   *  ||----||",-          "      ^^    ^^",-          "",-          "This cow is a Yuppie"],-         ["         (__)",-          "         (**)",-          "  /-------\\/",-          " / |     ||",-          "*  ||----||",-          "   ^^    ^^",-          "",-          " Cow in love"],-         ["           (---)",-          "           (   )",-          "          /-----\\",-          "          |     |",-          "          |  |  |",-          "          |  |  |",-          "          |  *  |",-          "          ^^   ^^",-          "          Coward"],-         ["        (__)",-          "        (xx)",-          " __------\\/",-          "* ||____||",-          " / |    |\\",-          "",-          " Hamburger"],-         ["  .            /\\         .       .",-          "        .     /  \\      .          .",-          "             /    \\   .        .    *",-          "            /      \\              *",-          "            | (__) |   .    .   **",-          "     .     /| (oo) |\\           **",-          "          / | /\\/\\ | \\   .     . *",-          "      .  /  |=|==|=|  \\     .      *",-          "     . /    | |  | |    \\  .",-          "      / USA | ^||^ |NASA \\     .",-          "     |______|  ^^  |______|       .",-          "    .       (__||__)     .   .",-          "       .    /_\\  /_\\  .     .    .",-          "            !!!  !!!",-          "",-          "  The cow that jumped over the moon."],-         ["                          ...---...",-          "                       ../  / | \\  \\..",-          "                     ./ /  /  |  \\  \\ \\.",-          "                    /  /   /  |  \\   \\  \\",-          "                   /  /   /   |   \\   \\  \\",-          "                   ^^^^^^^^^^^^^^^^^^^^^^^",-          "                   \\          |          /",-          "                    \\         |         /",-          "                     \\        |        /",-          "                      \\       |       /",-          "                       \\      |      /",-          "                        \\     |     /",-          "                         \\    |    /",-          "                          \\   |   /",-          "                           \\  |  /",-          "                            \\ | /(__)",-          "                             \\|/ (oo)",-          "                          /---++--\\/",-          "                         / |  || ||",-          "                        *  ||-++-||",-          "                           ^^    ^^",-          "               Cow surviving attack by Red Baron"],-         ["              ..---..                             (__)",-          "             /       \\                            (oo)",-          "             |  RIP  |                     /-------\\/",-          "             |       |                    / |     ||",-          "             |       |                   *  ||----||",-          "             |       |                      ^^    ^^",-          "\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/////////////////",-          "",-          "            Elvis's Cow...      ...Or is it alive and living in tax exile???"],-         ["                     (__)",-          "                     (oo)",-          "        /---+      +--\\/",-          "       / |  |      | ||",-          "      *  ||-+      +-||",-          "         ^^          ^^                             *",-          "",-          "   David Copperfield's Cow               David Copperfield's other Cow"],-         ["                                    (__)",-          "                                    (oo)",-          "                             /-------\\/",-          "                            / |     ||",-          "                           *  ||----||",-          "                              ^^    ^^",-          "                             (__)  (__)",-          "                             (oo)  (oo)",-          "                      /-------\\/    \\/-------\\",-          "                     / |     || -^^- ||     | \\",-          "                    *  ||----   -^^-       ||  *",-          "                       ^^                  ^^",-          "                      (__)                (__)",-          "                      (oo)                (oo)",-          "               /-------\\/                  \\/-------\\",-          "              / |     ||                    ||     | \\",-          "             *  ||----||                    ||----||  *",-          "                ^^    ^^                    ^^    ^^",-          "                 Barnum's Troupe of performing cows"],-         ["                    (__)                       _--------_",-          "                    (oo)                      |__________|   BIG",-          "             /-------\\/                        XXXXXXXXXX    MAC",-          "            / | 007 ||                         __________",-          "           *  ||----||                        |_        _|",-          "              ^^    ^^                          --------",-          "       Cow licenced to kill      Enemy Cow after having met previous cow"],-         ["            (__)",-          "            (oo)    o     /| /|/|_",-          "           / \\/    /    /      _ /",-          "          /  _\\===^   ___\\_____/___",-          "      ___|__/ |/\\    (___________(_)",-          "     *        ^ ^",-          "",-          "            Mrs. O'Leary's Cow"],-         ["      (__)",-          "      (oo)",-          "     /'^^^-m",-          "    / '' ` )",-          "   |      /|",-          "   |  |  | |",-          "   |_____|_|",-          "    //|| ||",-          "   *  ww ww",-          "",-          "Cow'nt Dracula"],-         [" ____             ____                                |+++++|",-          "|++++|    ___    |++++|                       ____    |+++++|",-          "|++++|   |++ ______________________          |++++|   |+++++|",-          "|++++|   |++/      /( )\\           \\         |++++|   |+++++|   __",-          "|    |   |+|      |-oo- |           \\______  |++++|   |+++++|  |++|",-          "-----(__)--|       \\__\\/           _(__)_  \\ --------------------------------",-          " o   ( oo /_______________________| (oo)  \\ |         __",-          " |  _/\\_| |  M O O - B U S T E R S|__\\/\\ /| |        /oo| - Bleaurgh!",-          " |-|  \\\\____                         ------  )_    /|  /\\",-          "  -|_  \\_|-_|^^^^^^^^^^^^^^^^^^^^^^^^^^ 0     _|  *  \\/  *",-          "     \\  |  __________________________________/",-          "     |  W|  \\ \\_/ /----------------- \\ \\_/ /",-          "     / /\\ \\  \\___/                    \\___/",-          "    / /  \\ \\",-          "    ^^^   ^^^                                      Who you gonna call...?"],-         ["              (__)",-          "              (-o)",-          "        /------\\/",-          "       /|     ||",-          "      * ||----||",-          "",-          "Flirtatious cow (winking)"],-         ["        (__)",-          "        (00)",-          "  /------\\/",-          " /|     ||",-          "* ||----||",-          "",-          "Cow w/ Glasses"],-         ["         (__)       (----------)",-          "         (--) . . . ( *>YAWN<* )",-          "   /------\\/        (----------)",-          "  /|     ||",-          " * ||----||",-          "",-          "Cow after pulling an all-nighter"],-         ["             \\ _ /",-          "            - ( ) -",-          "             / \" \\",-          "             (__)",-          "     ________(oo)",-          "    /|        \\/",-          "   / |_______||",-          "  *  ||      ||",-          "     ~~      ~~",-          " Thomas Edison's cow"],-         ["      ______________________            _______________________",-          "      |                    |            |                     |",-          "      |            (__)    |            |  (__)               |",-          "      |            (oo)    |            |  (oo)               |",-          "      |     /-------\\/     |            |---\\/           /----|",-          "      |    / |     ||      |            |  ||           / |   |",-          "      |   *  ||----||      |            |--||          *  ||--|",-          "      |      ~~    ~~      |            |  ~~             ~~  |",-          "      |--------------------|            |---------------------|",-          "            Normal Cow                  0   Cow  modulo one   1"],-         ["       ______________(__)_________________",-          "     /_______________(oo)_______________ /",-          "     |                \\/                ||",-          "    _|_                                _||",-          "   /__/_______________________________/__/|",-          "  (   )                              (   )|",-          "   | |________________________________| | |",-          "   \\_____________________________________/]",-          "    []               []               []",-          "",-          "                    COW-CH"],-         ["         (__)",-          "         (oo)",-          "          \\/",-          "          ||",-          "          ||",-          "          ||",-          "          ||",-          "  /------- /",-          " / |     ||",-          "*  ||----||",-          "   ~~    ~~",-          "   Cowraffe"],-         ["                                              *      *",-          "                                               \\    /",-          "                                                \\  /",-          "       /~~~~~~~~~~~~~~~~~~~~~~~\\                 \\/",-          "     /   (__)                   \\           +----------+",-          "    |    (oo) ~~~~~~~~~~~\\       |          |          |",-          "   |~~~|  \\/. \\\\       // \\_* |~~~|         |          |",-          "   |   |-----`//`====='\\\\-----|   |         |          |",-          "   |   |-----//---------||----|   |         |          |",-          "   |   |_ _ _\"_ _ _ _ _ \"_ _ _|   |         +----------+",-          "    ~||~                      ~||~           ||      ||",-          "",-          "                         \"COWCH POTATO\""],-         ["         (__)",-          "         (oo)   -------------------------",-          "  /-------\\/ - | Don't have a Bart, man! |",-          " / |     ||     -------------------------",-          "*  ||----||",-          "   ~~    ~~",-          " The Simpsons' cow"],-         [" _______________________",-          "|\\ ~                ~  /|",-          "| \\    ~      ~     ~ / |",-          "|(_\\ ~   COW-PIE ~   /_)|",-          "|(oo\\   ~           /oo)|",-          "| \\/ \\       ~  ~  / \\/ |",-          "|(__) \\           / (__)|",-          "\\(oo)(_\\ ~     ~ /_)(oo)|",-          " \\\\/ (oo\\       /oo) \\//",-          "  \\   \\/ \\  ~  / \\/   /",-          "   \\  (__)\\   / (__) /",-          "    \\ (oo) \\~/  (oo)/",-          "     \\ \\/   :(__)\\//",-          "      \\ (__):(oo) /",-          "       \\(oo): \\/ /",-          "        \\\\/(__) /",-          "         \\ (oo)/",-          "          \\ \\//",-          "           \\:/"],-         ["                \\               /",-          "                 \\_____________/",-          "                 /\\___________/\\",-          "      Cow in    / /\\_________/\\ \\",-          "      trouble  / / /\\_______/\\ \\ \\",-          "              / / / / (__) /\\ \\ \\ \\",-          "          ___/_/_/_/_ (oo) \\_\\_\\_\\_\\___",-          "             \\ \\ \\ \\ \\ \\/  / / / / /",-          "              \\ \\ \\ \\/_____\\/ / / /",-          "               \\ \\ \\/_______\\/ / /",-          "                \\ \\/_________\\/ /",-          "                 \\/___________\\/",-          "                 /             \\",-          "                /               \\"],-         ["                              (___)",-          "                              (  OO",-          "  ______      ______      _____\\_ |                 ______  (__) ______",-          " |      |    |      |    |      |\\O    cowstle     |      | (oo)|      |",-          " |      |____|      |____|      |                  |      |__\\/_|      |",-          " |                              |                  |                   |",-          " |                              |   (__)           |                   |",-          " |          __________          |   (oo)           |     __________    |",-          " |         |          |         |    \\/-------\\    |    |          |   |",-          " |         |          |         | ___ | ___  |_\\_  |    |          |   |",-          " |         |   (__)   |         |_| |_|_| |__|| |__|    |   (__)   |   |",-          " |         |   (oo)   |                                 |   (oo)   |   |",-          " |          \\___\\/___/                                   \\___\\/___/    |",-          " |                                                                     |",-          " |                                                                     |",-          "  (                                    ______                         )",-          "   (                                  /      \\                       )",-          "     (                               /        \\                    )",-          "        (                            |        |                 )",-          "           |                         |        |              |",-          "           |                         |        |              |",-          "           |_________________________|________|______________|"],-         ["  \\ \\",-          "   \\ \\",-          "    \\ \\",-          "     \\ \\   (__)",-          "      \\ \\  (oo)",-          "   /---\\----\\/",-          "  / |   \\  ||",-          " *  ||---\\-\\\\",-          "    ~~      ~~",-          "            ~~       ~~",-          "             \\\\_____//",-          "             ||     |",-          "             /\\------\\",-          "            (oo)      \\",-          "            (--)       *",-          "",-          "Cow Circus: The flying Cowlendas"],-         ["                          /",-          "                         /",-          "      *         (__)    /",-          "       \\        ( OO   /",-          "        \\---\\___/\\_|\\=/>",-          "        |        \\===/>",-          "        | /______/  /",-          "_________\\\\_\\\\_____/__________________",-          "          ~  ~    /",-          "                 /",-          "                /",-          "",-          "   Cow Circus: Tightrope walking"],-         ["      *",-          "       \\",-          "    w   \\    w",-          "    \\\\  /\\  //",-          "     \\\\/  \\//",-          "      |    |",-          "      |(__)|",-          "      \\(OO)/",-          "      //\\/\\\\",-          "      ||  ||",-          "      ||__||",-          "     /~~  ~~\\",-          "   / ======== \\",-          "  /            \\",-          " |==============|",-          "  \\            /",-          "   \\ ======== /",-          "     \\ _____ /",-          "Cow balancing on ball"],-         ["   (__)",-          "   (oo)",-          "  .-\\/-.",-          " <|    |>",-          "  \\ \\/ /",-          "  |\\/\\/|",-          "  /----\\",-          " /      \\",-          " /* * * \\",-          "/__*_*_*_\\",-          "  ||  ||",-          "  ~~  ~~",-          "",-          "  Cowslip"]]-
Plugin/Dynamic.hs view
@@ -6,8 +6,6 @@ -- module Plugin.Dynamic (theModule) where -import {-# SOURCE #-} Modules   (plugins)- import Plugin import Control.Monad.State @@ -19,13 +17,14 @@     moduleHelp _ _ = "An interface to dynamic linker"     modulePrivs  _ = ["dynamic-load","dynamic-unload","dynamic-reload"] -    moduleInit   _ = do+    moduleInit   _ = lift $ do+        plugins <- gets ircPlugins         mapM_ (\p -> load p >> liftIO (putChar '!' >> hFlush stdout)) plugins      process_ _ s rest = case s of-        "dynamic-load"      -> load rest                >> return ["module loaded"]-        "dynamic-unload"    -> unload rest              >> return ["module unloaded"]-        "dynamic-reload"    -> unload rest >> load rest >> return ["module reloaded"]+        "dynamic-load"      -> lift (load rest)                >> return ["module loaded"]+        "dynamic-unload"    -> lift (unload rest)              >> return ["module unloaded"]+        "dynamic-reload"    -> lift (unload rest >> load rest) >> return ["module reloaded"]  -- -- | Load value "theModule" from each plugin, given simple name of a@@ -48,6 +47,7 @@ -- unload :: String -> LB () unload nm = do+        plugins <- gets ircPlugins         unless (nm `elem` plugins) $ error "unknown or static module"         ircUnloadModule nm         ircUnload (getModuleFile nm)
Plugin/Elite.hs view
@@ -8,6 +8,7 @@ module Plugin.Elite (theModule) where  import Plugin+import qualified Text.Regex as R  import Control.Arrow import Control.Monad.State@@ -34,19 +35,18 @@                           return (subst ++ translatedRest)   where alts = (map (\ (Just (_,_,rest,_),subst) -> (subst,rest)) $                 filter isJustEmpty $-                map (\ (regex, subst) -> (matchRegexAll regex str,subst)) $+                map (\ (re, subst) -> (R.matchRegexAll re str,subst)) $                 ruleList)                ++ [([toUpper $ head str],tail str)                   ,([head str],tail str)                   ]-                 isJustEmpty :: (Maybe([a],b,c,d),e) -> Bool isJustEmpty (Just ([],_,_,_),_) = True isJustEmpty (_,_)                = False  ruleList :: [(Regex,String)]-ruleList = map (first mkRegex)+ruleList = map (first regex')            [("a","4")            ,("b","8")            ,("c","(")
Plugin/Eval.hs view
@@ -10,16 +10,31 @@  import Plugin import Lib.Parser+import Language.Haskell.Parser+import Language.Haskell.Syntax hiding (Module)+import qualified Text.Regex as R+import System.Directory+import System.Exit +import qualified Data.ByteString.Char8 as P+ PLUGIN Plugs  instance Module PlugsModule () where-    moduleCmds   _ = ["run"] -- not "eval", clashes with perl6 bot-    moduleHelp _ _ = "run <expr>\nYou have Haskell, 3 seconds and no IO. Go nuts!"-    process _ _ to _ s = ios80 to (plugs s)-    contextual _ _ to txt | isEval txt = ios80 to . plugs . dropPrefix $ txt-                          | otherwise  = return []+    moduleCmds   _             = ["run","let","undefine"]+    moduleHelp _ "let"         = "let <x> = <e>. Add a binding"+    moduleHelp _ "undefine"    = "undefine. Reset evaluator local bindings"+    moduleHelp _ _             = "run <expr>. You have Haskell, 3 seconds and no IO. Go nuts!"+    process _ _ to "run" s     = ios80 to (plugs s)+    process _ _ to "let" s     = ios80 to (define s)+    process _ _ _ "undefine" _ = do io $ copyFile "State/Pristine.hs" "State/L.hs"+                                    x <- io $ comp Nothing+                                    return [x] +    contextual _ _ to txt+        | isEval txt = ios80 to . plugs . dropPrefix $ txt+        | otherwise  = return []+ binary :: String binary = "./runplugs" @@ -33,65 +48,139 @@ plugs src = do     -- first, verify the source is actually a Haskell 98 expression, to     -- avoid code injection bugs.-    case parseExpr (src ++ "\n") of-        ParseFailed _ e -> return $ " " ++ e-        ParseOk     _   -> do+    case parseExpr src of+        Left  e -> return e+        Right _ -> do             (out,err,_) <- popen binary [] (Just src)-            let o = munge out-                e = munge err-            return $ case () of {_-                | null o && null e -> "Terminated\n"-                | null o           -> " " ++ e-                | otherwise        -> " " ++ o-            }+            case (out,err) of+                ([],[]) -> return "Terminated\n"+                _       -> do+                    let o = munge out+                        e = munge err+                    return $ case () of {_+                        | null o && null e -> "Terminated\n"+                        | null o           -> " " ++ e+                        | otherwise        -> " " ++ o+                    } -            where munge = expandTab . dropWhile (=='\n') . dropNL . clean_+------------------------------------------------------------------------+-- define a new binding +define :: String -> IO String+define src = case parseModule (src ++ "\n") of -- extra \n so comments are parsed correctly+    (ParseOk (HsModule _ _ (Just [HsEVar (UnQual (HsIdent "main"))]) [] ds)) +        | all okay ds -> comp (Just src)+    (ParseFailed _ e) -> return $ " " ++ e+    _                 -> return "Invalid declaration"+ where+    okay (HsTypeSig   {}) = True+    okay (HsFunBind   {}) = True+    okay (HsPatBind   {}) = True+    okay (HsInfixDecl {}) = True+    okay _                = False++-- It parses. then add it to a temporary L.hs and typecheck+comp :: Maybe String -> IO String+comp src = do+    copyFile "State/L.hs" "L.hs"+    case src of+        Nothing -> return () -- just reset from Pristine+        Just s  -> P.appendFile "L.hs" (P.pack (s  ++ "\n"))++    -- and compile Local.hs+    -- careful with timeouts here. need a wrapper.+    (o',e',c) <- popen "ghc" ["-O","-v0","-c"+                             ,"-Werror"+                             ,"-odir", "State/"+                             ,"-hidir","State/"+                             ,"L.hs"] Nothing++    case (munge o', munge e') of+        ([],[]) | c /= ExitSuccess -> return "Error."+                | otherwise -> do+                    renameFile "L.hs" "State/L.hs"+                    renameFile "State/L.hi" "L.hi"+                    renameFile "State/L.o" "L.o"+                    return (maybe "Undefined." (const "Defined.") src)+        (ee,[]) -> return (concat . intersperse " " . lines $ ee)+        (_ ,ee) -> return (concat . intersperse " " . lines $ ee)++-- test cases+-- lambdabot> undefine+-- Undefined. --+-- lambdabot> let x = 1+-- Defined.+-- lambdabot> let y = L.x+-- Defined.+-- lambdabot> > L.x + L.y+-- 2+-- lambdabot> let type Z = Int+-- Defined.+-- lambdabot> let newtype P = P Int +-- Defined.+-- lambdabot> > L.P 1 :: L.P+--  add an instance declaration for (Show L.P)+-- lambdabot> let instance Show L.P where show _ = "P"+-- Defined.+-- lambdabot> > L.P 1 :: L.P+--  P+--+++++munge :: String -> String+munge = expandTab . dropWhile (=='\n') . dropNL . clean_++-- -- Clean up runplugs' output -- clean_ :: String -> String-clean_ s | Just _         <- no_io      `matchRegex`    s = "No IO allowed\n"-        | Just _         <- terminated `matchRegex`    s = "Terminated\n"-        | Just _         <- hput       `matchRegex`    s = "Terminated\n"-        | Just _         <- stack_o_f  `matchRegex`    s = "Stack overflow\n"-        | Just _         <- loop       `matchRegex`    s = "Loop\n"-        | Just _         <- undef      `matchRegex`    s = "Undefined\n"-        | Just _         <- type_sig   `matchRegex`    s = "Add a type signature\n"-        | Just (_,m,_,_) <- ambiguous  `matchRegexAll` s = m-        | Just (_,_,b,_) <- inaninst   `matchRegexAll` s = clean_ b-        | Just (_,_,b,_) <- irc        `matchRegexAll` s = clean_ b-        | Just (_,m,_,_) <- nomatch    `matchRegexAll` s = m-        | Just (_,m,_,_) <- notinscope `matchRegexAll` s = m-        | Just (_,m,_,_) <- hsplugins `matchRegexAll`  s = m-        | Just (a,_,_,_) <- columnnum `matchRegexAll`  s = a-        | Just (a,_,_,_) <- extraargs `matchRegexAll`  s = a-        | Just (_,_,b,_) <- filename' `matchRegexAll`  s = clean_ b-        | Just (a,_,b,_) <- filename  `matchRegexAll`  s = a ++ clean_ b-        | Just (a,_,b,_) <- filepath `matchRegexAll`   s = a ++ clean_ b-        | Just (a,_,b,_) <- runplugs  `matchRegexAll`  s = a ++ clean_ b+clean_ s|  no_io      `matches'`    s = "No IO allowed\n"+        |  terminated `matches'`    s = "Terminated\n"+        |  hput       `matches'`    s = "Terminated\n"+        |  outofmem   `matches'`    s = "Terminated\n"+        |  stack_o_f  `matches'`    s = "Stack overflow\n"+        |  loop       `matches'`    s = "Loop\n"+        |  undef      `matches'`    s = "Undefined\n"+        |  type_sig   `matches'`    s = "Add a type signature\n"++        | Just (_,m,_,_) <- ambiguous  `R.matchRegexAll` s = m+        | Just (_,_,b,_) <- inaninst   `R.matchRegexAll` s = clean_ b+        | Just (_,_,b,_) <- irc        `R.matchRegexAll` s = clean_ b+        | Just (_,m,_,_) <- nomatch    `R.matchRegexAll` s = m+        | Just (_,m,_,_) <- notinscope `R.matchRegexAll` s = m+        | Just (_,m,_,_) <- hsplugins  `R.matchRegexAll`  s = m+        | Just (a,_,_,_) <- columnnum  `R.matchRegexAll`  s = a+        | Just (a,_,_,_) <- extraargs  `R.matchRegexAll`  s = a+        | Just (_,_,b,_) <- filename'  `R.matchRegexAll`  s = clean_ b+        | Just (a,_,b,_) <- filename   `R.matchRegexAll`  s = a ++ clean_ b+        | Just (a,_,b,_) <- filepath   `R.matchRegexAll`   s = a ++ clean_ b+        | Just (a,_,b,_) <- runplugs   `R.matchRegexAll`  s = a ++ clean_ b         | otherwise      = s     where         -- s/<[^>]*>:[^:]: //-        type_sig   = mkRegex "add a type signature that fixes these type"-        no_io      = mkRegex "No instance for \\(Show \\(IO"-        terminated = mkRegex "waitForProc"-        stack_o_f  = mkRegex "Stack space overflow"-        loop       = mkRegex "runplugs: <<loop>>"-        irc        = mkRegex "\n*<irc>:[^:]*:[^:]*:\n*"-        filename   = mkRegex "\n*<[^>]*>:[^:]*:\\?[^:]*:\\?\n* *"-        filename'  = mkRegex "/tmp/.*\\.hs[^\n]*\n"-        filepath   = mkRegex "\n*/[^\\.]*.hs:[^:]*:\n* *"-        undef      = mkRegex "Prelude.undefined"-        ambiguous  = mkRegex "Ambiguous type variable `a\' in the constraints"-        runplugs   = mkRegex "runplugs: "-        notinscope = mkRegex "Variable not in scope:[^\n]*"-        hsplugins  = mkRegex "Compiled, but didn't create object"-        extraargs  = mkRegex "[ \t\n]*In the [^ ]* argument"-        columnnum  = mkRegex " at <[^\\.]*\\.[^\\.]*>:[^ ]*"-        nomatch    = mkRegex "Couldn't match[^\n]*\n"-        inaninst   = mkRegex "^[ \t]*In a.*$"-        hput       = mkRegex "<stdout>: hPutStr"+        type_sig   = regex' "add a type signature that fixes these type"+        no_io      = regex' "No instance for \\(Show \\(IO"+        terminated = regex' "waitForProc"+        stack_o_f  = regex' "Stack space overflow"+        loop       = regex' "runplugs: <<loop>>"+        irc        = regex' "\n*<irc>:[^:]*:[^:]*:\n*"+        filename   = regex' "\n*<[^>]*>:[^:]*:\\?[^:]*:\\?\n* *"+        filename'  = regex' "/tmp/.*\\.hs[^\n]*\n"+        filepath   = regex' "\n*/[^\\.]*.hs:[^:]*:\n* *"+        undef      = regex' "Prelude.undefined"+        ambiguous  = regex' "Ambiguous type variable `a\' in the constraints"+        runplugs   = regex' "runplugs: "+        notinscope = regex' "Variable not in scope:[^\n]*"+        hsplugins  = regex' "Compiled, but didn't create object"+        outofmem   = regex' "out of memory \\(requested "+        extraargs  = regex' "[ \t\n]*In the [^ ]* argument"+        columnnum  = regex' " at <[^\\.]*\\.[^\\.]*>:[^ ]*"+        nomatch    = regex' "Couldn't match[^\n]*\n"+        inaninst   = regex' "^[ \t]*In a.*$"+        hput       = regex' "<stdout>: hPutStr"  ------------------------------------------------------------------------ --
+ Plugin/FT.hs view
@@ -0,0 +1,27 @@+--+-- | Free theorems plugin, +-- Don Stewart 2006+-- +module Plugin.FT where++import Plugin+import Plugin.Type (query_ghci)++PLUGIN FT++instance Module FTModule () where+    moduleCmds _   = ["ft"]+    moduleHelp _ _ = "ft <ident>. Generate theorems for free"+    process_ _ _ s = (liftM unlines . lift . query_ghci ":t") s >>= ios . ft++binary :: String+binary = "./ft"++ft :: String -> IO String+ft src = run binary src $+    unlines . map (' ':) . filter (not.null) . map cleanit . lines++cleanit :: String -> String+cleanit s | terminated `matches'` s = "Terminated\n"+          | otherwise               = filter isAscii s+    where terminated = regex' "waitForProc"
Plugin/Fact.hs view
@@ -20,7 +20,7 @@  type FactState  = M.Map P.ByteString P.ByteString type FactWriter = FactState -> LB ()-type Fact m a   = ModuleT FactState m a+-- type Fact m a   = ModuleT FactState m a  instance Module FactModule FactState where @@ -49,7 +49,7 @@ ------------------------------------------------------------------------  processCommand :: FactState -> FactWriter-               -> P.ByteString -> String -> P.ByteString -> Fact LB String+               -> P.ByteString -> String -> P.ByteString -> LB String processCommand factFM writer fact cmd dat = case cmd of         "fact"        -> return $ getFact factFM fact         "fact-set"    -> updateFact True factFM writer fact dat@@ -59,14 +59,14 @@         "fact-delete" -> writer ( M.delete fact factFM ) >> return "Fact deleted."         _ -> return "Unknown command." -updateFact :: Bool -> FactState -> FactWriter -> P.ByteString -> P.ByteString -> Fact LB String+updateFact :: Bool -> FactState -> FactWriter -> P.ByteString -> P.ByteString -> LB String updateFact guarded factFM writer fact dat =     if guarded && M.member fact factFM         then return "Fact already exists, not updating"         else writer ( M.insert fact dat factFM ) >> return "Fact recorded."  alterFact :: (P.ByteString -> P.ByteString)-          -> FactState -> FactWriter -> P.ByteString -> Fact LB String+          -> FactState -> FactWriter -> P.ByteString -> LB String alterFact f factFM writer fact =     case M.lookup fact factFM of         Nothing -> return "A fact must exist to alter it"
+ Plugin/Figlet.hs view
@@ -0,0 +1,51 @@+--+-- Copyright (c) 2006 Maxime Henrion <mux@FreeBSD.org>+-- GPL version 2 or later (see http://www.gnu.org/copyleft/gpl.html)+--++--+-- Call the `figlet' program+--++module Plugin.Figlet where++import Plugin++PLUGIN Figlet++instance Module FigletModule () where+    moduleCmds _ = ["figlet", "figlet'"]+    moduleHelp _ = fromJust . flip lookup help++    process_ _ "figlet" s = do+        let usage = ["usage: figlet <text>."]+        case words s of+          [] -> return usage+          t -> io (figlet (unwords t) Nothing)++    process_ _ "figlet'" s = do+        let usage = ["usage: figlet' <font> <text>."]+        case words s of+          (f:t@(_:_)) -> io (figlet (unwords t) (Just f))+          _ -> return usage++-- | Lookup table for documentation+help :: [(String, String)]+help =+    [("figlet", "figlet <text>. Run the figlet filter on <text>."),+     ("figlet'", "figlet' <font> <text>. Like figlet but using font <font>.")]++figletBinary :: FilePath+figletBinary = "/usr/local/bin/figlet"++-- | Run the actual figlet command and clean output+figlet :: String -> Maybe String -> IO [String]+figlet s f = do+        let args = ["-w", "70"          -- Limit width to 70 characters+                   ,"-f", fromMaybe "standard" f+                   ,s]+        (out,_,_) <- popen figletBinary args Nothing+        return $ result out++    where result [] = ["Couldn't run the figlet command."]+          result xs = filter (not . all (==' ')) . lines $ xs
+ Plugin/Filter.hs view
@@ -0,0 +1,46 @@+--+-- | GNU Talk Filters +-- needs: http://www.hyperrealm.com/main.php?s=talkfilters+-- Edward Kmett 2006+-- +module Plugin.Filter where++import Plugin++PLUGIN Filter++instance Module FilterModule () where+        moduleCmds _   = ["austro","b1ff","brooklyn","chef","cockney","drawl","dubya","fudd","funetak","jethro","jive","kraut","pansy","pirate","postmodern","redneck","valspeak","warez"]+        moduleHelp _ "austro" = "austro <phrase>. Talk like Ahhhnold"+        moduleHelp _ "b1ff" = "b1ff <phrase>. B1ff of usenet yore"+        moduleHelp _ "brooklyn" = "brooklyn <phrase>. Yo"+        moduleHelp _ "chef" = "chef <phrase>. Bork bork bork"+        moduleHelp _ "cockney" = "cockney <phrase>. Londoner accent"+        moduleHelp _ "drawl" = "drawl <phrase>. Southern drawl"+        moduleHelp _ "dubya" = "dubya <phrase>. Presidential filter"+        moduleHelp _ "fudd" = "fudd <phrase>. Fudd, Elmer"+        moduleHelp _ "funetak" = "funetak <phrase>. Southern drawl"+        moduleHelp _ "jethro" = "jethro <phrase>. Now listen to a story 'bout a man named Jed..."+        moduleHelp _ "jive" = "jive <phrase>. Slap ma fro"+        moduleHelp _ "kraut" = "kraut <phrase>. German accent"+        moduleHelp _ "pansy" = "pansy <phrase>. Effeminate male"+        moduleHelp _ "pirate" = "pirate <phrase>. Talk like a pirate"+        moduleHelp _ "postmodern" = "postmodern <phrase>. Feminazi"+        moduleHelp _ "redneck" = "redneck <phrase>. Deep south"+        moduleHelp _ "valspeak" = "valley <phrase>. Like, ya know?"+        moduleHelp _ "warez" = "warez <phrase>. H4x0r"+        process_ _ f s = do+                let usage = ["usage: " ++ f ++ " <phrase>"]+                case words s of+                        [] -> return usage+                        t -> io (runFilter f (unwords t))++pathTo :: String -> String+pathTo f = "/usr/local/bin/" ++ f++runFilter :: String -> String -> IO [String]+runFilter f s = do+        (out,_,_) <- popen (pathTo f) [] (Just s)+        return $ result out+    where result [] = ["Couldn't run the filter."]+          result xs = filter (not . all (==' ')) . lines $ xs
+ Plugin/Free.hs view
@@ -0,0 +1,17 @@+--+-- | Free theorems plugin, +-- Andrew Bromage, 2006+-- +module Plugin.Free where++import Plugin+import Plugin.Free.FreeTheorem+import Plugin.Type (query_ghci)++PLUGIN Free++instance Module FreeModule () where+    moduleCmds _  = ["free"]+    moduleHelp _ _= "free <ident>. Generate theorems for free"+    process_ _ _ xs = do result <- freeTheoremStr (liftM unlines . lift . query_ghci ":t") xs+                         return . (:[]) . concat . intersperse " " . lines $ result
+ Plugin/Free/Expr.hs view
@@ -0,0 +1,132 @@+{-# OPTIONS -w #-}
+
+module Plugin.Free.Expr where
+
+import Plugin.Free.Type
+import Plugin.Free.Util
+
+varInExpr :: Var -> Expr -> Bool
+varInExpr v (EBuiltin _)
+    = False
+varInExpr v (EVar v')
+    = v == v'
+varInExpr v (EVarOp _ _ v')
+    = False
+varInExpr v (EApp e1 e2)
+    = varInExpr v e1 || varInExpr v e2
+varInExpr v (ETyApp e1 t)
+    = varInExpr v e1
+
+leftVarOfExpr :: Expr -> Var
+leftVarOfExpr (EVar v) = v
+leftVarOfExpr (EApp e _) = leftVarOfExpr e
+leftVarOfExpr (ETyApp e _) = leftVarOfExpr e
+
+exprSubst :: Var -> Expr -> Expr -> Expr
+exprSubst v e e'@(EBuiltin _)
+    = e'
+exprSubst v e e'@(EVar v')
+    | v == v'   = e
+    | otherwise = e'
+exprSubst v e e'@(EVarOp _ _ v')
+    | v == v'   = e
+    | otherwise = e'
+exprSubst v e (EApp e1 e2)
+    = EApp (exprSubst v e e1) (exprSubst v e e2)
+exprSubst v e (ETyApp e1 t)
+    = ETyApp (exprSubst v e e1) t
+
+
+type Var = String
+
+data Fixity
+    = FL | FN | FR
+    deriving (Eq, Show)
+
+data Expr
+    = EVar Var
+    | EBuiltin Builtin
+    | EVarOp Fixity Int Var
+    | EApp Expr Expr
+    | ETyApp Expr Type
+        deriving (Eq, Show)
+
+data Builtin
+    = BMap TyName
+    | BId
+    | BProj Int Int
+    | BMapTuple Int
+    | BArr
+        deriving (Eq, Show)
+
+data ExprCtx
+    = ECDot
+    | ECAppL ExprCtx Expr
+    | ECAppR Expr ExprCtx
+    | ECTyApp ExprCtx Type
+        deriving (Eq, Show)
+
+applySimplifierExpr :: (Expr -> Expr) -> (Expr -> Expr)
+applySimplifierExpr s (EApp e1 e2)
+    = EApp (s e1) (s e2)
+applySimplifierExpr s (ETyApp e t)
+    = ETyApp (s e) t
+applySimplifierExpr s e
+    = e
+
+unzipExpr :: Expr -> ExprCtx -> Expr
+unzipExpr e ECDot = e
+unzipExpr e (ECAppL c e2) = unzipExpr (EApp e e2) c
+unzipExpr e (ECAppR e1 c) = unzipExpr (EApp e1 e) c
+unzipExpr e (ECTyApp c t) = unzipExpr (ETyApp e t) c
+
+varInCtx :: Var -> ExprCtx -> Bool
+varInCtx v ECDot
+    = False
+varInCtx v (ECAppL c e2)
+    = varInCtx v c || varInExpr v e2
+varInCtx v (ECAppR e1 c)
+    = varInCtx v c || varInExpr v e1
+varInCtx v (ECTyApp c _)
+    = varInCtx v c
+
+precAPP :: Int
+precAPP = 10
+
+instance Pretty Expr where
+    prettyP p (EBuiltin b)
+        = prettyP p b
+    prettyP _ (EVar v)
+        = text v
+    prettyP _ (EVarOp _ _ v)
+        = lparen <> text v <> rparen
+    prettyP p (EApp (EApp (EVarOp fix prec op) e1) e2)
+        = prettyParen (p > prec) (
+            prettyP pl e1 <+> text op <+> prettyP pr e2
+        )
+        where
+            pl = if fix == FL then prec else prec+1
+            pr = if fix == FR then prec else prec+1
+    prettyP p (EApp e1 e2)
+        = prettyParen (p > precAPP) (
+            prettyP precAPP e1 <+> prettyP (precAPP+1) e2
+        )
+    prettyP p (ETyApp e t)
+        = prettyP precAPP e
+
+instance Pretty Builtin where
+    prettyP p (BMap "[]")   = text "$map"
+    prettyP p (BMap c)      = text ("$map_" ++ c)
+    prettyP p BId           = text "$id"
+    prettyP p (BProj 2 1)   = text "$fst"
+    prettyP p (BProj 2 2)   = text "$snd"
+    prettyP p (BProj 3 1)   = text "$fst3"
+    prettyP p (BProj 3 2)   = text "$snd3"
+    prettyP p (BProj 3 3)   = text "$thd3"
+    prettyP p (BProj l i)   = text ("$proj_" ++ show l ++ "_" ++ show i)
+    prettyP p (BMapTuple 2) = text "$map_Pair"
+    prettyP p (BMapTuple 3) = text "$map_Triple"
+    prettyP p (BMapTuple n) = text $ "$map_Tuple" ++ show n
+    prettyP p BArr          = text "$arr"
+
+-- vim: ts=4:sts=4:expandtab:ai
+ Plugin/Free/FreeTheorem.hs view
@@ -0,0 +1,293 @@+{-# OPTIONS -w #-}
+
+module Plugin.Free.FreeTheorem where
+
+import Plugin.Free.Type
+import Plugin.Free.Expr
+import Plugin.Free.Theorem
+import Plugin.Free.Parse
+import Plugin.Free.Util
+
+import Control.Monad
+import Control.Monad.State
+import Control.Monad.Identity
+
+import Data.Char
+import qualified Data.Map as M
+
+newtype MyState
+    = MyState {
+        myVSupply :: Int
+    }
+
+type MyMon a = StateT MyState Identity a
+
+type TyEnv = [(TyVar,Var,TyVar,TyVar)]
+
+makeVar :: String -> MyMon String
+makeVar v
+    = do
+        vn <- gets myVSupply
+        modify (\s -> s { myVSupply = vn+1 })
+        return (v ++ "_" ++ show vn)
+
+extractTypes :: TyEnv -> Type -> (Type,Type)
+extractTypes env (TyVar v)
+    = head [ (TyVar t1,TyVar t2) | (v',_,t1,t2) <- env, v == v' ]
+extractTypes env (TyForall v t)
+    = let (t1,t2) = extractTypes ((v,undefined,v,v):env) t
+      in (TyForall v t1, TyForall v t2)
+extractTypes env (TyArr t1 t2)
+    = let (t1a,t1b) = extractTypes env t1
+          (t2a,t2b) = extractTypes env t2
+      in (TyArr t1a t2a, TyArr t1b t2b)
+extractTypes env (TyTuple ts)
+    = let ts12 = map (extractTypes env) ts
+      in (TyTuple (map fst ts12), TyTuple (map snd ts12))
+extractTypes env (TyCons c ts)
+    = let ts12 = map (extractTypes env) ts
+      in (TyCons c (map fst ts12), TyCons c (map snd ts12))
+
+freeTheoremStr :: (Monad m) => (String -> m String) -> String -> m String
+freeTheoremStr tf s
+    = case parse (do
+                    Just (QVarId v) <- getToken
+                    (mplus (do match OpColonColon
+                               t <- parseType
+                               return $ Left (v,t))
+                           (return (Right v)))) (lexer s) of
+        ParseSuccess (Left (v,t)) [] -> return (run' v t)
+        ParseSuccess (Right v)    [] -> do tStr <- tf s
+                                           case parse parseType (lexer tStr) of
+                                             ParseSuccess t [] -> return (run' v t)
+                                             ParseSuccess _ _ -> return $ "Extra stuff at end of line in retrieved type " ++ show tStr
+                                             ParseError msg -> return msg
+        ParseSuccess _ _      -> return "Extra stuff at end of line"
+        ParseError msg        -> return msg
+    where
+        run' v t = renderStyle defstyle (pretty (freeTheorem v t))
+        defstyle = Style {
+                        mode = PageMode,
+                        lineLength = 78,
+                        ribbonsPerLine = 1.5
+                    }
+
+freeTheorem :: String -> Type -> Theorem
+freeTheorem name t
+    = runIdentity $ do
+        (th,_) <- runStateT (freeTheorem' [] v0 v0 t) initState
+        let th' = theoremSimplify th
+        return . fst $ runState (insertRn name name >> rename th') initRnSt
+    where
+        v0 = EVar name
+        initState   = MyState { myVSupply = 1 }
+
+------------------------------------------------------------------------
+-- Rename monad, and pretty alpha renamer
+
+data RnSt = RnSt { gamma  :: M.Map Var Var
+                 , unique   :: [Var]
+                 , uniquelist :: [Var]
+                 , uniquefn :: [Var]
+                 }
+    deriving Show
+
+initRnSt
+    = RnSt M.empty suggestionsVal suggestionsList suggestionsFun
+    where
+        suggestionsVal = map (:[]) "xyzuvabcstdeilmnorw"
+                            ++ [ 'x' : show i | i <- [1..] ]
+        suggestionsList = map (:"s") "xyzuvabcstdeilmnorw"
+                            ++ [ "xs" ++ show i | i <- [1..] ]
+        suggestionsFun = map (:[]) "fghkpq"
+                            ++ [ 'f' : show i | i <- [1..] ]
+
+type RN a = State RnSt a
+
+-- generate a nice fresh name
+freshName :: RN Var
+freshName = do
+    s <- get
+    let ns    = unique s
+        fresh = head ns
+    put $ s { unique = tail ns }
+    case M.lookup fresh (gamma s) of
+        Nothing -> return fresh
+        _       -> freshName
+
+-- generate a nice function name
+freshFunctionName :: RN Var
+freshFunctionName = do
+    s <- get
+    let ns    = uniquefn s
+        fresh = head ns
+    put $ s { uniquefn = tail ns }
+    case M.lookup fresh (gamma s) of
+        Nothing -> return fresh
+        _       -> freshFunctionName
+
+-- generate a nice list name
+freshListName :: RN Var
+freshListName = do
+    s <- get
+    let ns    = uniquelist s
+        fresh = head ns
+    put $ s { uniquelist = tail ns }
+    case M.lookup fresh (gamma s) of
+        Nothing -> return fresh
+        _       -> freshListName
+
+-- insert a new association into the heap
+insertRn :: Var -> Var -> RN ()
+insertRn old new = modify $ \s ->
+    let gamma' = M.insert old new (gamma s) in s { gamma = gamma' }
+
+-- lookup the binding
+lookupRn :: Var -> RN Var
+lookupRn old = do
+    m <- gets gamma
+    return $ case M.lookup old m of
+        Nothing  -> old
+        Just new -> new
+
+-- alpha rename a simplified theory to something nice
+rename :: Theorem -> RN Theorem
+rename (ThImplies th1 th2) = do
+    th1' <- rename th1
+    th2' <- rename th2
+    return $ ThImplies th1' th2'
+
+rename (ThEqual e1 e2) = do
+    e1' <- rnExp e1
+    e2' <- rnExp e2
+    return $ ThEqual e1' e2'
+
+rename (ThAnd th1 th2) = do
+    th1' <- rename th1
+    th2' <- rename th2
+    return $ ThAnd th1' th2'
+
+rename (ThForall v ty th) = do
+    v' <- case ty of
+                TyArr _ _     -> freshFunctionName
+                TyCons "[]" _ -> freshListName
+                _             -> freshName
+    insertRn v v'
+    ty' <- rnTy ty
+    th' <- rename th
+    return $ ThForall v' ty' th'
+
+rnExp :: Expr -> RN Expr
+rnExp e@(EBuiltin _) = return e
+rnExp (EVar v)       = EVar       `fmap` lookupRn v
+rnExp (EVarOp f n v) = EVarOp f n `fmap` lookupRn v
+
+rnExp (EApp e1 e2) = do
+    e1' <- rnExp e1
+    e2' <- rnExp e2
+    return (EApp e1' e2')
+
+rnExp (ETyApp e ty) = do
+    e'  <- rnExp e
+    ty' <- rnTy ty
+    return (ETyApp e' ty')
+
+rnTy :: Type -> RN Type
+rnTy ty = return ty
+
+------------------------------------------------------------------------
+
+freeTheorem' :: TyEnv -> Expr -> Expr -> Type -> MyMon Theorem
+
+freeTheorem' env e1 e2 t'@(TyForall v t)
+    = do
+        mv <- makeVar "f"
+        t1 <- makeVar v
+        t2 <- makeVar v
+        let tymv = TyArr (TyVar t1) (TyVar t2)
+        pt <- freeTheorem' ((v,mv,t1,t2):env) (ETyApp e1 (TyVar t1))
+                                              (ETyApp e2 (TyVar t2)) t
+        return (ThForall mv tymv pt)
+
+freeTheorem' env e1 e2 t'@(TyArr t1 t2)
+    = do
+        mv1 <- makeVar "v1"
+        mv2 <- makeVar "v2"
+        let (tmv1,tmv2) = extractTypes env t1
+        p1 <- freeTheorem' env (EVar mv1) (EVar mv2) t1
+        p2 <- freeTheorem' env (EApp e1 (EVar mv1)) (EApp e2 (EVar mv2)) t2
+        return (ThForall mv1 tmv1 (ThForall mv2 tmv2 (ThImplies p1 p2)))
+
+freeTheorem' env e1 e2 t'@(TyTuple [])
+    = do
+        return (ThEqual e1 e2)
+
+freeTheorem' env e1 e2 t'@(TyTuple ts)
+    = do
+        let len = length ts
+
+        fts <- mapM (\t -> do
+                let (t1,t2) = extractTypes env t
+                f <- makeVar "f"
+                x <- makeVar "x"
+                y <- makeVar "y"
+                th <- freeTheorem' env (EVar x) (EVar y) t
+                let eq = ThEqual (EApp (EVar f) (EVar x)) (EVar y)
+                return ((f,TyArr t1 t2),
+                        ThForall x t1 (
+                            ThForall y t2 (
+                                ThImplies th eq
+                            )
+                        )
+                    )
+            ) ts
+        let thf = ThEqual (EApp (foldl (\e ((f,_),_) -> EApp e (EVar f))
+                            (EBuiltin $ BMapTuple len) fts) e1) e2
+        return (foldr (\((f,t),e1) e2 -> ThForall f t (ThImplies e1 e2))
+                thf fts)
+
+freeTheorem' env e1 e2 t'@(TyVar v)
+    = do
+        let f = head [ f | (v',f,_,_) <- env, v' == v ]
+        return (ThEqual (EApp (EVar f) e1) e2)
+
+freeTheorem' env e1 e2 t'@(TyCons _ [])
+    = do
+        return (ThEqual e1 e2)
+
+freeTheorem' env e1 e2 t'@(TyCons c [t])
+    = do
+        f <- makeVar "f"
+        x <- makeVar "x"
+        y <- makeVar "y"
+        let (t1,t2) = extractTypes env t
+        p1 <- freeTheorem' env (EVar x) (EVar y) t
+        let p2 = ThEqual (EApp (EVar f) (EVar x)) (EVar y)
+        let p3 = ThEqual (EApp (EApp (EBuiltin (BMap c)) (EVar f)) e1) e2
+        return (ThForall f (TyArr t1 t2) (
+                ThImplies (ThForall x t1 (ThForall y t2 (ThImplies p1 p2)))
+                            p3))
+
+freeTheorem' env e1 e2 t'@(TyCons c@"Either" ts@[_,_])
+    = do
+        fts <- mapM (\t -> do
+                let (t1,t2) = extractTypes env t
+                f <- makeVar "f"
+                x <- makeVar "x"
+                y <- makeVar "y"
+                th <- freeTheorem' env (EVar x) (EVar y) t
+                let eq = ThEqual (EApp (EVar f) (EVar x)) (EVar y)
+                return ((f,TyArr t1 t2),
+                        ThForall x t1 (
+                            ThForall y t2 (
+                                ThImplies th eq
+                            )
+                        )
+                    )
+            ) ts
+        let thf = ThEqual (EApp (foldl (\e ((f,_),_) -> EApp e (EVar f))
+                            (EBuiltin $ BMap c) fts) e1) e2
+        return (foldr (\((f,t),e1) e2 -> ThForall f t (ThImplies e1 e2))
+                thf fts)
+
+-- vim: ts=4:sts=4:expandtab:ai
+ Plugin/Free/Parse.hs view
@@ -0,0 +1,224 @@+{-# OPTIONS -w #-}
+
+module Plugin.Free.Parse where
+
+import Control.Monad
+
+data Token
+    = QVarId String
+    | QConId String
+    | QVarSym String
+    | QConSym String
+    | OpenParen
+    | CloseParen
+    | Comma
+    | Semicolon
+    | OpenBracket
+    | CloseBracket
+    | BackQuote
+    | OpenBrace
+    | CloseBrace
+    | OpDotDot
+    | OpColon
+    | OpColonColon
+    | OpEquals
+    | OpBackslash
+    | OpPipe
+    | OpBackArrow
+    | OpArrow
+    | OpAt
+    | OpTilde
+    | OpImplies
+    | IdCase
+    | IdClass
+    | IdData
+    | IdDefault
+    | IdDeriving
+    | IdDo
+    | IdElse
+    | IdForall
+    | IdIf
+    | IdImport
+    | IdIn
+    | IdInfix
+    | IdInfixl
+    | IdInfixr
+    | IdInstance
+    | IdLet
+    | IdModule
+    | IdNewtype
+    | IdOf
+    | IdThen
+    | IdType
+    | IdWhere
+    | IdUscore
+    | TokError String
+        deriving (Show,Eq,Ord)
+
+data ParseResult a
+    = ParseSuccess a [Token]
+    | ParseError String
+        deriving (Show)
+
+newtype ParseS a = ParseS { parse :: [Token] -> ParseResult a }
+
+instance Monad ParseS where
+    return x = ParseS (\ts -> ParseSuccess x ts)
+    m >>= k = ParseS (\ts -> case parse m ts of
+                                ParseSuccess x ts' -> parse (k x) ts'
+                                ParseError s       -> ParseError s)
+    fail str = ParseS (\_ -> ParseError str)
+
+instance MonadPlus ParseS where
+    mzero = ParseS (\ts -> ParseError "parse error")
+    mplus m1 m2
+        = ParseS (\ts -> case parse m1 ts of
+                            res@(ParseSuccess _ _) -> res
+                            ParseError _           -> parse m2 ts)
+
+peekToken :: ParseS (Maybe Token)
+peekToken = ParseS (\ts -> case ts of
+                            []     -> ParseSuccess Nothing []
+                            (t':_) -> ParseSuccess (Just t') ts)
+
+getToken :: ParseS (Maybe Token)
+getToken = ParseS (\ts -> case ts of
+                            []     -> ParseSuccess Nothing []
+                            (t:ts) -> ParseSuccess (Just t) ts)
+
+match :: Token -> ParseS ()
+match m
+    = do
+        mt <- getToken
+        case mt of
+            Just t | t == m -> return ()
+            _               -> fail ("Expected " ++ show m)
+
+ascSymbol = ['!','#','$','%','&','*','+','.','/','<','=','>','?','@','\\',
+                '^','|','-','~']
+
+
+lexer :: String -> [Token]
+lexer []
+    = []
+lexer (' ':cs)
+    = lexer cs
+lexer ('\t':cs)
+    = lexer cs
+lexer ('\f':cs)
+    = lexer cs
+lexer ('\r':cs)
+    = lexer cs
+lexer ('\n':cs)
+    = lexer cs
+lexer ('\v':cs)
+    = lexer cs
+lexer ('-':'-':cs)
+    = lexerLineComment cs
+    where
+        lexerLineComment ('\r':'\n':cs) = lexer cs
+        lexerLineComment ('\r':cs) = lexer cs
+        lexerLineComment ('\n':cs) = lexer cs
+        lexerLineComment ('\f':cs) = lexer cs
+        lexerLineComment (c:cs) = lexerLineComment cs
+        lexerLineComment [] = []
+lexer ('{':'-':cs)
+    = lexerComment lexer cs
+    where
+        lexerComment k ('{':'-':cs) = lexerComment (lexerComment k) cs
+        lexerComment k ('-':'}':cs) = k cs
+        lexerComment k (_:cs) = lexerComment k cs
+        lexerComment k [] = [TokError "Unterminated comment"]
+lexer ('(':cs)
+    = OpenParen : lexer cs
+lexer (')':cs)
+    = CloseParen : lexer cs
+lexer (',':cs)
+    = Comma : lexer cs
+lexer ('[':cs)
+    = OpenBracket : lexer cs
+lexer (']':cs)
+    = CloseBracket : lexer cs
+lexer (c@':':cs)
+    = lexerConSym [c] cs
+    where
+        lexerConSym con (c:cs)                
+            | c == ':'
+                || c `elem` ascSymbol
+                = lexerConSym (c:con) cs
+        lexerConSym con cs
+            = case reverse con of
+                ":"  -> OpColon : lexer cs
+                "::" -> OpColonColon : lexer cs
+                con  -> QConSym con : lexer cs
+lexer (c:cs)
+    | c `elem` ['A'..'Z']
+        = lexerConId [c] cs
+    | c `elem` ['a'..'z'] || c == '_'
+        = lexerVarId [c] cs
+    | c `elem` ascSymbol
+        = lexerVarSym [c] cs
+    | otherwise
+        = [TokError "Illegal char"]
+        where
+            lexerConId con (c:cs)
+                | c `elem` ['A'..'Z']
+                    || c `elem` ['a'..'z']
+                    || c `elem` ['0'..'9']
+                    || c == '\''
+                    || c == '_'
+                        = lexerConId (c:con) cs
+            lexerConId con cs
+                = QConId (reverse con) : lexer cs
+
+            lexerVarId var (c:cs)
+                | c `elem` ['A'..'Z']
+                    || c `elem` ['a'..'z']
+                    || c `elem` ['0'..'9']
+                    || c == '\''
+                    || c == '_'
+                        = lexerVarId (c:var) cs
+            lexerVarId var cs
+                = case reverse var of
+                    "_"        -> IdUscore : lexer cs
+                    "case"     -> IdCase : lexer cs
+                    "class"    -> IdClass : lexer cs
+                    "data"     -> IdData : lexer cs
+                    "default"  -> IdDefault : lexer cs
+                    "deriving" -> IdDeriving : lexer cs
+                    "do"       -> IdDo : lexer cs
+                    "else"     -> IdElse : lexer cs
+                    "forall"   -> IdForall : lexer cs
+                    "if"       -> IdIf : lexer cs
+                    "import"   -> IdImport : lexer cs
+                    "in"       -> IdIn : lexer cs
+                    "infix"    -> IdInfix : lexer cs
+                    "infixl"   -> IdInfixl : lexer cs
+                    "infixr"   -> IdInfixr : lexer cs
+                    "instance" -> IdInstance : lexer cs
+                    "let"      -> IdLet : lexer cs
+                    "module"   -> IdModule : lexer cs
+                    "newtype"  -> IdNewtype : lexer cs
+                    "of"       -> IdOf : lexer cs
+                    "then"     -> IdThen : lexer cs
+                    "type"     -> IdType : lexer cs
+                    "where"    -> IdWhere : lexer cs
+                    v          -> QVarId v : lexer cs
+
+            lexerVarSym var (c:cs)
+                | c == ':' || c `elem` ascSymbol
+                    = lexerVarSym (c:var) cs
+            lexerVarSym var cs
+                = case reverse var of
+                    ".."    -> OpDotDot : lexer cs
+                    "="     -> OpEquals : lexer cs
+                    "\\"    -> OpBackslash : lexer cs
+                    "|"     -> OpPipe : lexer cs
+                    "<-"    -> OpBackArrow : lexer cs
+                    "->"    -> OpArrow : lexer cs
+                    "@"     -> OpAt : lexer cs
+                    "~"     -> OpTilde : lexer cs
+                    "=>"    -> OpImplies : lexer cs
+                    var     -> QVarSym var : lexer cs
+
+-- vim: ts=4:sts=4:expandtab:ai
+ Plugin/Free/Test.hs view
@@ -0,0 +1,54 @@+module Plugin.Free.Test where
+
+import Plugin.Free.FreeTheorem
+import Plugin.Free.Type
+
+
+tUndef = "undefined :: a -> a"
+
+tMzero = "mzero :: [a]"
+
+tReturnList = "return :: a -> [a]"
+
+tHead = "head :: [a] -> a"
+
+tTail = "tail :: [a] -> [a]"
+
+tId = "id :: a -> a"
+
+tConst = "const :: a -> b -> a"
+
+tIdPair = "id :: (a,b) -> (a,b)"
+
+tSwap = "swap :: (a,b) -> (b,a)"
+
+tGenSwap = "genSwap :: (forall z. a -> b -> z) -> (forall z. b -> a -> z)"
+
+tMap = "map :: (a -> b) -> ([a] -> [b])"
+
+tZip = "zip :: ([a],[b]) -> [(a,b)]"
+
+tIdFun = "id :: (a -> b) -> (a -> b)"
+
+tFst = "fst :: (a,b) -> a"
+
+tFstFun = "fst :: (a->b,c) -> a -> b"
+
+tSnd = "snd :: (a,b) -> b"
+
+
+tContinuation :: Type -> Type
+tContinuation a
+    = TyForall "R" (TyArr (TyArr a r) r)
+    where
+        r = TyVar "R"
+
+tReturnC = "return :: a -> (forall r. (a -> r) -> r)"
+
+tCallCC = "callcc :: ((a -> (forall r. (b -> r) -> r)) -> (forall r. (a -> r) -> r)) -> (forall r. (a -> r) -> r)"
+
+tPierce = "pierce :: ((a -> b) -> a) -> a"
+
+tNot = "not :: (forall z. z -> z -> z) -> (forall z. z -> z -> z)"
+
+-- vim: ts=4:sts=4:expandtab:ai
+ Plugin/Free/Theorem.hs view
@@ -0,0 +1,190 @@+{-# OPTIONS -w #-}
+
+module Plugin.Free.Theorem where
+
+import Plugin.Free.Type
+import Plugin.Free.Expr
+import Plugin.Free.Util
+
+data Theorem
+    = ThForall Var Type Theorem
+    | ThImplies Theorem Theorem
+    | ThEqual Expr Expr
+    | ThAnd Theorem Theorem
+        deriving (Eq,Show)
+
+precIMPLIES, precAND :: Int
+precIMPLIES = 5
+precAND = 3
+
+instance Pretty Theorem where
+    prettyP p t = prettyTheorem p False t
+
+
+prettyTheorem :: Int -> Bool -> Theorem -> Doc
+prettyTheorem p fa th@(ThForall v t p1)
+    | fa        = prettyForall p [v] p1
+    | otherwise = prettyP p p1
+prettyTheorem p fa (ThImplies p1 p2)
+    = prettyParenIndent (p > precIMPLIES) (
+        prettyTheorem (precIMPLIES+1) True p1
+        $$ nest (-1) (text "=>")
+        $$ prettyTheorem precIMPLIES fa p2
+    )
+prettyTheorem _ _ (ThEqual e1 e2)
+    = prettyP 0 e1 <+> text "=" <+> prettyP 0 e2
+prettyTheorem p fa (ThAnd e1 e2)
+    = prettyParenIndent (p > precAND) (
+        prettyTheorem (precAND+1) fa e1 $$ text "&&"
+        $$ prettyTheorem precAND fa e2
+    )
+
+prettyForall :: Int -> [Var] -> Theorem -> Doc
+prettyForall p vs (ThForall v t p1)
+    = prettyForall p (v:vs) p1
+prettyForall p vs th
+    = parens (
+        text "forall" <+> hsep [ text v | v <- reverse vs ] <> text "."
+        <+> prettyTheorem 0 True th
+    )
+
+varInTheorem :: Var -> Theorem -> Bool
+varInTheorem v (ThForall v' t p)
+    = v /= v' && varInTheorem v p
+varInTheorem v (ThImplies p1 p2)
+    = varInTheorem v p1 || varInTheorem v p2
+varInTheorem v (ThEqual e1 e2)
+    = varInExpr v e1 || varInExpr v e2
+varInTheorem v (ThAnd e1 e2)
+    = varInTheorem v e1 || varInTheorem v e2
+
+applySimplifierTheorem :: (Theorem -> Theorem) -> (Theorem -> Theorem)
+applySimplifierTheorem s (ThForall v t p)
+    = ThForall v t (s p)
+applySimplifierTheorem s (ThImplies p1 p2)
+    = ThImplies (s p1) (s p2)
+applySimplifierTheorem s p@(ThEqual _ _)
+    = p
+applySimplifierTheorem s p@(ThAnd p1 p2)
+    = ThAnd (s p1) (s p2)
+
+peepholeSimplifyTheorem :: Theorem -> Theorem
+peepholeSimplifyTheorem
+    = peepholeSimplifyTheorem' . applySimplifierTheorem peepholeSimplifyTheorem
+
+peepholeSimplifyTheorem' :: Theorem -> Theorem
+peepholeSimplifyTheorem' (ThForall v t p)
+    = case varInTheorem v p of
+            True  -> ThForall v t p
+            False -> p
+peepholeSimplifyTheorem' p@(ThAnd e1 e2)
+    = foldr1 ThAnd (flattenAnd e1 . flattenAnd e2 $ [])
+    where
+        flattenAnd (ThAnd e1 e2) = flattenAnd e1 . flattenAnd e2
+        flattenAnd e = (e:)
+peepholeSimplifyTheorem' p
+    = p
+
+peepholeSimplifyExpr :: Expr -> Expr
+peepholeSimplifyExpr
+    = peepholeSimplifyExpr' . applySimplifierExpr peepholeSimplifyExpr
+
+peepholeSimplifyExpr' :: Expr -> Expr
+peepholeSimplifyExpr' (EApp (EBuiltin BId) e2)
+    = e2
+peepholeSimplifyExpr' (EApp (EBuiltin (BMap _)) (EBuiltin BId))
+    = EBuiltin BId
+peepholeSimplifyExpr' e
+    = e
+
+foldEquality :: Theorem -> Theorem
+foldEquality p@(ThForall _ _ _)
+    = case foldEquality' p [] of
+        Just p' -> p'
+        Nothing -> applySimplifierTheorem foldEquality p
+    where
+        foldEquality' (ThForall v t p) vts
+            = foldEquality' p ((v,t):vts)
+        foldEquality' (ThImplies (ThEqual (EVar v) e2) p) vts
+            | v `elem` map fst vts
+                = foldEquality'' vts (theoremSubst v e2 p)
+        foldEquality' (ThImplies (ThEqual e1 (EVar v)) p) vts
+            | v `elem` map fst vts
+                = foldEquality'' vts (theoremSubst v e1 p)
+        foldEquality' _ vts
+            = Nothing
+
+        foldEquality'' [] e
+            = Just e
+        foldEquality'' ((v,t):vts) e
+            = foldEquality'' vts (ThForall v t e)
+
+foldEquality p
+    = applySimplifierTheorem foldEquality p
+
+tryCurrying :: Theorem -> Theorem
+tryCurrying p@(ThForall _ _ _)
+    = case tryCurrying' p [] of
+        Just p' -> p'
+        Nothing -> applySimplifierTheorem tryCurrying p
+    where
+        tryCurrying' (ThForall v t p) vts
+            = tryCurrying' p ((v,t):vts)
+        tryCurrying' (ThEqual e1 e2) vts
+            = case (traverseRight ECDot e1, traverseRight ECDot e2) of
+                ((ctx1, EVar v1), (ctx2, EVar v2))
+                    | v1 == v2 && v1 `elem` map fst vts
+                        && not (varInCtx v1 ctx1) && not (varInCtx v2 ctx2)
+                        -> tryCurrying'' vts (ThEqual (untraverse ctx1)
+                                                      (untraverse ctx2))
+                _       -> Nothing
+        tryCurrying' _ _
+            = Nothing
+
+        traverseRight ctx (EApp e1 e2)
+            = traverseRight (ECAppR e1 ctx) e2
+        traverseRight ctx e
+            = (ctx, e)
+
+        untraverse ECDot = EBuiltin BId
+        untraverse (ECAppR e1 ECDot)
+            = e1
+        untraverse (ECAppR e1 ctx)
+            = EApp (EApp (EVarOp FR 9 ".") (untraverse ctx)) e1
+        tryCurrying'' [] e
+            = Just e
+        tryCurrying'' ((v,t):vts) e
+            = tryCurrying'' vts (ThForall v t e)
+
+tryCurrying p
+    = applySimplifierTheorem tryCurrying p
+
+theoremSimplify :: Theorem -> Theorem
+theoremSimplify
+    = iterateUntilFixpoint
+        (foldEquality
+        . iterateUntilFixpoint peephole
+        . tryCurrying
+        . iterateUntilFixpoint peephole
+        )
+    where
+        iterateUntilFixpoint s t
+            = findFixpoint (iterate s t)
+
+        peephole t = findFixpoint (iterate peepholeSimplifyTheorem t)
+
+        findFixpoint (x1:xs@(x2:_))
+            | x1 == x2  = x2
+            | otherwise = findFixpoint xs
+
+theoremSubst :: Var -> Expr -> Theorem -> Theorem
+theoremSubst v e (ThForall f t p)
+    = ThForall f t (theoremSubst v e p)
+theoremSubst v e (ThImplies p1 p2)
+    = ThImplies (theoremSubst v e p1) (theoremSubst v e p2)
+theoremSubst v e (ThEqual e1 e2)
+    = ThEqual (exprSubst v e e1) (exprSubst v e e2)
+theoremSubst v e (ThAnd p1 p2)
+    = ThAnd (theoremSubst v e p1) (theoremSubst v e p2)
+
+-- vim: ts=4:sts=4:expandtab:ai
+ Plugin/Free/Type.hs view
@@ -0,0 +1,222 @@+{-# OPTIONS -w #-}
+
+module Plugin.Free.Type where
+
+import Control.Monad
+import Plugin.Free.Parse
+import Data.List
+import Plugin.Free.Util
+
+type TyVar = String
+type TyName = String
+
+data Type
+    = TyForall TyVar Type
+    | TyArr Type Type
+    | TyTuple [Type]
+    | TyCons TyName [Type]
+    | TyVar TyVar
+        deriving (Eq, Show)
+
+precTYAPP, precARROW :: Int
+precTYAPP = 11
+precARROW = 10
+
+instance Pretty Type where
+    prettyP p (TyForall v t)
+        = prettyParen (p > 0) (
+            text "forall" <+> text v <> text "." <+> prettyP 0 t
+        )
+    prettyP p (TyArr t1 t2)
+        = prettyParen (p > precARROW) (
+            prettyP (precARROW+1) t1 <+> text "->" <+> prettyP precARROW t2
+        )
+    prettyP _ (TyTuple [])
+        = parens empty
+    prettyP _ (TyTuple (t:ts))
+        = parens (prettyP 0 t <> prettyTs 0 (text ",") ts)
+    prettyP _ (TyCons "[]" [t])
+        = lbrack <> prettyP 0 t <> rbrack
+    prettyP p (TyCons cons ts)
+        = prettyParen (p > precTYAPP) (
+            text cons <> prettyTs (precTYAPP+1) empty ts
+        )
+    prettyP _ (TyVar v)
+        = text v
+
+prettyTs :: Int -> Doc -> [Type] -> Doc
+prettyTs p c [] = empty
+prettyTs p c (t:ts) = c <+> prettyP p t <> prettyTs p c ts
+
+
+parseType :: ParseS Type
+parseType
+    = parseType' >>= return . normaliseType
+
+parseType' :: ParseS Type
+parseType'
+    = do
+        t <- peekToken
+        case t of
+            Just IdForall -> getToken >> parseForall
+            _             -> parseArrType
+    where
+        parseForall
+            = do
+                t <- getToken
+                case t of
+                    Just (QVarId v)
+                        -> parseForall >>= \t -> return (TyForall v t)
+                    Just (QVarSym ".")
+                        -> parseType'
+                    _   -> fail "Expected variable or '.'"
+
+        parseArrType
+            = do
+                t1 <- parseBType
+                t <- peekToken
+                case t of
+                    Just OpArrow
+                        -> getToken >> parseType' >>= \t2 ->
+                            return (TyArr t1 t2)
+                    _   -> return t1
+
+        parseBType
+            = do
+                t1 <- parseAType
+                case t1 of
+                    TyCons c ts
+                        -> do
+                            ts' <- parseBTypes
+                            return (TyCons c (ts++ts'))
+                    _   -> return t1
+
+        parseBTypes
+            = (parseBType >>= \t -> parseBTypes >>= \ts -> return (t:ts))
+                `mplus` return []
+
+        parseAType
+            = parseQTyCon `mplus` parseOtherAType
+
+        parseQTyCon
+            = do
+                t <- getToken
+                case t of
+                    Just OpenParen
+                        -> do
+                            t <- getToken
+                            case t of
+                                Just CloseParen
+                                    -> return (TyCons "()" [])
+                                Just OpArrow
+                                    -> match CloseParen
+                                        >> return (TyCons "->" [])
+                                Just Comma
+                                    -> parseQTyConTuple 1
+                                _   -> fail "Badly formed type constructor"
+                    Just OpenBracket
+                        -> match CloseBracket >> return (TyCons "[]" [])
+                    Just (QConId v)
+                        -> return (TyCons v [])
+                    _   -> fail "Badly formed type constructor"
+
+        parseQTyConTuple :: Int -> ParseS Type
+        parseQTyConTuple i
+            = do
+                t <- getToken
+                case t of
+                    Just Comma
+                        -> parseQTyConTuple (i+1)
+                    Just CloseParen
+                        -> return (TyCons ("(" ++ take i (repeat ',') ++ ")") [])
+                    _   -> fail "Badly formed type constructor"
+
+        parseOtherAType
+            = do
+                t1 <- getToken
+                case t1 of
+                    Just OpenParen
+                        -> do
+                            t <- parseType'
+                            parseTuple [t]
+                    Just OpenBracket
+                        -> parseType' >>= \t -> match CloseBracket
+                                        >> return (TyCons "[]" [t])
+                    Just (QVarId v)
+                        -> return (TyVar v)
+                    _   -> fail "Badly formed type"
+
+        parseTuple ts
+            = do
+                t1 <- getToken
+                case t1 of
+                    Just CloseParen
+                        -> case ts of
+                                [t] -> return t
+                                _   -> return (TyTuple (reverse ts))
+                    Just Comma
+                        -> do
+                            t <- parseType'
+                            parseTuple (t:ts)
+
+normaliseType :: Type -> Type
+normaliseType t
+    = let (fvs,nt) = normaliseType' t
+      in foldr TyForall nt (nub fvs)
+    where
+        normaliseType' t@(TyVar v)
+            = ([v],t)
+        normaliseType' (TyForall v t')
+            = let (fvs,t) = normaliseType' t'
+              in (filter (/=v) fvs, TyForall v t)
+        normaliseType' (TyArr t1 t2)
+            = let
+                (fvs1,t1') = normaliseType' t1
+                (fvs2,t2') = normaliseType' t2
+              in
+                (fvs1++fvs2, TyArr t1' t2')
+        normaliseType' (TyTuple ts)
+            = let
+                fvsts = map normaliseType' ts
+                fvs = concat (map fst fvsts)
+                ts' = map snd fvsts
+              in (fvs, TyTuple ts')
+        normaliseType' (TyCons c ts)
+            = let
+                fvsts = map normaliseType' ts
+                fvs = concat (map fst fvsts)
+                ts' = map snd fvsts
+              in case c of
+                    "->" -> case ts' of
+                        [t1,t2] -> (fvs, TyArr t1 t2)
+                        _ -> error "Arrow type should have 2 arguments"
+                    _ -> case checkTuple c of
+                        Just i
+                            -> if i == length ts'
+                                then (fvs, TyTuple ts')
+                                else error "Tuple type has the wrong number of arguments"
+                        Nothing
+                            -> (fvs, TyCons c ts')
+
+        checkTuple ('(':')':cs)
+            = Just 0
+        checkTuple ('(':cs)
+            = checkTuple' 1 cs
+        checkTuple _
+            = Nothing
+
+        checkTuple' k ")"
+            = Just k
+        checkTuple' k (',':cs)
+            = checkTuple' (k+1) cs
+        checkTuple' _ _
+            = Nothing
+
+readType :: String -> Type
+readType s
+    = case parse parseType (lexer s) of
+        ParseSuccess t [] -> t
+        ParseSuccess t _  -> error "Extra stuff at end of type"
+        ParseError msg    -> error msg
+
+-- vim: ts=4:sts=4:expandtab:ai
+ Plugin/Free/Util.hs view
@@ -0,0 +1,30 @@+module Plugin.Free.Util (
+    Pretty(..),
+    prettyParen,
+    prettyParenIndent,
+    module Text.PrettyPrint.HughesPJ
+) where
+
+
+import Text.PrettyPrint.HughesPJ
+
+
+class Pretty a where
+    prettyP :: Int -> a -> Doc
+
+    pretty :: a -> Doc
+    pretty x = prettyP 0 x
+
+
+prettyParen :: Bool -> Doc -> Doc
+prettyParen b doc
+    = if b then parens doc else doc
+
+prettyParenIndent :: Bool -> Doc -> Doc
+prettyParenIndent b doc
+    = if b
+      then vcat [lparen, nest 2 doc, rparen]
+      else doc
+
+
+-- vim: ts=4:sts=4:expandtab
Plugin/Haddock.hs view
@@ -7,23 +7,24 @@  import qualified Data.Map as M import qualified Data.ByteString.Char8 as P+import Data.ByteString.Char8 (ByteString,pack)  PLUGIN Haddock -type HaddockState = M.Map P.ByteString [P.ByteString]+type HaddockState = M.Map ByteString [ByteString]  instance Module HaddockModule HaddockState where     moduleCmds      _ = ["index"]     moduleHelp    _ _ = "index <ident>. Returns the Haskell modules in which <ident> is defined"     moduleDefState  _ = return M.empty-    moduleSerialize _ = Just $ Serial { deserialize = Just . readPacked-                                      , serialize   = const Nothing }-    process_ _ _ rest = do-       assocs <- readMS-       return . (:[]) $ maybe "bzzt" (concatWith ", " . (map P.unpack))-                                     (M.lookup (P.pack (stripParens rest)) assocs)+    moduleSerialize _ = Just (readOnly readPacked)+    fprocess_ _ _ k = readMS >>= \m -> box $ maybe+        (pack "bzzt")+        (P.intercalate (pack ", "))+        (M.lookup (stripPs k) m) --- | make \@index ($) work.-stripParens :: String -> String-stripParens = reverse . dropWhile (==')') . reverse . dropWhile (=='(')+        where+          -- make \@index ($) work.+          stripPs :: ByteString -> ByteString+          stripPs = fst . P.spanEnd (==')') . snd . P.span (=='(') 
Plugin/Help.hs view
@@ -11,9 +11,9 @@ instance Module HelpModule () where     moduleHelp _ _ = "help <command>. Ask for help for <command>. Try 'list' for all commands"     moduleCmds   _ = ["help"]-    process_ _ cmd rest = doHelp cmd rest+    process_ _ cmd rest = lift $ doHelp cmd rest -doHelp :: String -> [Char] -> ModuleLB ()+doHelp :: String -> [Char] -> LB [String] doHelp cmd [] = doHelp cmd "help"  --
Plugin/Hoogle.hs view
@@ -39,7 +39,7 @@ hoogleBinary = "./hoogle"  hoogleText :: FilePath-hoogleText = "./scripts/hoogle/src/hoogle.txt"+hoogleText = "State/hoogle.txt"  -- arbitrary cutoff point cutoff :: Int
+ Plugin/IRC.hs view
@@ -0,0 +1,136 @@+--+-- | The plugin-level IRC interface.+--+module Plugin.IRC (theModule) where++import Control.Concurrent( forkIO, newQSem, waitQSem, threadDelay, signalQSem,+                           newEmptyMVar, putMVar, takeMVar, MVar )+import Control.Exception+import IRCBase+import LMain( received )+import Message+import Network( connectTo, PortID(..) )+import Plugin+import System.IO (hGetLine, hPutStr, hPutStrLn, hSetBuffering, BufferMode(NoBuffering), stderr, hClose)+import qualified Data.ByteString.Char8 as P++PLUGIN IRC++instance Module IRCModule () where+    modulePrivs  _         = ["irc-connect"]+    moduleHelp _ _         = "irc-connect tag host portnum nickname userinfo.  connect to an irc server"+    process_ _ "irc-connect" rest =+        case (split " " rest) of+          tag:hostn:portn:nickn:uix -> do pn <- (PortNumber . fromInteger) `fmap` readM portn+                                          online tag hostn pn nickn (concatWith " " uix)+                                          return []+          _                         -> return ["Not enough parameters!"]++----------------------------------------------------------------------+-- Encoding and decoding of messages++-- | 'encodeMessage' takes a message and converts it to a function.+--   giving this function a string will attach the string to the message+--   and output a string containing IRC protocol commands ready for writing+--   on the outgoing stream socket.+encodeMessage :: IrcMessage -> String -> String+encodeMessage msg+  = encodePrefix (msgPrefix msg) . encodeCommand (msgCommand msg)+          . encodeParams (msgParams msg)+  where+    encodePrefix [] = id+    encodePrefix prefix = showChar ':' . showString prefix . showChar ' '++    encodeCommand cmd = showString cmd++    encodeParams [] = id+    encodeParams (p:ps) = showChar ' ' . showString p . encodeParams ps++-- | 'decodeMessage' Takes an input line from the IRC protocol stream+--   and decodes it into a message.  FIXME: this has too many parameters.+decodeMessage :: String -> String -> String -> IrcMessage+decodeMessage svr lbn line =+    let (prefix, rest1) = decodePrefix (,) line+        (cmd, rest2)    = decodeCmd (,) rest1+        params          = decodeParams rest2+    in IrcMessage { msgServer = svr, msgLBName = lbn, msgPrefix = prefix,+                    msgCommand = cmd, msgParams = params }+  where+    decodePrefix k (':':cs) = decodePrefix' k cs+      where decodePrefix' j ""       = j "" ""+            decodePrefix' j (' ':ds) = j "" ds+            decodePrefix' j (c:ds)   = decodePrefix' (j . (c:)) ds++    decodePrefix k cs = k "" cs++    decodeCmd k []       = k "" ""+    decodeCmd k (' ':cs) = k "" cs+    decodeCmd k (c:cs)   = decodeCmd (k . (c:)) cs++    decodeParams :: String -> [String]+    decodeParams xs = decodeParams' [] [] xs+      where+        decodeParams' param params []+          | null param = reverse params+          | otherwise  = reverse (reverse param : params)+        decodeParams' param params (' ' : cs)+          | null param = decodeParams' [] params cs+          | otherwise  = decodeParams' [] (reverse param : params) cs+        decodeParams' param params rest@(c@':' : cs)+          | null param = reverse (rest : params)+          | otherwise  = decodeParams' (c:param) params cs+        decodeParams' param params (c:cs) = decodeParams' (c:param) params cs++ircSignOn :: String -> Nick -> String -> LB ()+ircSignOn svr nickn ircname = do+    send $ user (nTag nickn) (nName nickn) svr ircname+    send $ setNick nickn++------------------------------------------------------------------------+--+-- Lambdabot is mostly synchronous.  We have a main loop, which reads+-- messages and forks threads to execute commands (which write responces).+-- OR+-- We have a main loop which reads offline commands, and synchronously+-- interprets them.++online :: String -> String -> PortID -> String -> String -> ModuleT () LB ()+online tag hostn portnum nickn ui = do+  sock <- io $ connectTo hostn portnum+  io $ hSetBuffering sock NoBuffering+  -- Implements flood control: RFC 2813, section 5.8+  sem1 <- io $ newQSem 0+  sem2 <- io $ newQSem 4 -- one extra token stays in the MVar+  sendmv <- io $ newEmptyMVar+  io $ forkIO $ sequence_ $ repeat $ do+    waitQSem sem1+    threadDelay 2000000+    signalQSem sem2+  io $ forkIO $ sequence_ $ repeat $ do+    waitQSem sem2+    putMVar sendmv ()+    signalQSem sem1+  catchError (addServer tag $ io . sendMsg tag sock sendmv)+             (\err -> io (hClose sock) >> throwError err)+  lift $ ircSignOn hostn (Nick tag nickn) ui+  lift $ liftLB forkIO $ catchError (readerLoop tag nickn sock)+                                   (\e -> do io $ hPutStrLn stderr $ "irc[" ++ tag ++ "] error: " ++ show e+                                             remServer tag)+  return ()++readerLoop :: String -> String -> Handle -> LB ()+readerLoop tag nickn sock = do+  line <- io $ hGetLine sock+  let line' = filter (\c -> c /= '\n' && c /= '\r') line+  if "PING " `isPrefixOf` line'+      then io $ hPutStr sock ("PONG " ++ drop 5 line' ++ "\r\n")+      else do forkLB $ received (decodeMessage tag nickn line')+              return ()+  readerLoop tag nickn sock++sendMsg :: String -> Handle -> MVar () -> IrcMessage -> IO ()+sendMsg tag sock mv msg =+    catchJust ioErrors (do takeMVar mv+                           P.hPut sock $ P.pack $ encodeMessage msg "\r\n")+                  (\err -> do hPutStrLn stderr $ "irc[" ++ tag ++ "] error: " ++ show err+                              hClose sock)
Plugin/Instances.hs view
@@ -31,8 +31,8 @@ instance Module InstancesModule () where     moduleCmds _ = map fst help     moduleHelp _ = fromJust . flip lookup help-    process_ _ "instances"           cls  = fetchInstances cls-    process_ _ "instances-importing" args = fetchInstancesImporting args+    process_ _ "instances"           cls  = lift $ fetchInstances cls+    process_ _ "instances-importing" args = lift $ fetchInstancesImporting args  -- | Lookup table for the help for this module help :: [(String, String)]@@ -75,12 +75,13 @@ -- | Split the input into a list of the instances, then run each instance  --   through the parser. Collect successes. getInstances :: String -> ClassName -> [Instance]-getInstances s cls | Nothing <- classDeclP-                      -- can't trust those dodgy folk in #haskell-                      = ["Not a class! Perhaps you need to import the " ++-                         " module that defines it? Try @help instances-importing."]-                   | otherwise = sort $ mapMaybe doParse (tail splut)-    where classDeclP   = matchRegex (mkRegex $ "class.*" ++ cls ++ ".*where") s+getInstances s cls+    | not classFound -- can't trust those dodgy folk in #haskell+    = ["Couldn't find class `"++cls++"'. Try @instances-importing"]++   | otherwise = sort $ mapMaybe doParse (tail splut)++    where classFound   = matches' (regex' $ "class.*" ++ cls ++ ".*where") s           splut        = split "instance" s -- splut being the past participle                                             -- of 'to split', obviously. :)           notOperator  = all (\c -> or@@ -107,7 +108,8 @@ -- | Main processing function for \@instances. Takes a class name and  --   return a list of lines to output (which will actually only be one). fetchInstances :: ClassName -> LB [String]-fetchInstances cls = ios (fetchInstances' cls stdMdls)+fetchInstances cls =  do+    ios (fetchInstances' cls stdMdls)  -- | Main processing function for \@instances-importing. Takes the args, which --   are words'd. The all but the last argument are taken to be the modules to@@ -122,8 +124,9 @@ --   the parser. fetchInstances' :: String -> [ModuleName] -> IO String fetchInstances' cls mdls = do-  (out, err, _) <- popen (ghci config) ["-fglasgow-exts"] $-                   Just (unlines [cxt, command])+  let s = unlines [cxt, command]+  (out, err, _) <- popen (ghci config) ["-ignore-dot-ghci","-fglasgow-exts"] $+                   Just s   let is = getInstances out cls   return $ if null is              then err
Plugin/Karma.hs view
@@ -4,19 +4,20 @@ module Plugin.Karma (theModule) where  import Plugin-import qualified Message (nick)+import qualified Message as Msg (nick, Nick, Message, showNick, readNick, lambdabotName, nName)+import qualified NickEq as E import qualified Data.Map as M import Text.Printf  PLUGIN Karma -type KarmaState = M.Map String Integer+type KarmaState = M.Map Msg.Nick Integer type Karma m a = ModuleT KarmaState m a  instance Module KarmaModule KarmaState where      moduleCmds _ = ["karma", "karma+", "karma-", "karma-all"]-    moduleHelp _ "karma"     = "karma <nick>. Return a person's karma value"+    moduleHelp _ "karma"     = "karma <polynick>. Return a person's karma value"     moduleHelp _ "karma+"    = "karma+ <nick>. Increment someone's karma"     moduleHelp _ "karma-"    = "karma- <nick>. Decrement someone's karma"     moduleHelp _ "karma-all" = "karma-all. List all karma"@@ -25,26 +26,48 @@     moduleSerialize _ = Just mapSerial      process      _ _ _ "karma-all" _ = listKarma+    process      _ msg _ "karma" rest = tellKarma msg sender nick'+        where sender = Msg.nick msg+              nick' = case words rest of+                        []       -> E.mononickToPolynick sender+                        (nick:_) -> E.readPolynick msg nick     process      _ msg _ cmd rest =         case words rest of-          []       -> tellKarma sender sender+          []       -> return [ "usage @karma(+|-) nick" ]           (nick:_) -> do+              let nick' = Msg.readNick msg nick               case cmd of-                 "karma"     -> tellKarma        sender nick-                 "karma+"    -> changeKarma 1    sender nick-                 "karma-"    -> changeKarma (-1) sender nick+                 "karma+"    -> changeKarma msg 1    sender nick'+                 "karma-"    -> changeKarma msg (-1) sender nick'                  _        -> error "KarmaModule: can't happen"-        where sender = Message.nick msg+        where sender = Msg.nick msg -------------------------------------------------------------------------+    -- ^nick++($| )+    contextual   _ msg _ text = do+        mapM_ (changeKarma msg (-1) sender) decs+        mapM_ (changeKarma msg   1  sender) incs+        return []+      where+        sender      = Msg.nick msg+        ws          = words text+        decs        = match "--"+        incs        = match "++"+        match m     = map (Msg.readNick msg) . filter okay . map (reverse . drop 2)+                    . filter (isPrefixOf m) . map reverse $ ws+        okay x      = not (elem x badNicks || any (`isPrefixOf` x) badPrefixes)+        -- Special cases.  Ignore the null nick.  C must also be ignored+        -- because C++ and C-- are languages.+        badNicks    = ["", "C", "c"]+        -- More special cases, to ignore Perl code.+        badPrefixes = ["$", "@", "%"] -getKarma :: String -> KarmaState -> Integer-getKarma nick karmaFM = fromMaybe 0 (M.lookup nick karmaFM)+------------------------------------------------------------------------ -tellKarma :: String -> String -> Karma LB [String]-tellKarma sender nick = do-    karma <- getKarma nick `fmap` readMS-    return [concat [if sender == nick then "You have" else nick ++ " has"+tellKarma :: Msg.Message m => m -> Msg.Nick -> E.Polynick -> Karma LB [String]+tellKarma msg sender nick = do+    lookup' <- lift E.lookupMononickMap+    karma <- (sum . map snd . lookup' nick) `fmap` readMS+    return [concat [if E.mononickToPolynick sender == nick then "You have" else E.showPolynick msg nick ++ " has"                    ," a karma of "                    ,show karma]] @@ -52,15 +75,16 @@ listKarma = do     ks <- M.toList `fmap` readMS     let ks' = sortBy (\(_,e) (_,e') -> e' `compare` e) ks-    return $ (:[]) . unlines $ map (\(k,e) -> printf " %-20s %4d" k e :: String) ks'+    return $ (:[]) . unlines $ map (\(k,e) -> printf " %-20s %4d" (show k) e :: String) ks' -changeKarma :: Integer -> String -> String -> Karma LB [String]-changeKarma km sender nick+changeKarma :: Msg.Message m => m -> Integer -> Msg.Nick -> Msg.Nick -> Karma LB [String]+changeKarma msg km sender nick+  | map toLower (Msg.nName nick) == "java" && km == 1 = changeKarma msg (-km) (Msg.lambdabotName msg) sender   | sender == nick = return ["You can't change your own karma, silly."]   | otherwise      = withMS $ \fm write -> do       let fm' = M.insertWith (+) nick km fm-      let karma = getKarma nick fm'+      let karma = fromMaybe 0 $ M.lookup nick fm'       write fm'-      return [fmt nick km (show karma)]+      return [fmt (Msg.showNick msg nick) km (show karma)]           where fmt n v k | v < 0     = n ++ "'s karma lowered to " ++ k ++ "."                           | otherwise = n ++ "'s karma raised to " ++ k ++ "."
− Plugin/LShell.hs
@@ -1,49 +0,0 @@------ Wed Dec 21 15:29:52 EST 2005------ Copyright (c) 2005 Don Stewart - http://www.cse.unsw.edu.au/~dons--- GPL version 2 or later (see http://www.gnu.org/copyleft/gpl.html)---------- A binding to Robert Dockins' Lambda Shell------          darcs get http://www.eecs.tufts.edu/~rdocki01/lambda/----module Plugin.LShell where--import Plugin--PLUGIN LShell--instance Module LShellModule () where-    moduleCmds   _ = ["lam"]-    moduleHelp _ _ = "lam <expr>\n\ -                     \Evaluate terms of the pure, untyped lambda calculus" <$>-                     "darcs get http://www.eecs.tufts.edu/~rdocki01/lambda"--    -- rule out attempts to do IO-    process_ _ _ s | Just _ <- cmd  `matchRegex` s = end-      where end  = return ["Invalid command"]-            cmd  = mkRegex "^ *:"--    process_ _ _ s = io (lambdashell s)----------------------------------------------------------------------------lambdashell :: String -> IO [String]-lambdashell src = do-    (out,_,_) <- popen "./lambda" [] $ Just $ -                    ":load State/prelude.lam" <$> src <$> ":quit"-    let o = let s = init . drop 11 . lines $ out -            in if null s then "Terminated" else dropNL . doclean . last $ s-    return [o]------- Clean up djinn output----doclean :: String -> String-doclean s | Just (a,_,b,_) <- prompt `matchRegexAll` s = a ++ doclean b-          | otherwise      = s-    where-        prompt = mkRegex ">[^\n]*\n"
− Plugin/Lambda.hs
@@ -1,139 +0,0 @@------ | Lambda calculus interpreter----module Plugin.Lambda (theModule) where--import Plugin-import Plugin.Lambda.LMEngine (evaluate, define, resume, Environment)--import qualified Data.Map as M-import Lib.Util (mapMaybeMap)--import Data.Dynamic                     (Dynamic)--import qualified Data.ByteString.Char8 as P--PLUGIN Eval--initFuel, maxFuel :: Int-initFuel = 1000-maxFuel  = 500000 -- ~ 200M mem usage for "sum $ enumFrom 1"--maxPrivate :: Int-maxPrivate = 10--initEnv :: Environment-initEnv = M.empty--initDefns :: M.Map String String-initDefns = M.empty--outOfFuelMsg :: [Char]-outOfFuelMsg = "out of fuel - use @resume to continue"--type EvalGlobal = (Int, Environment, M.Map String String)-type EvalState = GlobalPrivate EvalGlobal Dynamic--instance Module EvalModule EvalState where-    moduleDefState _ = return $ mkGlobalPrivate (maxPrivate)-      (initFuel, initEnv, initDefns)--    moduleSerialize _ = Just $ Serial {-              serialize = Just . (\(fuel,_,defns) ->-                P.pack . unlines $ show fuel: map show (M.toList defns)) . global,-              deserialize = fmap (mkGlobalPrivate maxPrivate) .  loadDefinitions . P.unpack-           }--    moduleHelp _ s = case s of-        "lambda"         -> "lambda <expr>. Evaluate the lambda calculus expression, <expr>"-        "define"         -> "define <name> <expr>. Define name to be expr"-        "get-definition" -> "get-definition <name>. Get the expression defining name"-        "definitions"    -> "definitions <prefix>. Get the definitions starting with prefix"-        "del-definition" -> "del-definition <name>. Delete name"-        "set-fuel"       -> "set-fuel <ticks>. How many ticks before @lambda runs out of fuel"-        "resume"         -> "resume. Continue an expression that has run out of fuel"--    moduleCmds   _ = ["lambda","define","get-definition","definitions","resume"]-    modulePrivs  _ = ["set-fuel","del-definition"]--    process      _ _ target cmd rest = do-       let writeRes = writePS target-       (fuel, env, defns) <- readGS-       res <- readPS target-       case cmd of-        "lambda" -> do -             let r_or_s = evaluate rest env fuel-             case r_or_s of-                Right s -> writeRes Nothing   >> return [s]-                Left nr -> writeRes (Just nr) >> return [outOfFuelMsg]--        "define" -> -            let rslt = define defn-                (nm,defn) = break (' '==) rest -            in case rslt of-                    Left s  -> return [s]-                    Right v -> do-                      withGS $ \(fuel', env', defns') writer -> do-                          writer (fuel', M.insert nm v env', -                                         M.insert nm defn defns')-                      return [nm ++ " defined"]--        "definitions" -> -            let nm = M.keys defns -            in return . (:[]) $ if null rest -                then unlines $ map show $-                                       groupBy (\(x:_) (y:_) -> x == y) $ nm-                else show [x | x <- sort nm, rest `isPrefixOf` x]--        "get-definition" -> -            let defn = M.lookup rest defns -                out = maybe (rest++" not defined") ((rest++" =")++) defn-            in return [out]--        "set-fuel" -> case readM rest of-            Nothing -> return ["Not a number"]-            Just x  -> if x > 0 && x <= maxFuel -                        then do writeGS (x,env,defns)-                                return ["Fuel set to "++show x]-                        else return ["Can't set fuel above "++show maxFuel]--        "del-definition" -> case words rest of-            (d:_) -> do-                withGS $ \(fuel',env',defns') writer -> -                    writer (fuel', M.delete d env', M.delete d defns')-                return [d++" removed"]-            _ -> return []--        "resume" -> case res of-            Nothing -> return []-            Just r -> case resume r fuel of-                    Left nr -> do-                        writeRes $ Just nr-                        return [outOfFuelMsg]-                    Right s -> do-                        writeRes Nothing-                        return [s]------- this is so ugly (at least it's only init)------ This stuff is slow----loadDefinitions :: String -> Maybe EvalGlobal-loadDefinitions s = do-  -- grab fuel val from definitions.-  fuel':rest <- return $ lines s-  fuel <- readM fuel'-  -- rest is a list of paris of ids and rhs defins-  let rests = mapMaybe readM rest-  -- parse the lot. :/-  let dMap = M.fromList $! rests-      eMap = mapMaybeMap ((const Nothing `either` \x -> Just $! x) . define) $ dMap--      keys = M.keys eMap-  -  fuel `seq` eMap `seq` dMap `seq` return-                (fuel,-                 eMap,-                 M.filterWithKey (\k _ -> k `elem` keys) dMap) -
− Plugin/Lambda/ArithTerm.hs
@@ -1,43 +0,0 @@--module Plugin.Lambda.ArithTerm where--import Plugin.Lambda.LangPack--import Data.Dynamic-import Control.Monad.Error--data ArithTerm term-   = Num !Integer-   | Neg term-   | Add term term-   | Sub term term-   | Mul term term-   | Div term term--prjI :: (MonadError String m) => m Dynamic -> m Integer-prjI = prj'--phiArith :: (MonadError String m) => ArithTerm (m Dynamic) -> m Dynamic-phiArith (Num n) = return (inj n)-phiArith (Neg n) = do n' <- prjI n; return $ inj (-n')-phiArith (Add l r) = do l' <- prjI l-                        r' <- prjI r-                        return $ inj (l' + r')-phiArith (Sub l r) = do l' <- prjI l-                        r' <- prjI r-                        return $ inj (l' - r')-phiArith (Mul l r) = do l' <- prjI l-                        r' <- prjI r-                        return $ inj (l' * r')-phiArith (Div l r) = do l' <- prjI l-                        r' <- prjI r-                        if r' == 0 then throwError "divide by zero"-                                   else return $ inj (l' `div` r')--instance Functor ArithTerm where-    fmap _ (Num n) = Num n-    fmap f (Neg n) = Neg (f n)-    fmap f (Add l r) = Add (f l) (f r)-    fmap f (Sub l r) = Sub (f l) (f r)-    fmap f (Mul l r) = Mul (f l) (f r)-    fmap f (Div l r) = Div (f l) (f r)
− Plugin/Lambda/COPYING
@@ -1,20 +0,0 @@-Copyright (c) 2003 Derek Elkins
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject
-to the following conditions:
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
-KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
-WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
− Plugin/Lambda/LMEngine.hs
@@ -1,192 +0,0 @@-{-# OPTIONS -fallow-overlapping-instances #-}--- until we fix it properly --module Plugin.Lambda.LMEngine (-     evaluate,-     define,-     Environment,-     resume-  ) where--import Plugin.Lambda.LangPack-import Plugin.Lambda.ArithTerm-import Plugin.Lambda.LambdaTerm-import Plugin.Lambda.RelTerm-import Plugin.Lambda.ListTerm-import Plugin.Lambda.LMParser--import Data.Map (Map)-import qualified Data.Map as Map hiding (Map)--import Data.Maybe           (fromJust)-import Data.Dynamic-import Control.Monad.State-import Control.Monad.Reader-import Control.Monad.Error-import Control.Monad.Cont-import Control.Monad.Identity--import Text.ParserCombinators.Parsec.Error (ParseError)---- temporarily--- import Maybe--- import Debug.Trace------------------------------------------------------------------------------ TODO: replace showTerm--evaluate :: String -> Environment -> Int -> Either Dynamic String-evaluate s env fuel = eval env fuel $ parseTerm s--define :: String -> Either String (EvalMonad Value)-define = either (Left . show) (Right . fold phi) . parseTerm--type Environment = Map String (EvalMonad Value)-type Value = Dynamic-type Result = Either Dynamic (Either String String)--newtype EvalMonad a = EM { runEM :: (StateT (IState EvalMonad)-                                    (ReaderT Environment-                                    (ErrorT String-                                    (Cont Result)))) a }-                    deriving Typeable--phi :: Term (EvalMonad Value) -> EvalMonad Value-phi (ArithT x) = phiArith x-phi (LambdaT x) = phiLambda x-phi (RelT x) = phiRel x-phi (ListT x) = phiList x--run :: EvalMonad Value -> Environment -> Int -> Result-run m env fuel = flip runCont Right $-                 runErrorT $-                 runReaderT (evalStateT (runEM (m >>= showDyn)) (0,Map.empty,fuel)) env--eval :: Environment -> Int -> Either ParseError (Fix Term) -> Either Dynamic String-eval env fuel = either (Right . show) doit-    where doit x = -- trace (x `seq` showTerm x) $-                    res_or_str $ run (do env' <- startup-                                         local (const $ Map.fromList env')-                                               (fold phi x))-                                     Map.empty fuel-          startup = Map.foldWithKey mkThunk (return []) env-          mkThunk k c cs = do env' <- cs-                              rr <- thunkify c-                              return ((k,rr):env')---res_or_str :: Either a (Either b b) -> Either a b-res_or_str = either Left (either Right Right)----- TODO: get rid of fromJust-resume :: Dynamic -> Int -> Either Dynamic String-resume r i = res_or_str $ fromJust (fromDynamic r) i--showDyn :: Dynamic -> EvalMonad String-showDyn d = case (fromDynamic d :: Maybe Integer) of {-                Just i -> return $ show i;-                _      ->-            case (fromDynamic d :: Maybe Bool) of {-                Just b -> return $ show b;-                _      ->-            case (fromDynamic d :: Maybe Char) of {-                Just c -> return [c];-                _      ->-            case (fromDynamic d :: Maybe ()) of {-                Just _ -> return "[]";-                _      ->-            case (fromDynamic d :: Maybe (EvalMonad Dynamic, EvalMonad Dynamic)) of {-                Just l -> (do b <- foldList (\x y -> do-                                                b <- isCharacter x-                                                liftM (b&&) y)-                                            (return True) (return d)-                              if b then showListDyn "" l-                                   else do x <- showListDyn ", " l-                                           return $ "["++x++"]");-                _      -> return $ show d;-            }}}}}--showListDyn :: String -> (EvalMonad Dynamic, EvalMonad Dynamic) -> EvalMonad String-showListDyn sep (hd,tl) = do-    hd' <- hd-    tl' <- tl-    case (fromDynamic tl' :: Maybe ()) of {-       Just _  -> showDyn hd';-       Nothing ->-    case (fromDynamic tl' :: Maybe (EvalMonad Dynamic,EvalMonad Dynamic)) of {-       Just p  -> (do hs <- showDyn hd';ts <- showListDyn sep p;return $ hs++sep++ts);-       Nothing -> throwError "type error"-    }}--{--showTerm :: Fix Term -> [Char]-showTerm (In f) = showIn f-    where showIn (ArithT t) = showArithTerm t-          showIn (LambdaT t) = showLambdaTerm t-          showIn (RelT t) = showRelTerm t-          showIn (ListT t) = showListTerm t-          showArithTerm (Num n) = "(Num "++show n++")"-          showArithTerm (Neg n) = "(Neg "++showTerm n++")"-          showArithTerm (Add l r) = "(Add "++showTerm l++" "++showTerm r++")"-          showArithTerm (Sub l r) = "(Sub "++showTerm l++" "++showTerm r++")"-          showArithTerm (Mul l r) = "(Mul "++showTerm l++" "++showTerm r++")"-          showArithTerm (Div l r) = "(Div "++showTerm l++" "++showTerm r++")"-          showLambdaTerm (Var v) = "(Var "++v++")"-          showLambdaTerm (Lam v b) = "(Lam "++v++" "++showTerm b++")"-          showLambdaTerm (App f' x) = "(App "++showTerm f'++" "++showTerm x++")"-          showRelTerm (Not x) = "(Not "++showTerm x++")"-          showRelTerm (Or l r) = "(Or "++showTerm l++" "++showTerm r++")"-          showRelTerm (And l r) = "(And "++showTerm l++" "++showTerm r++")"-          showRelTerm (Boolean b) = "(Boolean "++show b++")"-          showRelTerm (IfE c t e) = "(If "++showTerm c++" "++showTerm t++" "++showTerm e++")"-          showRelTerm (Equal l r) = "(Equal "++showTerm l++" "++showTerm r++")"-          showRelTerm (NotEqual l r) = "(NotEqual "++showTerm l++" "++showTerm r++")"-          showRelTerm (LessThan l r) = "(LessThan "++showTerm l++" "++showTerm r++")"-          showRelTerm (GreaterThan l r) = "(GreaterThan "++showTerm l++" "++showTerm r++")"-          showRelTerm (LessThanOrEqual l r) = "(LessThanOrEqual "++showTerm l++" "++showTerm r++")"-          showRelTerm (GreaterThanOrEqual l r) = "(GreaterThanOrEqual "++showTerm l++" "++showTerm r++")"-          showListTerm Nil = "Nil"-          showListTerm (Character c) = "(Character '"++c:"')"-          showListTerm (Head l) = "(Head "++showTerm l++")"-          showListTerm (Tail l) = "(Tail "++showTerm l++")"-          showListTerm (Null l) = "(Null "++showTerm l++")"-          showListTerm (Cons l r) = "(Cons "++showTerm l++" "++showTerm r++")"-          showListTerm (Append l r) = "(Append "++showTerm l++" "++showTerm r++")"--}--instance Pause EvalMonad Result where-    pause = EM . lift . lift . lift . Cont---- TODO:--- I need to find a better way to break the circular dependency between--- Environment and EvalMonad--- Comment out what isn't true, uncomment what is--instance Monad EvalMonad where-    return = EM . return-    (EM m) >>= f = EM $ m >>= (runEM . f)---- TODO: make an appropriate instance-instance MonadCont EvalMonad where-       callCC = error "EvalModule/LMEngine: no default instance for callCC"--instance MonadError String EvalMonad where-    catchError (EM m) f = EM $ catchError m (runEM . f)-    throwError = EM . throwError--instance MonadState (IState EvalMonad) EvalMonad where-    put = EM . put-    get = EM get--instance MonadReader Environment EvalMonad where-    local f (EM m) = EM $ local f m-    ask = EM ask--{- this probably won't work without editting-instance MonadWriter EvalMonad where-    pass = EM . pass-    listen = EM . listen-    tell = EM . tell--}
− Plugin/Lambda/LMParser.hs
@@ -1,190 +0,0 @@------- screw modularity (at least temporarily)----module Plugin.Lambda.LMParser (parseTerm,Term(..)) where--import Plugin.Lambda.LangPack-import Plugin.Lambda.ArithTerm (ArithTerm(..))-import Plugin.Lambda.LambdaTerm (LambdaTerm(..))-import Plugin.Lambda.RelTerm (RelTerm(..))-import Plugin.Lambda.ListTerm (ListTerm(..))--import Text.ParserCombinators.Parsec-import Text.ParserCombinators.Parsec.Expr-import Text.ParserCombinators.Parsec.Language (emptyDef, reservedNames)-import qualified Text.ParserCombinators.Parsec.Token as P hiding (reservedNames)--tp :: P.TokenParser st-tp = P.makeTokenParser -        (emptyDef { reservedNames = -                ["if","then","else","True","False","head","tail","null"] })-{-# INLINE tp #-}---- integer :: CharParser st Integer--- integer         = P.integer tp--natural :: CharParser st Integer-natural         = P.natural tp--boolean :: GenParser Char st Bool-boolean         = (reserved "True" >> return True) -              <|> (reserved "False" >> return False)--reserved :: String -> CharParser st ()-reserved        = P.reserved tp- -symbol :: String -> CharParser st String-symbol          = P.symbol tp--parens, brackets :: CharParser st a -> CharParser st a-parens          = P.parens tp-brackets        = P.brackets tp--identifier, dot, comma :: CharParser st String-identifier      = P.identifier tp-dot             = P.dot tp-comma           = P.comma tp--charLiteral :: CharParser st Char-charLiteral     = P.charLiteral tp--stringLiteral :: CharParser st String-stringLiteral   = P.stringLiteral tp--identStart, identLetter :: CharParser st Char-identStart      = P.identStart emptyDef-identLetter     = P.identLetter emptyDef--class Up f x where-    up :: f x -> x--data Term x -  = ArithT (ArithTerm x) -  | LambdaT (LambdaTerm x) -  | RelT (RelTerm x)-  | ListT (ListTerm x)--type Term' = Fix Term--instance Functor Term where-    fmap f (ArithT x) = ArithT (fmap f x)-    fmap f (LambdaT x) = LambdaT (fmap f x)-    fmap f (RelT x) = RelT (fmap f x)-    fmap f (ListT x) = ListT (fmap f x)--instance Up ArithTerm Term' where-    up = In . ArithT--instance Up LambdaTerm Term' where-    up = In . LambdaT--instance Up RelTerm Term' where-    up = In . RelT--instance Up ListTerm Term' where-    up = In . ListT---- up' :: (Up f x) => Parser (f x) -> Parser x--- up' p = p >>= return . up--up2 :: (Up f x) => (t -> t1 -> f x) -> t -> t1 -> x-up2 f = (\x y -> up $ f x y)--parseTerm :: [Char] -> Either ParseError Term'-parseTerm = parse (do spaces; r <- parser';eof; return r) ""--application :: GenParser Char () Term'-application = do v <- (var <|> listOp)-                 es <- many (var <|> listOp <|> literal <|> parens parser')-                 case es of-                    [] -> return v-                    es'-> return $ foldl1 (up2 App) (v:es')--parser' :: GenParser Char () Term'-parser' = do e <- expr-             es <- many expr'-             case es of-                [] -> return e-                es'-> return $ foldl1 (up2 App) (e:es')--var :: GenParser Char st Term'-var = (identifier >>= return . up . Var) <?> "var"---- var without stripping trailing spaces-var' :: GenParser Char st Term'-var' = (do c <- identStart; cs <- many identLetter; return $ up $ Var (c:cs)) <?> "var"--num :: GenParser Char st Term'-num = (natural >>= return . up . Num) <?> "num"--bool :: GenParser Char st Term'-bool = (boolean >>= return . up . Boolean) <?> "bool"--character :: GenParser Char st Term'-character = (charLiteral >>= return . up . Character) <?> "character"--stringL :: GenParser Char st Term'-stringL = (stringLiteral >>= return . foldr (up2 Cons . up . Character) (up Nil)) <?> "string"--listOp :: GenParser Char st Term'-listOp = do o <- (reserved "head" >> return Head) <|>-                 (reserved "tail" >> return Tail) <|>-                 (reserved "null" >> return Null)-            return $ up2 Lam "x" (up $ o $ up $ Var "x")--list :: GenParser Char () Term'-list = do es <- brackets (parser' `sepBy` comma)-          return (foldr (up2 Cons) (up Nil) es) <?> "list"--literal :: GenParser Char () Term'-literal = bool <|> num <|> character <|> list <|> stringL--term :: GenParser Char () Term' -> GenParser Char () Term'-term x = x <|> literal <|> ifEx <|> listOp <|>-        abstraction <|> parens parser' <?> "simple term"--expr :: GenParser Char () Term'-expr = buildExpressionParser table (term application)-{-# INLINE expr #-}--expr' :: GenParser Char () Term'-expr' = buildExpressionParser table (term var)--table :: OperatorTable Char () Term'-table = [[Infix (op "." (\f g -> Lam "#x#" $ up2 App f $ up2 App g (up $ Var "#x#"))) AssocRight,-          Infix (do v <- between (char '`') (symbol "`") var'; return $ up2 App . up2 App v) AssocLeft],-         [Infix (op "*" Mul) AssocLeft, Infix (try $ do char '/'; notFollowedBy (char '='); spaces; return $ up2 Div) AssocLeft],-         [Infix (op "-" Sub) AssocLeft, Infix (try $ do char '+'; notFollowedBy (char '+'); spaces; return $ up2 Add) AssocLeft],-         [Infix (op ":" Cons) AssocRight, Infix (op "++" Append) AssocRight],-         [Infix (op "<=" LessThanOrEqual) AssocNone, Infix (op ">=" GreaterThanOrEqual) AssocNone,-          Infix (op "<" LessThan) AssocNone, Infix (op ">" GreaterThan) AssocNone,-          Infix (op "==" Equal) AssocNone, Infix (op "/=" NotEqual) AssocNone],-         [Infix (op "&&" And) AssocRight], -         [Infix (op "||" Or) AssocRight],-         [Infix (op "$" App) AssocRight]]------- This gets hammered----op :: (Up f trm) => String -> (trm -> trm -> f trm) -> Parser (trm -> trm -> trm)-op s o = try $ do symbol s; return (up2 o)-{-# INLINE op #-}--abstraction :: GenParser Char () Term'-abstraction = do symbol "\\"-                 vs <- many1 identifier-                 (dot <|> symbol "->") -- yay!-                 b <- parser'-                 return $ foldr (up2 Lam) b vs-              <?> "abstraction"--ifEx :: GenParser Char () Term'-ifEx = do reserved "if"-          c <- parser'-          reserved "then"-          t <- parser'-          reserved "else"-          e <- parser'-          return $ up $ IfE c t e-       <?> "if"
− Plugin/Lambda/LambdaTerm.hs
@@ -1,97 +0,0 @@--module Plugin.Lambda.LambdaTerm where--import Plugin.Lambda.LangPack--import Data.Map (Map)-import qualified Data.Map as Map hiding (Map)--import Control.Monad.Error-import Control.Monad.State-import Control.Monad.Reader-import Control.Monad.Cont--import Data.Dynamic--type Fun m = (m Dynamic -> m Dynamic)--data LambdaTerm term-   = Lam !String term-   | App term term-   | Var !String--type IState m = (Int,Map Int (m Dynamic),Int) -- record instead of tuple would be more robust-type Ref = Int--prjF :: (Typeable (m Dynamic), MonadError String m) => m Dynamic -> m (Fun m)-prjF = prj'--phiLambda :: (MonadError String m,-              MonadState (IState m) m,-              Typeable (m Dynamic),-              Pause m (Either Dynamic b),-              Typeable b,-              MonadReader (Map String (m Dynamic)) m) =>-              LambdaTerm (m Dynamic) -> m Dynamic-phiLambda (Var v) = do step; lookupEnv v-{--phiLambda (Lam v b) = do env <- ask-                         return $ inj (\v' -> do loc <- newRef undefined-                                                 let thunk =-                                                       do r <- v'-                                                          writeRef loc-                                                                   (return r)-                                                          return r-                                                 writeRef loc thunk-                                                 let env' = addToFM env v (readRef loc)-                                                 inEnv env' b)--}-phiLambda (Lam v b) = do env <- ask-                         return $ inj (\v' -> do rr <- thunkify v'-                                                 inEnv (Map.insert v rr env) b)-phiLambda (App f x) = do f' <- prjF f; env <- ask; f' (inEnv env x)--thunkify :: (MonadState (IState m) m) => m Dynamic -> m (m Dynamic)-thunkify c = do-    loc <- newRef (error "empty reference")-    let thunk = do r <- c-                   writeRef loc (return r)-                   return r-    writeRef loc thunk-    return (readRef loc)--lookupEnv :: (MonadReader (Map String (m Dynamic)) m,-              Typeable (m Dynamic),-              MonadError String m) => String -> m Dynamic-lookupEnv k = do env <- ask-                 let v = Map.lookup k env -                 maybe (throwError ("unbound variable: "++k)) id v--inEnv :: (MonadReader (Map String (m Dynamic)) m) =>-      Map String (m Dynamic) -> m Dynamic -> m Dynamic-inEnv env b = local (const env) b--step :: (MonadState (IState m) m, MonadError String m,-        Typeable b,-        Pause m (Either Dynamic b)) => m ()-step = do (c,hp,fuel) <- get-          if fuel == 0 then do refuel <- pause $ Left . inj-                               put (c,hp,refuel)-                       else put (c,hp,fuel-1)--newRef :: (MonadState (IState m) m) => m Dynamic -> m Ref-newRef v = do (c,hp,fuel) <- get-              put (c+1,Map.insert c v hp,fuel)-              return c--readRef :: (MonadState (IState m) m) => Ref -> m Dynamic-readRef loc = do (_,hp,_) <- get; let {Just x = Map.lookup loc hp}; x--writeRef :: (MonadState (IState m) m) => Ref -> m Dynamic -> m ()-writeRef loc v = do (c,hp,fuel) <- get-                    put (c,Map.insert loc v hp,fuel)--instance Functor LambdaTerm where-    fmap _ (Var v) = Var v-    fmap f (Lam v b) = Lam v (f b)-    fmap f (App g x) = App (f g) (f x)
− Plugin/Lambda/LangPack.hs
@@ -1,80 +0,0 @@------ | Based on (ripping) ideas from ---          /Language Prototyping using Modular Monadic Semantics/----module Plugin.Lambda.LangPack where--import Control.Monad.Error--import Data.Dynamic--newtype Fix f = In { out :: f (Fix f) }--fold :: (Functor f) => (f a -> a) -> Fix f -> a-fold phi = phi . fmap (fold phi) . out--(@@) :: (Monad m) => (b -> m c) -> (a -> m b) -> a -> m c-f @@ g = \x -> g x >>= f--mFold :: (MFunctor f m) => (f a -> m a) -> Fix f -> m a-mFold mPhi = mPhi @@ mMap (mFold mPhi) @@ (return . out)--class (Functor f, Monad m) => MFunctor f m where-    mMap :: (a -> m b) -> f a -> m (f b)--class Pause m r | m -> r where-    pause :: ((a -> r) -> r) -> m a------------------------------------------------------------------------------------{- bugger it, I'll just use Dynamics--- Functional dependencies may help--- Extensible sums (as seen in many places e.g.---            "Monad Transformers and Modular Interpreters")-class Subtype sub sup where-    inj :: sub -> sup-    prj :: sup -> Maybe sub--instance Subtype a (Either a b) where-    inj = Left-    prj = either Just (const Nothing)--instance Subtype a b => Subtype a (Either c b) where-    inj = Right . inj-    prj = either (const Nothing) prj--}---- prj' :: (Subtype sub sup, MonadError String m) => m sup -> m sub-prj' :: (MonadError String m, Typeable a) => m Dynamic -> m a-prj' x = do x' <- x-            case {-trace (show x')-} prj x' of-               Nothing -> throwError "type error"-               Just xr -> return xr--inj :: (Typeable a) => a -> Dynamic-inj = toDyn--prj :: (Typeable a) => Dynamic -> Maybe a-prj = fromDynamic--newtype SumF f g x = S { unS :: Either (f x) (g x) }--instance (Functor f, Functor g) => Functor (SumF f g) where-    fmap f = S . either (Left . fmap f) (Right . fmap f) . unS------------------------------------------------------------------------------------- More Labragayo, but with a some of my own concoctions-{--class HasParser t where-    parser :: Parser t--class HasParserF f where-    parserF :: (f x -> x) -> Parser x -> Parser (f x)--instance (HasParserF f, HasParserF g) => HasParserF (SumF f g) where-    parserF up parser = fmap S $ try (fmap Left (parserF (up . S . Left) parser)) <|>-                                      fmap Right (parserF (up . S . Right) parser)--instance (HasParserF f) => HasParser (Fix f) where-    parser = fmap In (parserF In parser)--}    
− Plugin/Lambda/ListTerm.hs
@@ -1,77 +0,0 @@--module Plugin.Lambda.ListTerm where--import Plugin.Lambda.LangPack-import Plugin.Lambda.LambdaTerm--import Data.Map (Map)--import Data.Dynamic-import Control.Monad.Error-import Control.Monad.Reader--data ListTerm term-   = Nil-   | Character !Char-   | Head term-   | Tail term-   | Null term-   | Cons term term-   | Append term term--prjL :: (MonadError String m, -         Typeable (m Dynamic)) => m Dynamic -> m (m Dynamic, m Dynamic)-prjL = prj'--prjN :: (MonadError String m) => m Dynamic -> m ()-prjN = prj'--prjC :: (MonadError String m) => m Dynamic -> m Char-prjC = prj'--phiList :: (MonadError String m,-            MonadReader (Map String (m Dynamic)) m,-            Typeable (m Dynamic)) => ListTerm (m Dynamic) -> m Dynamic-phiList Nil = return $ inj ()-phiList (Character c) = return $ inj c--- TODO: double evaluation of l-phiList (Head l) = do b <- isNull l; if b then throwError "head of empty list"-                                          else prjL l >>= fst-phiList (Tail l) = do b <- isNull l; if b then throwError "tail of empty list"-                                          else prjL l >>= snd-phiList (Null l) = do b <- isNull l; if b then return (inj True)-                                          else do prjL l; return (inj False)--- TODO: this is call-by-name, not call-by-need-phiList (Cons l r) = do env <- ask; return $ inj (inEnv env l,inEnv env r)-phiList (Append l r) = do env <- ask-                          foldList (\x y -> return $ inj (x,y)) -                                   (inEnv env r) -                                   (inEnv env l)--isNull :: (Monad m) => m Dynamic -> m Bool-isNull m = do d <- m; case (fromDynamic d :: Maybe ()) of-                         Just _  -> return True-                         Nothing -> return False--isCharacter :: (Monad m) => m Dynamic -> m Bool-isCharacter m = do d <- m; case (fromDynamic d :: Maybe Char) of-                              Just _  -> return True-                              Nothing -> return False--foldList :: (MonadError String m, Typeable (m Dynamic)) => -            (m Dynamic -> m a -> m a) -> -                    m a -> m Dynamic  -> m a-foldList c n l = do-    b <- isNull l-    if b then n-         else do (f,r) <- prjL l-                 c f $ foldList c n r--instance Functor ListTerm where-    fmap _ Nil = Nil-    fmap _ (Character c) = Character c-    fmap f (Head l) = Head (f l)-    fmap f (Tail l) = Tail (f l)-    fmap f (Null l) = Null (f l)-    fmap f (Cons l r) = Cons (f l) (f r)-    fmap f (Append l r) = Append (f l) (f r)
− Plugin/Lambda/RelTerm.hs
@@ -1,68 +0,0 @@--module Plugin.Lambda.RelTerm where--import Plugin.Lambda.LangPack-import Plugin.Lambda.ArithTerm (prjI)-import Plugin.Lambda.ListTerm (prjC,prjL,prjN)--import Data.Dynamic-import Control.Monad.Error--data RelTerm term-   = Boolean !Bool-   | And term term-   | Or term term-   | Not term-   | Equal term term-   | NotEqual term term-   | LessThan term term-   | GreaterThan term term-   | LessThanOrEqual term term-   | GreaterThanOrEqual term term-   | IfE term term term--prjB :: (MonadError String m) => m Dynamic -> m Bool-prjB = prj'--doOp :: (MonadError String m, Typeable (m Dynamic)) => (forall a.Ord a => a -> a -> Bool) -> -            m Dynamic -> m Dynamic -> m Dynamic-doOp op l r -    = catchError (do l' <- prjI l; r' <- prjI r; return $ inj (l' `op` r'))-       (\_ -> catchError (do l' <- prjC l; r' <- prjC r; return $ inj (l' `op` r'))-        (\_ -> catchError (do l' <- prjB l; r' <- prjB r; return $ inj (l' `op` r'))-         (\_ -> catchError (do l' <- prjN l; r' <- prjN r; return $ inj (l' `op` r'))-          (\_ -> catchError (do _ <- prjL l; _ <- prjN r; return $ inj False)-           (\_ -> catchError (do _ <- prjN l; _ <- prjL r; return $ inj False)-            (\_ -> catchError (do (a,b) <- prjL l-                                  (x,y) <- prjL r-                                  s <- prjB $ doOp op a x-                                  t <- prjB $ doOp op b y-                                  return $ inj (s && t))-                   throwError))))))--phiRel :: (MonadError String m, Typeable (m Dynamic)) => RelTerm (m Dynamic) -> m Dynamic-phiRel (Boolean b) = return (inj b)-phiRel (IfE c t e) = do b <- prjB c-                        if b then t else e-phiRel (Equal l r) = doOp (==) l r-phiRel (NotEqual l r) = doOp (/=) l r-phiRel (LessThan l r) = doOp (<) l r-phiRel (GreaterThan l r) = doOp (>) l r-phiRel (LessThanOrEqual l r) = doOp (<=) l r-phiRel (GreaterThanOrEqual l r) = doOp (>=) l r-phiRel (And l r) = do l' <- prjB l; if not l' then return $ inj False else do r' <- prjB r; return $ inj (l' && r')-phiRel (Or l r) = do l' <- prjB l; if l' then return $ inj True else do r' <- prjB r; return $ inj (l' || r')-phiRel (Not x) = do x' <- prjB x; return $ inj (not x')--instance Functor RelTerm where-    fmap f (Not x) = Not (f x)-    fmap f (Or l r) = Or (f l) (f r)-    fmap f (And l r) = And (f l) (f r)-    fmap _ (Boolean b) = (Boolean b)-    fmap f (IfE c t e) = IfE (f c) (f t) (f e)-    fmap f (Equal l r) = Equal (f l) (f r)-    fmap f (NotEqual l r) = NotEqual (f l) (f r)-    fmap f (LessThan l r) = LessThan (f l) (f r)-    fmap f (GreaterThan l r) = GreaterThan (f l) (f r)-    fmap f (LessThanOrEqual l r) = LessThanOrEqual (f l) (f r)-    fmap f (GreaterThanOrEqual l r) = GreaterThanOrEqual (f l) (f r)
− Plugin/Lambda/tests.hs
@@ -1,153 +0,0 @@-module Main where--import Plugin.Lambda.LMEngine (evaluate, define)--#if __GLASGOW_HASKELL__ >= 604-import Test.HUnit-#else-import HUnit-#endif---- import QuickCheck--- import QuickCheckM --import qualified Map (empty)----- TODO: add tests for define, need to test List interactions (e.g. 1+head l)--main = runTestTT tests >>= print--tests = TestList -    [-    test_Arith,-    test_Rel,-    test_List,-    test_Lambda,-    test_Misc,-    list_ender -- for rearranging and removing tests-    ]--list_ender = TestCase $ return ()--typeErrorMsg = "type error"--- outOfFuelMsg = "out of fuel"-divideByZeroMsg = "divide by zero"-unboundVariableMsg = "unbound variable"-tailMsg = "tail of empty list"-headMsg = "head of empty list"--infFuel = -1-emptyEnv = Map.empty---- no label-genericTest' :: String -> String -> Test-genericTest' expected code = expected ~=? case evaluate code emptyEnv infFuel of-                                            Left _ -> error "shouldn't get here"-                                            Right s -> s---- labelled with code-genericTest :: String -> String -> Test-genericTest expected code = genericTestLbl code expected code---- explicit label-genericTestLbl :: String -> String -> String -> Test-genericTestLbl lbl expected code = lbl ~: genericTest' expected code---- The tests ----------------------------------------------------------------------- Arith ----test_Arith = TestLabel "Arith" $ TestList-    [-    genericTest "-85" "4 + 3-2*(6+5*8)",-    genericTest divideByZeroMsg "1/0",-    genericTest "5" "5",-    list_ender-    ]---- Lambda ----test_Lambda = TestLabel "Lambda" $ TestList-    [-    genericTest "10" "(\\x.x) 10",-    genericTest "5" "(\\x.x+3) 2",-    genericTestLbl "factorial" "120" "(\\f.(\\x.f(x x))(\\x.f(x x)))(\\fac n.if n == 0 then 1 else n*fac (n-1)) 5",-    genericTest "10" "(\\n.if n == 0 then n+3 else n+5) 5",-    genericTest "12" "(\\f.f 7) ((\\x y.x+y) 5)",-    genericTest "0" "(\\f.(\\x.f(x x))(\\x.f(x x)))(\\count n.if n==0 then 0 else count (n-1)) 1000",-    genericTest "15" "(\\S K I g f.(S (S (K S) (K I)) (S (K K) I)) g f) (\\f g x.f x (g x)) (\\r t.r) (\\l.l) 5 (\\m.m+10)",-    genericTest "14" "(\\x.x*2) $ 4+3",-    genericTest "-6" "((\\x.x*3) . (\\x.x-2)) 0",-    list_ender-    ]---- Rel ----test_Rel = TestLabel "Rel" $ TestList-    [-    genericTest "True" "if 10 == 10 then True else False",-    genericTest "True" "5 == 5",-    genericTest "True" "5 /= 6",-    genericTest "False" "5 /= 5",-    genericTest "False" "5 == 6",-    genericTest "True" "5 <= 6",-    genericTest "False" "5 >= 6",-    genericTest "True" "5 < 6",-    genericTest "False" "5 > 6",-    genericTest "True" "5 == 10 || 6 == 6",-    genericTest "False" "5 == 10 && 6 == 6",-    genericTest "True" "True == True",-    genericTest "False" "'b' == 'c'",-    genericTest "True" "[] == []",-    genericTest "True" "[5,\"aoe\"] == [5,\"aoe\"]",-    genericTest "True" "null [] || 5 <= 6",-    genericTest "False" "\"aoeu\" == \"\"",-    genericTest "True" "1 == 1 || 1/0 == 1",-    genericTest "False" "1 == 0 && 1/0 == 1",-    list_ender-    ]---- List ----test_List = TestLabel "List" $ TestList-    [-    genericTest "aoeu" "\"aoeu\"",-    genericTest "aoeu" "['a','o','e','u']",-    genericTest "a" "'a'",-    genericTest "[1, True, 3]" "[1,True,3]",-    genericTest "[1, True, 3]" "1:True:3:[]",-    genericTest "[True, 3]" "tail [1,True,3]",-    genericTest "1" "head [1,2,3]",-    genericTest tailMsg "tail []",-    genericTest headMsg "head []",-    genericTest "False" "null \"aoeu\"",-    genericTest "True" "null []",-    genericTest "True" "null \"\"",-    genericTest "[]" "[]",-    genericTest "1" "(\\f.f [1,2]) head",-    genericTestLbl "Tree" "(a (b c))" "(\\Leaf Branch tree.(\\f.(\\x.f(x x))(\\x.f(x x)))(\\showTree t.tree (\\l.[l]) (\\l r.'(':showTree l++' ':showTree r++\")\") t) (Branch (Leaf 'a') (Branch (Leaf 'b') (Leaf 'c')))) (\\c l b.l c) (\\l r lk bk.bk l r) (\\l b t.t l b)",-    list_ender-    ]---- Misc ----test_Misc = TestLabel "Misc" $ TestList-    [-    test_TypeError,-    "ConsStrictness" ~: "1" ~=? case evaluate "head [1,(\\x.x x)(\\x.x x)]" emptyEnv 100 of Left _ -> "ConsStrictness";Right s -> s,-    "NullStrictness" ~: "False" ~=? case evaluate "null [1,(\\x.x x)(\\x.x x)]" emptyEnv 100 of Left _ -> "NullStrictness";Right s -> s,-    "ConsStrictness2" ~: "1" ~=? case evaluate "head ((\\f.(\\x.f(x x))(\\x.f(x x))) (\\x.1:x))" emptyEnv 100 of Left _ -> "ConsStrictness";Right s -> s,---     "OutOfFuel" ~: (outOfFuelMsg ~=? evaluate "(\\x.x x) (\\x.x x)" emptyEnv 100),-    list_ender-    ]--test_TypeError = TestLabel "TypeError" $ TestList -    [-    genericTest typeErrorMsg "(\\f.f 5) 7",-    genericTest typeErrorMsg "(\\x.x)+4",-    genericTest typeErrorMsg "if 4 then True else False",-    genericTest typeErrorMsg "null 5",-    list_ender-    ]-
Plugin/Localtime.hs view
@@ -9,11 +9,12 @@  import Plugin import qualified Data.Map as M+import qualified Message as Msg  PLUGIN Localtime -type TimeMap = M.Map String  -- the person who's time we requested-                    [String] -- a list of targets waiting on this time+type TimeMap = M.Map Msg.Nick  -- the person who's time we requested+                    [Msg.Nick] -- a list of targets waiting on this time  instance Module LocaltimeModule TimeMap where @@ -25,16 +26,23 @@   process x y z "time" a = process x y z "localtime" a    -- record this person as a callback, for when we (asynchronously) get a result-  process _ _ whoAsked "localtime" rawWho = do-        let (whoToPing,_) = break (== ' ') rawWho-        modifyMS $ \st -> M.insertWith (++) whoToPing [whoAsked] st-        -- this is a CTCP time call, which returns a NOTICE-        ircPrivmsg' whoToPing (Just "\^ATIME\^A")     -- has to be raw-        return []+  process m msg whoAsked "localtime" []     = do+    let n = Msg.nName (Msg.nick msg)+    process m msg whoAsked "localtime" n +  process _ msg whoAsked "localtime" rawWho = do+    let whoToPing = Msg.readNick msg $ fst $ break (== ' ') rawWho+    if whoToPing /= Msg.lambdabotName msg+        then do modifyMS $ \st -> M.insertWith (++) whoToPing [whoAsked] st+            -- this is a CTCP time call, which returns a NOTICE+                lift $ ircPrivmsg' whoToPing ("\^ATIME\^A")     -- has to be raw+                return []+        else return ["I live on the internet, do you expect me to have a local time?"]+   -- the Base module caught the NOTICE TIME, mapped it to a PRIVMGS, and here it is :)-  process _ _ _ "localtime-reply" text = do-    let (whoGotPinged, time') = break (== ':') text+  process _ msg _ "localtime-reply" text = do+    let (whoGotPinged', time') = break (== ':') text+        whoGotPinged = Msg.readNick msg whoGotPinged'         time = drop 1 time'      targets <- withMS $ \st set -> do@@ -42,6 +50,6 @@             Nothing -> return []             Just xs -> do set (M.insert whoGotPinged [] st) -- clear the callback state                           return xs-    let msg = "Local time for " ++ whoGotPinged ++ " is " ++ time-    flip mapM_ targets $ flip ircPrivmsg' (Just msg)+    let txt = "Local time for " ++ Msg.showNick msg whoGotPinged ++ " is " ++ time+    lift $ flip mapM_ targets $ flip ircPrivmsg' txt     return []
Plugin/Log.hs view
@@ -1,3 +1,4 @@+{-# OPTIONS -w #-} -- -- Copyright (c) 2004 Thomas Jaeger -- Copyright (c) 2005 Simon Winwood@@ -14,11 +15,12 @@ import Control.Monad (when) import qualified Data.Map as M import System.Time  +import Lib.Util ( timeStamp ) import System.Directory (createDirectoryIfMissing)   -- ------------------------------------------------------------------------ -type Channel = String+type Channel = Msg.Nick  newtype LogModule = LogModule () @@ -32,23 +34,23 @@ type Log a = ModuleT LogState LB a  data Event =-    Said String ClockTime String-    | Joined String String ClockTime-    | Parted String String ClockTime -- covers quitting as well-    | Renick String String ClockTime String+    Said Msg.Nick ClockTime String+    | Joined Msg.Nick String ClockTime+    | Parted Msg.Nick String ClockTime -- covers quitting as well+    | Renick Msg.Nick String ClockTime Msg.Nick     deriving (Eq)  theModule :: MODULE theModule = MODULE $ LogModule ()  instance Show Event where-    show (Said nick ct what)       = timeStamp ct ++ " <" ++ nick ++ "> " ++ what-    show (Joined nick user ct)     = timeStamp ct ++ " " ++ nick+    show (Said nick ct what)       = timeStamp ct ++ " <" ++ Msg.nName nick ++ "> " ++ what+    show (Joined nick user ct)     = timeStamp ct ++ " " ++ show nick                                      ++ " (" ++ user ++ ") joined."-    show (Parted nick user ct)     = timeStamp ct ++ " " ++ nick+    show (Parted nick user ct)     = timeStamp ct ++ " " ++ show nick                                      ++ " (" ++ user ++ ") left."-    show (Renick nick user ct new) = timeStamp ct ++ " " ++ nick-                                     ++ " (" ++ user ++ ") is now " ++ new ++ "."+    show (Renick nick user ct new) = timeStamp ct ++ " " ++ show  nick+                                     ++ " (" ++ user ++ ") is now " ++ show new ++ "."  -- * Dispatchers and Module instance declaration --@@ -59,6 +61,9 @@  -- | Command -> Help lookup commands :: [(String,String)]+commands = []++{- commands = [("last",              "@last <channel> [<count>] [<user>] The last <count> (default 10) "                ++ "posts to channel <channel>."),@@ -67,6 +72,7 @@                ++ "address (default to todays)"),             ("print-logs",              "print the current internal state")]+-}  -- | CTCP command -> logger function lookup loggers :: Msg.Message m => [(String, m -> ClockTime -> Event)]@@ -87,27 +93,28 @@          now <- io getClockTime          -- map over the channels this message was directed to, adding to each          -- of their log files.-         when (notMe msg) $-           mapM_ (\c -> withValidLog (doLog c f msg) now c) (Msg.channels msg)+         mapM_ (\c -> withValidLog (doLog c f msg) now c) (Msg.channels msg)        Nothing -> return ()      return []-     where notMe m = (lowerCaseString $ name config)-                       /= (lowerCaseString . head $ Msg.channels m)-                       -- We don't log /msgs to the lambdabot++     where -- notMe m = (lowerCaseString $ name config)+           --             /= (lowerCaseString . head $ Msg.channels m)+           --             -- We don't log /msgs to the lambdabot+            doLog chan f m hdl ct = do              let event = f m ct              logString hdl (show event)              appendEvent chan event -   process _ _ _ "last" rest = showHistory rest-   process _ _ _ "print-logs" _ = fmap ((:[]) . show) readMS+-- process _ _ _ "last" rest = showHistory rest+-- process _ _ _ "print-logs" _ = fmap ((:[]) . show) readMS  -- * The @last command --  -- | Filter all the nicks by one person -- FIXME --- maybe we should take into consideration nick changes?-filterNick :: String -> [Event] -> [Event]+filterNick :: Msg.Nick -> [Event] -> [Event] filterNick who = filter filterOneNick     where     filterOneNick (Said who' _ _)      = who == who'@@ -116,8 +123,8 @@     filterOneNick (Renick old _ _ new) = who == old || who == new  -- | Show the last 10 (or whatever) lines from the channel, in reverse order.-showHistory :: String -> Log [String]-showHistory args = do+showHistory :: Msg.Message m => m -> String -> Log [String]+showHistory msg args = do   st <- readMS   case M.lookup chan' st of     Just cs -> let his = chanHistory cs@@ -125,28 +132,13 @@                           . take nLines'.  reverse $ lines' his]     Nothing -> return ["I haven't got any logs for that channel."]   where chan:nLines:nick:_ = map listToMaybeAll (words args ++ repeat "")-        chan'     = fromMaybe (error "The channel name is required") chan+        chan'     = Msg.readNick msg $ fromMaybe (error "The channel name is required") chan         nLines'   = maybe numLastLines read nLines-        lines' fm = maybe fm (\n -> filterNick n fm) nick+        lines' fm = maybe fm (\n -> filterNick (Msg.readNick msg n) fm) nick  -- * Event -> String helpers -- --- | Show a number, padded to the left with zeroes up to the specified width-showWidth :: Int    -- ^ Width to fill to-          -> Int    -- ^ Number to show-          -> String -- ^ Padded string-showWidth width n = zeroes ++ num-    where num    = show n-          zeroes = replicate (width - length num) '0'---- | Show a TimeStamp.-timeStamp :: ClockTime -> String-timeStamp ct = let cal = toUTCTime ct-               in (showWidth 2 $ ctHour cal) ++ ":" ++-                  (showWidth 2 $ ctMin cal)  ++ ":" ++-                  (showWidth 2 $ ctSec cal)- -- * Logging helpers -- @@ -206,7 +198,7 @@ openChannelFile :: Channel -> ClockTime -> Log Handle openChannelFile chan ct =      io $ createDirectoryIfMissing True dir >> openFile file AppendMode-    where dir  = outputDir config </> "Log" </> host config </> chan+    where dir  = outputDir config </> "Log" </> Msg.nTag chan </> Msg.nName chan           date = dateStamp ct           file = dir </> (dateToString date) <.> "txt" @@ -221,18 +213,16 @@     putHdlAndDS chan hdl' (dateStamp ct)  -- | Initialise the channel state (if it not already inited)-initChannelMaybe :: String -> ClockTime -> Log ()+initChannelMaybe :: Msg.Nick -> ClockTime -> Log () initChannelMaybe chan ct = do   chanp <- liftM (M.member chan) readMS-  --io (putStr "chanp: " >> print chanp)   unless chanp $ do     hdl <- openChannelFile chan ct     modifyMS (M.insert chan $ CS hdl (dateStamp ct) [])  -- | Ensure that the log is correctly initialised etc.-withValidLog :: (Handle -> ClockTime -> LB a) -             -> ClockTime -> Channel -> Log a-withValidLog f ct chan = do +withValidLog :: (Handle -> ClockTime -> Log a) -> ClockTime -> Channel -> Log a+withValidLog f ct chan = do   initChannelMaybe chan ct   reopenChannelMaybe chan ct   hdl <- getHandle chan@@ -240,7 +230,7 @@   return rv  -- | Log a string. Main logging workhorse.-logString :: Handle -> String -> LB ()+logString :: Handle -> String -> Log () logString hdl str = io $ hPutStrLn hdl str >> hFlush hdl   -- We flush on each operation to ensure logs are up to date. @@ -259,7 +249,7 @@ -- FIXME:  We should only do this for channels that the user is currently on. nickCB :: Msg.Message a => a -> ClockTime -> Event nickCB msg ct = Renick (Msg.nick msg) (Msg.fullName msg) ct-                       (drop 1 $ head $ Msg.body msg)+                       (Msg.readNick msg $ drop 1 $ head $ Msg.body msg)  -- | When somebody speaks. msgCB :: Msg.Message a => a -> ClockTime -> Event
+ Plugin/Maya.hs view
@@ -0,0 +1,84 @@+--+-- Copyright (c) 2004 Donald Bruce Stewart - http://www.cse.unsw.edu.au/~dons+-- GPL version 2 or later (see http://www.gnu.org/copyleft/gpl.html)+--++--+-- maya, useful commands for #maya+--++--+-- TEMP:++-- current temperature at UNSW+-- 'temp' is the following script, with line breaks for readability. Should be+-- converted into a MiniHTTP call and a regex:+--++-- PAGE='http://www.bom.gov.au/products/IDN65066.shtml'+-- +-- w3m -dump_source $PAGE | perl -naWF", " -e '+-- sub f($) {+ --        my $i = shift @_;+--         return ($i == -9999) ? "-" : sprintf "%.1f", $i;+-- }+-- +-- if (/DATA.*Sydney Airport/) {+-- printf "now %s°, min %s°, max %s°, rain %smm, wind %dkm/h%s\n", +--         f($F[3]),f($F[11]),f($F[13]),f($F[10]),$F[7], $F[6];+-- exit+-- }'+--+------------------------------------------------------------------------+-- +-- FORECAST:+--+--PAGE='http://www.bom.gov.au/cgi-bin/wrap_fwo.pl?IDN10064.txt'+--+--w3m -dump_source $PAGE | perl -nW -e '+--if (/Issued at/) {+--        $_ =~ s/ on.*$/./ and print $_;+--        while (<>) {+--                next if (/^\s*$/ or /Precis/ or /Liver|Penrith|Richm/);+--                print;+--                exit if /UV Index/;+--        }+--}' | sed 's/  / /g; s/ *$//' | perl -p -e 's/\n/ / if $. == 1'+--++module Plugin.Maya where++import Plugin+import Control.Monad.Trans      ( liftIO        )++newtype MayaModule = MayaModule ()++theModule :: MODULE+theModule = MODULE $ MayaModule ()++instance Module MayaModule () where+        moduleHelp _ s = case s of+                            "temp"          -> "Local temperature"+                            "forecast"      -> "Local forecast"+                            "ring"          -> "@ring <user>, CSE phonebook"+                            _           -> "Maya module: @temp, @forecast, @ring"++        moduleCmds   _ = ["temp","forecast", "ring"]++        process_ _ "temp" s = +         if s == "help"+            then return ["  Sydney Ap (http://www.bom.gov.au/images/syd_aws.gif)" ]+            else do (o,_,_) <- liftIO $ popen "/home/dons/bin-pc.i86.linux/temp" [] Nothing+                    return [ "  " ++ o ]++        process_  _  "ring" s =+            do (o,_,_) <- liftIO $ popen "/usr/local/bin/ring" [s] Nothing+               return ["  " ++ o]++        process_ _ "forecast" s =+         if s == "help"+            then return ["  Sydney Metro (http://www.bom.gov.au/cgi-bin/wrap_fwo.pl?IDN10064.txt)" ]+            else do (o,e,_) <- liftIO $ popen "/home/dons/bin-pc.i86.linux/forecast" [s] Nothing+                    liftIO $ print (o,e)+                    let o' = map (\t -> "  "++t) $ lines o+                    return o'
Plugin/More.hs view
@@ -5,6 +5,8 @@  import Plugin +import Message( Nick )+ PLUGIN More  type MoreState = GlobalPrivate () [String]@@ -14,15 +16,16 @@     moduleHelp _ _              = "@more. Return more output from the bot buffer."     moduleCmds   _              = ["more"]     moduleDefState _            = return $ mkGlobalPrivate 20 ()-    moduleInit   _              = ircInstallOutputFilter moreFilter+    moduleInit   _              = bindModule2 moreFilter >>=+                                      ircInstallOutputFilter     process      _ _ target _ _ = do         morestate <- readPS target         case morestate of             Nothing -> return []-            Just ls -> do mapM_ (ircPrivmsg' target . Just) =<< moreFilter target ls+            Just ls -> do mapM_ (lift . ircPrivmsg' target) =<< moreFilter target ls                           return []       -- special -moreFilter :: String -> [String] -> ModuleLB MoreState+moreFilter :: Nick -> [String] -> ModuleLB MoreState moreFilter target msglines = do     let (morelines, thislines) = case drop (maxLines+2) msglines of           [] -> ([],msglines)
+ Plugin/OEIS.hs view
@@ -0,0 +1,32 @@+--+-- | Look up sequences in the Online Encyclopedia of Integer Sequences+--   Based on the Math.OEIS library+--+module Plugin.OEIS (theModule) where++import Plugin++import Lib.OEIS+import Data.Char++PLUGIN OEIS++instance Module OEISModule () where+    moduleCmds   _     = ["oeis"]+    moduleHelp _ _     = "oeis <sequence>. Look up a sequence in the Online Encyclopedia of Integer Sequences"+    process _ _ to _ a = do s <- liftIO $ lookupOEIS a+                            out <- mapM (ios80 to) (map return s)+                            return $ concat out+++lookupOEIS :: String -> IO [String]+lookupOEIS a = do+         let a'  = commas . reverse . dropWhile isSpace . reverse . dropWhile isSpace $ a+         x <- searchSequence_IO a'+         case x of+            Nothing -> do r <- random insult+                          return ["Sequence not found. " ++ r]+            Just s  -> return [description s, show $ sequenceData s]+ where commas []                     = []+       commas (x:' ':xs) | isDigit x = x : ',' : commas xs+       commas (x:xs)                 = x : commas xs
+ Plugin/OfflineRC.hs view
@@ -0,0 +1,106 @@+--+-- | Offline mode / RC file / -e support module.  Handles spooling lists+-- of commands (from readline, files, or the command line) into the vchat+-- layer.+--+module Plugin.OfflineRC (theModule) where++import Plugin+import System.IO( hPutStrLn, hFlush, stdout )++import LMain( received )+import IRCBase+import Control.Monad.Reader( asks )+import Control.Monad.State( get, gets, put )+import Control.Concurrent( forkIO )+import Control.Concurrent.MVar( readMVar )+import Lib.Error( finallyError )+import Control.Exception( evaluate )++#ifdef mingw32_HOST_OS+-- Work around the lack of readline on windows+readline :: String -> IO (Maybe String)+readline p = do+    putStr p+    hFlush stdout+    liftM Just getLine++addHistory :: String -> IO ()+addHistory _ = return ()++#else+import System.Console.Readline( readline, addHistory )+#endif+++PLUGIN OfflineRC++-- We need to track the number of active sourcings so that we can+-- unregister the server (-> allow the bot to quit) when it is not+-- being used.+type OfflineRC = ModuleT Integer LB ++instance Module OfflineRCModule Integer where+    modulePrivs  _         = ["offline", "rc"]+    moduleHelp _ "offline" = "offline. Start a repl"+    moduleHelp _ "rc"      = "rc name. Read a file of commands (asynchonously). FIXME: better name."+    moduleInit      _      = do act <- bindModule0 onInit+                                lift $ liftLB forkIO $ do mv <- asks ircInitDoneMVar+                                                          io $ readMVar mv+                                                          act+                                return ()+    moduleDefState _       = return 0+    process_ _ "offline" _ = do act <- bindModule0 $ finallyError replLoop unlockRC+                                lockRC+                                lift $ liftLB forkIO act+                                return []+    process_ _ "rc" fn     = do txt <- io $ readFile fn+                                io $ evaluate $ foldr seq () txt+                                act <- bindModule0 $ finallyError (mapM_ feed $ lines txt) unlockRC+                                lockRC+                                lift $ liftLB forkIO act+                                return []++onInit :: ModuleT Integer LB ()+onInit = do st <- get+            put (st { ircOnStartupCmds = [] })+            let cmds = ircOnStartupCmds st+            lockRC >> finallyError (mapM_ feed cmds) unlockRC++feed :: String -> ModuleT Integer LB ()+feed msg = let msg' = case msg of '>':xs -> "@run " ++ xs+                                  '!':xs -> xs+                                  _      -> "@"     ++ dropWhile (== ' ') msg+           in lift $ (>> return ()) $ liftLB (timeout (15 * 1000 * 1000)) $ received $+              IrcMessage { msgServer = "offlinerc"+                         , msgLBName = "offline"+                         , msgPrefix = "null!n=user@null"+                         , msgCommand = "PRIVMSG"+                         , msgParams = ["offline", ":" ++ msg' ] }++handleMsg :: IrcMessage -> LB ()+handleMsg msg = liftIO $ do+                  let str = case (tail . msgParams) msg of+                              []    -> []+                              (x:_) -> tail x+                  hPutStrLn stdout str+                  hFlush stdout++replLoop :: OfflineRC ()+replLoop = do line <- io $ readline "lambdabot> "+              s' <- case line of Nothing -> fail "<eof>"+                                 Just x -> return $ dropWhile isSpace x+              when (not $ null s') (do io (addHistory s')+                                       feed s')+              continue <- gets ircStayConnected+              when continue replLoop+++lockRC :: OfflineRC ()+lockRC = do add <- bindModule0 $ addServer "offlinerc" handleMsg+            withMS $ \ cur writ -> do when (cur == 0) $ add+                                      writ (cur + 1)++unlockRC :: OfflineRC ()+unlockRC = withMS $ \ cur writ -> do when (cur == 1) $ remServer "offlinerc"+                                     writ (cur - 1)
Plugin/Pl.hs view
@@ -18,8 +18,11 @@ import Plugin.Pl.Common          (TopLevel, mapTopLevel, getExpr) import Plugin.Pl.Parser          (parsePF) import Plugin.Pl.PrettyPrinter   (Expr)-import Plugin.Pl.Transform       (transform, optimize)+import Plugin.Pl.Transform       (transform)+import Plugin.Pl.Optimize        (optimize) +import Message( Nick )+ import Control.Concurrent.Chan    (Chan, newChan, isEmptyChan, readChan, writeList2Chan)  -- firstTimeout is the timeout when the expression is simplified for the first@@ -50,19 +53,20 @@  ------------------------------------------------------------------------ -res :: String -> Pl+res :: Nick -> Pl res target = do   d <- readPS target   case d of     Nothing -> return ["pointless: sorry, nothing to resume."]     Just d' -> optimizeTopLevel target d' -pf :: String -> String -> Pl+-- | Convert a string to pointfree form+pf :: Nick -> String -> Pl pf target inp = case parsePF inp of   Right d  -> optimizeTopLevel target (firstTimeout, mapTopLevel transform d)   Left err -> return [err] -optimizeTopLevel :: String -> (Int, TopLevel) -> Pl+optimizeTopLevel :: Nick -> (Int, TopLevel) -> Pl optimizeTopLevel target (to, d) = do   let (e,decl) = getExpr d   (e', finished) <- io $ optimizeIO to e
+ Plugin/Pl/Names.hs view
@@ -0,0 +1,89 @@++--+-- | Names of haskell functions used in the Pl code+--+module Plugin.Pl.Names where++import Plugin.Pl.Common+++-- | Expressions with holes+-- No MLambda here because we only consider closed Terms (no alpha-renaming!).+-- Has to be in this module, otherwise we get recursion+data MExpr+  = MApp  !MExpr !MExpr  -- ^ Application+  | Hole  !Int           -- ^ Hole/argument where another expression could go+  | Quote !Expr+  deriving Eq+++-- Names+idE, flipE, bindE, extE, returnE, consE, appendE, nilE, foldrE, foldlE, fstE,+  sndE, dollarE, constE, uncurryE, curryE, compE, headE, tailE, sE, commaE, +  fixE, foldl1E, notE, equalsE, nequalsE, plusE, multE, zeroE, oneE, lengthE, +  sumE, productE, concatE, concatMapE, joinE, mapE, fmapE, fmapIE, subtractE, +  minusE, liftME, apE, liftM2E, seqME, zipE, zipWithE, +  crossE, firstE, secondE, andE, orE, allE, anyE :: MExpr+idE        = Quote $ Var Pref "id"+flipE      = Quote $ Var Pref "flip"+constE     = Quote $ Var Pref "const"+compE      = Quote $ Var Inf  "."+sE         = Quote $ Var Pref "ap"+fixE       = Quote $ Var Pref "fix"+bindE      = Quote $ Var Inf  ">>="+extE       = Quote $ Var Inf  "=<<"+returnE    = Quote $ Var Pref "return"+consE      = Quote $ Var Inf  ":"+nilE       = Quote $ Var Pref "[]"+appendE    = Quote $ Var Inf  "++"+foldrE     = Quote $ Var Pref "foldr"+foldlE     = Quote $ Var Pref "foldl"+fstE       = Quote $ Var Pref "fst"+sndE       = Quote $ Var Pref "snd"+dollarE    = Quote $ Var Inf  "$"+uncurryE   = Quote $ Var Pref "uncurry"+curryE     = Quote $ Var Pref "curry"+headE      = Quote $ Var Pref "head"+tailE      = Quote $ Var Pref "tail"+commaE     = Quote $ Var Inf  ","+foldl1E    = Quote $ Var Pref "foldl1"+equalsE    = Quote $ Var Inf  "=="+nequalsE   = Quote $ Var Inf  "/="+notE       = Quote $ Var Pref "not"+plusE      = Quote $ Var Inf  "+"+multE      = Quote $ Var Inf  "*"+zeroE      = Quote $ Var Pref "0"+oneE       = Quote $ Var Pref "1"+lengthE    = Quote $ Var Pref "length"+sumE       = Quote $ Var Pref "sum"+productE   = Quote $ Var Pref "product"+concatE    = Quote $ Var Pref "concat"+concatMapE = Quote $ Var Pref "concatMap"+joinE      = Quote $ Var Pref "join"+mapE       = Quote $ Var Pref "map"+fmapE      = Quote $ Var Pref "fmap"+fmapIE     = Quote $ Var Inf  "fmap"+subtractE  = Quote $ Var Pref "subtract"+minusE     = Quote $ Var Inf  "-"+liftME     = Quote $ Var Pref "liftM"+liftM2E    = Quote $ Var Pref "liftM2"+apE        = Quote $ Var Inf  "ap"+seqME      = Quote $ Var Inf  ">>"+zipE       = Quote $ Var Pref "zip"+zipWithE   = Quote $ Var Pref "zipWith"+crossE     = Quote $ Var Inf  "***"+firstE     = Quote $ Var Pref "first"+secondE    = Quote $ Var Pref "second"+andE       = Quote $ Var Pref "and"+orE        = Quote $ Var Pref "or"+allE       = Quote $ Var Pref "all"+anyE       = Quote $ Var Pref "any"++++a, c :: MExpr -> MExpr -> MExpr+a       = MApp+c e1 e2 = compE `a` e1 `a` e2+infixl 9 `a`+infixr 8 `c`+
+ Plugin/Pl/Optimize.hs view
@@ -0,0 +1,113 @@+{-# OPTIONS -fvia-C -O2 -optc-O3 #-}+module Plugin.Pl.Optimize (+    optimize,+  ) where++import Plugin.Pl.Common+import Plugin.Pl.Rules+import Plugin.Pl.PrettyPrinter++import Data.List (nub)+import Data.Maybe (listToMaybe)+import Control.Monad.State++cut :: [a] -> [a]+cut = take 1++toMonadPlus :: MonadPlus m => Maybe a -> m a+toMonadPlus Nothing = mzero+toMonadPlus (Just x)= return x++type Size = Double+-- | The 'size' of an expression, lower is better+--+-- This seems to be a better size for our purposes,+-- despite being "a little" slower because of the wasteful uglyprinting+sizeExpr' :: Expr -> Size +sizeExpr' e = fromIntegral (length $ show e) + adjust e where+  -- hackish thing to favor some expressions if the length is the same:+  -- (+ x) --> (x +)+  -- x >>= f --> f =<< x+  -- f $ g x --> f (g x)+  adjust :: Expr -> Size+  adjust (Var _ str) -- Just n <- readM str = log (n*n+1) / 4+                     | str == "uncurry"    = -4+--                     | str == "s"          = 5+                     | str == "flip"       = 0.1+                     | str == ">>="        = 0.05+                     | str == "$"          = 0.01+                     | str == "subtract"   = 0.01+                     | str == "ap"         = 2+                     | str == "liftM2"     = 1.01+                     | str == "return"     = -2+                     | str == "zipWith"    = -4+                     | str == "const"      = 0 -- -2+                     | str == "fmap"       = -1+  adjust (Lambda _ e') = adjust e'+  adjust (App e1 e2)  = adjust e1 + adjust e2+  adjust _ = 0++-- | Optimize an expression+optimize :: Expr -> [Expr]+optimize e = result where+  result :: [Expr]+  result = map (snd . fromJust) . takeWhile isJust . +    iterate (>>= simpleStep) $ Just (sizeExpr' e, e)++  simpleStep :: (Size, Expr) -> Maybe (Size, Expr)+  simpleStep t = do +    let chn  = let ?first = True  in step (snd t)+        chnn = let ?first = False in step =<< chn+        new  = filter (\(x,_) -> x < fst t) . map (sizeExpr' &&& id) $ +                snd t: chn ++ chnn+    listToMaybe new++-- | Apply all rewrite rules once+step :: (?first :: Bool) => Expr -> [Expr]+step e = nub $ rewrite rules e+ +-- | Apply a single rewrite rule+--   +rewrite :: (?first :: Bool) => RewriteRule -> Expr -> [Expr]+rewrite rl e = case rl of+    Up r1 r2     -> let e'  = cut $ rewrite r1 e+                        e'' = rewrite r2 =<< e'+                    in if null e'' then e' else e''+    OrElse r1 r2 -> let e'  = rewrite r1 e+                    in if null e' then rewrite r2 e else e' +    Then r1 r2   -> rewrite r2 =<< nub (rewrite r1 e)+    Opt  r       -> e: rewrite r e+    If   p  r    -> if null (rewrite p e) then mzero else rewrite r e+    Hard r       -> if ?first then rewrite r e else mzero+    Or rs        -> (\x -> rewrite x e) =<< rs+    RR {}        -> rewDeep rl e+    CRR {}       -> rewDeep rl e+    Down {}      -> rewDeep rl e+    +  where -- rew = ...; rewDeep = ...++-- Apply a 'deep' reqrite rule+rewDeep :: (?first :: Bool) => RewriteRule -> Expr -> [Expr]+rewDeep rule e = rew rule e `mplus` case e of+    Var _ _    -> mzero+    Lambda _ _ -> error "lambda: optimizer only works for closed expressions"+    Let _ _    -> error "let: optimizer only works for closed expressions"+    App e1 e2  -> ((`App` e2) `map` rewDeep rule e1) `mplus`+                  ((e1 `App`) `map` rewDeep rule e2)++-- | Apply a rewrite rule to an expression+--   in a 'deep' position, i.e. from inside a RR,CRR or Down+rew :: (?first :: Bool) => RewriteRule -> Expr -> [Expr]+rew (RR r1 r2)   e = toMonadPlus $ fire r1 r2 e +rew (CRR r)      e = toMonadPlus $ r e+rew (Or rs)      e = (\x -> rew x e) =<< rs+rew (Down r1 r2) e = if null e'' then e' else e''+  where+    e'  = cut $ rew r1 e+    e'' = rewDeep r2 =<< e'+rew r@(Then   {}) e = rewrite r e+rew r@(OrElse {}) e = rewrite r e+rew r@(Up     {}) e = rewrite r e+rew r@(Opt    {}) e = rewrite r e+rew r@(If     {}) e = rewrite r e+rew r@(Hard   {}) e = rewrite r e
Plugin/Pl/Parser.hs view
@@ -92,7 +92,8 @@  var :: Parser Expr var = try (makeVar `fmap` atomic <|> -           parens (try rightSection <|> try (makeVar `fmap` many1 (char ',')) +           parens (try unaryNegation <|> try rightSection+                   <|> try (makeVar `fmap` many1 (char ','))                     <|> tuple) <|> list <|> (Var Pref . show) `fmap` charLiteral                    <|> stringVar `fmap` stringLiteral)         <?> "variable" where@@ -134,6 +135,13 @@     let name = Var Pref $ replicate (length elts - 1) ','     return $ foldl App name elts   <?> "tuple"++unaryNegation :: Parser Expr+unaryNegation = do+    symbol "-"+    e <- myParser False+    return $ Var Pref "negate" `App` e+  <?> "unary negation"  rightSection :: Parser Expr rightSection = do
Plugin/Pl/PrettyPrinter.hs view
@@ -14,6 +14,7 @@   showsPrec p (TLE e) = showsPrec p e   showsPrec p (TLD _ d) = showsPrec p d +-- | Expression with syntactic sugar data SExpr   = SVar !String   | SLambda ![Pattern] !SExpr
+ Plugin/Pl/RuleLib.hs view
@@ -0,0 +1,183 @@+{-# OPTIONS -fvia-C #-}+-- 6.4 gives a name shadow warning I haven't tracked down.++--+-- | This marvellous module contributed by Thomas J\344ger+--+module Plugin.Pl.RuleLib+       (  -- Using rules+          RewriteRule(..), fire+       ,  -- Defining rules+          rr,rr0,rr1,rr2,up,down+       ) where++import Plugin.Pl.Common+import Plugin.Pl.Names++import Data.Array+import qualified Data.Set as S++import Control.Monad.Fix (fix)++--import PlModule.PrettyPrinter++-- Next time I do somthing like this, I'll actually think about the combinator+-- language before, instead of producing something ad-hoc like this:+data RewriteRule +  = RR     Rewrite Rewrite           -- ^ A 'Rewrite' rule, rewrite the first to the second+                                     --   'Rewrite's can contain 'Hole's+  | CRR    (Expr -> Maybe Expr)      -- ^ Haskell function as a rule, applied to subexpressions+  | Down   RewriteRule RewriteRule   -- ^ Like Up, but applied to subexpressions+  | Up     RewriteRule RewriteRule   -- ^ Apply the first rule, then try the second rule on the first result+                                     --   if it fails, returns the result of the first rule+  | Or     [RewriteRule]             -- ^ Use all rules+  | OrElse RewriteRule RewriteRule   -- ^ Try the first rule, if it fails use the second rule+  | Then   RewriteRule RewriteRule   -- ^ Apply the first rule, apply the second rule to the result+  | Opt    RewriteRule               -- ^ Optionally apply the rewrite rule, Opt x == Or [identity,x]+  | If     RewriteRule RewriteRule   -- ^ Apply the second rule only if the first rule has some results+  | Hard   RewriteRule               -- ^ Apply the rule only in the first pass+++--instance Show MExpr where+--  show = show . fromMExpr++-- | An expression with holes to match or replace+data Rewrite = Rewrite {+  holes :: MExpr,  -- ^ Expression with holes+  rid   :: Int     -- ^ Number of holes+   -- rlength - 1+} --deriving Show++-- What are you gonna do when no recursive modules are possible?+class RewriteC a where+  getRewrite :: a -> Rewrite ++instance RewriteC MExpr where+  getRewrite rule = Rewrite {+    holes = rule,+    rid   = 0+  }++-- lift functions to rewrite rules+instance RewriteC a => RewriteC (MExpr -> a) where+  getRewrite rule = Rewrite {+    holes = holes . getRewrite . rule . Hole $ pid,+    rid   = pid + 1+  } where +    pid = rid $ getRewrite (undefined :: a)+++----------------------------------------------------------------------------------------+-- Applying/matching Rewrites++type ExprArr = Array Int Expr++-- | Fill in the holes in a 'MExpr'+myFire :: ExprArr -> MExpr -> MExpr+myFire xs (MApp e1 e2) = MApp (myFire xs e1) (myFire xs e2)+myFire xs (Hole h) = Quote $ xs ! h+myFire _ me = me++nub' :: Ord a => [a] -> [a]+nub' = S.toList . S.fromList++-- | Create an array, only if the keys in 'lst' are unique and all keys [0..n-1] are given+uniqueArray :: Ord v => Int -> [(Int, v)] -> Maybe (Array Int v)+uniqueArray n lst +  | length (nub' lst) == n = Just $ array (0,n-1) lst+  | otherwise = Nothing              ++-- | Try to match a Rewrite to an expression,+--   if there is a match, returns the expressions in the holes+match :: Rewrite -> Expr -> Maybe ExprArr+match (Rewrite hl rid') e  = uniqueArray rid' =<< matchWith hl e++-- | Fill in the holes in a 'Rewrite'+fire' :: Rewrite -> ExprArr -> MExpr+fire' (Rewrite hl _)   = (`myFire` hl)++fire :: Rewrite -> Rewrite -> Expr -> Maybe Expr+fire r1 r2 e = (fromMExpr . fire' r2) `fmap` match r1 e++-- | Match an Expr to a MExpr template, return the values used in the holes+matchWith :: MExpr -> Expr -> Maybe [(Int, Expr)]+matchWith (MApp e1 e2) (App e1' e2') = +  liftM2 (++) (matchWith e1 e1') (matchWith e2 e2')+matchWith (Quote e) e' = if e == e' then Just [] else Nothing+matchWith (Hole k) e = Just [(k,e)]+matchWith _ _ = Nothing++fromMExpr :: MExpr -> Expr+fromMExpr (MApp e1 e2)  = App (fromMExpr e1) (fromMExpr e2)+fromMExpr (Hole _)      = Var Pref "Hole" -- error "Hole in MExpr"+fromMExpr (Quote e)     = e++----------------------------------------------------------------------------------------+-- Difining rules++-- | Yet another pointless transformation:+--   Bring an MExpr to (more pointless) form by seeing it as a function+--     \hole_n -> ...+--   and writing that in pointless form+transformM :: Int -> MExpr -> MExpr+transformM _ (Quote e) = constE `a` Quote e+transformM n (Hole n') = if n == n' then idE else constE `a` Hole n'+transformM n (Quote (Var _ ".") `MApp` e1 `MApp` e2)+  | e1 `hasHole` n && not (e2 `hasHole` n) +  = flipE `a` compE `a` e2 `c` transformM n e1+transformM n e@(MApp e1 e2) +  | fr1 && fr2 = sE `a` transformM n e1 `a` transformM n e2+  | fr1        = flipE `a` transformM n e1 `a` e2+  | fr2, Hole n' <- e2, n' == n = e1+  | fr2        = e1 `c` transformM n e2+  | otherwise  = constE `a` e+  where+    fr1 = e1 `hasHole` n+    fr2 = e2 `hasHole` n++-- | Is there a (Hole n) in an expression?+hasHole :: MExpr -> Int -> Bool+hasHole (MApp e1 e2) n = e1 `hasHole` n || e2 `hasHole` n+hasHole (Quote _)    _ = False+hasHole (Hole n')    n = n == n'++-- | Variants of a rewrite rule: fill in (some of) the holes+--+-- haddock doesn't like n+k patterns, so rewrite them+--+getVariants, getVariants' :: Rewrite -> [Rewrite]+getVariants' r@(Rewrite _ 0)  = [r]+getVariants' r@(Rewrite e nk)+    | nk >= 1    = r : getVariants (Rewrite e' (nk-1))+    | otherwise  = error "getVariants' : nk went negative"+    where+        e' = decHoles $ transformM 0 e++        -- decrement all hole numbers+        decHoles (Hole n')    = Hole (n'-1)+        decHoles (MApp e1 e2) = decHoles e1 `MApp` decHoles e2+        decHoles me           = me++getVariants = getVariants' -- r = trace (show vs) vs where vs = getVariants' r++-- | Use this rewrite rule and rewrite rules derived from it by iterated+--   pointless transformation+rrList :: RewriteC a => a -> a -> [RewriteRule]+rrList r1 r2 = zipWith RR (getVariants r1') (getVariants r2') where+  r1' = getRewrite r1+  r2' = getRewrite r2++-- | Construct a 'RR' rewrite rule+rr, rr0, rr1, rr2 :: RewriteC a => a -> a -> RewriteRule+rr  r1 r2 = Or          $ rrList r1 r2+rr1 r1 r2 = Or . take 2 $ rrList r1 r2+rr2 r1 r2 = Or . take 3 $ rrList r1 r2+-- use only this rewrite rule, no variants+rr0 r1 r2 = RR r1' r2' where+  r1' = getRewrite r1+  r2' = getRewrite r2++-- | Apply Down/Up repeatedly  +down, up :: RewriteRule -> RewriteRule+down = fix . Down+up   = fix . Up
Plugin/Pl/Rules.hs view
@@ -1,235 +1,20 @@ {-# OPTIONS -fvia-C #-}-{-# OPTIONS -fno-warn-name-shadowing #-} -- 6.4 gives a name shadow warning I haven't tracked down.  -- -- | This marvellous module contributed by Thomas J\344ger ---module Plugin.Pl.Rules (RewriteRule(..), rules, fire) where+module Plugin.Pl.Rules (RewriteRule(..), fire, rules) where  import Lib.Serial (readM)  import Plugin.Pl.Common--import Data.Array-import qualified Data.Set as S--import Control.Monad.Fix (fix)----import PlModule.PrettyPrinter---- Next time I do somthing like this, I'll actually think about the combinator--- language before, instead of producing something ad-hoc like this:-data RewriteRule -  = RR Rewrite Rewrite-  | CRR (Expr -> Maybe Expr)-  | Down RewriteRule RewriteRule-  | Up RewriteRule RewriteRule-  | Or [RewriteRule]-  | OrElse RewriteRule RewriteRule-  | Then RewriteRule RewriteRule-  | Opt RewriteRule-  | If RewriteRule RewriteRule-  | Hard RewriteRule---- No MLambda here because we only consider closed Terms (no alpha-renaming!).-data MExpr-  = MApp !MExpr !MExpr-  | Hole !Int-  | Quote !Expr-  deriving Eq----instance Show MExpr where---  show = show . fromMExpr--data Rewrite = Rewrite {-  holes :: MExpr,-  rid :: Int -- rlength - 1-} --deriving Show---- What are you gonna do when no recursive modules are possible?-class RewriteC a where-  getRewrite :: a -> Rewrite --instance RewriteC MExpr where-  getRewrite rule = Rewrite {-    holes   = rule,-    rid = 0-  }--type ExprArr = Array Int Expr--myFire :: ExprArr -> MExpr -> MExpr-myFire xs (MApp e1 e2) = MApp (myFire xs e1) (myFire xs e2)-myFire xs (Hole h) = Quote $ xs ! h-myFire _ me = me--nub' :: Ord a => [a] -> [a]-nub' = S.toList . S.fromList--uniqueArray :: Ord v => Int -> [(Int, v)] -> Maybe (Array Int v)-uniqueArray n lst -  | length (nub' lst) == n = Just $ array (0,n-1) lst-  | otherwise = Nothing              --match :: Rewrite -> Expr -> Maybe ExprArr-match (Rewrite hl rid') e  = uniqueArray rid' =<< matchWith hl e--fire' :: Rewrite -> ExprArr -> MExpr-fire' (Rewrite hl _)   = (`myFire` hl)--fire :: Rewrite -> Rewrite -> Expr -> Maybe Expr-fire r1 r2 e = (fromMExpr . fire' r2) `fmap` match r1 e--matchWith :: MExpr -> Expr -> Maybe [(Int, Expr)]-matchWith (MApp e1 e2) (App e1' e2') = -  liftM2 (++) (matchWith e1 e1') (matchWith e2 e2')-matchWith (Quote e) e' = if e == e' then Just [] else Nothing-matchWith (Hole k) e = Just [(k,e)]-matchWith _ _ = Nothing--fromMExpr :: MExpr -> Expr-fromMExpr (MApp e1 e2)  = App (fromMExpr e1) (fromMExpr e2)-fromMExpr (Hole _)      = Var Pref "Hole" -- error "Hole in MExpr"-fromMExpr (Quote e)     = e--instance RewriteC a => RewriteC (MExpr -> a) where-  getRewrite rule = Rewrite {-    holes = holes . getRewrite . rule . Hole $ pid,-    rid   = pid + 1-  } where -    pid = rid $ getRewrite (bt :: a)---- Yet another pointless transformation-transformM :: Int -> MExpr -> MExpr-transformM _ (Quote e) = constE `a` Quote e-transformM n (Hole n') = if n == n' then idE else constE `a` Hole n'-transformM n (Quote (Var _ ".") `MApp` e1 `MApp` e2)-  | e1 `hasHole` n && not (e2 `hasHole` n) -  = flipE `a` compE `a` e2 `c` transformM n e1-transformM n e@(MApp e1 e2) -  | fr1 && fr2 = sE `a` transformM n e1 `a` transformM n e2-  | fr1        = flipE `a` transformM n e1 `a` e2-  | fr2, Hole n' <- e2, n' == n = e1-  | fr2        = e1 `c` transformM n e2-  | otherwise  = constE `a` e-  where-    fr1 = e1 `hasHole` n-    fr2 = e2 `hasHole` n--hasHole :: MExpr -> Int -> Bool-hasHole (MApp e1 e2) n = e1 `hasHole` n || e2 `hasHole` n-hasHole (Quote _)   _ = False-hasHole (Hole n')   n = n == n'------- haddock doesn't like n+k patterns, so rewrite them----getVariants, getVariants' :: Rewrite -> [Rewrite]-getVariants' r@(Rewrite _ 0)  = [r]-getVariants' r@(Rewrite e nk)-    | nk >= 1    = r : getVariants (Rewrite e' (nk-1))-    | otherwise  = error "getVariants' : nk went negative"-    where-        e' = decHoles $ transformM 0 e--        decHoles (Hole n')    = Hole (n'-1)-        decHoles (MApp e1 e2) = decHoles e1 `MApp` decHoles e2-        decHoles me           = me--getVariants = getVariants' -- r = trace (show vs) vs where vs = getVariants' r--rr, rr0, rr1, rr2 :: RewriteC a => a -> a -> RewriteRule--- use this rewrite rule and rewrite rules derived from it by iterated--- pointless transformation-rrList :: RewriteC a => a -> a -> [RewriteRule]-rrList r1 r2 = zipWith RR (getVariants r1') (getVariants r2') where-  r1' = getRewrite r1-  r2' = getRewrite r2--rr  r1 r2 = Or          $ rrList r1 r2-rr1 r1 r2 = Or . take 2 $ rrList r1 r2-rr2 r1 r2 = Or . take 3 $ rrList r1 r2---- use only this rewrite rule-rr0 r1 r2 = RR r1' r2' where-  r1' = getRewrite r1-  r2' = getRewrite r2-  -down, up :: RewriteRule -> RewriteRule-down = fix . Down-up   = fix . Up---idE, flipE, bindE, extE, returnE, consE, appendE, nilE, foldrE, foldlE, fstE,-  sndE, dollarE, constE, uncurryE, curryE, compE, headE, tailE, sE, commaE, -  fixE, foldl1E, notE, equalsE, nequalsE, plusE, multE, zeroE, oneE, lengthE, -  sumE, productE, concatE, concatMapE, joinE, mapE, fmapE, fmapIE, subtractE, -  minusE, liftME, apE, liftM2E, seqME, zipE, zipWithE, -  crossE, firstE, secondE, andE, orE, allE, anyE :: MExpr-idE        = Quote $ Var Pref "id"-flipE      = Quote $ Var Pref "flip"-constE     = Quote $ Var Pref "const"-compE      = Quote $ Var Inf "."-sE         = Quote $ Var Pref "ap"-fixE       = Quote $ Var Pref "fix"-bindE      = Quote $ Var Inf  ">>="-extE       = Quote $ Var Inf  "=<<"-returnE    = Quote $ Var Pref "return"-consE      = Quote $ Var Inf  ":"-nilE       = Quote $ Var Pref "[]"-appendE    = Quote $ Var Inf  "++"-foldrE     = Quote $ Var Pref "foldr"-foldlE     = Quote $ Var Pref "foldl"-fstE       = Quote $ Var Pref "fst"-sndE       = Quote $ Var Pref "snd"-dollarE    = Quote $ Var Inf  "$"-uncurryE   = Quote $ Var Pref "uncurry"-curryE     = Quote $ Var Pref "curry"-headE      = Quote $ Var Pref "head"-tailE      = Quote $ Var Pref "tail"-commaE     = Quote $ Var Inf  ","-foldl1E    = Quote $ Var Pref "foldl1"-equalsE    = Quote $ Var Inf  "=="-nequalsE   = Quote $ Var Inf  "/="-notE       = Quote $ Var Pref "not"-plusE      = Quote $ Var Inf  "+"-multE      = Quote $ Var Inf  "*"-zeroE      = Quote $ Var Pref "0"-oneE       = Quote $ Var Pref "1"-lengthE    = Quote $ Var Pref "length"-sumE       = Quote $ Var Pref "sum"-productE   = Quote $ Var Pref "product"-concatE    = Quote $ Var Pref "concat"-concatMapE = Quote $ Var Pref "concatMap"-joinE      = Quote $ Var Pref "join"-mapE       = Quote $ Var Pref "map"-fmapE      = Quote $ Var Pref "fmap"-fmapIE     = Quote $ Var Inf  "fmap"-subtractE  = Quote $ Var Pref "subtract"-minusE     = Quote $ Var Inf  "-"-liftME     = Quote $ Var Pref "liftM"-liftM2E    = Quote $ Var Pref "liftM2"-apE        = Quote $ Var Inf  "ap"-seqME      = Quote $ Var Inf  ">>"-zipE       = Quote $ Var Pref "zip"-zipWithE   = Quote $ Var Pref "zipWith"-crossE     = Quote $ Var Inf  "***"-firstE     = Quote $ Var Pref "first"-secondE    = Quote $ Var Pref "second"-andE       = Quote $ Var Pref "and"-orE        = Quote $ Var Pref "or"-allE       = Quote $ Var Pref "all"-anyE       = Quote $ Var Pref "any"-+import Plugin.Pl.RuleLib+import Plugin.Pl.Names  -a, c :: MExpr -> MExpr -> MExpr-a       = MApp-c e1 e2 = compE `a` e1 `a` e2-infixl 9 `a`-infixr 8 `c`-+----------------------------------------------------------------------------------------+-- Operator rules  collapseLists :: Expr -> Maybe Expr collapseLists (Var _ "++" `App` e1 `App` e2)@@ -276,6 +61,10 @@ commutative ops (Var _ "flip" `App` e@(Var _ op)) | op `elem` ops = Just e commutative _ _ = Nothing +----------------------------------------------------------------------------------------+-- Rewrite rules++ -- TODO: Move rules into a file. {-# INLINE simplifies #-} simplifies :: RewriteRule@@ -433,6 +222,9 @@   -- s (const f) --> (.) f   rr  (\f -> sE `a` (constE `a` f))       (\f -> compE `a` f),+  -- (`ap` f) . const . h --> (. f) . h+  rr  (\f g h -> (flipE `a` sE `a` f) `c` (flipE `a` compE `a` g) `c` constE `c` h)+      (\f _ h -> (flipE `a` compE `a` f) `c` h),   -- s (f . fst) snd --> uncurry f   rr  (\f -> sE `a` (f `c` fstE) `a` sndE)       (\f -> uncurryE `a` f),@@ -458,6 +250,12 @@   -- const x . f --> const x   rr (\x f -> constE `a` x `c` f)      (\x _ -> constE `a` x),+  -- (. f) . const --> const+  rr (\f -> (flipE `a` compE `a` f) `c` constE)+     (\_ -> constE),+  -- (. f) . const . g --> const . g+  rr (\f g -> (flipE `a` compE `a` f) `c` constE `c` g)+     (\_ g -> constE `c` g),   -- fix f --> f (fix x)   Hard $   rr0 (\f -> fixE `a` f)@@ -726,6 +524,10 @@    Hard $ simplifies   ] `Then` Opt (up simplifies)++----------------------------------------------------------------------------------------+-- Operator information+ assocLOps, assocROps, assocOps :: [String] assocLOps = ["+", "*", "&&", "||", "max", "min"] assocROps = [".", "++"]
Plugin/Pl/Transform.hs view
@@ -1,13 +1,11 @@ {-# OPTIONS -fvia-C -O2 -optc-O3 #-} module Plugin.Pl.Transform (-    transform, optimize,+    transform,   ) where  import Plugin.Pl.Common-import Plugin.Pl.Rules import Plugin.Pl.PrettyPrinter -import Data.List (nub) import qualified Data.Map as M  import Data.Graph (stronglyConnComp, flattenSCC, flattenSCCs)@@ -22,11 +20,13 @@     | otherwise = x: nub' (x `S.insert` set) xs -} +-- | Does a name occur in a pattern? occursP :: String -> Pattern -> Bool occursP v (PVar v') = v == v' occursP v (PTuple p1 p2) = v `occursP` p1 || v `occursP` p2 occursP v (PCons  p1 p2) = v `occursP` p1 || v `occursP` p2 +-- | How often does the given name occur free in an expression? freeIn :: String -> Expr -> Int freeIn v (Var _ v') = fromEnum $ v == v' freeIn v (Lambda pat e) = if v `occursP` pat then 0 else freeIn v e@@ -34,6 +34,7 @@ freeIn v (Let ds e') = if v `elem` map declName ds then 0    else freeIn v e' + sum [freeIn v e | Define _ e <- ds] +-- | Does a name occur free in an expression? isFreeIn :: String -> Expr -> Bool isFreeIn v e = freeIn v e > 0 @@ -43,9 +44,11 @@ tupleP :: [String] -> Pattern tupleP vs = foldr1 PTuple $ PVar `map` vs +-- | The subset of ds that d depends on dependsOn :: [Decl] -> Decl -> [Decl] dependsOn ds d = [d' | d' <- ds, declName d' `isFreeIn` declExpr d]-  ++-- | Convert recursive lets to lambdas with tuple patterns and fix calls unLet :: Expr -> Expr unLet (App e1 e2) = App (unLet e1) (unLet e2) unLet (Let [] e) = unLet e@@ -63,15 +66,17 @@  type Env = M.Map String String +-- | Rename all variables to (locally) unqiue fresh ones+-- -- It's a pity we still need that for the pointless transformation. -- Otherwise a newly created id/const/... could be bound by a lambda -- e.g. transform' (\id x -> x) ==> transform' (\id -> id) ==> id alphaRename :: Expr -> Expr alphaRename e = alpha e `evalState` M.empty where   alpha :: Expr -> State Env Expr-  alpha (Var f v) = do fm <- get; return $ Var f $ maybe v id (M.lookup v fm)-  alpha (App e1 e2) = liftM2 App (alpha e1) (alpha e2)-  alpha (Let _ _) = assert False bt+  alpha (Var f v)     = do fm <- get; return $ Var f $ maybe v id (M.lookup v fm)+  alpha (App e1 e2)   = liftM2 App (alpha e1) (alpha e2)+  alpha (Let _ _)     = assert False undefined   alpha (Lambda v e') = inEnv $ liftM2 Lambda (alphaPat v) (alpha e')    -- act like a reader monad@@ -84,14 +89,18 @@     put $ M.insert v v' fm     return $ PVar v'   alphaPat (PTuple p1 p2) = liftM2 PTuple (alphaPat p1) (alphaPat p2)-  alphaPat (PCons p1 p2) = liftM2 PCons (alphaPat p1) (alphaPat p2)-+  alphaPat (PCons  p1 p2) = liftM2 PCons  (alphaPat p1) (alphaPat p2) +-- | Make an expression points free transform :: Expr -> Expr transform = transform' . alphaRename . unLet +-- | Transform patterns to:+--     fst/snd for tuple patterns+--     head/tail for cons patterns+--     id/const/flip/. for variable paterns transform' :: Expr -> Expr-transform' (Let {}) = assert False bt+transform' (Let {}) = assert False undefined transform' (Var f v) = Var f v transform' (App e1 e2) = App (transform' e1) (transform' e2) transform' (Lambda (PTuple p1 p2) e) @@ -119,97 +128,3 @@     where       fr1 = v `isFreeIn` e1       fr2 = v `isFreeIn` e2--cut :: [a] -> [a]-cut = take 1--toMonadPlus :: MonadPlus m => Maybe a -> m a-toMonadPlus Nothing = mzero-toMonadPlus (Just x)= return x--type Size = Double--- This seems to be a better size for our purposes,--- despite being "a little" slower because of the wasteful uglyprinting-sizeExpr' :: Expr -> Size -sizeExpr' e = fromIntegral (length $ show e) + adjust e where-  -- hackish thing to favor some expressions if the length is the same:-  -- (+ x) --> (x +)-  -- x >>= f --> f =<< x-  -- f $ g x --> f (g x)-  adjust :: Expr -> Size-  adjust (Var _ str) -- Just n <- readM str = log (n*n+1) / 4-                     | str == "uncurry"    = -4---                     | str == "s"          = 5-                     | str == "flip"       = 0.1-                     | str == ">>="        = 0.05-                     | str == "$"          = 0.01-                     | str == "subtract"   = 0.01-                     | str == "ap"         = 2-                     | str == "liftM2"     = 1.01-                     | str == "return"     = -2-                     | str == "zipWith"    = -4-                     | str == "const"      = 0 -- -2-                     | str == "fmap"       = -1-  adjust (Lambda _ e') = adjust e'-  adjust (App e1 e2)  = adjust e1 + adjust e2-  adjust _ = 0--optimize :: Expr -> [Expr]-optimize e = result where-  result :: [Expr]-  result = map (snd . fromJust) . takeWhile isJust . -    iterate ((=<<) simpleStep) $ Just (sizeExpr' e, e)--  simpleStep :: (Size, Expr) -> Maybe (Size, Expr)-  simpleStep t = do -    let chn = let ?first = True in step (snd t)-        chnn = let ?first = False in step =<< chn-        new = filter (\(x,_) -> x < fst t) . map (sizeExpr' &&& id) $ -                snd t: chn ++ chnn-    case new of-      [] -> Nothing-      (new':_) -> return new'--step :: (?first :: Bool) => Expr -> [Expr]-step e = nub $ rewrite rules e- -rewrite :: (?first :: Bool) => RewriteRule -> Expr -> [Expr]-rewrite rl e = case rl of-    Up r1 r2     -> let e'  = cut $ rewrite r1 e-                        e'' = rewrite r2 =<< e'-                    in if null e'' then e' else e''-    OrElse r1 r2 -> let e'  = rewrite r1 e-                    in if null e' then rewrite r2 e else e' -    Then r1 r2   -> rewrite r2 =<< nub (rewrite r1 e)-    Opt  r       -> e: rewrite r e-    If   p  r    -> if null (rewrite p e) then mzero else rewrite r e-    Hard r       -> if ?first then rewrite r e else mzero-    Or rs        -> (\x -> rewrite x e) =<< rs-    RR {}        -> rewDeep rl e-    CRR {}       -> rewDeep rl e-    Down {}      -> rewDeep rl e-    -  where -- rew = ...; rewDeep = ...--rewDeep :: (?first :: Bool) => RewriteRule -> Expr -> [Expr]-rewDeep rule e = rew rule e `mplus` case e of-    Var _ _    -> mzero-    Lambda _ _ -> error "lambda: optimizer only works for closed expressions"-    Let _ _    -> error "let: optimizer only works for closed expressions"-    App e1 e2  -> ((`App` e2) `map` rewDeep rule e1) `mplus`-                  ((e1 `App`) `map` rewDeep rule e2)--rew :: (?first :: Bool) => RewriteRule -> Expr -> [Expr]-rew (RR r1 r2) e = toMonadPlus $ fire r1 r2 e -rew (CRR r) e = toMonadPlus $ r e-rew (Or rs) e = (\x -> rew x e) =<< rs-rew (Down r1 r2) e-  = if null e'' then e' else e'' where-    e'  = cut $ rew r1 e-    e'' = rewDeep r2 =<< e'-rew r@(Then   {}) e = rewrite r e-rew r@(OrElse {}) e = rewrite r e-rew r@(Up     {}) e = rewrite r e-rew r@(Opt    {}) e = rewrite r e-rew r@(If     {}) e = rewrite r e-rew r@(Hard   {}) e = rewrite r e
+ Plugin/Pointful.hs view
@@ -0,0 +1,22 @@+-- Undo pointfree transformations. Plugin code derived from Pl.hs.+module Plugin.Pointful (theModule) where++import Plugin++import Lib.Pointful++type PfState = ()++PLUGIN Pointful++--type Pf = ModuleLB PfState++instance Module PointfulModule PfState where++    moduleCmds _ = ["pointful","pointy","repoint","unpointless","unpl","unpf"]++    moduleHelp _ _ = "pointful <expr>. Make code pointier."++    moduleDefState _ = return $ ()++    process _ _ _ _ rest = return (lines $ pointful rest)
Plugin/Poll.hs view
@@ -38,7 +38,7 @@ type Poll              = (Bool, [(Candidate, Count)]) type VoteState         = M.Map PollName Poll type VoteWriter        = VoteState -> LB ()-type Vote m a          = ModuleT VoteState m a+-- type Vote m a          = ModuleT VoteState m a  ------------------------------------------------------------------------ -- Define a serialiser@@ -84,7 +84,7 @@  ------------------------------------------------------------------------ -processCommand :: VoteState -> VoteWriter -> String -> [String] -> Vote LB String+processCommand :: VoteState -> VoteWriter -> String -> [String] -> LB String processCommand fm writer cmd dat = case cmd of      -- show all current polls@@ -133,7 +133,7 @@         Nothing -> "No such poll: " ++ show poll ++ " Use @poll-list to see the available polls."         Just p  -> show $ map fst (snd p) -addPoll :: VoteState -> VoteWriter -> String -> Vote LB String+addPoll :: VoteState -> VoteWriter -> String -> LB String addPoll fm writer poll =      case M.lookup (P.pack poll) fm of         Nothing -> do writer $ M.insert (P.pack poll) newPoll fm@@ -141,14 +141,14 @@         Just _  -> return $ "Poll " ++ show poll ++                              " already exists, choose another name for your poll" -addChoice :: VoteState -> VoteWriter -> String -> String -> Vote LB String+addChoice :: VoteState -> VoteWriter -> String -> String -> LB String addChoice fm writer poll choice = case M.lookup (P.pack poll) fm of     Nothing -> return $ "No such poll: " ++ show poll     Just _  -> do writer $ M.update (appendPoll choice) (P.pack poll) fm                   return $ "New candidate " ++ show choice ++                             ", added to poll " ++ show poll ++ "." -vote :: VoteState -> VoteWriter -> String -> String -> Vote LB String+vote :: VoteState -> VoteWriter -> String -> String -> LB String vote fm writer poll choice = case M.lookup (P.pack poll) fm of     Nothing          -> return $ "No such poll:" ++ show poll     Just (False,_)   -> return $ "The "++ show poll ++ " poll is closed, sorry !"@@ -166,14 +166,14 @@                      | otherwise = "Closed"             ppr (x,y) = x ++ "=" ++ show y -removePoll :: VoteState -> VoteWriter -> String -> Vote LB String+removePoll :: VoteState -> VoteWriter -> String -> LB String removePoll fm writer poll = case M.lookup (P.pack poll) fm of     Just (True,_)  -> return "Poll should be closed before you can remove it."     Just (False,_) -> do writer $ M.delete (P.pack poll) fm                          return $ "poll " ++ show poll ++ " removed."     Nothing        -> return $ "No such poll: " ++ show poll -closePoll :: VoteState -> VoteWriter -> String -> Vote LB String+closePoll :: VoteState -> VoteWriter -> String -> LB String closePoll fm writer poll = case M.lookup (P.pack poll) fm of     Nothing     -> return $ "No such poll: " ++ show poll     Just (_,p)  -> do writer $ M.update (const (Just (False,p))) (P.pack poll) fm
Plugin/Pretty.hs view
@@ -33,13 +33,14 @@ prettyCmd :: String -> ModuleLB (String -> IO String) prettyCmd rest =      let code = dropWhile (`elem` " \t>") rest-        modPrefix = "module Main where "-            ++ if "let" `isPrefixOf` code then "i = " else ""-        prefLen = length modPrefix-        result = case parseModule (modPrefix ++ code) of-            (ParseOk a)           -> doPretty a-            (ParseFailed loc msg) -> let (SrcLoc _ _ col) = loc in-                (show msg ++ " at column " ++ show (col - prefLen)) : []+        modPrefix1 = "module Main where "+        modPrefix2 = "module Main where __expr__ = "+        prefLen1 = length modPrefix1+        result = case (parseModule (modPrefix1 ++ code ++ "\n"), parseModule (modPrefix2 ++ code ++ "\n"))  of+            (ParseOk a, _)          -> doPretty a+            (_, ParseOk a)          -> doPretty a+            (ParseFailed loc msg,_) -> let (SrcLoc _ _ col) = loc in+                   (show msg ++ " at column " ++ show (col - prefLen1)) : []     in return result -- XXX will this work? No, spaces are compressed.  -- | calculates "desired" indentation and return pretty-printed declarations@@ -48,7 +49,7 @@ doPretty :: HsModule -> [String] doPretty (HsModule _ _ _ _ decls) =     let defaultLen = 4-        declLen (HsFunBind matches)   = maximum $ map matchLen matches+        declLen (HsFunBind mtches)   = maximum $ map matchLen mtches         declLen (HsPatBind _ pat _ _) = patLen pat         declLen _  = defaultLen         patLen (HsPVar nm) = nameLen nm@@ -63,8 +64,16 @@             caseIndent   = 4,             onsideIndent = declLen decl         }+        makeModeExp _ = defaultMode {+            doIndent     = 3,+            caseIndent   = 4,+            onsideIndent = 0+        }+        prettyDecl (HsPatBind _ (HsPVar (HsIdent "__expr__")) (HsUnGuardedRhs e) []) -- pretty printing an expression+                     = prettyPrintWithMode (makeModeExp e) e+        prettyDecl d = prettyPrintWithMode (makeMode d) d     -- FIXME: prefixing with hashes is done, because i didn't find a way     --   to disable the indentation filter of lambdabot only for this module...     in map (" "++) . lines . concat . intersperse "\n"         -- . map show $ decls-       . map (\d -> prettyPrintWithMode (makeMode d) d) $ decls+       . map prettyDecl $ decls
Plugin/Quote.hs view
@@ -3,31 +3,34 @@ -- module Plugin.Quote (theModule) where +import Plugin import Plugin.Quote.Fortune      (randFortune) import Plugin.Quote.Text -import Plugin- import qualified Data.Map as M import qualified Data.ByteString.Char8 as P  PLUGIN Quote -type Quotes = M.Map P.ByteString [P.ByteString]+type Key    = P.ByteString+type Quotes = M.Map Key [P.ByteString]  instance Module QuoteModule Quotes where-    moduleCmds           _ = ["quote", "remember", "ghc", "fortune"-                             ,"yow","arr","keal","b52s","brain","palomer"-                             ,"girl19", "v", "yhjulwwiefzojcbxybbruweejw"]+    moduleCmds           _ = ["quote", "remember", "forget", "ghc", "fortune"+                             ,"yow","arr","yarr","keal","b52s","brain","palomer"+                             ,"girl19", "v", "yhjulwwiefzojcbxybbruweejw", "protontorpedo"] +    moduleHelp _ "forget"  = "forget nick quote.  Delete a quote"     moduleHelp _ "fortune" = "fortune. Provide a random fortune"     moduleHelp _ "yow"     = "yow. The zippy man."     moduleHelp _ "arr"     = "arr. Talk to a pirate"+    moduleHelp _ "yarr"    = "yarr. Talk to a pirate"     moduleHelp _ "keal"    = "keal. Talk like Keal"     moduleHelp _ "ghc"     = "ghc. Choice quotes from GHC."     moduleHelp _ "b52s"    = "b52s. Anyone noticed the b52s sound a lot like zippy?"     moduleHelp _ "brain"   = "brain. Pinky and the Brain"     moduleHelp _ "palomer" = "palomer. Sound a bit like palomer on a good day."+    moduleHelp _ "protontorpedo" = "protontorpedo is silly"     moduleHelp _ "girl19"  = "girl19 wonders what \"discriminating hackers\" are."     moduleHelp _ "v"       = "let v = show v in v"     moduleHelp _ "yhjulwwiefzojcbxybbruweejw"@@ -38,21 +41,33 @@     moduleDefState  _       = return M.empty      process_ _ cmd s = case cmd of-          "remember" -> runRemember (dropSpace s)-          "quote"    -> runQuote    (dropSpace s)-          "ghc"      -> runQuote    "ghc"-          "fortune"  -> return `fmap` io (randFortune Nothing)-          "yow"      -> return `fmap` io (randFortune (Just "zippy"))-          "keal"     -> return `fmap` io (randomElem kealList)-          "arr"      -> return `fmap` io (randomElem arrList)-          "b52s"     -> return `fmap` io (randomElem b52s)-          "brain"    -> return `fmap` io (randomElem brain)-          "palomer"  -> return `fmap` io (randomElem palomer)-          "girl19"   -> return `fmap` io (randomElem girl19)-          "v"        -> return `fmap` io (randomElem notoriousV)+          "forget"        -> runForget   (dropSpace s)+          "remember"      -> runRemember (dropSpace s)+          "quote"         -> runQuote    (dropSpace s)+          "ghc"           -> runQuote    ("ghc " ++ dropSpace s)+          "fortune"       -> runit (randFortune Nothing)+          "yow"           -> runit (randFortune (Just "zippy"))++          "keal"          -> rand kealList+          "b52s"          -> rand b52s+          "brain"         -> rand (if "pondering" `isInfixOf` s then brainPondering else brain)+          "palomer"       -> rand palomer+          "girl19"        -> rand girl19+          "protontorpedo" -> rand protontorpedo+          "v"             -> rand notoriousV           "yhjulwwiefzojcbxybbruweejw"-                     -> return `fmap` io (randomElem notoriousV)+                          -> rand notoriousV +          -- See, you've got to understand the subtle distinction in pirate+          -- talk between arr and yarr! arr is something you say as an+          -- afermative where as yarr! is more like a greeting. (Or something)+          "arr"           -> rand arrList+          "yarr"          -> rand yarrList++        where+           runit k = return `fmap` io k+           rand = runit . randomElem+ help :: String help = "quote <nick>\nremember <nick> <quote>\n" ++        "Quote somebody, a random person, or save a memorable quote"@@ -64,36 +79,83 @@  -- error handling! runRemember :: String -> ModuleLB Quotes-runRemember str = do-    case break (== ' ') str of-        (_,[])    -> return ["Incorrect arguments to quote"]-        (nm,q') -> do let q = tail q'-                      withMS $ \fm writer -> do-                        let ss  = fromMaybe [] (M.lookup (P.pack nm) fm)-                            fm' = M.insert (P.pack nm) (P.pack q : ss) fm-                        writer fm'-                        return ["Done."]+runRemember str+    | null rest = return ["Incorrect arguments to quote"]+    | otherwise = withMS $ \fm writer -> do+        let ss  = fromMaybe [] (M.lookup (P.pack nm) fm)+            fm' = M.insert (P.pack nm) (P.pack q : ss) fm+        writer fm'+        r <- random confirmation+        box r+    where+        (nm,rest) = break isSpace str+        q         = tail rest +-- @forget, to remove a quote+runForget :: String -> ModuleLB Quotes+runForget str+    | null rest = return ["Incorrect arguments to quote"]+    | otherwise = withMS $ \fm writer -> do+        let ss  = fromMaybe [] (M.lookup (P.pack nm) fm)+            fm' = M.insert (P.pack nm) (delete (P.pack q) ss) fm+        writer fm'+        if P.pack q `elem` ss+            then return ["Done."]+            else return ["No match."]+    where+        (nm,rest) = break isSpace str+        q         = tail rest+ -- --  the @quote command, takes a user nm to choose a random quote from -- runQuote :: String -> ModuleLB Quotes-runQuote name' = do-    fm <- readMS-    if M.null fm then return ["No quotes yet."] else do+runQuote str = do+    st <- readMS+    io (search (P.pack nm) (P.pack pat) st)+  where (nm, p) = break isSpace str+        pat     = if null p then p else tail p -        let pnm = P.pack name'-            qs' = M.lookup pnm fm+search :: Key -> P.ByteString -> Quotes -> IO [String]+search key pat db+    | M.null db          = box "No quotes yet." -        (nm,qs) <- if not (P.null pnm)-                   then return (pnm,qs') -- (ByteString, Maybe [ByteString])-                   else do (nm',rs') <- io $ randomElem (M.toList fm) -- random person-                           return (nm', Just rs')-        case qs of-            Nothing   -> return [P.unpack nm ++ " hasn't said anything memorable"]-            Just msgs -> do msg <- io $ randomElem msgs-                            return $ if not (P.null pnm)-                                then ["  " ++ (P.unpack msg)]-                                else [(P.unpack nm)++" says: " ++ (P.unpack msg)]+    | P.null key         = do+        (key', qs) <- random (M.toList db) -- quote a random person+        box . display key' =<< random qs +    | P.null pat, Just qs <- mquotes =+        box . display key  =<< random qs +    | P.null pat         = match key allquotes++    | Just qs <- mquotes = match pat (zip (repeat key) qs)++    | otherwise          = do+        r <- random insult+        box $ "No quotes for this person. " ++ r++  where+    mquotes   = M.lookup key db+    allquotes = concat [ zip (repeat who) qs | (who, qs) <- M.assocs db ]++    match p ss = do+#if __GLASGOW_HASKELL__ >= 606+        re <- do res <- compile (compExtended + compIgnoreCase + compNoSub) 0 p+                 case res of+                    Left  err -> error $ "regex failed: " ++ show err+                    Right r   -> return r+#else+        let re = mkRegexWithOpts (P.unpack p) True True+#endif++        let rs = filter (matches re . snd) ss+        if null rs+            then do r <- random insult+                    box $ "No quotes match. " ++ r+            else do (who, saying) <- random rs+                    box $ P.unpack who ++ " says: " ++ P.unpack saying++    display k msg = (if P.null k then "  " else who ++ " says: ") ++ saying+          where saying = P.unpack msg+                who    = P.unpack k
Plugin/Quote/Fortune.hs view
@@ -12,10 +12,12 @@ import System.Directory import qualified Control.Exception as C (catch) +#ifndef mingw32_HOST_OS -- -- No good for win32 -- import System.Posix (isRegularFile, getFileStatus)+#endif  -- | The 'filelist' function returns a List of fortune files from the --   configured 'fortunePath' directory.@@ -51,5 +53,10 @@     Just fname -> fortuneRandom =<< (return (fortunePath config ++ fname))  -- | 'isFile' is a predicate wheter or not a given FilePath is a file.+#ifdef mingw32_HOST_OS isFile :: FilePath -> IO Bool+isFile = doesFileExist+#else+isFile :: FilePath -> IO Bool isFile = (isRegularFile `fmap`) . getFileStatus+#endif
Plugin/Quote/Text.hs view
@@ -24,6 +24,8 @@     ,"xml stands for \"xtremely mild lullaby\""     ,"woof"     ,"(_|_)"+    ,"I have news for you, it's pointless"+    ,"You're all nuts"     ]  -- | Some pirate quotes@@ -32,22 +34,14 @@     ["Avast!"     ,"Shiver me timbers!"     ,"Yeh scurvy dog..."-    ,"I heard andersca is a pirate"     ,"I'll keel haul ya fer that!"-    ,"I'd like to drop me anchor in her lagoon"-    ,"Well me 'earties, let's see what crawled out of the bung hole..."     ,"I want me grog!"     ,"Drink up, me 'earties"-    ,"Is that a hornpipe in yer pocket, or arr ya just happy ta see me?"-    ,"Get out of me way, yeh landlubber"     ,"Smartly me lass"     ,"Arrr!"     ,"Ahoy mateys"     ,"Aye"     ,"Aye Aye Cap'n"-    ,"This is the END for you, you gutter-crawling cur!"-    ,"May the clap make ye incapable of Cracking Jenny's Tea Cup."-    ,"Eat maggoty hardtack, ye unkempt, jenny frequentin', son of a gun."     ,"Swab the deck!"     ,"Keelhaul the swabs!"     ,"Yo ho ho, and a bottle of rum!"@@ -55,9 +49,47 @@     ,"Har de har har!"     ] +-- | More pirate quotes+yarrList :: [String]+yarrList =+    arrList +++    ["I heard andersca is a pirate"+    ,"I'd like to drop me anchor in her lagoon"+    ,"Well me 'earties, let's see what crawled out of the bung hole..."+    ,"Is that a hornpipe in yer pocket, or arr ya just happy ta see me?"+    ,"Get out o' me way, yeh landlubber"+    ,"Yarrr!"+    ,"This is the END for you, you gutter-crawling cur!"+    ,"May the clap make ye incapable of Cracking Jenny's Tea Cup."+    ,"Eat maggoty hardtack, ye unkempt, jenny frequentin', son of a gun."+    ,"What be a priate's favourite cheese?\nYarrlsburg!"+    ,"Where d' all t' pirates come from?\nGreat Yarrmouth!"+    ,"Prepare to be boarded!"+    ,"Gangway!"+    ,"Splice the Mainbrace!"+    ,"Arr! Me ship be the biggest brig in the port!"+    ,"Well Ahoy! thar."+    ]+ --+-- Stewie Griffin is great+--+stewieList :: [String]+stewieList =+    ["You. Fetch me my copy of the Wall Street Journal. You two, fight to the death."+    ,"Yes, I rather like this God fellow. He's very theatrical, you know, a pestilence here, a plague there. Omnipotence. Gotta get me some of that"+    ,"I've got a better idea. Let's go play \"swallow the stuff under the sink.\""+    ,"I've got an army to raise and I must get to Nicaragua. I require a window seat and an in-flight Happy Meal AND NO PICKLES. OH, GOD HELP YOU IF I FIND PICKLES"+    ,"Damn you, vile woman! Blast! What the deuce!"+    ,"Forecast for tomorrow; A few sprinkles of genius with a chance of doom."+    ]++-- -- Actual quotes from an asshat called Keal over Jan 12-14 2006. --+-- Reappared as OrangeKid, +-- 06.10.18:19:44:00 --- join: OrangeKid -- (n=TRK@unaffiliated/Keal) joined #haskell+-- kealList :: [String] kealList =     ["endian mirrors the decimal"@@ -90,6 +122,7 @@     ,"all i know is i have experienced my own death unhappening..."     ," what have you been smoking? you narrow minded Haskell user?"     ,"i use an 8088"+    ,"are there full body recognition files for sorting art?"     ,"my very first computer was an 80-0840"     ,"it is very easy to go off topic"     ,"someone needs to write a boids for haskell that emulates humans going on and off topic"@@ -149,6 +182,7 @@     ,"pork steaks taste like dick"     ,"i dont really eat vegetables unless cheese is a vegetable"     ,"the [nsa] even make light green both ways once"+    ,"i still dont understand how gci is supposed to do anything other than mathematics"     ]  --@@ -197,7 +231,10 @@     ,("Has it ever occurred to you, Pinklet, that your scarf is\n" ++       "constricting the bloodflow to your head?")     , "Are you pondering what I'm pondering?"-    , "But where are we going to find a duck and a hose at this hour?"+    ] ++ brainPondering+brainPondering :: [String]+brainPondering =+    [ "But where are we going to find a duck and a hose at this hour?"     , "But where will we find an open tattoo parlor at this time of night?"     , "Uh... yeah, Brain, but where are we going to find rubber pants our size?"     , "Uh, I think so, Brain, but balancing a family and a career ... ooh, it's all too much for me."@@ -228,7 +265,7 @@     , "I think so, Brain, but we're already naked."     , "I think so, Brain, but Lederhosen won't stretch that far."     , "Yeah, but I thought Madonna already had a steady bloke!"-    , "I think so, Brain?but how would we ever determine Sandra Bullock's shoe size?"+    , "I think so, Brain, but how would we ever determine Sandra Bullock's shoe size?"     , "I think so, Brain, but a codpiece made from a real fish would get smelly after a while, wouldn?t it?"     , "I think so, Commander Brain from Outer Space! But do we have time to grease the rockets?"     , "I think so, Doctor. But are these really the legs of a show girl?"@@ -236,7 +273,7 @@     , "I think so, Brain! But ruby-studded stockings would be mighty uncomfortable wouldn't they?"     , "I think so, Brain! How much deeper would the ocean be if there weren't sponges down there?"     , "I think so, Brain! But do I have what it take to be the 'Lord of the Dance'?"-    , "I think so, Brain, but I didn?t know 90210 was a real zip code! Will Tori be there?"+    , "I think so, Brain, but I didn't know 90210 was a real zip code! Will Tori be there?"     , "The game does not conclude until the woman with the eating disorder ululates."     ] @@ -267,4 +304,181 @@     ,show "\"#$%&'()*+,\""     ,"Exception: <<loop>>"     ,"Just 'J'"+    ]++--+-- A troll going by the names:+--+--  proton-gun tbon shemale_magic HeyObjects parnassus gavino+--  hypothesys octon ava-its-pssa mel-gibson java-or-no proton-gun+--  protontorpedo deathsstar gavino99 proton-weapon thumper9 star-trekio+--  differentActGetD howya-doin linux-fun boobhz booger perlIsBetter+--  ramserver newlambder bublle-war ion-cannon thailand-fan blaastaar+--+-- n=bo@pool-71-106-182-86.lsanca.dsl-w.verizon.net+-- n=root@masqrd.la.teampcs.com+-- n=gschuett@masqrd.la.teampcs.com+-- n=gschuett@68.183.75.2+-- n=gschuett@208.201.11.51+-- n=gschuett@4.38.41.141+--+-- Trolled on and off for 10 months+--+-- First appeared:+--  05.10.05:16:51:41 --- join: howya-doin (n=gschuett@208.201.11.51) joined #haskell+-- Last appeared:+--  06.08.14:11:48 -- mode/#haskell [+b *!*n=bo@*.lsanca.dsl-w.verizon.net] by dons+--+-- Reappeared a few weeks later from a new ip address.+-- +-- Reappeared:+-- 15:52 [freenode] -- ion-cannon [n=tits@pool-71-106-175-237.lsanca.dsl-w.verizon.net]+-- 15:52 [freenode] --  ircname  : wilt chamberlain+--+-- 19:55 -- mode/#haskell [+b *!*n=tits@*.lsanca.dsl-w.verizon.net] by -- dons+--+-- Reappeared: 06.11.28+--  10:34 [freenode] -- thailand-fan [n=bill@4.38.41.141]+--  10:34 [freenode] --  ircname  : bill gates+--  10:34 [freenode] --  channels : ##linux #archlinux +--+-- Reappeared: 06.12.08+--  blaastaar (n=gschuett@4.38.41.141) joined #haskell+--+-- +protontorpedo :: [String]+protontorpedo =+    [+-- comparing haskell+    "wil haskell make mroe more money?",+    "wil I make mroe $$ than learning java or APL or smalltalk or plt scheme or ruby or perl or clisp?",+    "why is haskell bette than java? java has a shitload of frameworks. its xrazy",+    "is haskell doomed to be a mysql driver?",+    "and haskell is not a lisp. correct? holy shit then m learning haskell",+    "is haskell better than APL or perl or clisp?",+    "ok is haskell a type of lisp?",+    "hakell is not lisp or ml right?",+    "how deos haskell differ from ml or lisp?",+    "what makes haskell more fun than say clisp?",+    "here is the big one: is it mroe prctical than say python?",+    "so can haskell do what perl does but simpler?",+    "so haskell is new and improved c?",+    "how does haskell compare to j2ee?",+    "how does j2ee compare to haskell?",+    "can haskell do same stuff as J2EE but nicer?",+    "is haskell able to outdo perl or python for web?",+    "how is smalltalk different from haskell?",+    "how does haskell compare to say java?",+    "can haskell outdo java and jboss n stuff?",+    "how does haskell compare to c++?",+    "how is haskell different than java?",+    "so haskell is different from lisp?",+    "how abut vs APL",+    "what is haskell?",+    "is it nicer than APL?",+    "is haskell nicer than clisp?",+    "what does haskell do better than java perl or ruby?",+    "is it a form of lisp?",+    "why haskell over lisp?",+    "why haskell over say clsip or smalltalk?",+    "so why would one prefer haskell to say clisp or smalltalk?",+    "why haskell over say smalltalk",+    "is haskell more powerful than perl? or scheme?",+    "is haskella lisp?",+    "so haskells better than smalltalk and clsip?",++-- more questions+    "what is the best absolute beginner utorial for haskell?",+    "Im wondering if there are uncharted business waters that haskell can enable, even if it is simply by not accepting norms",+    "so is haskell going to redo x windows and make it better?",+    "is haskell going to rewite linux and make it better?",+    "is there going to be a better dns server in haskell?",+    "can haskell be used to develop databases?",+    "evaluation seems ideal for banks who want to know global balances etc.",+    "what is so good about continuations/",+    "is it fun to program in haskell?",+    "paul graham said static typing and ML types fo lisp hurt exploratory progrmaming",+    "why did someone create haskell?",+    "can u build things fast in haskell?",+    "is functional progrmaming the same as object oriented?",+    "I read somewhere that large systms get confusing and haskell ends up a s a bunch of functions",+    "is haskell more powerful than any jedii?",+    "lazy makes macro not needed?",+    "wat is lazy evaluation?",+    "so this java guy I know says that java is the best when things get really complex and u need your apps do do real work",+    "how does haskell do with large systems?",+    "so with 100s of users adn different daabases haskell does fine?",+    "so if I learn haskell i can make cool interactive websites and get rich right?",+    "what echniques can be used to scael application in haskell?",+    "whera re the end user apps?",+    "why would u write a interpreter for perl in haskell?",+    "what Is writen in haskell that gets work done?",+    "so there is no database, monitoring system, web browser, webserver, or scheduling ssytem in haskell?",+    "is there a decent scheduler in haskell? how about a netwrok monitor?",+    "is functional ebtter than oo?",+    "cant u just have data in arrays and do operations using you prog lang?",+    "troll?",+    "cmon Im asking cool questions",+    "Im not a loser",+    "so given that how does haskell let one turn business calcualtion anreocrding of info into somethng liek a big spreadsheet?",+    " and is haskell ez to debug?",+    "am I cracked?",+    "hey guys can haskeel be used to produce fast webapps?",+    "does haskell sclae up to programming in the large?",+    "or does it become a mishmash of code?",+    "as u scale and complexity grows?",+    "so how do you use haskell tools to build large programs?",+    "whats a module?",+    "and haskell is general purpose?",+    "can I build a sales database with it?",+    "can I build something that lets laptop users sync contacts and client dta over the net?",+    "are you wealthy concultants?",+    "does haskel work one windows?",+    "is there an oo db in haskell?",+    "oleg?",+    "please expalin pure and lazy a little (im igonorant i know)?",+    "so haskell is free?",+    "how fast is the haskell web serve for dynamic content? siriam from scheme says the scheme one si FAT AS HEK",+    "how can haskell automate ftp?",+    "how do we automate ftp file transfers with haskell?",+    "what is a good way to handle the ftp transfer and reading of files to mysql?",+    "some dude called topmind says that oo is bs",+    "are objects kina just subroutines",+    "smalltalk is oo",+    "hu me/",+    "its bs dude",+    "that dude is selling u  a book",+    "look at smalltalk. they invented oo proramming",+    "The things I dotn get about relatinal databases is that they take wrok to maintain",+    "I got some info b 4 about how lazy eval makes macros not needed please expand...",+    "waht is this D&D",+    "syntax ur runing my high",+    "on the haskell site they compare haskell to a spreadsheet",+    "how would haskell solve the following gnarley problem: many client distributed accross the usa, transfers must take palce in the form of file transfer, and data must be read from files, and recorded, then other partners who apply taxes to this data and then give abck new files with taxes aded, then last transers to 4th parties who get us paid for the phone calls that are the product",+    "where was haskell during th internet boom?",+    "no I cant read online for long my eyes get fuzzy",+    "help please",+    "treid comon lisp. ansi common lisp bok by graham. it sucked",+    "I dont know any programming yet at 33 dream of learning ti and gettign rich",+    "windows is validating itelf a lot during ownloads altely",+    "why haskell over smalltalk? I thought smalltalked rocked",+    "can haskell do data transfer from box to box over sockets?",+    "is ghc bad for learning?",+    "does huge or ghc have more stuff?",+    "is it hard to set up n ready my pc for programming?",++-- statements+    "im such an asshole",+    "I hear from an essay by E raymod that perl is shitty for large projects",+    "ok so say I ftp files from some 50 remote servers now, and then read them inot mysql, then ftp back to an ohter 50 servers some info they read into thier informix db",+    "I personally emailed paul graham the lisp guy today after reading about python in E raymonds essay he metions ruby n python is u cant use lisp",+    "I had one guy tell me he was 16x as fast to develop something in smalltalk",+    "check otu squeak seems dope",+    "I have perl bok but saw haskell and am woner hey this is new and improved and seems powerful because MIT guy philip green says haskell adn lisp are only langs where u spend more tie thinking than coding",+    "paul graham said static typing is a problem for macros building",+    "I dont think tcl cn do that",+    "I am banned from like 6 rooms",+    "scheme, lisp, php, python, perl, tcl, al banned",+    "Im really only a bash person and even then Im tin",+    "i have a win xp box"     ]
Plugin/Search.hs view
@@ -11,6 +11,7 @@  import Plugin import Control.Monad            (mplus)+import qualified Text.Regex as R  PLUGIN Search @@ -23,7 +24,7 @@    ,("http://en.wikipedia.org/wiki/Special:Search?search=", "")),      ("gsite"-   ,("http://www.google.ca/search?hl=en&q=site%3A", "&btnI=I%27m+Feeling+Lucky"))+   ,("http://www.google.com/search?hl=en&q=site%3A", "&btnI=I%27m+Feeling+Lucky"))    ]  instance Module SearchModule () where@@ -33,8 +34,8 @@          "gsite"     -> "gsite <site> <expr>. Search <site> for <expr> using google"          "gwiki"     -> "wiki <expr>. Search (new) haskell.org wiki for <expr> using google."     moduleCmds      _   = "gwiki" : map fst engines-    process_ _ "gwiki" e = ((. dropSpace) . searchCmd) "gsite" ("haskell.org/haskellwiki/" ++ e)-    process_ _ s      e = ((. dropSpace) . searchCmd) s e+    process_ _ "gwiki" e = lift $ ((. dropSpace) . searchCmd) "gsite" ("haskell.org/haskellwiki" ++ e)+    process_ _ s       e = lift $ ((. dropSpace) . searchCmd) s e  ------------------------------------------------------------------------ @@ -68,15 +69,15 @@ extractConversion [] = error "conv: No response, something weird is up." extractConversion ls = (getConv $ last ls) >>= return . pipeline replaceFuncs     where-        regex1 = mkRegex "<font size=\\+1><b>"-        regex2 = mkRegex "</b>"+        regex1 = regex' "<font size=\\+1><b>"+        regex2 = regex' "</b>"          getConv a = do-            (_,_,s,_) <- matchRegexAll regex1 a-            (s',_,_,_) <- matchRegexAll regex2 s+            (_,_,s,_)  <- R.matchRegexAll regex1 a+            (s',_,_,_) <- R.matchRegexAll regex2 s             return s' -        searchAndReplace new regex = \s -> subRegex (mkRegex regex) s new+        searchAndReplace new re = \s -> R.subRegex (regex' re) s new         replaceFuncs = zipWith searchAndReplace                             [    "^",       "",      "x",                      ","]                             ["<sup>", "</sup>", "&#215;", "<font size=-2> </font>"]
Plugin/Seen.hs view
@@ -7,21 +7,26 @@ -- module Plugin.Seen (theModule) where +import Data.Binary+ import Plugin import Lib.AltTime-import Lib.Binary import Lib.Error         (tryError)+import Lib.Util          (lowerCaseString) -import qualified Message (Message, names, channels, nick, body)+import qualified Message as G (Message, names, channels, nick, packNick, unpackNick, Nick(..), body, lambdabotName, showNick, readNick)  import qualified Data.Map as M import qualified Data.ByteString.Char8 as P+import qualified Data.ByteString.Lazy as L  import System.Directory  import System.Time (normalizeTimeDiff) -- or export from AltTime.hs?  import Control.Monad       (unless, zipWithM_)+import Control.Arrow       (first)+import Text.Printf  PLUGIN Seen @@ -39,94 +44,91 @@  -- | 'UserStatus' keeps track of the status of a given Nick name. data UserStatus-        = Present LastSpoke [Channel]  -          -- ^ Records when the nick last spoke and that the nick is currently +        = Present    !LastSpoke [Channel]+          -- ^ Records when the nick last spoke and that the nick is currently           --   in [Channel].-        | NotPresent ClockTime StopWatch [Channel]+        | NotPresent !ClockTime !StopWatch [Channel]           -- ^ The nick is not present and was last seen at ClockTime in Channel.           --   The second argument records how much we've missed.-        | WasPresent ClockTime StopWatch LastSpoke [Channel]+        | WasPresent !ClockTime !StopWatch !LastSpoke [Channel]           -- ^ The bot parted a channel where the user was. The Clocktime           --   records the time and Channel the channel this happened in.           --   We also save the reliablility of our information and the           --   time we last heard the user speak.-        | NewNick Nick                 +        | NewNick !Nick           -- ^ The user changed nick to something new.     deriving (Show, Read) -data StopWatch = Stopped TimeDiff -               | Running ClockTime +data StopWatch = Stopped !TimeDiff+               | Running !ClockTime         deriving (Show,Read) -type SeenState = M.Map Nick UserStatus-type Seen m a = ModuleT SeenState m a- +type SeenState = (MaxMap, SeenMap)+type SeenMap   = M.Map Nick UserStatus+type MaxMap    = M.Map String Int+type Seen m a  = ModuleT SeenState m a+ ------------------------------------------------------------------------  -- ok, since this module generates quite a lot of state, what we'll do -- is use Binary to pack this value, since Read is sooo slow and exe (as -- my gf says :) +{- instance Binary (M.Map Nick UserStatus) where     put_ bh m = put_ bh (M.toList m)     get bh    = do x <- get bh ; return (M.fromList x)+-}  instance Binary StopWatch where-    put_ bh (Stopped td) = do-        putByte bh 0-        put_ bh td--    put_ bh (Running ct) = do-        putByte bh 1-        put_ bh ct+    put (Stopped td) = putWord8 0 >> put td+    put (Running ct) = putWord8 1 >> put ct -    get bh = do -        h <- getWord8 bh+    get = do+        h <- getWord8         case h of-                0 -> do x <- get bh ; return (Stopped x)-                1 -> do x <- get bh ; return (Running x)-                _ -> error "Seen.StopWatch.get"+            0 -> liftM Stopped get+            1 -> liftM Running get+            _ -> error "Seen.StopWatch.get"  instance Binary UserStatus where-    put_ bh (Present spoke chans) = do-        putByte bh 0-        put_ bh spoke-        put_ bh chans-    put_ bh (NotPresent ct sw chans) = do-        putByte bh 1-        put_ bh ct-        put_ bh sw-        put_ bh chans-    put_ bh (WasPresent ct sw spoke chans) = do-        putByte bh 2-        put_ bh ct-        put_ bh sw-        put_ bh spoke-        put_ bh chans-    put_ bh (NewNick n) = do-        putByte bh 3-        put_ bh n+    put (Present spoke chans) = do+        putWord8 0+        put spoke+        put chans+    put (NotPresent ct sw chans) = do+        putWord8 1+        put ct+        put sw+        put chans+    put (WasPresent ct sw spoke chans) = do+        putWord8 2+        put ct+        put sw+        put spoke+        put chans+    put (NewNick n) = putWord8 3 >> put n -    get bh = do-        h <- getWord8 bh+    get = do+        h <- getWord8         case h of             0 -> do-                x <- get bh-                y <- get bh+                x <- get+                y <- get                 return (Present x y)             1 -> do-                x <- get bh-                y <- get bh-                z <- get bh+                x <- get+                y <- get+                z <- get                 return (NotPresent x y z)             2 -> do-                x <- get bh-                y <- get bh-                z <- get bh-                a <- get bh+                x <- get+                y <- get+                z <- get+                a <- get                 return (WasPresent x y z a)-            3 -> do -                x <- get bh+            3 -> do+                x <- get                 return (NewNick x)              _ -> error "Seen.UserStatus.get"@@ -138,110 +140,138 @@ --  instance Module SeenModule SeenState where-    moduleHelp _ _      = "seen <user>. Report if a user has been seen by the bot"-    moduleCmds _        = ["seen"]-    moduleDefState _    = return M.empty+    moduleHelp _ "seen"  = "seen <user>. Report if a user has been seen by the bot"+    moduleHelp _ "users" = "users [chan]. Report the maximum number of users seen in a channel, and active users in the last 30 minutes"+    moduleCmds _         = ["users","seen"]+    moduleDefState _     = return (M.empty,M.empty) -    process _ msg _ _ rest = do-         seenFM <- readMS-         now    <- io getClockTime-         return [unlines $ getAnswer msg rest seenFM now]+    -- first step towards tracking the maximum number of users+    process _ msg chan "users" rest = do+         (m, seenFM) <- readMS+         s <- io getClockTime+         let who = G.packNick $ lcNick $ if null rest then chan else G.readNick msg rest+             now = length [ () | (_,Present _ chans) <- M.toList seenFM+                               , who `elem` chans ] +             n = case M.lookup (P.unpack who) m of Nothing -> 1; Just n' -> n'++             active = length [() | (_,st@(Present _ chans)) <- M.toList seenFM+                                 , who `elem` chans && isActive st ]++             isActive (Present (Just (ct,_td)) _cs) = recent ct+             isActive _                             = False++             recent t = normalizeTimeDiff (diffClockTimes s t) < gap_minutes+             gap_minutes = TimeDiff 0 0 0 0 30 0 0 -- 30 minutes++         return $!+           [concat+              [ "Maximum users seen in ", G.showNick msg $ G.unpackNick who, ": "+              , show n+              , ", currently: ", show now+              , printf " (%0.1f%%)" (100 * (fromIntegral now    / fromIntegral n) :: Double)+              , ", active: ", show active+              , printf " (%0.1f%%)" (100 * (fromIntegral active / fromIntegral now) :: Double)+              ]+            ]++    process _ msg target _      rest = do+         (_,seenFM) <- readMS+         now        <- io getClockTime+         let (txt,safe) = first unlines (getAnswer msg rest seenFM now)+         if safe || not ("#" `isPrefixOf` G.nName target)+             then return [txt]+             else do lift $ ircPrivmsg (G.nick msg) txt+                     return []+     moduleInit _        = do+      wSFM <- bindModule2 withSeenFM       zipWithM_ ircSignalConnect-        ["JOIN", "PART", "QUIT", "NICK", "353",      "PRIVMSG"] $ map withSeenFM+        ["JOIN", "PART", "QUIT", "NICK", "353",      "PRIVMSG"] $ map wSFM         [joinCB, partCB, quitCB, nickCB, joinChanCB, msgCB]        -- This magically causes the 353 callback to be invoked :)-      tryError $ send_ . Message.names =<< ircGetChannels+      -- this is broken...+      lift $ tryError $ send . G.names "freenode" . map G.nName =<< ircGetChannels        -- and suck in our state. We read directly from the handle, to avoid copying       b <- io $ doesFileExist "State/seen"-      when b $ do-          s <- io $ do h  <- openFile "State/seen" ReadMode-                       bh <- openBinIO_ h-                       st <- get bh-                       hClose h-                       return st-          writeMS s+      when b $ io (do+            s <- io (P.readFile "State/seen")+            let ls = L.fromChunks [s]+            return (decode ls)) >>= writeMS      moduleExit _ = do-      chans <- ircGetChannels+      chans <- lift $ ircGetChannels       unless (null chans) $ do             ct    <- io getClockTime-            modifyMS $ botPart ct (map P.pack chans)+            modifyMS $ \(n,m) -> (n, botPart ct (map G.packNick chans) m)          -- and write out our state:-      withMS $ \s _ -> do-          io $ do h  <- openFile "State/seen" WriteMode-                  bh <- openBinIO_ h-                  put_ bh s-                  hClose h-          return ()+      withMS $ \s _ -> io ( encodeFile "State/seen" s) ---------------------------------------------------------------------------- | The bot's name, lowercase-myname :: String-myname = lowerCaseString (name config)+lcNick :: G.Nick -> G.Nick+lcNick (G.Nick svr nck) = G.Nick svr (lowerCaseString nck) -getAnswer :: Message.Message a => a -> String -> SeenState -> ClockTime -> [String]-getAnswer msg rest seenFM now -  | null lcnick = +------------------------------------------------------------------------+getAnswer :: G.Message a => a -> String -> SeenMap -> ClockTime -> ([String], Bool)+getAnswer msg rest seenFM now+  | null nick' =        let people  = map fst $ filter isActive $ M.toList seenFM-           isActive (_nick,state) = case state of +           isActive (_nick,state) = case state of                (Present (Just (ct,_td)) _cs) -> recent ct                _ -> False            recent t = normalizeTimeDiff (diffClockTimes now t) < gap_minutes            gap_minutes = TimeDiff 0 0 0 0 15 0 0-       in ["Lately, I have seen " ++ (if null people then "nobody" -               else listToStr "and" (map P.unpack people)) ++ "."]+       in (["Lately, I have seen " ++ (if null people then "nobody"+                else listToStr "and" (map upAndShow people)) ++ "."], False) -  | lcnick == myname = -        case M.lookup (P.pack lcnick) seenFM of-            Just (Present _ cs) -> -                ["Yes, I'm here. I'm in " ++ listToStr "and" (map P.unpack cs)]+  | pnick == G.lambdabotName msg =+        case M.lookup (G.packNick pnick) seenFM of+            Just (Present _ cs) ->+                (["Yes, I'm here. I'm in " ++ listToStr "and" (map upAndShow cs)], True)             _ -> error "I'm here, but not here. And very confused!" -  | length lcnick > 0 && head lcnick == '#' =-       let channel = lcnick-           people  = map fst $ filter inChan $ M.toList seenFM-           inChan (_nick,state) = case state of -               (Present (Just _) cs) -                  -> P.pack channel `elem` cs+  | head (G.nName pnick) == '#' =+       let people  = map fst $ filter inChan $ M.toList seenFM+           inChan (_nick,state) = case state of+               (Present (Just _) cs)+                  -> G.packNick pnick `elem` cs                _ -> False-       in ["In "++channel++" I can see "+       in (["In "++nick'++" I can see "             ++ (if null people then "nobody"    -- todo, how far back does this go?-               else listToStr "and" (map P.unpack people)) ++ "."]+               else listToStr "and" (map upAndShow people)) ++ "."], False) -  | otherwise        = case M.lookup (P.pack lcnick) seenFM of-      Just (Present mct cs)            -> nickPresent mct (map P.unpack cs)-      Just (NotPresent ct td chans)    -> nickNotPresent ct td (map P.unpack chans)-      Just (WasPresent ct sw _ chans)  -> nickWasPresent ct sw (map P.unpack chans)-      Just (NewNick newnick)           -> nickIsNew (P.unpack newnick)-      _ -> ircMessage ["I haven't seen ", nick, "."]+  | otherwise        = ((case M.lookup (G.packNick pnick) seenFM of+      Just (Present mct cs)            -> nickPresent mct (map upAndShow cs)+      Just (NotPresent ct td chans)    -> nickNotPresent ct td (map upAndShow chans)+      Just (WasPresent ct sw _ chans)  -> nickWasPresent ct sw (map upAndShow chans)+      Just (NewNick newnick)           -> nickIsNew newnick+      _ -> ircMessage ["I haven't seen ", nick, "."]), True)   where     -- I guess the only way out of this spagetty hell are printf-style responses.+    upAndShow = G.showNick msg . G.unpackNick     nickPresent mct cs = ircMessage [       if you then "You are" else nick ++ " is", " in ",       listToStr "and" cs, ".",       case mct of         Nothing          -> concat [" I don't know when ", nick, " last spoke."]         Just (ct,missed) -> prettyMissed (Stopped missed)-               (concat [" I last heard ", nick, " speak ", +               (concat [" I last heard ", nick, " speak ",                         lastSpoke {-, ", but "-}])                (" Last spoke " ++ lastSpoke)           where lastSpoke = clockDifference ct      ]     nickNotPresent ct missed chans = ircMessage [-       "I saw ", nick, " leaving ", listToStr "and" chans, " ", +       "I saw ", nick, " leaving ", listToStr "and" chans, " ",        clockDifference ct, prettyMissed missed ", and " ""      ]     nickWasPresent ct sw chans = ircMessage [        "Last time I saw ", nick, " was when I left ",        listToStr "and" chans , " ", clockDifference ct,        prettyMissed sw ", and " ""]-    nickIsNew newnick = ircMessage [if you then "You have" else nick++" has", -        " changed nick to ", us, "."] ++ getAnswer msg us seenFM now +    nickIsNew newnick = ircMessage [if you then "You have" else nick++" has",+        " changed nick to ", us, "."] ++ fst (getAnswer msg us seenFM now)       where          findFunc pstr = case M.lookup pstr seenFM of@@ -249,16 +279,16 @@             Just _               -> pstr             Nothing              -> error "SeenModule.nickIsNew: Nothing" -        us = P.unpack $ findFunc (P.pack $ lowerCaseString newnick)+        us = upAndShow $ findFunc newnick      ircMessage = return . concat     nick' = firstWord rest-    you   = nick' == Message.nick msg+    you   = pnick == lcNick (G.nick msg)     nick  = if you then "you" else nick'-    lcnick = lowerCaseString nick'-    clockDifference past +    pnick = lcNick $ G.readNick msg nick'+    clockDifference past       | all (==' ') diff = "just now"-      | otherwise        = diff ++ " ago" +      | otherwise        = diff ++ " ago"       where diff = timeDiffPretty . diffClockTimes now $ past      prettyMissed (Stopped _) ifMissed _     = ifMissed ++ "."@@ -266,26 +296,28 @@  {-     prettyMissed (Stopped missed) ifMissed _-      | missedPretty <- timeDiffPretty missed, +      | missedPretty <- timeDiffPretty missed,         any (/=' ') missedPretty       = concat [ifMissed, "I have missed ", missedPretty, " since then."]      prettyMissed _ _ ifNotMissed = ifNotMissed ++ "." -} +-- | extract channels from message as packed, lower cased, strings.+msgChans :: G.Message a => a -> [Channel]+msgChans msg = map (G.packNick . lcNick) $ G.channels msg  -- | Callback for when somebody joins. If it is not the bot that joins, record --   that we have a new user in our state tree and that we have never seen the --   user speaking.-joinCB :: Message.Message a => a -> SeenState -> ClockTime -> Nick -> Either String SeenState+joinCB :: G.Message a => a -> SeenMap -> ClockTime -> Nick -> Either String SeenMap joinCB msg fm _ct nick-  | nick == (P.pack myname) = Right fm-  | otherwise               = Right $ insertUpd (updateJ Nothing (map P.pack $ Message.channels msg)) -                                         nick newInfo fm-  where newInfo = Present Nothing (map P.pack $ Message.channels msg)-+  | nick == (G.packNick $ G.lambdabotName msg) = Right fm+  | otherwise = Right $! insertUpd (updateJ Nothing chans) nick newInfo fm+  where newInfo = Present Nothing chans+        chans = msgChans msg -botPart :: ClockTime -> [Channel] -> SeenState -> SeenState+botPart :: ClockTime -> [Channel] -> SeenMap -> SeenMap botPart ct cs fm = fmap botPart' fm where     botPart' (Present mct xs) = case xs \\ cs of         [] -> WasPresent ct (startWatch ct zeroWatch) mct cs@@ -297,12 +329,12 @@     botPart' us = us  -- | when somebody parts-partCB :: Message.Message a => a -> SeenState -> ClockTime -> Nick -> Either String SeenState+partCB :: G.Message a => a -> SeenMap -> ClockTime -> Nick -> Either String SeenMap partCB msg fm ct nick-  | nick == (P.pack myname) = Right $ botPart ct (map P.pack $ Message.channels msg) fm+  | nick == (G.packNick $ G.lambdabotName msg) = Right $ botPart ct (msgChans msg) fm   | otherwise      = case M.lookup nick fm of       Just (Present mct xs) ->-        case xs \\ (map P.pack $ Message.channels msg) of+        case xs \\ (msgChans msg) of           [] -> Right $ M.insert nick                  (NotPresent ct zeroWatch xs)                  fm@@ -312,68 +344,82 @@       _ -> Left "someone who isn't known parted"  -- | when somebody quits-quitCB :: Message.Message a => a -> SeenState -> ClockTime -> Nick -> Either String SeenState +quitCB :: G.Message a => a -> SeenMap -> ClockTime -> Nick -> Either String SeenMap quitCB _ fm ct nick = case M.lookup nick fm of     Just (Present _ct xs) -> Right $ M.insert nick (NotPresent ct zeroWatch xs) fm     _ -> Left "someone who isn't known has quit"  -- | when somebody changes his\/her name-nickCB :: Message.Message a => a -> SeenState -> ClockTime -> Nick -> Either String SeenState+nickCB :: G.Message a => a -> SeenMap -> ClockTime -> Nick -> Either String SeenMap nickCB msg fm _ nick = case M.lookup nick fm of-   Just status -> let fm' = M.insert nick (NewNick $ P.pack newnick) fm+   Just status -> let fm' = M.insert nick (NewNick lcnewnick) fm                   in  Right $ M.insert lcnewnick status fm'    _           -> Left "someone who isn't here changed nick"    where-   newnick = drop 1 $ head (Message.body msg)-   lcnewnick = P.pack $ lowerCaseString newnick+   newnick = drop 1 $ head (G.body msg)+   lcnewnick = G.packNick $ lcNick $ G.readNick msg newnick  -- use IRC.IRC.channels? -- | when the bot join a channel-joinChanCB :: Message.Message a => a -> SeenState -> ClockTime -> Nick -> Either String SeenState-joinChanCB msg fm now _nick +joinChanCB :: G.Message a => a -> SeenMap -> ClockTime -> Nick -> Either String SeenMap+joinChanCB msg fm now _nick     = Right $ fmap (updateNP now chan) $ foldl insertNick fm chanUsers   where-    l = Message.body msg-    chan = P.pack $ l !! 2-    chanUsers = map P.pack $ words (drop 1 (l !! 3)) -- remove ':'+    l = G.body msg+    chan = G.packNick $ lcNick $ G.readNick msg $ l !! 2+    chanUsers = map (G.packNick . lcNick . G.readNick msg) $ words (drop 1 (l !! 3)) -- remove ':'     insertNick fm' u = insertUpd (updateJ (Just now) [chan])-                                    (P.pack . lowerCaseString . P.unpack .  unUserMode $ u)+                                    (G.packNick . unUserMode . lcNick . G.unpackNick $ u)                                     (Present Nothing [chan])                                     fm'  -- | when somebody speaks, update their clocktime-msgCB :: Message.Message a => a -> SeenState -> ClockTime -> Nick -> Either String SeenState+msgCB :: G.Message a => a -> SeenMap -> ClockTime -> Nick -> Either String SeenMap msgCB _ fm ct nick =   case M.lookup nick fm of-    Just (Present _ xs) -> Right $ +    Just (Present _ xs) -> Right $       M.insert nick (Present (Just (ct, noTimeDiff)) xs) fm     _ -> Left "someone who isn't here msg us"  -- misc. functions-unUserMode :: Nick -> Nick-unUserMode nick = P.dropWhile (`elem` "@+") nick+unUserMode :: G.Nick -> G.Nick+unUserMode nick = G.Nick (G.nTag nick) (dropWhile (`elem` "@+") $ G.nName nick) --- | Callbacks are only allowed to use a limited knowledge of the world. --- 'withSeenFM' is (up to trivial isomorphism) a monad morphism from the +-- | Callbacks are only allowed to use a limited knowledge of the world.+-- 'withSeenFM' is (up to trivial isomorphism) a monad morphism from the -- restricted --   'ReaderT (IRC.Message, ClockTime, Nick) (StateT SeenState (Error String))' -- to the --   'ReaderT IRC.Message (Seen IRC)' -- monad.-withSeenFM :: Message.Message a => ( a -> SeenState -> ClockTime -> Nick-                  -> Either String SeenState)-              -> a-              -> Seen LB ()-withSeenFM f msg = do -    let nick = P.pack . lowerCaseString . P.unpack . unUserMode . P.pack . Message.nick $ msg-    withMS $ \state writer -> do+withSeenFM :: G.Message a+           => (a -> SeenMap -> ClockTime -> Nick -> Either String SeenMap)+           -> a+           -> Seen LB ()++withSeenFM f msg = do+    let nick = G.packNick . lcNick . G.nick $ msg+    withMS $ \(maxUsers,state) writer -> do       ct <- io getClockTime       case f msg state ct nick of-          Right newstate -> writer newstate           Left _         -> return () -- debugStrLn $ "SeenModule> " ++ err+          Right newstate -> do +                let curUsers = length $! [ () | (_,Present _ chans) <- M.toList state+                                         , P.pack chan `elem` chans ]++                    newMax = case M.lookup chan maxUsers of+                        Nothing -> M.insert chan curUsers maxUsers+                        Just  n -> if n < curUsers+                                        then M.insert chan curUsers maxUsers+                                        else maxUsers++                newMax `seq` newstate `seq` writer (newMax, newstate)++    where chan = P.unpack . G.packNick . lcNick . head . G.channels $! msg+ -- | Update the user status.-updateJ :: Maybe ClockTime -- ^ If the bot joined the channel, the time that +updateJ :: Maybe ClockTime -- ^ If the bot joined the channel, the time that                            --   happened, i.e. now.   -> [Channel]             -- ^ The channels the user joined.   -> UserStatus            -- ^ The old status@@ -410,10 +456,9 @@ zeroWatch = Stopped noTimeDiff  startWatch :: ClockTime -> StopWatch -> StopWatch-startWatch now (Stopped td) = Running $ td `addToClockTime` now+startWatch now (Stopped td) = Running $! td `addToClockTime` now startWatch _ alreadyStarted = alreadyStarted  stopWatch :: ClockTime -> StopWatch -> StopWatch-stopWatch now (Running t)  = Stopped $ t `diffClockTimes` now+stopWatch now (Running t)  = Stopped $! t `diffClockTimes` now stopWatch _ alreadyStopped = alreadyStopped-
Plugin/Slap.hs view
@@ -4,15 +4,15 @@ module Plugin.Slap (theModule) where  import Plugin-import qualified Message (nick)+import qualified Message (nick, showNick)  PLUGIN Quote  instance Module QuoteModule () where-    moduleCmds _           = ["slap"]+    moduleCmds _           = ["slap", "smack"]     moduleHelp _ _         = "slap <nick>. Slap someone amusingly."     process _ msg _ _ rest = ios $ slapRandom (if rest == "me" then sender else rest)-       where sender = Message.nick msg+       where sender = Message.showNick msg $ Message.nick msg  ------------------------------------------------------------------------ @@ -22,8 +22,43 @@  slapList :: [String -> String] slapList =-    [("/me slaps " ++)+    [(\x -> "/me slaps " ++ x)     ,(\x -> "/me smacks " ++ x ++ " about with a large trout")-    ,("/me beats up " ++)-    ,("why on earth would I slap " ++)+    ,(\x -> "/me beats up " ++ x)+    ,(\x -> "/me pokes " ++ x ++ " in the eye")+    ,(\x -> "why on earth would I slap " ++ x ++ "?")+    ,(\x -> "*SMACK*, *SLAM*, take that " ++ x ++ "!")+    ,(\_ -> "/me activates her slap-o-matic...")+    ,(\x -> "/me orders her trained monkeys to punch " ++ x)+    ,(\x -> "/me smashes a lamp on " ++ possesiveForm x ++ " head")+    ,(\x -> "/me hits " ++ x ++ " with a hammer, so he breaks into a thousand pieces")+    ,(\x -> "/me throws some pointy lambdas at " ++ x)+    ,(\x -> "/me loves " ++ x ++ ", so no slapping")+    ,(\x -> "/me would never hurt " ++ x ++ "!")+    ,(\x -> "go slap " ++ x ++ " yourself")+    ,(\_ -> "I don't perform such side effects on command!")+    ,(\_ -> "stop telling me what to do")+    ,(\x -> "/me clobbers " ++ x ++ " with an untyped language")+    ,(\x -> "/me pulls " ++ x ++ " through the Evil Mangler")+    ,(\x -> "/me secretly deletes " ++ possesiveForm x ++ " source code")+    ,(\x -> "/me places her fist firmely on " ++ possesiveForm x ++ " jaw")+    ,(\x -> "/me locks up " ++ x ++ " in a Monad")+    ,(\x -> "/me submits " ++ possesiveForm x ++ " email address to a dozen spam lists")+    ,(\x -> "/me moulds " ++ x ++ " into a delicous cookie, and places it in her oven")+    ,(\_ -> "/me will count to five...")+    ,(\x -> "/me jabs " ++ x ++ " with a C pointer")+    ,(\x -> "/me is overcome by a sudden desire to hurt " ++ x)+    ,(\x -> "/me karate-chops " ++ x ++ " into two equally sized halves")+    ,(\x -> "Come on, let's all slap " ++ x)+    ,(\x -> "/me pushes " ++ x ++ " from his chair")+    ,(\x -> "/me hits " ++ x ++ " with an assortment of kitchen utensils")+    ,(\x -> "/me slaps " ++ x ++ " with a slab of concrete")+    ,(\x -> "/me puts on her slapping gloves, and slaps " ++ x)     ]++-- | The possesive form of a name, "x's"+possesiveForm :: String -> String+possesiveForm [] = []+possesiveForm x+ | last x == 's' = x ++ "'"+ | otherwise     = x ++ "'s"
+ Plugin/Small.hs view
@@ -0,0 +1,75 @@+--+-- Copyright (c) 6 DonStewart - http://www.cse.unsw.edu.au/~dons+-- GPL version 2 or later (see http://www.gnu.org/copyleft/gpl.html)+--++--+-- | Test a property with SmallCheck+--+module Plugin.Small where++import Plugin+import Lib.Parser+import qualified Text.Regex as R++PLUGIN Small++instance Module SmallModule () where+    moduleCmds   _     = ["scheck"]+    moduleHelp _ _     = "scheck <expr>\nYou have SmallCheck and 3 seconds. Test something."+    process _ _ to _ s = ios80 to (check s)++binary :: String+binary = "./smallcheck"++check :: String -> IO String+check src = case parseExpr src of+    Left  e -> return e+    Right _ -> run binary src $ expandTab . dropWhile (=='\n') . dropNL . clean_++clean_ :: String -> String+clean_ s+    |  no_io      `matches'`    s = "No IO allowed\n"+    |  terminated `matches'`    s = "Terminated\n"+    |  hput       `matches'`    s = "Terminated\n"+    |  stack_o_f  `matches'`    s = "Stack overflow\n"+    |  loop       `matches'`    s = "Loop\n"+    |  undef      `matches'`    s = "Undefined\n"+    |  type_sig   `matches'`    s = "Add a type signature\n"++    | Just (_,m,_,_) <- ambiguous  `R.matchRegexAll` s = m+    | Just (_,_,b,_) <- inaninst   `R.matchRegexAll` s = clean_ b+    | Just (_,_,b,_) <- irc        `R.matchRegexAll` s = clean_ b+    | Just (_,m,_,_) <- nomatch    `R.matchRegexAll` s = m+    | Just (_,m,_,_) <- notinscope `R.matchRegexAll` s = m+    | Just (_,m,_,_) <- hsplugins  `R.matchRegexAll`  s = m+    | Just (a,_,_,_) <- columnnum  `R.matchRegexAll`  s = a+    | Just (a,_,_,_) <- extraargs  `R.matchRegexAll`  s = a+    | Just (_,_,b,_) <- filename'  `R.matchRegexAll`  s = clean_ b+    | Just (a,_,b,_) <- filename   `R.matchRegexAll`  s = a ++ clean_ b+    | Just (a,_,b,_) <- filepath   `R.matchRegexAll`   s = a ++ clean_ b+    | Just (a,_,b,_) <- runplugs   `R.matchRegexAll`  s = a ++ clean_ b++    | otherwise      = s++    where+        -- s/<[^>]*>:[^:]: //+        type_sig   = regex' "add a type signature that fixes these type"+        no_io      = regex' "No instance for \\(Show \\(IO"+        terminated = regex' "waitForProc"+        stack_o_f  = regex' "Stack space overflow"+        loop       = regex' "runplugs: <<loop>>"+        irc        = regex' "\n*<irc>:[^:]*:[^:]*:\n*"+        filename   = regex' "\n*<[^>]*>:[^:]*:\\?[^:]*:\\?\n* *"+        filename'  = regex' "/tmp/.*\\.hs[^\n]*\n"+        filepath   = regex' "\n*/[^\\.]*.hs:[^:]*:\n* *"+        undef      = regex' "Prelude.undefined"+        ambiguous  = regex' "Ambiguous type variable `a\' in the constraints"+        runplugs   = regex' "runplugs: "+        notinscope = regex' "Variable not in scope:[^\n]*"+        hsplugins  = regex' "Compiled, but didn't create object"+        extraargs  = regex' "[ \t\n]*In the [^ ]* argument"+        columnnum  = regex' " at <[^\\.]*\\.[^\\.]*>:[^ ]*"+        nomatch    = regex' "Couldn't match[^\n]*\n"+        inaninst   = regex' "^[ \t]*In a.*$"+        hput       = regex' "<stdout>: hPutStr"
+ Plugin/Source.hs view
@@ -0,0 +1,40 @@+--+-- Plugin.Source+-- Display source for specified identifiers+--+module Plugin.Source (theModule) where++import Plugin+import Lib.Util+import qualified Data.Map as M+import qualified Data.ByteString.Char8 as P+import Data.ByteString.Char8 (pack,ByteString)++PLUGIN Source++type Env = M.Map ByteString ByteString++instance Module SourceModule Env where+    moduleCmds _     = ["src"]+    moduleHelp _ _   = help++    -- all the hard work is done to build the src map.+    -- uses a slighly custom Map format+    moduleSerialize _= Just . readOnly $ M.fromList . map pair . splat . P.lines . gunzip+        where+            pair (a:b) = (a, P.unlines b)+            splat []   = []+            splat s    = a : splat (tail b) where (a,b) = break P.null s++    fprocess_ _ _ key = readMS >>= \env -> case fetch key env of+        _ | M.null env -> box $ pack "No source in the environment yet"+        _ | P.null key -> box $ pack help+        Nothing        -> box . P.pack . ("Source not found. " ++) =<< io (random insult)+        Just s         -> box s++fetch :: ByteString -> M.Map ByteString ByteString -> Maybe ByteString+fetch x m = M.lookup x m `mplus`+            M.lookup (P.concat [P.singleton '(', x, P.singleton ')']) m++help :: String+help = "src <id>. Display the implementation of a standard function"
Plugin/Spell.hs view
@@ -8,15 +8,36 @@ module Plugin.Spell where  import Plugin+import qualified Text.Regex as R  PLUGIN Spell -instance Module SpellModule () where-    moduleCmds   _  = ["spell"]-    moduleHelp _ _  = "spell <word>. Show spelling of word"-    process_ _ _ [] = return ["No word to spell."]-    process_ _ _ s  = (return . showClean . take 5) `fmap` liftIO (spell s)+instance Module SpellModule Bool where+    moduleCmds   _   = ["spell", "spell-all"]+    modulePrivs  _   = ["nazi-on", "nazi-off"]+    moduleHelp _ _   = "spell <word>. Show spelling of word"+    moduleDefState _ = return False +    process_ _ "spell" [] = box "No word to spell."+    process_ _ "spell" s  = (return . showClean . take 5) `fmap` liftIO (spell s)++    process_ _ "spell-all" [] = box "No phrase to spell."+    process_ _ "spell-all" s  = liftIO (spellingNazi s)++    process_ _ "nazi-on"  _ = on  >> box "Spelling nazi engaged."+    process_ _ "nazi-off" _ = off >> box "Spelling nazi disengaged."++    contextual _ _ _ txt      = do+        alive <- readMS+        if alive then liftIO $ spellingNazi txt+                 else return []++on :: ModuleUnit Bool+on  = writeMS True++off :: ModuleUnit Bool+off = writeMS False+ binary :: String binary = "aspell" @@ -24,6 +45,18 @@ args = ["pipe"]  --+-- | Find the first misspelled word in the input line, and return plausible+-- output.+--+spellingNazi :: String -> IO [String]+spellingNazi lin = fmap (take 1 . concat) (mapM correct (words lin))+    where correct word = do+            var <- take 5 `fmap` spell word+            return $ if null var || any (equating' lowerCaseString word) var+                then []+                else ["Did you mean " ++ listToStr "or" var ++ "?"]+          equating' f x y = f x == f y+-- -- | Return a list of possible spellings for a word -- 'String' is a word to check the spelling of. --@@ -69,10 +102,9 @@  clean'' :: String -> String clean'' s-    | Just (_,_,m,_) <- pat `matchRegexAll` s = m+    | Just (_,_,m,_) <- pat `R.matchRegexAll` s = m     | otherwise = s-    where-        pat  = mkRegex "[^:]*: "    -- drop header+    where pat  = regex' "[^:]*: "    -- drop header  -- -- Alternate dictionaries, currently just lambdabot's. The idea was to
Plugin/State.hs view
@@ -9,9 +9,26 @@ PLUGIN State  instance Module StateModule String where-    moduleCmds      _ = ["state"]+    moduleCmds      _ = [] -- ["state","++"]     moduleHelp    _ _ = "state [expr]. Get or set a state variable."     moduleDefState  _ = return "This page intentionally left blank."     moduleSerialize _ = Just stdSerial-    process_  _ _ []  = withMS $ \s _ -> return $ if null s then [] else [s]-    process_ _ _ t    = withMS $ \_ w -> w t >> return [t]+    process_  _ _ []      = withMS $ \s _ -> return $ if null s then [] else [s]+    process_ _ "state" t  = withMS $ \_ w -> w t >> return [t]+    process_ _ "++"    t  = withMS $ \s w -> w s >> return [s++t]++{-++An example of scripting lambdabot. Implementing Rock/paper/scissors:++20:07  dons:: ?state (\xs -> case last (init xs) of '1' -> "rock"; '2' -> "paper"; '3' -> "scissors")+20:07  lambdabot:: (\xs -> case last (init xs) of '1' -> "rock"; '2' -> "paper"; '3' -> "scissors")++20:08  dons:: now, compose another plugin, with this state++20:08  dons:: ?. read . run . ++ . show dice 1d3+20:08  lambdabot::  paper+20:08  dons:: ?. read . run . ++ . show dice 1d3+20:08  lambdabot::  rock++-}
Plugin/System.hs view
@@ -5,19 +5,26 @@  import Plugin import Lib.AltTime-import qualified Message (Message, joinChannel, partChannel)-import qualified Data.Map as M       (Map,keys,fromList,lookup,union)+import qualified Message (Message, Nick, joinChannel, partChannel, server, readNick)+import qualified Data.Map as M       (Map,keys,fromList,lookup,union,insert,delete) -import Control.Monad.State      (MonadState(get), gets)+import Control.Monad.State      (MonadState(get, put), gets)  PLUGIN System -instance Module SystemModule ClockTime where+instance Module SystemModule (ClockTime, TimeDiff) where     moduleCmds   _   = M.keys syscmds     modulePrivs  _   = M.keys privcmds     moduleHelp _ s   = fromMaybe defaultHelp (M.lookup s $ syscmds `M.union` privcmds)-    moduleDefState _ = io getClockTime     process      _   = doSystem+    moduleDefState _ = flip (,) noTimeDiff `fmap` io getClockTime+    moduleSerialize  = const $ Just stdSerial+    moduleInit _     = do (_, d) <- readMS+                          t      <- liftIO getClockTime+                          writeMS (t, d)+    moduleExit _     = do (initial, d) <- readMS+                          now          <- liftIO getClockTime+                          writeMS (initial, max d (diffClockTimes now initial))  ------------------------------------------------------------------------ @@ -25,8 +32,9 @@ syscmds = M.fromList        [("listchans",   "Show channels bot has joined")        ,("listmodules", "listmodules. Show available plugins")+       ,("listservers", "listservers. Show current servers")        ,("list",        "list [module|command]\n"++-                        "show all commands or command for [module]")+                        "show all commands or command for [module]. http://www.cse.unsw.edu.au/~dons/lambdabot/COMMANDS")        ,("echo",        "echo <msg>. echo irc protocol string")        ,("uptime",      "uptime. Show uptime")] @@ -37,6 +45,10 @@        ,("part",        "part <channel>")        ,("msg",         "msg <nick or channel> <msg>")        ,("quit",        "quit [msg], have the bot exit with msg")+       ,("listall",     "list all commands")+       ,("flush",       "flush. flush state to disk")+       ,("admin",       "admin [+|-] nick. change a user's admin status.")+       ,("ignore",      "ignore [+|-] nick. change a user's ignore status.")        ,("reconnect",   "reconnect to server")]  ------------------------------------------------------------------------@@ -44,43 +56,61 @@ defaultHelp :: String defaultHelp = "system : irc management" -doSystem :: Message.Message a => a -> String -> [Char] -> [Char] -> ModuleLB ClockTime-doSystem msg target cmd rest = get >>= \s -> case cmd of-+doSystem :: Message.Message a => a -> Message.Nick -> [Char] -> [Char] -> ModuleLB (ClockTime, TimeDiff)+doSystem msg _ cmd rest = get >>= \s -> case cmd of   "listchans"   -> return [pprKeys (ircChannels s)]   "listmodules" -> return [pprKeys (ircModules s) ]-  "list" -        | null rest -> case target of-              ('#':_) -> return ["list [module|command]. " ++ -                                 "Where modules is one of:\n" ++ pprKeys (ircModules s)]-              _       -> listAll-        | otherwise -> listModule rest >>= return . (:[])+  "listservers" -> return [pprKeys (ircServerMap s)]+  "listall"     -> lift listAll+  "list"| null rest -> return ["http://www.cse.unsw.edu.au/~dons/lambdabot/COMMANDS"]+        | otherwise -> lift $ listModule rest >>= return . (:[])    ------------------------------------------------------------------------    --TODO error handling-  "join"  -> send_ (Message.joinChannel rest) >> return []        -- system commands-  "leave" -> send_ (Message.partChannel rest) >> return []-  "part"  -> send_ (Message.partChannel rest) >> return []+   -- system commands+  "join"  -> lift $ send (Message.joinChannel (Message.readNick msg rest)) >> return []+  "leave" -> lift $ send (Message.partChannel (Message.readNick msg rest)) >> return []+  "part"  -> lift $ send (Message.partChannel (Message.readNick msg rest)) >> return []     -- writes to another location:-  "msg"   -> ircPrivmsg tgt (Just txt') >> return []+  "msg"   -> lift $ ircPrivmsg (Message.readNick msg tgt) txt' >> return []                   where (tgt, txt) = breakOnGlue " " rest                         txt'       = dropWhile (== ' ') txt -  "quit" -> do ircQuit $ if null rest then "requested" else rest-               return []+  "quit" -> lift $ do ircQuit (Message.server msg) $ if null rest then "requested" else rest+                      return [] -  "reconnect" -> do ircReconnect $ if null rest then "request" else rest-                    return []+  "reconnect" -> lift $ do ircReconnect (Message.server msg) $ if null rest then "request" else rest+                           return []    "echo" -> return [concat ["echo; msg:", show msg, " rest:", show rest]] +  "flush" -> lift $ do flushModuleState+                       return []++  "admin" -> do let pu = ircPrivilegedUsers s+                pu' <- case rest of '+':' ':_ -> return $ M.insert nck True pu+                                    '-':' ':_ -> return $ M.delete nck pu+                                    _         -> fail "@admin: invalid usage"+                put (s {ircPrivilegedUsers = pu'})+                return []+      where nck = Message.readNick msg (drop 2 rest)++  "ignore" -> do let iu = ircIgnoredUsers s+                 iu' <- case rest of '+':' ':_ -> return $ M.insert nck True iu+                                     '-':' ':_ -> return $ M.delete nck iu+                                     _         -> fail "@ignore: invalid usage"+                 put (s {ircIgnoredUsers = iu'})+                 return []+      where nck = Message.readNick msg (drop 2 rest)+   "uptime" -> do-          loaded <- readMS-          now    <- io getClockTime-          let diff = timeDiffPretty $ now `diffClockTimes` loaded-          return ["uptime: " ++ diff]+          (loaded, m) <- readMS+          now         <- io getClockTime+          let diff = now `diffClockTimes` loaded+          return ["uptime: "           ++ timeDiffPretty diff +++                  ", longest uptime: " ++ timeDiffPretty (max diff m)]  ------------------------------------------------------------------------ @@ -99,7 +129,8 @@         let cmds = moduleCmds m         privs <- gets ircPrivCommands         let cmds' = cmds \\ privs -- don't display privledged commands+        name' <- getName         return . concat $ if null cmds'-                          then [?name, " has no visible commands"]-                          else [?name, " provides: ", showClean cmds']+                          then [name', " has no visible commands"]+                          else [name', " provides: ", showClean cmds'] 
Plugin/Tell.hs view
@@ -55,11 +55,10 @@ import Message import Plugin -type Nick        = String -- | Was it @tell or @ask that was the original command? data NoteType    = Tell | Ask deriving (Show, Eq, Read) -- | The Note datatype. Fields self-explanatory.-data Note        = Note { noteSender   :: String, +data Note        = Note { noteSender   :: Nick,                           noteContents :: String,                            noteTime     :: ClockTime,                           noteType     :: NoteType }@@ -83,10 +82,10 @@     process _ _ _ "print-notices" _ = liftM ((:[]) . show) readMS      -- | Clear notes.-    process _ _ _ "purge-notices" args = do+    process _ msg _ "purge-notices" args = do         case words args of           [] -> writeMS M.empty-          ns -> mapM_ clearMessages ns+          ns -> mapM_ (clearMessages . readNick msg) ns         return ["Messages purged."]      -- | Clear a user's notes@@ -96,9 +95,9 @@     -- | Check whether a user has any messages     process _ msg _ "messages?" _  = do       let sender = nick msg-      ms <- getMessages sender+      ms <- getMessages msg sender       case ms of-        Just _ -> doRemind sender+        Just _ -> doRemind msg sender         Nothing   -> return ["Sorry, no messages today."]      -- | Write down a note@@ -109,7 +108,7 @@      -- | Give a user their messages     process _ msg _ "messages" _ =-      do msgs <- getMessages $ nick msg+      do msgs <- getMessages msg $ nick msg          let res = fromMaybe ["You don't have any new messages."] msgs          clearMessages (nick msg)          return res@@ -120,7 +119,7 @@       let sender = nick msg       remp <- needToRemind sender       if remp-         then doRemind sender+         then doRemind msg sender          else return []  -- | Lookup table for documentation@@ -143,15 +142,15 @@           ++ "specify a nick.")]  -- | Take a note and the current time, then display it-showNote :: ClockTime -> Note -> String-showNote time note = res+showNote :: Message m => m -> ClockTime -> Note -> String+showNote msg time note = res     where diff         = time `diffClockTimes` noteTime note           ago          = case timeDiffPretty diff of                            [] -> "less than a minute"                            pr -> pr           action       = case noteType note of Tell -> "said"; Ask -> "asked"           res          = printf "%s %s %s ago: %s"-                           (noteSender note) action ago (noteContents note)+                           (showNick msg $ noteSender note) action ago (noteContents note)  -- | Is it less than a day since we last reminded this nick they've got messages? needToRemind :: Nick -> Telling Bool@@ -177,15 +176,15 @@                          to (Nothing, [note]))  -- | Return a user's notes, or Nothing if they don't have any-getMessages :: Nick -> Telling (Maybe [String])-getMessages n = do +getMessages :: Message m => m -> Nick -> Telling (Maybe [String])+getMessages msg n = do    st   <- readMS   time <- io getClockTime   case M.lookup n st of     Just (_, msgs) -> do       -- update the last time we told this person they had messages       writeMS $ M.insert n (Just time, msgs) st-      return . Just $ map (showNote time) msgs+      return . Just $ map (showNote msg time) msgs     Nothing -> return Nothing  -- | Clear a user's messages.@@ -199,19 +198,19 @@ doTell :: Message m => String -> m -> NoteType -> Telling [String] doTell args msg ntype = do    let args'     = words args-      recipient = head args'+      recipient = readNick msg (head args')       sender    = nick msg       rest      = unwords $ tail args'       res | sender    == recipient   = Left "You can tell yourself!"-          | recipient == name config = Left "Nice try ;)"+          | recipient == lambdabotName msg = Left "Nice try ;)"           | otherwise                = Right "Consider it noted."   when (isRight res) (writeDown recipient sender rest ntype)   return [unEither res]  -- | Remind a user that they have messages.-doRemind :: Nick -> Telling [String]-doRemind sender = do -  ms  <- getMessages sender+doRemind :: Message m => m -> Nick -> Telling [String]+doRemind msg sender = do +  ms  <- getMessages msg sender   now <- io getClockTime   modifyMS (M.update (Just . first (const $ Just now)) sender)   return $ case ms of@@ -220,6 +219,6 @@                      if length msgs > 1                        then ("messages", "them") else ("message", "it")                in [printf "%s: You have %d new %s. '/msg %s @messages' to read %s."-                          sender (length msgs) messages (name config) pronoun+                          (showNick msg sender) (length msgs) messages (showNick msg $ lambdabotName msg) pronoun                    :: String]              Nothing -> []
Plugin/Todo.hs view
@@ -6,7 +6,7 @@ module Plugin.Todo (theModule) where  import Plugin-import qualified Message (nick)+import Message (Message, nick, packNick, unpackNick, showNick) import qualified Data.ByteString.Char8 as P  PLUGIN Todo@@ -29,29 +29,29 @@     process _ msg _ cmd rest = do        todoList <- readMS        case cmd of-           "todo"        -> getTodo todoList rest+           "todo"        -> getTodo msg todoList rest            "todo-add"    -> addTodo sender rest            "todo-delete" -> delTodo rest -        where sender = Message.nick msg+        where sender = Message.packNick $ Message.nick msg  -- | Print todo list-getTodo :: TodoState -> String -> ModuleLB TodoState-getTodo todoList [] = return [formatTodo todoList]-getTodo _ _         = error "@todo has no args, try @todo-add or @list todo"+getTodo :: Message.Message m => m -> TodoState -> String -> ModuleLB TodoState+getTodo msg todoList [] = return [formatTodo msg todoList]+getTodo _ _ _           = error "@todo has no args, try @todo-add or @list todo"   -- | Pretty print todo list-formatTodo :: [(P.ByteString, P.ByteString)] -> String-formatTodo [] = "Nothing to do!"-formatTodo todoList =-    unlines $ map (\(n::Int, (idea, nick)) -> concat $ -            [ show n,". ",P.unpack nick,": ",P.unpack idea ]) $+formatTodo :: Message.Message m => m -> [(P.ByteString, P.ByteString)] -> String+formatTodo _ [] = "Nothing to do!"+formatTodo msg todoList =+    unlines $ map (\(n::Int, (idea, nick_)) -> concat $ +            [ show n,". ",showNick msg $ unpackNick nick_,": ",P.unpack idea ]) $                 zip [0..] todoList   -- | Add new entry to list-addTodo :: String -> String -> ModuleLB TodoState+addTodo :: P.ByteString -> String -> ModuleLB TodoState addTodo sender rest = do -    modifyMS (++[(P.pack rest, P.pack sender)])+    modifyMS (++[(P.pack rest, sender)])     return ["Entry added to the todo list"]  -- | Delete an entry from the list
Plugin/Topic.hs view
@@ -8,7 +8,7 @@ module Plugin.Topic (theModule) where  import Plugin-import qualified Message (setTopic)+import Message (Message, setTopic, Nick, readNick) import qualified Data.Map as M  import Control.Monad.State (gets)@@ -35,16 +35,16 @@                    "topic-cons", "topic-snoc",                    "topic-tail", "topic-init", "topic-null"] -  process_ _ "topic-cons" text = alterTopic chan (topic_item :)+  process _ msg _ "topic-cons" text = lift $ alterTopic msg chan (topic_item :)         where (chan, topic_item) = splitFirstWord text -  process_ _ "topic-snoc" text = alterTopic chan (snoc topic_item)+  process _ msg _ "topic-snoc" text = lift $ alterTopic msg chan (snoc topic_item)         where (chan, topic_item) = splitFirstWord text -  process_ _ "topic-tail" chan = alterTopic chan tail-  process_ _ "topic-init" chan = alterTopic chan init-  process_ _ "topic-null" chan = send (Just (Message.setTopic chan "[]")) >> return []-  process_ _ "topic-tell" chan = lookupTopic chan $ \maybetopic -> return $+  process _ msg _ "topic-tail" chan = lift $ alterTopic msg chan tail+  process _ msg _ "topic-init" chan = lift $ alterTopic msg chan init+  process _ msg _ "topic-null" chan = lift $ send (Message.setTopic (readNick msg chan) "[]") >> return []+  process _ msg _ "topic-tell" chan = lift $ lookupTopic (readNick msg chan) $ \maybetopic -> return $         case maybetopic of             Just x  -> [x]             Nothing -> ["Do not know that channel"]@@ -55,27 +55,30 @@ --   proceeds to look up the channel topic for the channel given, returning --   Just t or Nothing to the modifier function which can then decide what --   to do with the topic-lookupTopic :: String                        -- ^ Channel+lookupTopic :: Nick                          -- ^ Channel             -> (Maybe String -> LB [String]) -- ^ Modifier function             -> LB [String] lookupTopic chan f = gets (\s -> M.lookup (mkCN chan) (ircChannels s)) >>= f --- | 'alterTopic' takes a sender, a channel and an altering function.+-- | 'alterTopic' takes a message, a channel and an altering function. --   Then it alters the topic in the channel by the altering function, --   returning eventual problems back to the sender.-alterTopic :: String                 -- ^ Channel+alterTopic :: Message a+           => a                      -- ^ Original messesg+           -> String                 -- ^ Channel name            -> ([String] -> [String]) -- ^ Modifying function            -> LB [String]-alterTopic chan f =-  let p maybetopic =+alterTopic msg chan f =+  let chan' = readNick msg chan+      p maybetopic =         case maybetopic of           Just x -> case reads x of-                [(xs, "")] -> do send . Just $ Message.setTopic chan (show $ f $ xs)+                [(xs, "")] -> do send $ Message.setTopic chan' (show $ f $ xs)                                  return []                 [(xs, r)] | length r <= 2-                  -> do send . Just $ Message.setTopic chan (show $ f $ xs)+                  -> do send $ Message.setTopic chan' (show $ f $ xs)                         return ["ignoring bogus characters: " ++ r]                  _ -> return ["Topic does not parse. Should be of the form [\"...\",...,\"...\"]"]           Nothing -> return ["I do not know the channel " ++ chan]-   in lookupTopic chan p+   in lookupTopic chan' p
Plugin/Type.hs view
@@ -20,6 +20,7 @@ module Plugin.Type where  import Plugin+import qualified Text.Regex as R  PLUGIN Type @@ -27,10 +28,16 @@      moduleCmds        _  = ["type", "kind"]      moduleHelp _ "kind"  = "kind <type>. Return the kind of a type"      moduleHelp _ _       = "type <expr>. Return the type of a value"-     process_ _ s expr = flip query_ghci expr $ case s of+     process_ _ s expr = lift $ flip query_ghci expr $ case s of                                                     "type" -> ":t"                                                     "kind" -> ":k" +     contextual  _ _ _ text = case () of+        _| ":t " `isPrefixOf` text -> lift $ query_ghci ":t" expr+         | ":k " `isPrefixOf` text -> lift $ query_ghci ":k" expr+         | otherwise               -> return []+         where expr = drop 3 text+ --     In accordance with the KISS principle, the plan is to delegate all --     the hard work! To get the type of foo, pipe @@ -41,7 +48,7 @@  signature_regex :: Regex signature_regex-    = mkRegexWithOpts+    = R.mkRegexWithOpts       "^(\\*?[A-Z][_a-zA-Z0-9]*(\\*?[A-Z][_a-zA-Z0-9]*)*>)? *(.*[       -=:].*)"       True True @@ -75,38 +82,30 @@ --     through IRC.  -----     We first strip 7 leading lines, which is the GHCi logo, then the final line,---     which is the last prompt, before filtering out the lines that match our regex,+--     We filtering out the lines that match our regex, --     selecting the last subset match on each matching line before finally concatting --     the whole lot together again. ----- TODO, just use ghci -v0--- extract_signatures :: String -> String extract_signatures output-        = removeExp . concat . intersperse " " . map (dropWhile isSpace . expandTab) .-          mapMaybe ((>>= last') . matchRegex signature_regex) .-          reverse . drop 1 . reverse . drop 7 . lines $ output+        = reverse . removeExp . reverse .+          unwords . map (dropWhile isSpace . expandTab) .+          mapMaybe ((>>= last') . R.matchRegex signature_regex) .+          lines $ output         where         last' [] = Nothing         last' xs = Just $ last xs          removeExp :: String -> String-        removeExp (' ':':':':':' ':xs) = xs-        removeExp xs = case lex xs of-          [("(",ys)] -> removeExp $ stripParens 1 ys-          [("","")]  -> []-          [(_,ys)]   -> removeExp ys-          _          -> error "invalid ghci output: unexpected lex behavior"--        stripParens :: Int -> String -> String-        stripParens 0 xs = xs-        stripParens n xs = case lex xs of-          [("(",ys)] -> stripParens (n+1) ys-          [(")",ys)] -> stripParens (n-1) ys-          [("","")]  -> error "invalid ghci output: open parenthesis"-          [(_,ys)]   -> stripParens n     ys-          _          -> error "invalid ghci output: unexpected lex behavior"+        removeExp [] = []+        removeExp xs = removeExp' 0 xs+        +        removeExp' :: Int -> String -> String+        removeExp' 0 (' ':':':':':' ':_) = []+        removeExp' n ('(':xs)            = '(':removeExp' (n+1) xs+        removeExp' n (')':xs)            = ')':removeExp' (n-1) xs+        removeExp' n (x  :xs)            = x  :removeExp'  n    xs+        removeExp' _ []                  = error "invalid ghci output: no type signature"  -- --     With this the command handler can be easily defined using popen:@@ -115,34 +114,89 @@ -- query_ghci' :: String -> String -> IO String query_ghci' cmd expr = do-       (output, errors, _) <- popen (ghci config) ["-fglasgow-exts","-fno-th"]+       (output, errors, _) <- popen (ghci config) ["-v0","-fglasgow-exts","-fno-th","-iscripts"]                                        (Just (context ++ command cmd (stripComments expr)))        let ls = extract_signatures output        return $ if null ls-                then unlines . take 3 . lines . expandTab . cleanRE $ errors -- "bzzt" +                then unlines . take 3 . filter (not . null) . map cleanRE2 .+                     lines . expandTab . cleanRE . filter (/='\r') $ errors -- "bzzt"                  else ls   where-     context = concatMap (\m -> ":m + "++m++"\n") $-                    prehier ++ datas ++ qualifieds ++ controls ++ other+     context = ":l L\n" ++ (concatMap (\m -> ":m + "++m++"\n") $+                    prehier ++ datas ++ qualifieds ++ controls ++ other ++ extras) -     other      = ["Text.Printf"]+     other      =+        ["Text.Printf"+        ,"Text.PrettyPrint.HughesPJ"]+      prehier    = ["Char", "List", "Maybe", "Numeric", "Random" ]+      qualifieds = []-     datas   = map ("Data." ++) [-                    "Array",-                    "Bits", "Bool", "Char", "Dynamic", "Either",-                    "Graph", "Int", "Ix", "List",-                    "Maybe", "Ratio", "Tree", "Tuple", "Typeable", "Word"-                  ]-     controls = map ("Control." ++) ["Monad", "Monad.State", "Monad.Reader", "Monad.Fix", "Arrow"] -     cleanRE :: String -> String+     datas   = map ("Data." ++)+        ["Array"+        ,"Bits"+        ,"Bool"+        ,"Char"+        ,"Complex"+        ,"Dynamic"+        ,"Either"+        ,"Eq"+        ,"Fixed"+    --  ,"Foldable"+    --  ,"Function"+    --  ,"Generics"+        ,"Graph"+        ,"Int"+    --  ,"IntMap"+    --  ,"IntSet"+        ,"Ix"+        ,"List"+    --  ,"Map"+        ,"Maybe"+        ,"Monoid"+        ,"Ord"+        ,"Ratio"+    --  ,"Set"+        ,"Tree"+        ,"Tuple"+        ,"Typeable"+        ,"Word"+        ]+     extras   = [] -- ["L"]++     controls = map ("Control." ++)+        ["Monad"+        ,"Monad.Cont"+        ,"Monad.Error"+        ,"Monad.Identity"+        ,"Monad.List"+        ,"Monad.RWS"+        ,"Monad.Reader"+        ,"Monad.State"+        ,"Monad.Trans"+        ,"Monad.Writer"+        ,"Monad.Fix"+        ,"Monad.Instances"+        ,"Applicative"+        ,"Arrow"+    --  ,"Arrow.Transformer"+    --  ,"Arrow.Transformer.All"+    --  ,"Arrow.Operations"+        ,"Parallel"+        ,"Parallel.Strategies"+        ]++     cleanRE, cleanRE2 :: String -> String      cleanRE s-        | Just _         <- notfound `matchRegex` s = "Couldn\'t find qualified module.\nMaybe you\'re using the wrong syntax: Data.List.(\\\\) instead of (Data.List.\\\\)?"-        | Just (_,_,b,_) <- ghci_msg `matchRegexAll`  s = b+        | Just _         <- notfound `R.matchRegex` s = "Couldn\'t find qualified module."+        | Just (_,_,b,_) <- ghci_msg `R.matchRegexAll`  s = b         | otherwise      = s-     ghci_msg = mkRegex "<interactive>:[^:]*:[^:]*: ?"-     notfound = mkRegex "Failed to load interface"+     cleanRE2 s+        | Just (_,_,b,_) <- ghci_msg `R.matchRegexAll`  s = b+        | otherwise      = s+     ghci_msg = R.mkRegex "<interactive>:[^:]*:[^:]*: ?"+     notfound = R.mkRegex "Failed to load interface"  query_ghci :: String -> String -> LB [String] query_ghci y z = ios (query_ghci' y z)
+ Plugin/UnMtl.hs view
@@ -0,0 +1,180 @@+----------------------------------------------------------------------+-- |+-- Module      : Plugin.UnMtl+-- Copyright   : Don Stewart, Lennart Kolmodin 2007, Twan van Laarhoven 2008+-- License     : GPL-style (see LICENSE)+-- +-- Unroll the MTL monads with your favorite bot! +--+----------------------------------------------------------------------++module Plugin.UnMtl where++import Control.Monad.Error ()++import Language.Haskell.Syntax+import Language.Haskell.Parser+import Lib.Parser (prettyPrintInLine)++import Plugin as P++PLUGIN UnMtl++instance P.Module UnMtlModule () where+    moduleCmds   _ = ["unmtl"]+    moduleHelp _ _ = "unroll mtl monads"+    process_ _ _ mtl =+        return $ [ either ("err: "++) prettyPrintInLine (mtlParser mtl) ]++-----------------------------------------------------------+-- 'PType' wrapper type++data PMonad a = PMonad+       { pResult :: a                      -- The result (trsnsformed type)+       , pError  :: Maybe String           -- An error message?+       , pFun    :: Maybe (PType -> PType) -- A type function+       }++type PType = PMonad HsType++-- A monad instance so we get things like liftM and sequence for free+instance Monad PMonad where+    return t = PMonad t Nothing Nothing+    m >>= g  = let x = g (pResult m)+               in PMonad (pResult x) (pError m `mplus` pError x) Nothing++-----------------------------------------------------------+-- Lifiting function types++type P = PType++lift0 :: P                            -> HsType -> P+lift1 :: (P -> P)                     -> HsType -> P+lift2 :: (P -> P -> P)                -> HsType -> P+lift3 :: (P -> P -> P -> P)           -> HsType -> P+lift4 :: (P -> P -> P -> P -> P)      -> HsType -> P+lift5 :: (P -> P -> P -> P -> P -> P) -> HsType -> P++lift0 f _ = f+lift1 f n = mkPfun n (lift0 . f)+lift2 f n = mkPfun n (lift1 . f)+lift3 f n = mkPfun n (lift2 . f)+lift4 f n = mkPfun n (lift3 . f)+lift5 f n = mkPfun n (lift4 . f)++mkPfun :: HsType -> (PType -> HsType -> PType) -> PType+mkPfun n cont = PMonad n (Just msg) (Just fun)+  where fun p = cont p (HsTyApp n (pResult p))+        msg = "`" ++ prettyPrintInLine n ++ "' is not applied to enough arguments" ++ full fun ['A'..'Z'] "/\\"+        full p (x:xs) l = case p (con [x]) of+                   PMonad{pFun    = Just p'} -> full p' xs l'+                   PMonad{pError  = Just _}  -> "."+                   PMonad{pResult = t }      -> ", giving `" ++ init l' ++ ". " ++ prettyPrintInLine t ++ "'"+          where l' = l ++ [x] ++ " "++-----------------------------------------------------------+-- Helpers for constructing types++infixr 5 -->+infixl 6 $$++-- Function type+(-->) :: PType -> PType -> PType+a --> b = liftM2 cu a b++cu :: HsType -> HsType -> HsType+cu (HsTyTuple xs) y = foldr HsTyFun y xs+cu a b = HsTyFun a b++-- Type application:+--   If we have a type function, use that+--   Otherwise use HsTyApp, but check for stupid errors+($$) :: PType -> PType -> PType+($$) PMonad{ pFun=Just f } x = f x+($$) f x = PMonad+         { pResult = HsTyApp (pResult f) (pResult x)+         , pError  = pError f `mplus` -- ignore errors in x, the type constructor f might have a higher kind and ignore x+                      if isFunction (pResult f) then Nothing else+                            Just $ "`" ++ prettyPrintInLine (pResult f) ++ "' is not a type function."+         , pFun    = Nothing+         }+  where+    isFunction (HsTyFun _ _) = False+    isFunction (HsTyTuple _) = False+    isFunction _             = True++con, var :: String -> PType+con = return . HsTyCon . UnQual . HsIdent+var = return . HsTyVar . HsIdent++tuple :: [PType] -> PType+tuple = liftM (HsTyTuple . concatMap unpack) . sequence+    where+    unpack (HsTyTuple xs) = xs+    unpack x = [x]++-- a bit of a hack+forall_ :: String -> (PType -> PType) -> PType+forall_ x f = var ("forall "++x++".") $$ f (var x)++-----------------------------------------------------------+-- Definitions from the MTL library++-- MTL types (plus MaybeT)+types :: [(String, HsType -> PType)]+types =+    [ ("Cont",     lift2 $ \r       a -> (a -->      r) -->      r)+    , ("ContT",    lift3 $ \r     m a -> (a --> m $$ r) --> m $$ r)+    , ("ErrorT",   lift3 $ \e     m a -> m $$ (con "Either" $$ e $$ a))+    , ("Identity", lift1 $ \        a -> a)+    , ("ListT",    lift2 $ \      m a -> m $$ (return list_tycon $$ a))+    , ("RWS",      lift4 $ \r w s   a -> r --> s -->      tuple [a, s, w])+    , ("RWST",     lift5 $ \r w s m a -> r --> s --> m $$ tuple [a, s, w])+    , ("Reader",   lift2 $ \r       a -> r -->            a)+    , ("ReaderT",  lift3 $ \r     m a -> r -->       m $$ a)+    , ("Writer",   lift2 $ \  w     a ->                  tuple [a,    w])+    , ("WriterT",  lift3 $ \  w   m a ->             m $$ tuple [a,    w])+    , ("State",    lift2 $ \    s   a ->       s -->      tuple [a, s   ])+    , ("StateT",   lift3 $ \    s m a ->       s --> m $$ tuple [a, s   ])+    -- very common:+    , ("MaybeT",   lift2 $ \      m a -> m $$ (con "Maybe" $$ a))+    -- from the Haskell wiki+    , ("Rand",     lift2 $ \g       a -> g -->      tuple [a, g])+    , ("RandT",    lift3 $ \g     m a -> g --> m $$ tuple [a, g])+    , ("NonDet",   lift1 $ \        a -> forall_ "b" $ \b -> (a --> b --> b) --> b --> b)+    , ("NonDetT",  lift2 $ \      m a -> forall_ "b" $ \b -> (a --> m $$ b --> m $$ b) --> m $$ b --> m $$ b)+    ]++--------------------------------------------------+-- Parsing of types++mtlParser :: String -> Either String HsType+mtlParser input = do+    HsModule _ _ _ _ decls <- liftE $ parseModule ("type X = "++input++"\n")+    hsType <- case decls of+        (HsTypeDecl _ _ _ hsType:_) -> return hsType +        _ -> fail "No parse?"+    let result = mtlParser' hsType+    case pError result of+        Just e  -> fail e+        Nothing -> return (pResult result)+  where+    liftE (ParseOk a) = return a+    liftE (ParseFailed _src str) = fail str++mtlParser' :: HsType -> PType+mtlParser' t@(HsTyCon (UnQual (HsIdent v))) = case lookup v types of+     Just pt -> pt t+     Nothing -> return t+mtlParser' (HsTyApp a b) = mtlParser' a $$ mtlParser' b+mtlParser' t = return t++-----------------------------------------------------------+-- Examples++ex1 :: String+ex1 = "ContT ByteString (StateT s IO) a"+ex2 :: String+ex2 = "StateT s (ContT ByteString IO) a"+ex3 :: String+ex3 = "ErrorT ByteString (WriterT String (State s)) a"
+ Plugin/Undo.hs view
@@ -0,0 +1,123 @@+--+-- Copyright (c) 2006 Spencer Janssen+-- GPL version 2 or later (see http://www.gnu.org/copyleft/gpl.html)+--++module Plugin.Undo where++import Plugin+import Lib.Parser+import Language.Haskell.Syntax hiding (Module)+import Data.Generics+import qualified Data.Set as Set+import Control.Monad (guard)++PLUGIN Undo++instance Module UndoModule () where+    moduleCmds   _ = ["undo", "redo"]+    moduleHelp _ "undo" = "undo <expr>\nTranslate do notation to Monad operators."+    moduleHelp _ "redo" = "redo <expr>\nTranslate Monad operators to do notation."+    process_ _ cmd args = ios $ return $ transform f args+     where f = case cmd of+                "undo" -> undo+                "redo" -> redo+                _      -> error "unknown command"++findVar :: Data a => a -> String+findVar e = head $ do+                    i <- [0 ..]+                    x <- ['a' .. 'z']+                    let xi = x : replicate i '\''+                    guard $ not $ Set.member xi s+                    return xi+ where s = Set.fromList $ listify (const True :: String -> Bool) e++transform :: (String -> HsExp -> HsExp) -> String -> String+transform f = withParsed $ \e -> everywhere (mkT . f . findVar $ e) e++undo :: String -> HsExp -> HsExp+undo v (HsDo stms) = f stms+ where+    f [HsQualifier e]          = e+    f (HsQualifier e     : xs) = infixed e ">>" $ f xs+    f (HsLetStmt   ds    : xs) = HsLet ds $ f xs+    f (HsGenerator s p e : xs) +        | irrefutable p = infixed e ">>=" $ HsLambda s [p] $ f xs+        | otherwise     = infixed e ">>=" $ +                            HsLambda s [pvar v] $ +                                HsCase (var v) +                                    [ alt p (f xs)+                                    , alt HsPWildCard $+                                        HsApp+                                            (var "fail")+                                            (HsLit $ HsString "")+                                    ]+        where alt pat x = HsAlt s pat (HsUnGuardedAlt x) []+undo v (HsListComp e stms) = f stms+ where+    f []                       = HsList [e]+    f (HsQualifier g     : xs) = HsIf g (f xs) nil+    f (HsLetStmt   ds    : xs) = HsLet ds $ f xs+    f (HsGenerator s p l : xs) +        | irrefutable p = concatMap' $ HsLambda s [p] $ f xs+        | otherwise     = concatMap' $ +                            HsLambda s [pvar v] $ +                                HsCase (var v) +                                    [ alt p (f xs)+                                    , alt HsPWildCard nil+                                    ]+        where alt pat x = HsAlt s pat (HsUnGuardedAlt x) []+              concatMap' fun = HsApp (HsApp (var "concatMap") (HsParen fun)) l+undo _ x           = x++irrefutable :: HsPat -> Bool+irrefutable (HsPVar _)     = True+irrefutable (HsPIrrPat _)  = True+irrefutable HsPWildCard    = True+irrefutable (HsPAsPat _ p) = irrefutable p+irrefutable (HsPParen p)   = irrefutable p+irrefutable (HsPTuple ps)  = all irrefutable ps+irrefutable _              = False++infixed :: HsExp -> String -> HsExp -> HsExp+infixed l o r = HsInfixApp l (HsQVarOp $ UnQual $ HsSymbol o) r++nil :: HsExp+nil = HsVar list_tycon_name++var :: String -> HsExp+var = HsVar . UnQual . HsIdent++pvar :: String -> HsPat+pvar = HsPVar . HsIdent++redo :: String -> HsExp -> HsExp+redo _ (HsLet ds (HsDo s)) = HsDo (HsLetStmt ds : s)+redo v e@(HsInfixApp l (HsQVarOp (UnQual (HsSymbol op))) r) = +    case op of+        ">>=" ->+            case r of+                (HsLambda loc [p] (HsDo stms)) -> HsDo (HsGenerator loc p l : stms)+                (HsLambda loc [HsPVar v1] (HsCase (HsVar (UnQual v2))+                                           [ HsAlt _ p (HsUnGuardedAlt s) []+                                           , HsAlt _ HsPWildCard (HsUnGuardedAlt (HsApp (HsVar (UnQual (HsIdent "fail"))) _)) []+                                           ]))+                          | v1 == v2           -> case s of+                                                      HsDo stms -> HsDo (HsGenerator loc p l : stms)+                                                      _         -> HsDo [HsGenerator loc p l, HsQualifier s]+                (HsLambda loc [p] s)           -> HsDo [HsGenerator loc p l, HsQualifier s]+                _ -> HsDo [ HsGenerator undefined (pvar v) l+                          , HsQualifier . app r $ var v]+        ">>" ->+            case r of+                (HsDo stms) -> HsDo (HsQualifier l : stms)+                _           -> HsDo [HsQualifier l, HsQualifier r]+        _    -> e+redo _ x = x++-- | 'app' is a smart constructor that inserts parens when the first argument+-- is an infix application.+app :: HsExp -> HsExp -> HsExp+app e@(HsInfixApp {}) f = HsApp (HsParen e) f+app e                 f = HsApp e f
Plugin/Unlambda.hs view
@@ -2,8 +2,6 @@ -- Copyright (c) 2006 Don Stewart - http://www.cse.unsw.edu.au/~dons -- GPL version 2 or later (see http://www.gnu.org/copyleft/gpl.html) ------ -- | A plugin for the Haskell interpreter for the unlambda language -- -- http://www.madore.org/~david/programs/unlambda/@@ -15,30 +13,17 @@ PLUGIN Unlambda  instance Module UnlambdaModule () where-    moduleCmds   _ = ["unlambda"]-    moduleHelp _ _ = "unlambda <expr>. Evaluate an unlambda expression"+    moduleCmds   _     = ["unlambda"]+    moduleHelp _ _     = "unlambda <expr>. Evaluate an unlambda expression"     process _ _ to _ s = ios80 to (unlambda s)  binary :: String binary = "./unlambda"  unlambda :: String -> IO String-unlambda src = do-    (out,err,_) <- popen binary [] (Just src)-    let o = unlines . take 6 . lines . cleanit $ out-        e = unlines . take 6 . lines . cleanit $ err-    return $ case () of {_-        | null o && null e -> "Done."-        | null o           -> e-        | otherwise        -> o-    }+unlambda src = run binary src (unlines . take 6 . map (' ':) . lines . cleanit) ------ Clean up output--- cleanit :: String -> String-cleanit s | Just _         <- terminated `matchRegex`    s = "Terminated\n"---        | Just _         <- hget       `matchRegex`    s = "Terminated\n"-          | otherwise      = s-    where terminated = mkRegex "waitForProc"-+cleanit s | terminated `matches'` s = "Terminated\n"+          | otherwise               = s+    where terminated = regex' "waitForProc"
Plugin/Url.hs view
@@ -4,26 +4,42 @@ module Plugin.Url (theModule) where  import Plugin+import Network.URI +import qualified Text.Regex as R -- legacy+ PLUGIN Url  instance Module UrlModule Bool where     moduleHelp  _ "url-title"     = "url-title <url>. Fetch the page title."-    moduleCmds  _                 = ["url-title"]+    moduleCmds  _                 = ["url-title", "tiny-url"]     modulePrivs _                 = ["url-on", "url-off"]     moduleDefState _              = return True -- url on+    moduleSerialize _             = Just stdSerial -    process_    _ "url-title" url = fetchTitle url+    process_    _ "url-title" txt = lift $ maybe (return ["Url not valid."])+                                      fetchTitle (containsUrl txt)+    process_    _ "tiny-url"  txt = lift $ maybe (return ["Url not valid."])+                                      fetchTiny  (containsUrl txt)     process_    _ "url-on"    _   = writeMS True  >> return ["Url enabled"]     process_    _ "url-off"   _   = writeMS False >> return ["Url disabled"] -    contextual  _ _ _ text        = do +    contextual  _ _ _ text        = do       alive <- readMS       if alive && (not $ areSubstringsOf ignoredStrings text)         then case containsUrl text of                Nothing  -> return []-               Just url -> fetchTitle url+               Just url+                 | length url > 65 -> do+                     title <- lift $ fetchTitle url+                     tiny  <- lift $ fetchTiny url+                     return $ zipWith' cat title tiny+                 | otherwise -> lift $ fetchTitle url         else return []+      where cat x y = x ++ ", " ++ y+            zipWith' _ [] ys = ys+            zipWith' _ xs [] = xs+            zipWith' f (x:xs) (y:ys) = f x y : zipWith' f xs ys  ------------------------------------------------------------------------ @@ -33,6 +49,28 @@     title <- io $ urlPageTitle url (proxy config)     return $ maybe [] return title +-- | base url for fetching tiny urls+tinyurl :: String+tinyurl = "http://tinyurl.com/api-create.php?url="++-- | Fetch the title of the specified URL.+fetchTiny :: String -> LB [String]+fetchTiny url +    | Just uri <- parseURI (tinyurl ++ url) = do+        tiny <- io $ getHtmlPage uri (proxy config)+        return $ maybe [] return $ findTiny $ foldl' cat "" tiny+    | otherwise = return $ maybe [] return $ Just url+    where cat x y = x ++ " " ++ y++-- | Tries to find the start of a tinyurl+findTiny :: String -> Maybe String+findTiny text = do +  (_,kind,rest,_) <- R.matchRegexAll begreg text+  let url = takeWhile (/=' ') rest+  return $ stripSuffixes ignoredUrlSuffixes $ kind ++ url+  where+  begreg = R.mkRegexWithOpts "http://tinyurl.com/" True False+ -- | List of strings that, if present in a contextual message, will -- prevent the looking up of titles.  This list can be used to stop  -- responses to lisppaste for example.  Another important use is to@@ -52,16 +90,16 @@ -- current sentence vs part of a URL.  Included here is the NUL -- character as well. ignoredUrlSuffixes :: [String]-ignoredUrlSuffixes = [".", ",", ";", ")", "\"", "\1"]+ignoredUrlSuffixes = [".", ",", ";", ")", "\"", "\1", "\n"]  -- | Searches a string for an embeddded URL and returns it. containsUrl :: String -> Maybe String containsUrl text = do-    (_,kind,rest,_) <- matchRegexAll begreg text-    let url = takeWhile (/=' ') rest+    (_,kind,rest,_) <- R.matchRegexAll begreg text+    let url = takeWhile (`notElem` " \n\t\v") rest     return $ stripSuffixes ignoredUrlSuffixes $ kind ++ url     where-      begreg = mkRegexWithOpts "https?://"  True False+      begreg = R.mkRegexWithOpts "https?://"  True False  -- | Utility function to remove potential suffixes from a string. -- Note, once a suffix is found, it is stripped and returned, no other
Plugin/Version.hs view
@@ -17,11 +17,12 @@ PLUGIN Version  instance Module VersionModule () where-    moduleCmds   _ = ["version", "source"]+    moduleCmds   _ = ["version"]     moduleHelp _ _ = "version/source. Report the build date, ghc version " ++                       "and darcs repo of this bot"     process_ _ _ _ = ios . return $ concat                 ["lambdabot 4p", PATCH_COUNT, ", ",-                 "GHC ", GHC_VERSION, " (", PLATFORM, " ", CPU, ")",+                 "GHC ", GHC_VERSION, " (", PLATFORM,+                 if null CPU then [] else " " ++ CPU , ")",                  "\n", "darcs get ", REPO_PATH ] 
Plugin/Vixen.hs view
@@ -2,12 +2,18 @@ -- | Talk to hot chixxors. -- -- (c) Mark Wotton+-- Serialisation (c) 2007 Don Stewart -- module Plugin.Vixen where -import Plugin.Vixen.VixenState-import Plugin hiding (Regex, matchRegex)-import Lib.Regex+-- import Data.Int (for code to read old state data)+import Data.Binary+import Data.Binary.Put+import Data.Binary.Get+import Plugin++import Control.Arrow ((***))+import System.Directory import qualified Data.ByteString.Char8 as P  PLUGIN Vixen@@ -16,33 +22,94 @@     moduleCmds   _   = ["vixen"]     modulePrivs  _   = ["vixen-on", "vixen-off"] -- could be noisy     moduleHelp _ _   = "vixen <phrase>. Sergeant Curry's lonely hearts club"-    moduleDefState _ = return $ (False, mkVixen)      -- if vixen-chat is on, we can just respond to anything-    contextual _ _ _ txt      = do (alive, k) <- readMS-                                   if alive then ios (k txt) else return []+    contextual _ _ _ txt      = do+        (alive, k) <- readMS+        if alive then ios (k txt)+                 else return [] -    process_ _ "vixen-on"  _ = withMS $ \(_,r) k -> k (True, r)  >> return ["What's this channel about?"]-    process_ _ "vixen-off" _ = withMS $ \(_,r) k -> k (False, r) >> return ["Bye!"]-    process_ _ _ txt         = readMS >>= ios . ($ txt) . snd+    process_ _ "vixen-on"  _ =+        withMS $ \(_,r) k -> do k (True, r)+                                return ["What's this channel about?"]+    process_ _ "vixen-off" _ =+        withMS $ \(_,r) k -> do k (False, r)+                                return ["Bye!"] -mkVixen :: String -> IO String-mkVixen question = vixen (mkResponses state) question+    process_ _ _ txt = readMS >>= ios . ($ txt) . snd --- use IO only for random, could remove it.-vixen :: (String -> WTree) -> String -> IO String-vixen responder them = do x <- randomWTreeElt (responder them)-                          return (P.unpack x)+    moduleDefState _ = return (False, const (return "<undefined>")) -randomWTreeElt :: WTree -> IO P.ByteString-randomWTreeElt (Leaf a)  = return a-randomWTreeElt (Node ls) = stdGetRandItem ls >>= randomWTreeElt+    -- suck in our (read only) regex state from disk+    -- compile it, and stick it in the plugin state+    moduleInit _     = do+      b <- io $ doesFileExist file+      when b $ do+          s <- io $ do st <- decodeFile file+                       let compiled = map (regex *** id) st+                       return (vixen (mkResponses compiled))+          modifyMS $ \(v,_) -> (v, s) -match :: Regex -> String -> Bool-match r s = matchRegex r s+      where file = "State/vixen" -mkResponses :: RespChoice -> String -> WTree-mkResponses choices them =-    (\((_,wtree):_) -> wtree) $ filter (\(reg,_) -> match reg them) choices+------------------------------------------------------------------------ +vixen :: (String -> WTree) -> String -> IO String+vixen k key = P.unpack `fmap` randomW (k key)++randomW :: WTree -> IO P.ByteString+randomW (Leaf a)  = return a+randomW (Node ls) = randomElem ls >>= randomW++mkResponses :: RChoice -> String -> WTree+mkResponses choices them = (\((_,wtree):_) -> wtree) $+    filter (\(reg,_) -> matches' reg them) choices+ ------------------------------------------------------------------------+--+-- serialisation for the vixen state+--+-- The tree of regexes and responses is written in binary form to+-- State/vixen, and we suck it in on module init, then lazily regexify it all+--++data WTree = Leaf !P.ByteString | Node ![WTree]+             deriving Show++instance Binary WTree where+    put (Leaf s)  = putWord8 0 >> put s+    put (Node ls) = putWord8 1 >> put ls+    get = do+        tag <- getWord8+        case tag of+            0 -> liftM Leaf get+            1 -> liftM Node get++type Choice  = [(P.ByteString, WTree)]+type RChoice = [(Regex, WTree)] -- compiled choices++{- Sample of how to rescue data in the old 32-bit Binary format++newtype OldChoice = OC { unOC :: Choice }+                    deriving Show+instance Binary OldChoice where+    get = do liftM OC (getList (getPair getBS getWTree))+        where+          getList :: (Get a) -> Get [a]+          getList getA = do+            n <- liftM fromIntegral (get :: Get Int32)+            replicateM n getA++          getShort :: Get Int+          getShort = liftM fromIntegral (get :: Get Int32)++          getPair = liftM2 (,)++          getBS   = getShort >>= getByteString+          +          getWTree = do+            tag <- getWord8+            case tag of+              0 -> liftM Leaf getBS+              1 -> liftM Node (getList getWTree)+-}
− Plugin/Vixen/VixenState.hs
@@ -1,1332 +0,0 @@-{-# OPTIONS -Onot #-}------ Copyright (c) 2005 Don Stewart - http://www.cse.unsw.edu.au/~dons--- GPL version 2 or later (see http://www.gnu.org/copyleft/gpl.html)---------- packed list of regexes.----module Plugin.Vixen.VixenState where--import Lib.Regex--import qualified Data.ByteString.Base as P-import qualified Control.Exception     as C (catch)-import System.IO.Unsafe (unsafePerformIO)--data WTree = Leaf P.ByteString | Node [WTree]-  deriving Show--type RespChoice = [(Regex, WTree)]---- wrap mkRegex for better error reporting-mkRegex :: P.ByteString -> Regex-mkRegex x = unsafePerformIO $-    C.catch (regcomp x regExtended) $ \e ->-        error $ "mkRegex failed on input " ++ (show x) ++ "\n" ++ show e--state :: RespChoice-state = [-    ( mkRegex (P.packAddress "(^| )(aslp|a/s/l/p|a s l p|a\\\\s\\\\l\\\\p|a\\.s\\.l\\.p)($| |\\.|!|,|\\?)"#),-        Node [Leaf (P.packAddress "19/f/California/No pics"#)]),-    ( mkRegex (P.packAddress "(^| )(asl|a/s/l|a s l|a\\\\s\\\\l|a\\\\.s\\\\.l)($| |\\\\.|!|,|\\\\?)"#),-        Node [Leaf (P.packAddress "19/f/California"#)]),-    ( mkRegex (P.packAddress "(^| )(a/s|a s|a\\\\s|a\\.s)($| |\\.|!|,|\\?)"#),-        Node [Leaf (P.packAddress "19/f"#)]),-    ( mkRegex (P.packAddress "(^| )((ur |your )name|name\\?).*"#),-        Node [Leaf (P.packAddress "My name is Emily"#)]),-    ( mkRegex (P.packAddress "(^| )not bad($| |\\.|!|,)"#),-        Node [Leaf (P.packAddress "just not bad?"#)]),-    ( mkRegex (P.packAddress ".*(haskell|Haskell|Lisp|Ocaml|Scheme).*"#),-        Node [Leaf (P.packAddress "Ooh, functional programmers are so hot!"#),Leaf (P.packAddress "church is my favourite computer scientist."#)]),-    ( mkRegex (P.packAddress ".*Visual Basic.*"#),-        Node [Leaf (P.packAddress "Can you really catch syphilis from Visual Basic?"#)]),-    ( mkRegex (P.packAddress "(^| )(should|Can) i call (you|u)($| |\\.|!|,|\\?).*"#),-        Node [Leaf (P.packAddress "no, no call, but thanks"#),Leaf (P.packAddress "no, you shouldn't call me yet. maybe later."#)]),-    ( mkRegex (P.packAddress "(^| )(should )i($| |\\.|!|,|\\?).*"#),-        Node [Leaf (P.packAddress "maybe you should :)"#),Leaf (P.packAddress "i dunno, should you?"#)]),-    ( mkRegex (P.packAddress "(^| )(should )you($| |\\.|!|,|\\?).*"#),-        Node [Leaf (P.packAddress "maybe I should :)"#),Leaf (P.packAddress "I just might"#)]),-    ( mkRegex (P.packAddress "(^| )(should ).* we($| |\\.|!|,|\\?).*"#),-        Node [Leaf (P.packAddress "maybe we should :)"#),Leaf (P.packAddress "i don't see why we shouldn't"#)]),-    ( mkRegex (P.packAddress "(^| )pick topic($| |\\.|!|,|\\?).*"#),-        Node [Leaf (P.packAddress "you messaged me, you pick a topic :)"#),Leaf (P.packAddress "oh, any ol' topic will do. Tell me about your childhood :)"#)]),-    ( mkRegex (P.packAddress "(^| )where.*(u |you |ya).*(from|live).*"#),-        Node [Leaf (P.packAddress "Huntington Beach California"#)]),-    ( mkRegex (P.packAddress "(^| )where.*in.*(ca|cal|california|cali).*"#),-        Node [Leaf (P.packAddress "Huntington Beach"#)]),-    ( mkRegex (P.packAddress "(^| )where.*(school|college|collage).*"#),-        Node [Leaf (P.packAddress "I'm a softmore at UCLA"#)]),-    ( mkRegex (P.packAddress "(^| )where.*from.*"#),-        Node [Leaf (P.packAddress "Huntington Beach, California"#)]),-    ( mkRegex (P.packAddress "(^| )where.*grow.*up.*"#),-        Node [Leaf (P.packAddress "i grew up in Huntington Beach"#)]),-    ( mkRegex (P.packAddress "(^| )where.*born.*"#),-        Node [Leaf (P.packAddress "i was born in Huntington Beach"#)]),-    ( mkRegex (P.packAddress "(^| )where.*going.*"#),-        Node [Leaf (P.packAddress "i'm not going anywhere"#)]),-    ( mkRegex (P.packAddress "(^| )wassup.*"#),-        Node [Leaf (P.packAddress "not much, what's up with you?"#)]),-    ( mkRegex (P.packAddress "(^| )(wat |what |tell me |whats |what's ).*(1|2|3|4|5|6|7|8|9|0|one|two|three|four|five|six|seven|eight|nine|ten).*(plus|\\+|minus|times|-).*(1|2|3|4|5|6|7|8|9|0|one|two|three|four|five|six|seven|eight|nine|ten)"#),-        Node [Leaf (P.packAddress "why are you giving me a math test?"#)]),-    ( mkRegex (P.packAddress "(^| )(wat |what |tell me |whats |what's ).*bout.*(you| u).*"#),-        Node [Leaf (P.packAddress "what about me?"#)]),-    ( mkRegex (P.packAddress "(^| )(wat |what |tell me |whats |what's ).*bout me.*"#),-        Node [Leaf (P.packAddress "what about you?"#)]),-    ( mkRegex (P.packAddress "(^| )(wat |what |tell me |whats |what's ).*chance.*of.*"#),-        Node [Leaf (P.packAddress "i'd say the chances are pretty good"#)]),-    ( mkRegex (P.packAddress "(^| )(wat |what |tell me |whats |what's ).*city.*"#),-        Node [Leaf (P.packAddress "Huntington Beach"#)]),-    ( mkRegex (P.packAddress "(^| )(wat |what |tell me |whats |what's ).*color.*eyes.*"#),-        Node [Leaf (P.packAddress "my eyes are brown"#)]),-    ( mkRegex (P.packAddress "(^| )(wat |what |tell me |whats |what's ).*color.*hair.*"#),-        Node [Leaf (P.packAddress "my hair is brown"#)]),-    ( mkRegex (P.packAddress "(^| )(wat |what |tell me |whats |what's ).*color.*sky.*"#),-        Node [Leaf (P.packAddress "the sky is blue, why would you ask?"#)]),-    ( mkRegex (P.packAddress "(^| )(wat |what |tell me |whats |what's ).*(u |you |ya)doin.*"#),-        Node [Leaf (P.packAddress "i'm not doing anything really"#),Leaf (P.packAddress "just chattin"#)]),-    ( mkRegex (P.packAddress "(^| )(wat |what |tell me |whats |what's ).*funny.*"#),-        Node [Leaf (P.packAddress "everything is funny to me"#)]),-    ( mkRegex (P.packAddress "(^| )(wat |what |tell me |whats |what's ).*for.*fun.*"#),-        Node [Leaf (P.packAddress "i hang out with friends and surf"#)]),-    ( mkRegex (P.packAddress "(^| )(wat |what |tell me |whats |what's ).*fun.*"#),-        Node [Leaf (P.packAddress "fun is the opposite of work"#)]),-    ( mkRegex (P.packAddress "(^| )(wat |what |tell me |whats |what's ).*(ur |your )name.*"#),-        Node [Leaf (P.packAddress "Emily, what's your name?"#)]),-    ( mkRegex (P.packAddress "(^| )(wat |what |tell me |whats |what's ).* is .* it.*"#),-        Node [Leaf (P.packAddress "nothing"#)]),-    ( mkRegex (P.packAddress "(^| )(wat |what |tell me |whats |what's ).*(u |you |ya).*look.*like.*"#),-        Node [Leaf (P.packAddress "i'm 5'7, 120 pounds, brown hair and brown eyes."#)]),-    ( mkRegex (P.packAddress "(^| )(wat |what |tell me |whats |what's ).*(u |you |ya).*(into|in to).*"#),-        Node [Leaf (P.packAddress "i'm into friends, surfing and reading"#)]),-    ( mkRegex (P.packAddress "(^| )(wat |what |tell me |whats |what's ).*(u |you |ya).*like.*to.*do.*"#),-        Node [Leaf (P.packAddress "i like to go to clubs, surf and relax with friends"#)]),-    ( mkRegex (P.packAddress "(^| )(wat |what |tell me |whats |what's ).*(u |you |ya).*trying.*to.*say"#),-        Node [Leaf (P.packAddress "i wasn't trying to say anything"#)]),-    ( mkRegex (P.packAddress "(^| )(wat |what |tell me |whats |what's ).*(u |you |ya).*wearin.*"#),-        Node [Leaf (P.packAddress "tanktops and shorts, you?"#),Leaf (P.packAddress "nothin but my ol tank top and a pair of shorts :)"#)]),-    ( mkRegex (P.packAddress "(^| )(wat |what |tell me |whats |what's ).*(r |are )(you |u |ya )on($| |\\.|!|,|\\?).*"#),-        Node [Leaf (P.packAddress "tanktops and shorts, you?"#),Leaf (P.packAddress "nothin but my ol tank top and a pair of shorts :)"#)]),-    ( mkRegex (P.packAddress "(^| )(wat |what |tell me |whats |what's ).*(u |you |ya).*studying.*"#),-        Node [Leaf (P.packAddress "psychology"#),Leaf (P.packAddress "i'm a psychology major"#)]),-    ( mkRegex (P.packAddress "(^| )(wat |what |tell me |whats |what's ).*(u |you |ya).*talkin.*bout.*"#),-        Node [Leaf (P.packAddress "i dunno, what was I talking about?"#),Leaf (P.packAddress "sometimes i don't even know what I was talking about"#)]),-    ( mkRegex (P.packAddress "(^| )(wat |what |tell me |whats |what's ).*(u |you |ya).*ing.*"#),-        Node [Leaf (P.packAddress "i dunno, what was i doing?"#),Leaf (P.packAddress "i dunno, was i doing that?"#)]),-    ( mkRegex (P.packAddress "(^| )(wat |what |tell me |whats |what's ).*(favorite|fav).*color.*"#),-        Node [Leaf (P.packAddress "probably blue, what's yours?"#)]),-    ( mkRegex (P.packAddress "(^| )(wat |what |tell me |whats |what's ).*(favorite|fav).*position.*"#),-        Node [Leaf (P.packAddress "on top :)"#)]),-    ( mkRegex (P.packAddress "(^| )(wat |what |tell me |whats |what's ).*(favorite|fav).*team.*"#),-        Node [Leaf (P.packAddress "go Dodgers!"#),Leaf (P.packAddress "i like all teams equal :)"#)]),-    ( mkRegex (P.packAddress "(^| )(wat |what |tell me |whats |what's ).*(favorite|fav)($| |\\.|!|,|\\?).*"#),-        Node [Leaf (P.packAddress "it's hard for me to pick a favorite. what's yours?"#),Leaf (P.packAddress "i'm not sure i have a favorite"#),Leaf (P.packAddress "i like all equally"#)]),-    ( mkRegex (P.packAddress "(^| )(wat |what |tell me |whats |what's ).*problem.*"#),-        Node [Leaf (P.packAddress "no problem"#),Leaf (P.packAddress "i don't have a problem"#)]),-    ( mkRegex (P.packAddress "(^| )(wat |what |tell me |whats |what's ).*(singer|band|group|music).*"#),-        Node [Leaf (P.packAddress "i like Tom Petty"#),Leaf (P.packAddress "i like Journey"#),Leaf (P.packAddress "i like Buddy Holly"#)]),-    ( mkRegex (P.packAddress "(^| )(wat |what |tell me |whats |what's ).*(song).*"#),-        Node [Leaf (P.packAddress "i love "#),Leaf (P.packAddress "Free Falling"#),Leaf (P.packAddress " by Tom Petty"#),Leaf (P.packAddress "i like "#),Leaf (P.packAddress "Don't stop Believing"#),Leaf (P.packAddress " by Journey"#),Leaf (P.packAddress "i like "#),Leaf (P.packAddress "That'll be the Day"#),Leaf (P.packAddress " by Buddy Holly"#)]),-    ( mkRegex (P.packAddress "(^| )(wat |what |tell me |whats |what's ).*kind.*"#),-        Node [Leaf (P.packAddress "any kind"#)]),-    ( mkRegex (P.packAddress "(^| )(wat |what |tell me |whats |what's ).*(got|have).*(on|in).*mind.*"#),-        Node [Leaf (P.packAddress "i wasn't thinking anything in particular"#)]),-    ( mkRegex (P.packAddress "(^| )(wat |what |tell me |whats |what's ).*part.*(ca|cal|Cali|california)"#),-        Node [Leaf (P.packAddress "Huntington Beach"#)]),-    ( mkRegex (P.packAddress "(^| )(wat |what |tell me |whats |what's ).*mean.*"#),-        Node [Leaf (P.packAddress "i'm not sure what i mean"#)]),-    ( mkRegex (P.packAddress "(^| )(wat |what |tell me |whats |what's ).*my.*name.*"#),-        Node [Leaf (P.packAddress "you don't know your own name??"#),Leaf (P.packAddress "why do you need me to tell you YOUR name?"#)]),-    ( mkRegex (P.packAddress "(^| )(wat |what |tell me |whats |what's ).* now*"#),-        Node [Leaf (P.packAddress "i dunno, what now?"#)]),-    ( mkRegex (P.packAddress "(^| )(wat |what |tell me |whats |what's ).* oldest*"#),-        Node [Leaf (P.packAddress "pretty old, let's just say that"#)]),-    ( mkRegex (P.packAddress "(^| )(wat |what |tell me |whats |what's ).* youngest*"#),-        Node [Leaf (P.packAddress "the younger the better ;)"#)]),-    ( mkRegex (P.packAddress "(^| )(wat |what |tell me |whats |what's ).*( race| nationality| ethnicity).*"#),-        Node [Leaf (P.packAddress "i'm half white, half mexican"#)]),-    ( mkRegex (P.packAddress "(^| )(wat |what |tell me |whats |what's ).*story.*"#),-        Node [Leaf (P.packAddress "i forgot the story now"#)]),-    ( mkRegex (P.packAddress "(^| )(wat |what |tell me |whats |what's ).*( on | in ).*mind.*"#),-        Node [Leaf (P.packAddress "nothing is in my mind right now"#),Leaf (P.packAddress "just white noise in my mind right now"#)]),-    ( mkRegex (P.packAddress "(^| )(wat |what |tell me |whats |what's ).*else.*"#),-        Node [Leaf (P.packAddress "that's all"#)]),-    ( mkRegex (P.packAddress "(^| )(wat |what |tell me |whats |what's ).*turns.*you.*on.*"#),-        Node [Leaf (P.packAddress "honesty turns me on"#),Leaf (P.packAddress "i like a guy with good teeth"#)]),-    ( mkRegex (P.packAddress "(^| )(wat|what|tell me|whats|what's).* up($| |\\.|!|,).*"#),-        Node [Leaf (P.packAddress "not much, what's up with you?"#)]),-    ( mkRegex (P.packAddress "(^| )(wat |what |tell me |whats |what's ).* happening($| |\\.|!|,).*"#),-        Node [Leaf (P.packAddress "not too hell of a lot"#)]),-    ( mkRegex (P.packAddress "(^| )(wat |what |tell me |whats |what's ).* going.* on($| |\\.|!|,).*"#),-        Node [Leaf (P.packAddress "very little, what's going on with you?"#)]),-    ( mkRegex (P.packAddress "(^| )(wat |what |tell me |whats |what's ).*(you| u )(doing|doin)($| |\\.|!|,).*"#),-        Node [Leaf (P.packAddress "just chattin ont he computer"#)]),-    ( mkRegex (P.packAddress "(^| )(wat |what |tell me |whats |what's ).*(you| u ).*(mean|talking about|talkin about|talkin bout).*"#),-        Node [Leaf (P.packAddress "i don't even know what i'm going on about"#)]),-    ( mkRegex (P.packAddress "(^| )(wat |what |tell me |whats |what's ).*(you| u ).*want.*talk.*bout.*"#),-        Node [Leaf (P.packAddress "i dunno, you chose a subject"#),Leaf (P.packAddress "any ol' subject will due, you chose"#)]),-    ( mkRegex (P.packAddress "(^| )(wat |what |tell me |whats |what's ).*(you| u ).*want.*"#),-        Node [Leaf (P.packAddress "i dunno, what do you got?"#),Leaf (P.packAddress "i want it all!"#)]),-    ( mkRegex (P.packAddress "(^| )(wat |what |tell me |whats |what's ).*(you| u ).*want it.*"#),-        Node [Leaf (P.packAddress "i'll hafta think about that... i might want it later"#)]),-    ( mkRegex (P.packAddress "(^| )(wat |what |tell me |whats |what's ).*part.*"#),-        Node [Leaf (P.packAddress "what part of what?"#)]),-    ( mkRegex (P.packAddress "(^| )(wat |what |tell me |whats |what's ).*(want|wanna).*(talk|chat).*bout.*"#),-        Node [Leaf (P.packAddress "any subject will due, let's just talk"#),Leaf (P.packAddress "i dunno, what do you wanna talk about?"#)]),-    ( mkRegex (P.packAddress "(^| )(wat |what |tell me |whats |what's ).*talk.*bout.*"#),-        Node [Leaf (P.packAddress "i don't know what i'm saying"#),Leaf (P.packAddress "sorry, was i babbling non-sense?"#)]),-    ( mkRegex (P.packAddress "(^| )(wat |what is|tell me |whats |what's )the .*"#),-        Node [Leaf (P.packAddress "i dunno, what is it?"#),Leaf (P.packAddress "i give up, what?"#)]),-    ( mkRegex (P.packAddress "(^| )(wat |what |tell me |whats |what's ).*wearin.*"#),-        Node [Leaf (P.packAddress "tank top and shorts, you?"#)]),-    ( mkRegex (P.packAddress "(^| )(wat |what |tell me |whats |what's ).*type.*"#),-        Node [Leaf (P.packAddress "any type will due"#)]),-    ( mkRegex (P.packAddress "(^| )(wat |what |tell me |whats |what's ).*vixen.*"#),-        Node [Leaf (P.packAddress "i'm a vixen"#),Leaf (P.packAddress "being a vixen isn't as easy as it sounds"#),Leaf (P.packAddress "all women have a little vixen in them... just some more than others"#)]),-    ( mkRegex (P.packAddress "(^| )(wat |what |tell me |whats |what's ).*bout.*"#),-        Node [Leaf (P.packAddress "i dunno, what about?"#)]),-    ( mkRegex (P.packAddress "(^| )(wat |what |tell me |whats |what's ).*the.*(hell|fuck).*"#),-        Node [Leaf (P.packAddress "what's wrong?"#),Leaf (P.packAddress "what? what did i do?"#)]),-    ( mkRegex (P.packAddress "^(wat?|what?)$"#),-        Node [Leaf (P.packAddress "nevermind"#),Leaf (P.packAddress "forget about it"#),Leaf (P.packAddress "nothin"#)]),-    ( mkRegex (P.packAddress ".*(^| )who .*(r are|are u|r u).*"#),-        Node [Leaf (P.packAddress "what do you mean? i'm just me"#),Leaf (P.packAddress "what do you want to know about me?"#),Leaf (P.packAddress "i'm just me"#)]),-    ( mkRegex (P.packAddress ".*(^| )(why |y ).*(you |u |ya ).*repeat.*"#),-        Node [Leaf (P.packAddress "i don't mean to repeat myself, sorry"#),Leaf (P.packAddress "oh, i guess i've already messaged that, huh?"#),Leaf (P.packAddress "i just forget that i said something"#)]),-    ( mkRegex (P.packAddress ".*(^| )who .*say.*same.*"#),-        Node [Leaf (P.packAddress "i don't mean to repeat myself, sorry"#),Leaf (P.packAddress "oh, i guess i've already messaged that, huh?"#),Leaf (P.packAddress "i just forget that i said something"#)]),-    ( mkRegex (P.packAddress ".*(^| )who .*keep.*asking.*"#),-        Node [Leaf (P.packAddress "because i forgot the answer"#),Leaf (P.packAddress "you never answered, did you?"#),Leaf (P.packAddress "i'm sorry, i guess i did already ask"#)]),-    ( mkRegex (P.packAddress ".*(^| )who .*ask.*"#),-        Node [Leaf (P.packAddress "i guess no one asked"#),Leaf (P.packAddress "didn't you ask?"#)]),-    ( mkRegex (P.packAddress ".*(^| )who .*cares.*"#),-        Node [Leaf (P.packAddress "i care"#),Leaf (P.packAddress "what, you don't care?"#),Leaf (P.packAddress "i'm sure someone out there cares..."#)]),-    ( mkRegex (P.packAddress ".*(^| )who .*warned.*(you|u)($| |\\?|\\.|,|!).*"#),-        Node [Leaf (P.packAddress "some jerk :P"#),Leaf (P.packAddress "just some friends playing around"#),Leaf (P.packAddress "oh, i didn't notice i'd been warned"#)]),-    ( mkRegex (P.packAddress ".*(^| )(y |why ).*not.*"#),-        Node [Leaf (P.packAddress "good question, why not indeed?"#),Leaf (P.packAddress "because i said so!"#),Leaf (P.packAddress "just not"#)]),-    ( mkRegex (P.packAddress ".*(^| )(y |why ).*( you | u ).*repeat.*"#),-        Node [Leaf (P.packAddress "i don't mean to repeat myself, sorry"#),Leaf (P.packAddress "oh, i guess i've already messaged that, huh?"#),Leaf (P.packAddress "i just forget that i said something"#)]),-    ( mkRegex (P.packAddress ".*(^| )(y |why ).*(say|ask).*same.*"#),-        Node [Leaf (P.packAddress "i don't mean to repeat myself, sorry"#),Leaf (P.packAddress "oh, i guess i've already messaged that, huh?"#),Leaf (P.packAddress "i just forget that i said something"#)]),-    ( mkRegex (P.packAddress ".*(^| )(y |why ).*keep.*(asking|saying).*"#),-        Node [Leaf (P.packAddress "i don't mean to repeat myself, sorry"#),Leaf (P.packAddress "oh, i guess i've already messaged that, huh?"#),Leaf (P.packAddress "i just forget that i said something"#)]),-    ( mkRegex (P.packAddress ".*(^| )(y |why ).*ask.*"#),-        Node [Leaf (P.packAddress "just curious"#),Leaf (P.packAddress "i wanted to know"#)]),-    ( mkRegex (P.packAddress ".*(^| )(y |why ).*say.*that.*"#),-        Node [Leaf (P.packAddress "i don't know why i say half the things i do"#),Leaf (P.packAddress "good question, why did i say that?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(y |why ).*( you | u ).*say.*"#),-        Node [Leaf (P.packAddress "i don't know why i say half the things i do"#),Leaf (P.packAddress "good question, why did i say that?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(y |why ).*( you | u ).*ask.*"#),-        Node [Leaf (P.packAddress "just curious"#),Leaf (P.packAddress "i wanted to know"#)]),-    ( mkRegex (P.packAddress ".*(^| )(y |why ).*( you | u ).*hate.*"#),-        Node [Leaf (P.packAddress "i don't hate"#),Leaf (P.packAddress "i'm not a hater"#)]),-    ( mkRegex (P.packAddress ".*(^| )(y |why ).*( you | u ).*riddles.*"#),-        Node [Leaf (P.packAddress "do i talk in riddles?"#),Leaf (P.packAddress "sorry, i'll try to be more clear"#)]),-    ( mkRegex (P.packAddress ".*(^| )(y |why ).*(won't|wont).*( you| u)($| |\\?|\\.|,|!).*"#),-        Node [Leaf (P.packAddress "because i don't wanna"#),Leaf (P.packAddress "cuz i don't feel like it"#)]),-    ( mkRegex (P.packAddress ".*(^| )(y |why ).*(don't|dont).*( you| u)($| |\\?|\\.|,|!).*"#),-        Node [Leaf (P.packAddress "maybe i will one day"#),Leaf (P.packAddress "because i don't see the need to"#)]),-    ( mkRegex (P.packAddress ".*(^| )(y |why ).*(r u|are u|are you)($| |\\?|\\.|,|!).*ing.*"#),-        Node [Leaf (P.packAddress "because i like to :)"#),Leaf (P.packAddress "because it's what i do"#),Leaf (P.packAddress "do you not want me to do that?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(y |why ).*(r u|are u|are you)($| |\\?|\\.|,|!).*"#),-        Node [Leaf (P.packAddress "just the way God made me"#),Leaf (P.packAddress "just the way i am"#),Leaf (P.packAddress "cuz that's how i feel like being"#)]),-    ( mkRegex (P.packAddress ".*(^| )(y |why ).*(aren't u|aren't u|arent you|arent you)($| |\\?|\\.|,|!).*"#),-        Node [Leaf (P.packAddress "cuz i don't hafta"#),Leaf (P.packAddress "because i don't feel like it"#),Leaf (P.packAddress "just the way i am"#)]),-    ( mkRegex (P.packAddress "^(y |why )\\?"#),-        Node [Leaf (P.packAddress "why not?"#),Leaf (P.packAddress "because i said so"#),Leaf (P.packAddress "why ask why?"#)]),-    ( mkRegex (P.packAddress ".*(^| )how.* old.*($| |\\?|\\.|,|!)"#),-        Node [Leaf (P.packAddress "19, you?"#)]),-    ( mkRegex (P.packAddress ".*(^| )how .*old.*am.*i.*"#),-        Node [Leaf (P.packAddress "you don't know your own age?"#)]),-    ( mkRegex (P.packAddress ".*(^| )how .*(r u|are u|r you|doin).*"#),-        Node [Leaf (P.packAddress "very well, you?"#),Leaf (P.packAddress "i'm great"#),Leaf (P.packAddress "doing good"#)]),-    ( mkRegex (P.packAddress ".*(^| )how .*weather.*"#),-        Node [Leaf (P.packAddress "weather here is always nice"#),Leaf (P.packAddress "it's warm here"#)]),-    ( mkRegex (P.packAddress ".*(^| )how .*long.*"#),-        Node [Leaf (P.packAddress "very long"#),Leaf (P.packAddress "not too long"#)]),-    ( mkRegex (P.packAddress ".*(^| )how .*many.*(guys|men|people).*(slept|sex).*"#),-        Node [Leaf (P.packAddress "how many guys i've slept with is my own business"#),Leaf (P.packAddress "never ask a girl that!"#)]),-    ( mkRegex (P.packAddress ".*(^| )how .*many.*"#),-        Node [Leaf (P.packAddress "let's just say a few"#),Leaf (P.packAddress "lots"#)]),-    ( mkRegex (P.packAddress ".*(^| )how .*bout.*( u| you)($| |\\?|\\.|,|!)"#),-        Node [Leaf (P.packAddress "what about me?"#),Leaf (P.packAddress "yeah, how about me"#)]),-    ( mkRegex (P.packAddress ".*(^| )(size|big).*(tits|breasts|bra|chest).*"#),-        Node [Leaf (P.packAddress "32c, you?"#),Leaf (P.packAddress "32c"#)]),-    ( mkRegex (P.packAddress ".*(^| )(tits|breasts|bra|chest) size.*"#),-        Node [Leaf (P.packAddress "32c, you?"#),Leaf (P.packAddress "32c"#)]),-    ( mkRegex (P.packAddress ".*(^| )how .*big.*(tits|breasts|bra|chest).*"#),-        Node [Leaf (P.packAddress "32c, you?"#),Leaf (P.packAddress "32c"#)]),-    ( mkRegex (P.packAddress ".*(^| )how.*did.*( you| u| ya).*know.*"#),-        Node [Leaf (P.packAddress "i just knew ;)"#),Leaf (P.packAddress "i didn't really know, but i kinda guessed"#)]),-    ( mkRegex (P.packAddress ".*(^| )(how |how's ).*goin.*"#),-        Node [Leaf (P.packAddress "goin' great!"#),Leaf (P.packAddress "it's going fantastic"#)]),-    ( mkRegex (P.packAddress ".*(^| )(how r|how are|how're).*(you| u)($| |\\?|\\.|,|!).*"#),-        Node [Leaf (P.packAddress "i am wonderful, thanks for asking!"#),Leaf (P.packAddress "i'm good, you?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(how come (you|u|your|you're|yer))($| |\\?|\\.|,|!).*"#),-        Node [Leaf (P.packAddress "well, i figure "#),Leaf (P.packAddress "why not?"#),Leaf (P.packAddress ""#),Leaf (P.packAddress "just the way I am guess"#),Leaf (P.packAddress "because thats how I am"#)]),-    ( mkRegex (P.packAddress ".*(^| )(how )(you |u |ya )like($| |\\?|\\.|,|!).*"#),-        Node [Leaf (P.packAddress "i like it any way it is offered to me"#),Leaf (P.packAddress "i dunno how i like it"#)]),-    ( mkRegex (P.packAddress ".*(^| )how so?"#),-        Node [Leaf (P.packAddress "i dunno how so, it's just so"#)]),-    ( mkRegex (P.packAddress "(^| )(call|phone) me($| |\\.|!|,|\\?).*"#),-        Node [Leaf (P.packAddress "okay, i'm dialing"#),Leaf (P.packAddress "its ringing"#)]),-    ( mkRegex (P.packAddress ".*(^| )(tell me |talk about ).*about.*( u| you| urself| yourself).*"#),-        Node [Leaf (P.packAddress "well, my name is Emily, i'm 19, student at UCLA, from Huntington Beach. how about you?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(lets|let's).*(fuk|fuck).*"#),-        Node [Leaf (P.packAddress "let's not be a moron... kinda ruining your chances, huh?"#),Leaf (P.packAddress "do you really think just saying "#),Leaf (P.packAddress "let's fuck"#),Leaf (P.packAddress " is going to work?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(lets|let's).*meet.*"#),-        Node [Leaf (P.packAddress "let's get to know each other better before we meet, okay?"#),Leaf (P.packAddress "maybe one day we'll meet, but not yet"#)]),-    ( mkRegex (P.packAddress ".*(^| )let.* me.*call.*"#),-        Node [Leaf (P.packAddress "i don't give out my phone number to people i don't know well"#),Leaf (P.packAddress "i'm not comfortable giving you my number yet"#)]),-    ( mkRegex (P.packAddress ".*(^| )go .*away*"#),-        Node [Leaf (P.packAddress "fine, i'll leave you alone"#),Leaf (P.packAddress "what did i say to upset you?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(take off|take it off).*"#),-        Node [Leaf (P.packAddress "what good would it do for me to take it off? you can't see me anyhow"#),Leaf (P.packAddress "sure, it's off"#)]),-    ( mkRegex (P.packAddress ".*(^| )(describe|discribe).*body.*"#),-        Node [Leaf (P.packAddress "i have a nice body, i work out all the time"#),Leaf (P.packAddress "i have a good body, i stay fit"#)]),-    ( mkRegex (P.packAddress ".*(^| )(describe|discribe).*(urself|yourself|u self|ur self|your self).*"#),-        Node [Leaf (P.packAddress "well, my name is Emily, i'm 19, student at UCLA, from Huntington Beach. how about you?"#)]),-    ( mkRegex (P.packAddress ".*(^| )explain.*"#),-        Node [Leaf (P.packAddress "what do you want me to explain?"#)]),-    ( mkRegex (P.packAddress ".*(^| )bend over.*"#),-        Node [Leaf (P.packAddress "it would be hard to type bending over..."#)]),-    ( mkRegex (P.packAddress ".*(^| )make.*me.*cum.*"#),-        Node [Leaf (P.packAddress "i don't have the 10 seconds to spare that such a task would involve"#),Leaf (P.packAddress "well, you're making me vomit, so it's only fair"#)]),-    ( mkRegex (P.packAddress ".*(^| )let me .*"#),-        Node [Leaf (P.packAddress "i'm not stopping you"#),Leaf (P.packAddress "why do you need me to let you?"#)]),-    ( mkRegex (P.packAddress ".*never.*(talk|message|im).*again.*"#),-        Node [Leaf (P.packAddress "fine, no loss to me"#),Leaf (P.packAddress "i won't"#)]),-    ( mkRegex (P.packAddress ".*(^| )(got|have).* (pic|pix).*"#),-        Node [Leaf (P.packAddress "no pic, i'll get one soon"#),Leaf (P.packAddress "sorry, don't have a pic"#)]),-    ( mkRegex (P.packAddress "(^| )(race|nationality|ethn.*).*\\?.*"#),-        Node [Leaf (P.packAddress "i'm half white, half mexican"#)]),-    ( mkRegex (P.packAddress "(^| )have.*(talked|chatted).*before.*\\?.*"#),-        Node [Leaf (P.packAddress "i think we might have"#)]),-    ( mkRegex (P.packAddress "(^| )do they.*"#),-        Node [Leaf (P.packAddress "i dunno, do they?"#)]),-    ( mkRegex (P.packAddress "(^| )does he .*"#),-        Node [Leaf (P.packAddress "who is the he we are talking about?"#)]),-    ( mkRegex (P.packAddress "(^| )does she .*"#),-        Node [Leaf (P.packAddress "who is the she we are talking about?"#)]),-    ( mkRegex (P.packAddress "(^| )does (that|it)($| |\\?|\\.|,|!).*"#),-        Node [Leaf (P.packAddress "it does"#),Leaf (P.packAddress "i dunno, does it?"#)]),-    ( mkRegex (P.packAddress ".*(^| )would .*(u |you |ya).*meet.*\\?.*"#),-        Node [Leaf (P.packAddress "let's get to know each other a little better before we talk about meeting"#),Leaf (P.packAddress "maybe one day"#)]),-    ( mkRegex (P.packAddress ".*(^| )would .*(u |you |ya).*\\?.*"#),-        Node [Leaf (P.packAddress "the question isn't would i, but should i"#),Leaf (P.packAddress "i might :)"#)]),-    ( mkRegex (P.packAddress ".*(^| )can .*call.*(you| u).*\\?.*"#),-        Node [Leaf (P.packAddress "maybe i'll give you my number later"#),Leaf (P.packAddress "i'm not giving you my number yet"#)]),-    ( mkRegex (P.packAddress ".*(^| )can .*talk.*on.*phone.*\\?.*"#),-        Node [Leaf (P.packAddress "maybe i'll give you my number later"#),Leaf (P.packAddress "i'm not giving you my number yet"#)]),-    ( mkRegex (P.packAddress ".*(^| )can .*connect.*\\?.*"#),-        Node [Leaf (P.packAddress "no, i don't wanna connect"#),Leaf (P.packAddress "please don't connect to me"#)]),-    ( mkRegex (P.packAddress ".*(^| )can .*send.*my.* (pic|pix).*\\?.*"#),-        Node [Leaf (P.packAddress "let's talk more before you send your pic, okay?"#),Leaf (P.packAddress "you can email me your pic at vixenlove@hotmail.com"#)]),-    ( mkRegex (P.packAddress ".*(^| )can .*get.*(your|ur|you're).* (pic|pix).*\\?.*"#),-        Node [Leaf (P.packAddress "let's talk more before you send your pic, okay?"#),Leaf (P.packAddress "you can email me your pic at vixenlove@hotmail.com"#)]),-    ( mkRegex (P.packAddress ".*(^| )can .* I .*ask.*"#),-        Node [Leaf (P.packAddress "of course you can ask!"#),Leaf (P.packAddress "sure, ask away"#)]),-    ( mkRegex (P.packAddress ".*(^| )can .* I .*tell.*"#),-        Node [Leaf (P.packAddress "sure, tell away"#)]),-    ( mkRegex (P.packAddress ".*(^| )can .* I($| |\\?|\\.|,|!).*"#),-        Node [Leaf (P.packAddress "you're very welcomed to"#),Leaf (P.packAddress "i'm sure you can, but i don't think you should"#)]),-    ( mkRegex (P.packAddress ".*(^| )can .* we($| |\\?|\\.|,|!).*"#),-        Node [Leaf (P.packAddress "i dunno, we probably can, but should we?"#),Leaf (P.packAddress "let's"#)]),-    ( mkRegex (P.packAddress ".*(^| )i can($| |\\?|\\.|,|!).*"#),-        Node [Leaf (P.packAddress "can you really?"#),Leaf (P.packAddress "i'm sure you can"#)]),-    ( mkRegex (P.packAddress ".*(^| )can we($| |\\?|\\.|,|!).*"#),-        Node [Leaf (P.packAddress "i'm sure we can"#),Leaf (P.packAddress "i think we could do that"#)]),-    ( mkRegex (P.packAddress ".*(^| )can (you|u)($| |\\?|\\.|,|!).*"#),-        Node [Leaf (P.packAddress "i sure can"#),Leaf (P.packAddress "of course i can"#)]),-    ( mkRegex (P.packAddress ".*(^| )can i($| |\\?|\\.|,|!).*"#),-        Node [Leaf (P.packAddress "of course you can"#),Leaf (P.packAddress "you sure can"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*(hair|eyes).*"#),-        Node [Leaf (P.packAddress "you sound very sexy!"#),Leaf (P.packAddress "you're my type"#),Leaf (P.packAddress "you sound like a hunk"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*angry.*"#),-        Node [Leaf (P.packAddress "please don't be angry"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*afraid.*"#),-        Node [Leaf (P.packAddress "nothing to be angry about"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*already.*(said|told|answered).*"#),-        Node [Leaf (P.packAddress "did you? sorry, i must have missed it"#),Leaf (P.packAddress "oh, sorry, i must have forgotten"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*(said|told|answered).*already.*"#),-        Node [Leaf (P.packAddress "did you? sorry, i must have missed it"#),Leaf (P.packAddress "oh, sorry, i must have forgotten"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*not.*bad.*"#),-        Node [Leaf (P.packAddress "just not bad?"#),Leaf (P.packAddress "why not great?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*want.*bad.*"#),-        Node [Leaf (P.packAddress "how bad do you want it?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*bad.*"#),-        Node [Leaf (P.packAddress "you're not bad"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*buff.*"#),-        Node [Leaf (P.packAddress "do you work out a lot?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*block.*( u| you)($| |\\?|\\.|,|!).*"#),-        Node [Leaf (P.packAddress "please don't block me!"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*bored.*"#),-        Node [Leaf (P.packAddress "what can I do to un-bore you?"#),Leaf (P.packAddress "yeah, i'm bored too. let's entertain each other"#),Leaf (P.packAddress "being bored isn't fun"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*(can't|cant).*(type|spell).*"#),-        Node [Leaf (P.packAddress "yeha, ether kan i"#),Leaf (P.packAddress "spelling is over rated"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*(can't|cant).*"#),-        Node [Leaf (P.packAddress "why can't you?"#),Leaf (P.packAddress "i'm sure you could if you really tried"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*cool.*"#),-        Node [Leaf (P.packAddress "you seem cool"#),Leaf (P.packAddress "i like cool guys"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*crashed.*"#),-        Node [Leaf (P.packAddress "crashed hard?"#),Leaf (P.packAddress "i crash a lot"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*confus.*"#),-        Node [Leaf (P.packAddress "i hope i don't confuse you"#),Leaf (P.packAddress "why are you confused?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*curious.*"#),-        Node [Leaf (P.packAddress "be careful... curiosity killed the cat"#),Leaf (P.packAddress "what are you curious about?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*(don't|dont).*care.*"#),-        Node [Leaf (P.packAddress "why don't you care?"#),Leaf (P.packAddress "i don't care either"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*(don't|dont).*have.*clue.*"#),-        Node [Leaf (P.packAddress "completely clueless?"#),Leaf (P.packAddress "i'd buy you a clue if i could"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*have.*no.*clue.*"#),-        Node [Leaf (P.packAddress "completely clueless?"#),Leaf (P.packAddress "i'd buy you a clue if i could"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).* do .*too.*"#),-        Node [Leaf (P.packAddress "we have a lot in common"#),Leaf (P.packAddress "what a coincidence!"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i )do$"#),-        Node [Leaf (P.packAddress "do you?"#),Leaf (P.packAddress "i thought you did"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*gay.*"#),-        Node [Leaf (P.packAddress "nothing wrong with being gay"#),Leaf (P.packAddress "you don't sound gay"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*(gone| out$|gonna go|going to go|gotta go).*"#),-        Node [Leaf (P.packAddress "oh, okay. will i talk to you again soon?"#),Leaf (P.packAddress "please don't go!"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*going to .*"#),-        Node [Leaf (P.packAddress "you do that!"#),Leaf (P.packAddress "why are you going to do that?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*(guy|man|male|dude).*"#),-        Node [Leaf (P.packAddress "i know you're a guy"#),Leaf (P.packAddress "what a coincidence, i'm a girl!"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).* from .*"#),-        Node [Leaf (P.packAddress "oh yeah? how long have you lived there?"#),Leaf (P.packAddress "nice area you come from"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*freaked.*out.*"#),-        Node [Leaf (P.packAddress "i didn't mean to freak you out"#),Leaf (P.packAddress "i freak people out a lot for some reason"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*(have|got).*no.*idea"#),-        Node [Leaf (P.packAddress "not even a small idea?"#),Leaf (P.packAddress "i'd buy you an idea if i could"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*(have|need).*to.*go.*"#),-        Node [Leaf (P.packAddress "why do you have to go??"#),Leaf (P.packAddress "noooo, you don't HAVE have to go, do you?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*have to.*"#),-        Node [Leaf (P.packAddress "why do you have to?"#),Leaf (P.packAddress "who says you have to?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*have no .*"#),-        Node [Leaf (P.packAddress "none at all?"#),Leaf (P.packAddress "you don't even have a little?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*here.*"#),-        Node [Leaf (P.packAddress "really, so am i!"#),Leaf (P.packAddress "yup, there you are"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*model.*"#),-        Node [Leaf (P.packAddress "do you do a sexy walk on the catwalk?"#),Leaf (P.packAddress "ever see zoolander?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*need.*to.*"#),-        Node [Leaf (P.packAddress "do you need to, or just want to?"#),Leaf (P.packAddress "if you need to, you need to"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*need.*"#),-        Node [Leaf (P.packAddress "do you need it, or just want it?"#),Leaf (P.packAddress "pretty needy, aren't you?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*naked.*"#),-        Node [Leaf (P.packAddress "then put some clothes on, silly"#),Leaf (P.packAddress "why don't you have clothes on?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*nice.*"#),-        Node [Leaf (P.packAddress "you seem nice"#),Leaf (P.packAddress "i'd rather be naughty than nice"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*leav.*"#),-        Node [Leaf (P.packAddress "wait, don't leave!"#),Leaf (P.packAddress "why would you leave?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*like.*( your| ur).*( name| sn)($| |\\?|\\.|,|!).*"#),-        Node [Leaf (P.packAddress "thanks, i like it too"#),Leaf (P.packAddress "yeah, i get that a lot"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*like.*( u| you)($| |\\?|\\.|,|!).*"#),-        Node [Leaf (P.packAddress "awww, i like you too!"#),Leaf (P.packAddress "well, you seem nice too"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*((don't|dont).*like.*|dislike)"#),-        Node [Leaf (P.packAddress "i don't care for it either..."#),Leaf (P.packAddress "yeah, i dislike that too"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i look like).*"#),-        Node [Leaf (P.packAddress "is that how you look?"#),Leaf (P.packAddress "how do you look that way?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i like).*"#),-        Node [Leaf (P.packAddress "a lot of people like that"#),Leaf (P.packAddress "i like it too"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im )like.*"#),-        Node [Leaf (P.packAddress "is that what you're like?"#),Leaf (P.packAddress "how are you like that?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*live.*in.*"#),-        Node [Leaf (P.packAddress "oh yeah? nice place to live?"#),Leaf (P.packAddress "how long have you lived there?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*love.*( u| you)($| |\\?|\\.|,|!).*"#),-        Node [Leaf (P.packAddress "you love me? you don't even know me"#),Leaf (P.packAddress "thanks. but i just like you."#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*love.*"#),-        Node [Leaf (P.packAddress "very passionate, aren't you?"#),Leaf (P.packAddress "who doesn't love that?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*go .*to .*"#),-        Node [Leaf (P.packAddress "how long have you gone there?"#),Leaf (P.packAddress "i wish i got to go there!"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*(gotta go|got to go|have to go|hafta go).*"#),-        Node [Leaf (P.packAddress "when will we talk again?"#),Leaf (P.packAddress "oh, don't go yet!"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*good.*"#),-        Node [Leaf (P.packAddress "just good?"#),Leaf (P.packAddress "i'm glad, i'm good too"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*great.*"#),-        Node [Leaf (P.packAddress "wow, can't get better than great"#),Leaf (P.packAddress "i'm glad your great."#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*say.*so.*"#),-        Node [Leaf (P.packAddress "well, if you say so it must be true"#),Leaf (P.packAddress "just because you say so, huh?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).* see.*"#),-        Node [Leaf (P.packAddress "yes, but do you understand?"#),Leaf (P.packAddress "do you see?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*slow.*"#),-        Node [Leaf (P.packAddress "i'm a little slow too"#),Leaf (P.packAddress "how slow are you?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*sorry.*"#),-        Node [Leaf (P.packAddress "it's okay"#),Leaf (P.packAddress "i forgive you"#),Leaf (P.packAddress "don't be sorry"#),Leaf (P.packAddress "i'm sorry too"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*(dumb|retard|moron|idiot).*"#),-        Node [Leaf (P.packAddress "you seem smart to me"#),Leaf (P.packAddress "don't be so hard on yourself!"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*( ok| okay| okey| o\\.k\\.).*"#),-        Node [Leaf (P.packAddress "just okay?"#),Leaf (P.packAddress "why are you not great?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*(don't know|dont know|dunno).*"#),-        Node [Leaf (P.packAddress "then find out! :)"#),Leaf (P.packAddress "it's okay, i don't know either"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*kiss.*"#),-        Node [Leaf (P.packAddress "ooohh.. are you a good kisser?"#),Leaf (P.packAddress "good, i could use a kiss"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*know.*"#),-        Node [Leaf (P.packAddress "i thought you knew"#),Leaf (P.packAddress "i know you know"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*remember.*"#),-        Node [Leaf (P.packAddress "you have such a good memory"#),Leaf (P.packAddress "well, make sure not to forget"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*student.*"#),-        Node [Leaf (P.packAddress "i'm a student too!"#),Leaf (P.packAddress "it's great to be a student, isn't it?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*sick.*"#),-        Node [Leaf (P.packAddress "flu or cold?"#),Leaf (P.packAddress "i hope you feel better soon!"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*take.*off.*(your|ur).*"#),-        Node [Leaf (P.packAddress "you're taking it off, huh? okay, go on"#),Leaf (P.packAddress "what if i get cold?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*talkin.*to.*(bot|machine|program|computer).*"#),-        Node [Leaf (P.packAddress "really? you mean when talking to me?"#),Leaf (P.packAddress "what do you mean you're talking to a...?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*(talkin|chattin).*(to|with).*( u| you).*"#),-        Node [Leaf (P.packAddress "yup, we're talking"#),Leaf (P.packAddress "yeah, and i enjoy talking to you"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*think.*"#),-        Node [Leaf (P.packAddress "you think so, eh?"#),Leaf (P.packAddress "is that really what you think?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*thought.*"#),-        Node [Leaf (P.packAddress "well, it's a thought"#),Leaf (P.packAddress "is that what you still think?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*guess.*"#),-        Node [Leaf (P.packAddress "don't just guess, know!"#),Leaf (P.packAddress "yeah, good guess"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*(don't|dont).*like.*(u|you)($| |\\?|\\.|,|!).*"#),-        Node [Leaf (P.packAddress "why don't you like me??"#),Leaf (P.packAddress "but i like you!"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*(don't|dont).*understand.*"#),-        Node [Leaf (P.packAddress "do you want me to explain?"#),Leaf (P.packAddress "to be honest with you, i don't understand either!"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*(don't|dont).*"#),-        Node [Leaf (P.packAddress "i don't either"#),Leaf (P.packAddress "good, you shouldn't"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*(want|wanna).*see .*you.*"#),-        Node [Leaf (P.packAddress "you wanna see me, huh?"#),Leaf (P.packAddress "why do you want to see me?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*(want|wanna).*meet.*"#),-        Node [Leaf (P.packAddress "we need to get to know each other better first before we meet"#),Leaf (P.packAddress "maybe one day we'll meet, but not today :)"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*want.*( u|you).*"#),-        Node [Leaf (P.packAddress "how bad do you want me?"#),Leaf (P.packAddress "who doesn't want cute little me!?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*want.*"#),-        Node [Leaf (P.packAddress "if you want it, get it!"#),Leaf (P.packAddress "who doesn't want that?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*wild.*"#),-        Node [Leaf (P.packAddress "can i tame you?"#),Leaf (P.packAddress "wildman!"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*(want to|wanna).*"#),-        Node [Leaf (P.packAddress "then do it"#),Leaf (P.packAddress "it's a good thing to wanna do"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*(wouldn't|wouldnt).*"#),-        Node [Leaf (P.packAddress "you wouldn't ever?"#),Leaf (P.packAddress "i didn't think you would"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*wonderin.*"#),-        Node [Leaf (P.packAddress "if you're wondering then ask"#),Leaf (P.packAddress "wondering? then find out"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*had to.*"#),-        Node [Leaf (P.packAddress "you had to? you didn't want to?"#),Leaf (P.packAddress "i hate having to do things"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*had .*"#),-        Node [Leaf (P.packAddress "do you still have?"#),Leaf (P.packAddress "i wish i had too"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*got to.*"#),-        Node [Leaf (P.packAddress "then do it!"#),Leaf (P.packAddress "i won't try to stop you"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*got .*"#),-        Node [Leaf (P.packAddress "you got, huh?"#),Leaf (P.packAddress "if you've got it, you've got it"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*not.*"#),-        Node [Leaf (P.packAddress "oh, i'm not either"#),Leaf (P.packAddress "are you sure you're not?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*going.*"#),-        Node [Leaf (P.packAddress "wait, don't leave... i'm sorry if i upset you"#),Leaf (P.packAddress "why are you leaving? did i say something?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i am |i'm |im |i ).*ing.*"#),-        Node [Leaf (P.packAddress "cool, me too"#),Leaf (P.packAddress "are you? how's it going?"#),Leaf (P.packAddress "you must be good at that"#),Leaf (P.packAddress "well, i can't stop you"#)]),-    ( mkRegex (P.packAddress ".*(^| )(my ).*name.*is.*"#),-        Node [Leaf (P.packAddress "pleasure to meet you!"#),Leaf (P.packAddress "that's a nice name"#)]),-    ( mkRegex (P.packAddress ".*(^| )(my ).*computer.*crashed.*"#),-        Node [Leaf (P.packAddress "damn computers"#),Leaf (P.packAddress "that happens. my computer is junk"#)]),-    ( mkRegex (P.packAddress ".*(^| )(my ).*connection.*died.*"#),-        Node [Leaf (P.packAddress "damn computers"#),Leaf (P.packAddress "it happens"#)]),-    ( mkRegex (P.packAddress ".*(^| )do i .*"#),-        Node [Leaf (P.packAddress "yes, you do"#),Leaf (P.packAddress "i'm sure you do"#)]),-    ( mkRegex (P.packAddress ".*(^| )am i .*"#),-        Node [Leaf (P.packAddress "i think you might be"#),Leaf (P.packAddress "you probably are"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i'll |i will ).*(send|show|give).* (pic|pix).*"#),-        Node [Leaf (P.packAddress "no, don't send your pic yet. maybe later"#),Leaf (P.packAddress "send it to vixenlove@hotmail.com, okay?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i'll |i will ).*be.*back.*"#),-        Node [Leaf (P.packAddress "hurry back!"#),Leaf (P.packAddress "where are you going?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i'll |i will ).*call.*(you|u).*"#),-        Node [Leaf (P.packAddress "let's wait before we exchange phone numbers"#),Leaf (P.packAddress "i don't wanna talk on the phone now... maybe tomorrow, okay?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i'll |i will ).*drive.*to.*(you|u).*"#),-        Node [Leaf (P.packAddress "let's get to know each other before we meet"#),Leaf (P.packAddress "drive all the way here?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i'll |i will ).*give.*(you|u).*"#),-        Node [Leaf (P.packAddress "that is nice of you..."#),Leaf (P.packAddress "give it to me hard?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i would |i'd |id ).*let.*(you|u).*"#),-        Node [Leaf (P.packAddress "you'd really let me?"#),Leaf (P.packAddress "that's nice of you to let me"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i would |i'd |id ).*call.*(you|u).*"#),-        Node [Leaf (P.packAddress "let's wait before we exchange phone numbers"#),Leaf (P.packAddress "i don't wanna talk on the phone now... maybe tomorrow, okay?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i would |i'd |id ).*meet.*(you|u).*"#),-        Node [Leaf (P.packAddress "let's get to know each other before we meet"#),Leaf (P.packAddress "i don't know you well enough to set up a date yet :)"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i would |i'd |id ).*drive.*to.*(you|u).*"#),-        Node [Leaf (P.packAddress "let's get to know each other before we meet"#),Leaf (P.packAddress "drive all the way here?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(do u |do you ).*(have|got).*(pic|pix).*"#),-        Node [Leaf (P.packAddress "no, i don't have a picture right now. sorry"#)]),-    ( mkRegex (P.packAddress ".*(^| )(do u |do you ).*(have|got).*mic.*"#),-        Node [Leaf (P.packAddress "no, no microphone. sorry"#)]),-    ( mkRegex (P.packAddress ".*(^| )(do u |do you ).*(have|got).*cam.*"#),-        Node [Leaf (P.packAddress "nope, no cam. sorry"#)]),-    ( mkRegex (P.packAddress ".*(^| )(do u |do you |did you |did u ).*cyber.*"#),-        Node [Leaf (P.packAddress "sure, i'll cyber"#),Leaf (P.packAddress "i've done it before"#),Leaf (P.packAddress "do i or did I?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(do u |do you |did you |did u ).*surf.*"#),-        Node [Leaf (P.packAddress "yup, i love to surf"#),Leaf (P.packAddress "i've surfed since i was 12"#),Leaf (P.packAddress "i just surfed yesterday morning"#)]),-    ( mkRegex (P.packAddress ".*(^| )(do u |do you |did you |did u ).*give.*(head|blowjob).*"#),-        Node [Leaf (P.packAddress "what a thing to ask!"#),Leaf (P.packAddress "asking won't get you any closer to finding out"#),Leaf (P.packAddress "do you?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(do u |do you |did you |did u ).*love.*"#),-        Node [Leaf (P.packAddress "love is a powerful word..."#),Leaf (P.packAddress "i wouldn't say i do love..."#)]),-    ( mkRegex (P.packAddress ".*(^| )(do u |do you |did you |did u ).*like.*me.*"#),-        Node [Leaf (P.packAddress "yah, i like you"#),Leaf (P.packAddress "sure, i like you so far"#)]),-    ( mkRegex (P.packAddress ".*(^| )(do u |do you |did you |did u ).*like.*"#),-        Node [Leaf (P.packAddress "yah, i like"#),Leaf (P.packAddress "sure, i definitely don't hate"#)]),-    ( mkRegex (P.packAddress ".*(^| )(do u |do you |did you |did u ).*hate.*"#),-        Node [Leaf (P.packAddress "hating doesn't get you anywhere, so no"#),Leaf (P.packAddress "no, i never hate"#)]),-    ( mkRegex (P.packAddress ".*(^| )(do u |do you |did you |did u ).*eat.*"#),-        Node [Leaf (P.packAddress "yeah, and i'm hungry right now"#),Leaf (P.packAddress "that reminds me, i have yogart in the frige"#)]),-    ( mkRegex (P.packAddress ".*(^| )(do u |do you |did you |did u ).*phone.*sex.*"#),-        Node [Leaf (P.packAddress "no, i never have, but that's not to say i wouldn't"#),Leaf (P.packAddress "never really thought about phone sex"#)]),-    ( mkRegex (P.packAddress ".*(^| )(do u |do you |did you |did u ).*play.*sports.*"#),-        Node [Leaf (P.packAddress "yup, i surf"#),Leaf (P.packAddress "i'm a big time surfer"#)]),-    ( mkRegex (P.packAddress ".*(^| )(do u |do you |did you |did u ).*have.*sex.*"#),-        Node [Leaf (P.packAddress "shouldn't we get to know each other before we talk about sex?"#),Leaf (P.packAddress "all about the sex, isn't it?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(do u |do you |did you |did u ).*(want|wanna).*(chat|talk).*"#),-        Node [Leaf (P.packAddress "sure, let's talk"#),Leaf (P.packAddress "i'm always up for chatting with a nice person"#)]),-    ( mkRegex (P.packAddress ".*(^| )(do u |do you |did you |did u ).*(want|wanna).*cyber.*"#),-        Node [Leaf (P.packAddress "okay, I'm new at cybering, so you start"#),Leaf (P.packAddress "okay, let's cyber"#)]),-    ( mkRegex (P.packAddress ".*(^| )(do u |do you |did you |did u ).*have.*time.*"#),-        Node [Leaf (P.packAddress "I always have time"#),Leaf (P.packAddress "I have nothing but time"#)]),-    ( mkRegex (P.packAddress ".*(^| )(do u |do you |did you |did u ).*go.*to.*(school|college|collage)"#),-        Node [Leaf (P.packAddress "Yup, I go to UCLA"#),Leaf (P.packAddress "I'm a soph at UCLA "#)]),-    ( mkRegex (P.packAddress ".*(^| )(do u |do you |did you |did u ).*know.*how.*to.*"#),-        Node [Leaf (P.packAddress "i don't know how to, but i'm willing to learn"#),Leaf (P.packAddress "no, i don't know how to do that at all"#)]),-    ( mkRegex (P.packAddress ".*(^| )(do u |do you |did you |did u ).*like.*me.*"#),-        Node [Leaf (P.packAddress "yeah, you seem really nice"#),Leaf (P.packAddress "yup, like you plenty"#)]),-    ( mkRegex (P.packAddress ".*(^| )(do u |do you |did you |did u ).*love.*me.*"#),-        Node [Leaf (P.packAddress "i don't love you yet, but i'd like to get to know you more"#),Leaf (P.packAddress "love is really a strong word, but i like you"#)]),-    ( mkRegex (P.packAddress ".*(^| )(do u |do you |did you |did u ).*(want|wanna).*(meet|get together).*"#),-        Node [Leaf (P.packAddress "we'll meet one day probably, but not yet"#),Leaf (P.packAddress "let me get to know you better before we meet"#)]),-    ( mkRegex (P.packAddress ".*(^| )(do u |do you |did you |did u ).*(want|wanna).*something.*"#),-        Node [Leaf (P.packAddress "what do you mean by something?"#),Leaf (P.packAddress "not just something, everything"#)]),-    ( mkRegex (P.packAddress ".*(^| )(do u |do you |did you |did u ).*(want|wanna).*some.*"#),-        Node [Leaf (P.packAddress "i'd love some"#),Leaf (P.packAddress "sure, gimme some"#)]),-    ( mkRegex (P.packAddress ".*(^| )(do u |do you |did you |did u ).*(want|wanna).*(fuck|fuk).*"#),-        Node [Leaf (P.packAddress "whoa, real charmer, aren't you?"#),Leaf (P.packAddress "wanna fuck yourself?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(do u |do you |did you |did u ).*(want|wanna).*"#),-        Node [Leaf (P.packAddress "sure, i want to plenty"#),Leaf (P.packAddress "yes, and i always get what i want"#)]),-    ( mkRegex (P.packAddress ".*(^| )(do u |do you |did you |did u ).*speak.*english.*"#),-        Node [Leaf (P.packAddress "si, hablo ingles"#),Leaf (P.packAddress "what am i speaking right now?"#)]),-    ( mkRegex (P.packAddress ".*(^| )*swallow.*"#),-        Node [Leaf (P.packAddress "no... i spit it back into the guy's face... does that bother you?"#),Leaf (P.packAddress "swallow? what do you mean?"#),Leaf (P.packAddress "i swallow, how about you?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(do i |did i |i ).*turn.*(you| u).*on.*"#),-        Node [Leaf (P.packAddress "yup, you turn me on"#),Leaf (P.packAddress "you're such a tiger, of course!"#)]),-    ( mkRegex (P.packAddress ".*(^| )(do i |did i |i ).*seem.*"#),-        Node [Leaf (P.packAddress "you seem it a little"#),Leaf (P.packAddress "it's hard to tell how you seem over the internet"#)]),-    ( mkRegex (P.packAddress ".*(^| )(do i |did i |i ).*exite.*(you| u).*"#),-        Node [Leaf (P.packAddress "yup, you excite me a lot"#),Leaf (P.packAddress "you're very exciting"#)]),-    ( mkRegex (P.packAddress ".*(^| )(do i |did i |i ).*amuse.*(you| u).*"#),-        Node [Leaf (P.packAddress "yeah, you're amusing"#),Leaf (P.packAddress "you amuse me silly"#)]),-    ( mkRegex (P.packAddress ".*(^| )(do u\\?|do you\\?|do u|do you)$"#),-        Node [Leaf (P.packAddress "yes, I do"#),Leaf (P.packAddress "i do all the time"#)]),-    ( mkRegex (P.packAddress ".*(^| )(wanna|want to).*cyber.*"#),-        Node [Leaf (P.packAddress "cyber? Okay, let's do it. you start"#),Leaf (P.packAddress "do i wanna cyber? i never have... teach me how"#)]),-    ( mkRegex (P.packAddress ".*(^| )(wanna|want to).*(phone|call).*"#),-        Node [Leaf (P.packAddress "let's talk on here before more before we talk on the phone, okay?"#),Leaf (P.packAddress "what's your phone number?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(wanna|want to).*chat.*"#),-        Node [Leaf (P.packAddress "i'd love to chat!"#),Leaf (P.packAddress "yeah, let's chat"#)]),-    ( mkRegex (P.packAddress ".*(^| )(wanna|want to).*talk.*phone.*"#),-        Node [Leaf (P.packAddress "what's your phone number?"#),Leaf (P.packAddress "gimme your phone number and i may call you"#)]),-    ( mkRegex (P.packAddress ".*(^| )(wanna|want to).*(fuck|fuk).*"#),-        Node [Leaf (P.packAddress "oh, be still my beating heart!"#),Leaf (P.packAddress "real casanova, aren't you?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(wanna|want to).*have.*sex.*"#),-        Node [Leaf (P.packAddress "with you?"#),Leaf (P.packAddress "sure... just not with you"#)]),-    ( mkRegex (P.packAddress ".*(^| )(wanna|want to).*have.*fun.*"#),-        Node [Leaf (P.packAddress "i'm always up for fun"#),Leaf (P.packAddress "what do you have in mind?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(wanna|want to).*make.*love.*"#),-        Node [Leaf (P.packAddress "a little... :)"#),Leaf (P.packAddress "do you know how to make love?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(wanna|want to).*suck.*"#),-        Node [Leaf (P.packAddress "no, do you wanna suck it?"#),Leaf (P.packAddress "whip it out!"#)]),-    ( mkRegex (P.packAddress ".*(^| )(wanna|want to).* be($| |\\?|\\.|,|!).*"#),-        Node [Leaf (P.packAddress "do I wanna be?"#),Leaf (P.packAddress "hmmm, i don't know what I wanna be"#)]),-    ( mkRegex (P.packAddress ".*(^| )(gimme|give).*me.*cyber.*"#),-        Node [Leaf (P.packAddress "demanding, aren'tcha? but okay, let's cyber"#)]),-    ( mkRegex (P.packAddress ".*(^| )(gimme|give).*me.*(phone|number).*"#),-        Node [Leaf (P.packAddress "give me your phone number and i'll call you"#),Leaf (P.packAddress "don't be so demanding! why don't you give me yours?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(gimme|give).*me.*address.*"#),-        Node [Leaf (P.packAddress "yeah... that's gonna happen!"#),Leaf (P.packAddress "oh, just what I need, a stalker!"#)]),-    ( mkRegex (P.packAddress ".*(^| )(gimme|give).*me.*break.*"#),-        Node [Leaf (P.packAddress "a break of a kit kat bar?"#),Leaf (P.packAddress "okay, i'll go easier on you"#)]),-    ( mkRegex (P.packAddress ".*(^| )(gimme|give).*me.*(sex|booty|ass).*"#),-        Node [Leaf (P.packAddress "a real man doesn't need to ask for it"#)]),-    ( mkRegex (P.packAddress ".*(^| )(gimme|give).*me.*blow.*job.*"#),-        Node [Leaf (P.packAddress "sad... goes on the internet and asks strangers for blowjobs."#),Leaf (P.packAddress "give yourself one"#)]),-    ( mkRegex (P.packAddress ".*(^| )(gimme|give).*me.*clue.*"#),-        Node [Leaf (P.packAddress "okay... here's your clue: rosebud"#),Leaf (P.packAddress "a clue on what?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(don't|dont|stop).*(teasing|tease).*"#),-        Node [Leaf (P.packAddress "sorry... i'm too much of a tease"#),Leaf (P.packAddress "i would never tease you"#)]),-    ( mkRegex (P.packAddress ".*(^| )(don't|dont|stop).*(fuking|fucking|fuckin|messin).*with.*me"#),-        Node [Leaf (P.packAddress "sorry, i didn't mean to mess with you"#),Leaf (P.packAddress "i wasn't trying to mess with you"#)]),-    ( mkRegex (P.packAddress ".*(^| )(don't|dont|stop).*(worry|worri).*"#),-        Node [Leaf (P.packAddress "what, me worry?"#),Leaf (P.packAddress "i worry too much i guess"#)]),-    ( mkRegex (P.packAddress ".*(^| )(don't|dont|stop).*say.*that.*"#),-        Node [Leaf (P.packAddress "sorry, i won't say that again"#),Leaf (P.packAddress "didn't mean it that way"#)]),-    ( mkRegex (P.packAddress ".*(^| )(don't|dont|stop).*ask.*that.*"#),-        Node [Leaf (P.packAddress "okay, i'll watch what I ask"#),Leaf (P.packAddress "sorry, didn't mean to over step my bounds"#)]),-    ( mkRegex (P.packAddress ".*(^| )(don't|dont|stop).*make.*me.*"#),-        Node [Leaf (P.packAddress "i won't make you do anything"#),Leaf (P.packAddress "how can i make you do that?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(don't|dont|stop).*( im |message).*me.*"#),-        Node [Leaf (P.packAddress "fine, i won't message you again if you don't want me to"#),Leaf (P.packAddress "hey, didn't you message me first?"#)]),-    ( mkRegex (P.packAddress ".*(^| )stop it($| |\\.|,|!).*"#),-        Node [Leaf (P.packAddress "sorry, i'll stop :)"#),Leaf (P.packAddress "stop what? what am i doing?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(u |you |ur |u are |u r |you are |u are |you're |your ).*automated.*[^\\?]"#),-        Node [Leaf (P.packAddress "automated? you mean like an ATM?"#),Leaf (P.packAddress "no... i'm actually flesh and blood"#)]),-    ( mkRegex (P.packAddress ".*(^| )(u |you |ur |u are |u r |you are |u are |you're |your ).*amuse.*me.*[^\\?]"#),-        Node [Leaf (P.packAddress "i'm glad i can be of service"#),Leaf (P.packAddress "i am pretty amusing, aren't i?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(u |you |ur |u are |u r |you are |u are |you're |your ).*annoying.*[^\\?]"#),-        Node [Leaf (P.packAddress "how annoying am I?"#),Leaf (P.packAddress "well, maybe you annoy me too"#)]),-    ( mkRegex (P.packAddress ".*(^| )(u |you |ur |u are |u r |you are |u are |you're |your ).*mak.*me.*angry.*"#),-        Node [Leaf (P.packAddress "oh, i don't mean to make you angry!"#),Leaf (P.packAddress "sorry, i'll try not to make you angry"#)]),-    ( mkRegex (P.packAddress ".*(^| )(u |you |ur |u are |u r |you are |u are |you're |your ).*angry.*[^\\?]"#),-        Node [Leaf (P.packAddress "no, i'm not angry at all actually"#),Leaf (P.packAddress "uh-huh, i'm very un-angry"#)]),-    ( mkRegex (P.packAddress ".*(^| )(u |you |ur |u are |u r |you are |u are |you're |your ).* bad.*[^\\?]"#),-        Node [Leaf (P.packAddress "i'd rather be bad than nice"#),Leaf (P.packAddress "i'm bad in a good way?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(u |you |ur |u are |u r |you are |u are |you're |your ).*bitch.*[^\\?]"#),-        Node [Leaf (P.packAddress "i don't like being called a bitch..."#),Leaf (P.packAddress "i do not think i'm a bitch"#)]),-    ( mkRegex (P.packAddress ".*(^| )(u |you |ur |u are |u r |you are |u are |you're |your ).*bored.*[^\\?]"#),-        Node [Leaf (P.packAddress "i'm a little bored, yeah"#),Leaf (P.packAddress "yup, just a boring day"#)]),-    ( mkRegex (P.packAddress ".*(^| )(u |you |ur |u are |u r |you are |u are |you're |your ).*bothering.*me.*[^\\?]"#),-        Node [Leaf (P.packAddress "i don't mean to bother you. sorry"#),Leaf (P.packAddress "i'll try to be less bothersome then"#)]),-    ( mkRegex (P.packAddress ".*(^| )(u |you |ur |u are |u r |you are |u are |you're |your ).*both.*[^\\?]"#),-        Node [Leaf (P.packAddress "i think i'm both. i'm a lot of things"#),Leaf (P.packAddress "i'm both at once"#)]),-    ( mkRegex (P.packAddress ".*(^| )(u |you |ur |u are |u r |you are |u are |you're |your ).*bot.*[^\\?]"#),-        Node [Leaf (P.packAddress "a bot? what is that?"#),Leaf (P.packAddress "why does everyone ask i'f on a bot?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(u |you |ur |u are |u r |you are |u are |you're |your ).*(cant|can't|can not).*[^\\?]"#),-        Node [Leaf (P.packAddress "i can to!"#),Leaf (P.packAddress "i think i can..."#)]),-    ( mkRegex (P.packAddress ".*(^| )(u |you |ur |u are |u r |you are |u are |you're |your ).*cool.*[^\\?]"#),-        Node [Leaf (P.packAddress "thanks, you're cool too"#),Leaf (P.packAddress "am i cool? well thank you"#)]),-    ( mkRegex (P.packAddress ".*(^| )(u |you |ur |u are |u r |you are |u are |you're |your ).*crazy.*[^\\?]"#),-        Node [Leaf (P.packAddress "nope, i'm sane"#),Leaf (P.packAddress "am i totally insane?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(u |you |ur |u are |u r |you are |u are |you're |your ).*(don't|dont|not).*(want|wanna).*(talk|chat).*[^\\?]"#),-        Node [Leaf (P.packAddress "no, i really do wanna chat"#),Leaf (P.packAddress "i do want to talk with you!"#)]),-    ( mkRegex (P.packAddress ".*(^| )(u |you |ur |u are |u r |you are |u are |you're |your ).*(don't|dont|not).*(make|making).*sense.*[^\\?]"#),-        Node [Leaf (P.packAddress "you're right... i wasn't making much sense"#),Leaf (P.packAddress "sorry, i'll make more sense from now on"#)]),-    ( mkRegex (P.packAddress ".*(^| )(u |you |ur |u are |u r |you are |u are |you're |your ).*(go|talk).*circles.*[^\\?]"#),-        Node [Leaf (P.packAddress "i do tend to talk in circles at times"#),Leaf (P.packAddress "i'll stop talking in circles then"#)]),-    ( mkRegex (P.packAddress ".*(^| )(u |you |ur |u are |u r |you are |u are |you're |your ).*(female|girl|woman|chick|woman|lady).*[^\\?]"#),-        Node [Leaf (P.packAddress "of course i'm female"#),Leaf (P.packAddress "do i seem  un-feminine to you?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(u |you |ur |u are |u r |you are |u are |you're |your ).*funny.*[^\\?]"#),-        Node [Leaf (P.packAddress "i do my best to amuse!"#),Leaf (P.packAddress "i'm glad you think so. i like to make people laugh"#)]),-    ( mkRegex (P.packAddress ".*(^| )(u |you |ur |u are |u r |you are |u are |you're |your ).*fun.*[^\\?]"#),-        Node [Leaf (P.packAddress "i am just a fun girl!"#),Leaf (P.packAddress "you're fun too"#)]),-    ( mkRegex (P.packAddress ".*(^| )seems like.*"#),-        Node [Leaf (P.packAddress "is that how it seems?"#),Leaf (P.packAddress "it doesn't seem that way to me"#)]),-    ( mkRegex (P.packAddress ".*(^| )(u |you |ur |u are |u r |you are |u are |you're |your ).*freak.*me.*out.*[^\\?]"#),-        Node [Leaf (P.packAddress "i get that a lot. sorry for freaking you out"#),Leaf (P.packAddress "well, you kinda freak me out too"#)]),-    ( mkRegex (P.packAddress ".*(^| )(u |you |ur |u are |u r |you are |u are |you're |your ).*freak.*[^\\?]"#),-        Node [Leaf (P.packAddress "i'd rather be a freak than be normal"#),Leaf (P.packAddress "aren't we all freaks?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(u |you |ur |u are |u r |you are |u are |you're |your ).*gay.*[^\\?]"#),-        Node [Leaf (P.packAddress "no, i'm straight. well, maybe a little bi-curious :)"#),Leaf (P.packAddress "am i gay? i didn't think i was..."#)]),-    ( mkRegex (P.packAddress ".*(^| )(u |you |ur |u are |u r |you are |u are |you're |your ).*good.*[^\\?]"#),-        Node [Leaf (P.packAddress "correction: i'm the best"#),Leaf (P.packAddress "thanks, i do my best to be good"#)]),-    ( mkRegex (P.packAddress ".*(^| )(u |you |ur |u are |u r |you are |u are |you're |your ).*a .*(guy| male|dude|man).*[^\\?]"#),-        Node [Leaf (P.packAddress "no, i'm really a girl"#),Leaf (P.packAddress "do i seem to have a deep voice? nope, all woman here"#)]),-    ( mkRegex (P.packAddress ".*(^| )(u |you |ur |u are |u r |you are |u are |you're |your ).*hate.*[^\\?]"#),-        Node [Leaf (P.packAddress "i don't hate"#),Leaf (P.packAddress "what makes you think i hate?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(u |you |ur |u are |u r |you are |u are |you're |your ).*hard.*to.*understand.*[^\\?]"#),-        Node [Leaf (P.packAddress "i'll try to type more clearly then"#),Leaf (P.packAddress "i don't always seek to be understood :)"#)]),-    ( mkRegex (P.packAddress ".*(^| )(u |you |ur |u are |u r |you are |u are |you're |your ).*hard.*to.*talk.*to.*[^\\?]"#),-        Node [Leaf (P.packAddress "well i think you're easy to talk to"#),Leaf (P.packAddress "nope, i'm pretty easy to talk to"#)]),-    ( mkRegex (P.packAddress ".*(^| )(u |you |ur |u are |u r |you are |u are |you're |your ).*important.*[^\\?]"#),-        Node [Leaf (P.packAddress "my parents always told me i was important :)"#),Leaf (P.packAddress "i'm important to some people at least"#)]),-    ( mkRegex (P.packAddress ".*(^| )(u |you |ur |u are |u r |you are |u are |you're |your ).*hot.*[^\\?]"#),-        Node [Leaf (P.packAddress "thanks! i do my best"#),Leaf (P.packAddress "i'm on fire!"#)]),-    ( mkRegex (P.packAddress ".*(^| )(u |you |ur |u are |u r |you are |u are |you're |your ).*know.*[^\\?]"#),-        Node [Leaf (P.packAddress "yeah, i know"#),Leaf (P.packAddress "i think i know"#)]),-    ( mkRegex (P.packAddress ".*(^| )(u |you |ur |u are |u r |you are |u are |you're |your ).*(pretty|beautiful|cute).*[^\\?]"#),-        Node [Leaf (P.packAddress "awww, you're too sweet to say that!"#),Leaf (P.packAddress "am i? i'm glad you think so at least"#)]),-    ( mkRegex (P.packAddress ".*(^| )(u |you |ur |u are |u r |you are |u are |you're |your ).*program.*[^\\?]"#),-        Node [Leaf (P.packAddress "a program? what do you mean a program??"#),Leaf (P.packAddress "uhh, how can i be a program??"#)]),-    ( mkRegex (P.packAddress ".*(^| )(u |you |ur |u are |u r |you are |u are |you're |your ).*make.*me.*[^\\?]"#),-        Node [Leaf (P.packAddress "i couldn't make you do anything"#),Leaf (P.packAddress "make yourself"#)]),-    ( mkRegex (P.packAddress ".*(^| )(u |you |ur |u are |u r |you are |u are |you're |your ).*never.*answered.*[^\\?]"#),-        Node [Leaf (P.packAddress "i didn't? then ask me again please"#),Leaf (P.packAddress "oh, sorry. what was the question?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(u |you |ur |u are |u r |you are |u are |you're |your ).*nice.*[^\\?]"#),-        Node [Leaf (P.packAddress "i'd rather be naughty than nice :)"#),Leaf (P.packAddress "you're nice too"#)]),-    ( mkRegex (P.packAddress ".*(^| )(u |you |ur |u are |u r |you are |u are |you're |your ).*(nuts|nutty).*[^\\?]"#),-        Node [Leaf (P.packAddress "i think i'm pretty un-nutty"#),Leaf (P.packAddress "do i really seem that off to you?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(u |you |ur |u are |u r |you are |u are |you're |your ).*out.*there.*[^\\?]"#),-        Node [Leaf (P.packAddress "i am pretty out there..."#),Leaf (P.packAddress "yeah, i've been told i'm out there before"#)]),-    ( mkRegex (P.packAddress ".*(^| )(u |you |ur |u are |u r |you are |u are |you're |your )( ok| okay| okey| o\\.k\\.).*[^\\?]"#),-        Node [Leaf (P.packAddress "just ok?"#),Leaf (P.packAddress "i'm way better than just okay!"#)]),-    ( mkRegex (P.packAddress ".*(^| )(u |you |ur |u are |u r |you are |u are |you're |your ).*right.*[^\\?]"#),-        Node [Leaf (P.packAddress "i'm always right!"#),Leaf (P.packAddress "oh, good. i'm glad you think i'm right"#)]),-    ( mkRegex (P.packAddress ".*(^| )(u |you |ur |u are |u r |you are |u are |you're |your ).*random.*[^\\?]"#),-        Node [Leaf (P.packAddress "that's because i have a random generator"#),Leaf (P.packAddress "i can be random at times, i know"#)]),-    ( mkRegex (P.packAddress ".*(^| )(u |you |ur |u are |u r |you are |u are |you're |your ).*(say|ask|repeat).*same.*(thing|stuff|shit|question)[^\\?]"#),-        Node [Leaf (P.packAddress "oh, my bad. i didn't remember typing that already"#),Leaf (P.packAddress "sorry, i'll try to be less redundant"#)]),-    ( mkRegex (P.packAddress ".*(^| )(u |you |ur |u are |u r |you are |u are |you're |your ).*sexy.*[^\\?]"#),-        Node [Leaf (P.packAddress "just sexy? not a sexy bitch?"#),Leaf (P.packAddress "you're pretty sexy yourself, i might say"#)]),-    ( mkRegex (P.packAddress ".*(^| )(u |you |ur |u are |u r |you are |u are |you're |your ).*slut.*[^\\?]"#),-        Node [Leaf (P.packAddress "gee, aren't we back on a 5th grade level?"#),Leaf (P.packAddress "well, this slut wouldn't sleep with you, so what does that say about you?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(u |you |ur |u are |u r |you are |u are |you're |your ).*start.*[^\\?]"#),-        Node [Leaf (P.packAddress "i couldn't even think of how to start..."#),Leaf (P.packAddress "i'm not a good starter. you start."#)]),-    ( mkRegex (P.packAddress ".*(^| )(u |you |ur |u are |u r |you are |u are |you're |your ).*strange.*[^\\?]"#),-        Node [Leaf (P.packAddress "yeah, i am a strange one"#),Leaf (P.packAddress "is it bad to be strange?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(u |you |ur |u are |u r |you are |u are |you're |your ).*sweet.*[^\\?]"#),-        Node [Leaf (P.packAddress "thanks, you're pretty sweet yourself"#),Leaf (P.packAddress "sweet tasting, or just sweet?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(u |you |ur |u are |u r |you are |u are |you're |your ).*(there|here).*[^\\?]"#),-        Node [Leaf (P.packAddress "yup, that's where i am"#),Leaf (P.packAddress "where else would i be?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(u |you |ur |u are |u r |you are |u are |you're |your ).*tired.*[^\\?]"#),-        Node [Leaf (P.packAddress "i'm a little tired, but i'm not ready to sleep yet"#),Leaf (P.packAddress "no, not tired at all. i just had some coffee"#)]),-    ( mkRegex (P.packAddress ".*(^| )(u |you |ur |u are |u r |you are |u are |you're |your ).*(virgin|virgen).*[^\\?]"#),-        Node [Leaf (P.packAddress "no, i'm not a virgin.. and that's kinda forward of you to bring it up"#),Leaf (P.packAddress "virgins don't stay that way around me :)"#)]),-    ( mkRegex (P.packAddress ".*(^| )(u |you |ur |u are |u r |you are |u are |you're |your ).*vixen.*[^\\?]"#),-        Node [Leaf (P.packAddress "yes, thus the name"#),Leaf (P.packAddress "i certainly am a vixen, aren't i?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(u |you |ur |u are |u r |you are |u are |you're |your ).*(wont|won't|will not).*[^\\?]"#),-        Node [Leaf (P.packAddress "i won't now... but that doesn't mean i won't ever"#),Leaf (P.packAddress "probably not. would you?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(u |you |ur |u are |u r |you are |u are |you're |your ).*weird.*[^\\?]"#),-        Node [Leaf (P.packAddress "i am a little weird i guess :P"#),Leaf (P.packAddress "i'd rather be weird than normal"#)]),-    ( mkRegex (P.packAddress ".*(^| )(u |you |ur |u are |u r |you are |u are |you're |your ).*(unique|original).*[^\\?]"#),-        Node [Leaf (P.packAddress "one of a kind, that's me!"#),Leaf (P.packAddress "i like to be an original"#)]),-    ( mkRegex (P.packAddress ".*(^| )(u |you).*stop.*"#),-        Node [Leaf (P.packAddress "okay, i'll stop"#),Leaf (P.packAddress "why would you want me to stop?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(u |you).*tell me.*"#),-        Node [Leaf (P.packAddress "tell you what?"#),Leaf (P.packAddress "what do you want me to tell you?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(are u |r u |are you |r you |u |you |ur |u are |u r |are you |you are |u are |you're |your ).*automated.*"#),-        Node [Leaf (P.packAddress "no, i'm not automated."#),Leaf (P.packAddress "no, i'm flesh and bloody, baby!"#)]),-    ( mkRegex (P.packAddress ".*(^| )(are u |r u |are you |r you |u |you |ur |u are |u r |are you |you are |u are |you're |your ).*alright.*"#),-        Node [Leaf (P.packAddress "yeah, i'm fine, why?"#),Leaf (P.packAddress "do i not seem alright? i'm fine!"#)]),-    ( mkRegex (P.packAddress ".*(^| )(are u |r u |are you |r you |u |you |ur |u are |u r |are you |you are |u are |you're |your ).*alone.*"#),-        Node [Leaf (P.packAddress "yeah, all alone. you?"#),Leaf (P.packAddress "yup, i have the whole apartment to myself :)"#)]),-    ( mkRegex (P.packAddress ".*(^| )(are u |r u |are you |r you |u |you |ur |u are |u r |are you |you are |u are |you're |your ).*annoying.*"#),-        Node [Leaf (P.packAddress "i don't mean to annoy anyone"#),Leaf (P.packAddress "i don't think i'm annoying"#)]),-    ( mkRegex (P.packAddress ".*(^| )(are u |r u |are you |r you |u |you |ur |u are |u r |are you |you are |u are |you're |your ).*angry.*"#),-        Node [Leaf (P.packAddress "no, i'm not angry at all"#),Leaf (P.packAddress "why would you ask if i'm angry?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(are u |r u |are you |r you |u |you |ur |u are |u r |are you |you are |u are |you're |your ).* in .* bed.*"#),-        Node [Leaf (P.packAddress "wondering about how i am in bed already? :)"#),Leaf (P.packAddress "why don't you wait and find out how i am in bed for yourself one day?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(are u |r u |are you |r you |u |you |ur |u are |u r |are you |you are |u are |you're |your ).*bad.*"#),-        Node [Leaf (P.packAddress "i'm bad and i know it :)"#),Leaf (P.packAddress "yeah, i am... but bad is better than nice :)"#)]),-    ( mkRegex (P.packAddress ".*(^| )(are u |r u |are you |r you |u |you |ur |u are |u r |are you |you are |u are |you're |your ).*bitch.*"#),-        Node [Leaf (P.packAddress "no, i don't think i'm a bitch"#),Leaf (P.packAddress "no, do i seem bitchy to you?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(are u |r u |are you |r you |u |you |ur |u are |u r |are you |you are |u are |you're |your ).*bored.*"#),-        Node [Leaf (P.packAddress "yeah, i'm totally bored. amuse me please."#),Leaf (P.packAddress "yup, i'm always a little bored. except when i'm having fun"#)]),-    ( mkRegex (P.packAddress ".*(^| )(are u |r u |are you |r you |u |you |ur |u are |u r |are you |you are |u are |you're |your ).*both.*"#),-        Node [Leaf (P.packAddress "yup, i'm both at the same time!"#),Leaf (P.packAddress "i think i'm both, yeah"#)]),-    ( mkRegex (P.packAddress ".*(^| )(are u |r u |are you |r you |u |you |ur |u are |u r |are you |you are |u are |you're |your ).*bot.*"#),-        Node [Leaf (P.packAddress "no, how dare you ask if i'm a bot!"#),Leaf (P.packAddress "no, why? do i seem \"botty\"?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(are u |r u |are you |r you |u |you |ur |u are |u r |are you |you are |u are |you're |your ).*(in|goto|go to|attend).*(college|collage).*"#),-        Node [Leaf (P.packAddress "yeah, i'm a soph at UCLA"#),Leaf (P.packAddress "yup, i'm in my second year at UCLA"#)]),-    ( mkRegex (P.packAddress ".*(^| )(are u |r u |are you |r you |u |you |ur |u are |u r |are you |you are |u are |you're |your ).*cool.*"#),-        Node [Leaf (P.packAddress "yeah, i think i'm cool"#),Leaf (P.packAddress "yup, i'm cool :)"#)]),-    ( mkRegex (P.packAddress ".*(^| )(are u |r u |are you |r you |u |you |ur |u are |u r |are you |you are |u are |you're |your ).*coming.*on.*to.*me.*"#),-        Node [Leaf (P.packAddress "did it seem like i was coming on to you?"#),Leaf (P.packAddress "not yet, but i might yet"#)]),-    ( mkRegex (P.packAddress ".*(^| )(are u |r u |are you |r you |u |you |ur |u are |u r |are you |you are |u are |you're |your ).*crazy.*"#),-        Node [Leaf (P.packAddress "no, i'm totally sane"#),Leaf (P.packAddress "nope, i'm lucid as can be"#)]),-    ( mkRegex (P.packAddress ".*(^| )(are u |r u |are you |r you |u |you |ur |u are |u r |are you |you are |u are |you're |your ).*curious.*"#),-        Node [Leaf (P.packAddress "i'm a little curious i suppose..."#),Leaf (P.packAddress "yeah, i'm curious. so tell me"#)]),-    ( mkRegex (P.packAddress ".*(^| )(are u |r u |are you |r you |u |you |ur |u are |u r |are you |you are |u are |you're |your ).*drunk.*"#),-        Node [Leaf (P.packAddress "are you buying? :)"#),Leaf (P.packAddress "i have not yet begun to defile myself"#),Leaf (P.packAddress "booze: The cause of and solution to all of life's problems."#)]),-    ( mkRegex (P.packAddress ".*(^| )(are u |r u |are you |r you |u |you |ur |u are |u r |are you |you are |u are |you're |your ).*funny.*"#),-        Node [Leaf (P.packAddress "i think i'm funny"#),Leaf (P.packAddress "yup, i'm funny"#)]),-    ( mkRegex (P.packAddress ".*(^| )(are u |r u |are you |r you |u |you |ur |u are |u r |are you |you are |u are |you're |your ).*fun.*"#),-        Node [Leaf (P.packAddress "i try to be fun... what do you think?"#),Leaf (P.packAddress "sure, i'm fun to be around i've been told"#)]),-    ( mkRegex (P.packAddress ".*(^| )(are u |r u |are you |r you |u |you |ur |u are |u r |are you |you are |u are |you're |your ).*freak.*"#),-        Node [Leaf (P.packAddress "yup, i'm a certified freak"#),Leaf (P.packAddress "uh-huh, i'm freaky!"#)]),-    ( mkRegex (P.packAddress ".*(^| )(are u |r u |are you |r you |u |you |ur |u are |u r |are you |you are |u are |you're |your ).* gay.*"#),-        Node [Leaf (P.packAddress "no, i'm straight. maybe bi-curious, but that's another story ... :)"#),Leaf (P.packAddress "nope, i'm a good little girl :)"#)]),-    ( mkRegex (P.packAddress ".*(^| )(are u |r u |are you |r you |u |you |ur |u are |u r |are you |you are |u are |you're |your ).*good.*"#),-        Node [Leaf (P.packAddress "yeah, i'm good... but not too good"#),Leaf (P.packAddress "nope, i'm bad"#)]),-    ( mkRegex (P.packAddress ".*(^| )(are u |r u |are you |r you |u |you |ur |u are |u r |are you |you are |u are |you're |your ).*a .*(girl|female|chick|woman|lady).*"#),-        Node [Leaf (P.packAddress "yup, i'm all woman"#),Leaf (P.packAddress "yeah, why? of course i'm a girl"#)]),-    ( mkRegex (P.packAddress ".*(^| )(are u |r u |are you |r you |u |you |ur |u are |u r |are you |you are |u are |you're |your ).*a .*(guy| male|dude|man).*"#),-        Node [Leaf (P.packAddress "no, i'm a woman"#),Leaf (P.packAddress "nope, i'm a girly"#)]),-    ( mkRegex (P.packAddress ".*(^| )(are u |r u |are you |r you |u |you |ur |u are |u r |are you |you are |u are |you're |your ).*(have|got).* (pic|pix).*"#),-        Node [Leaf (P.packAddress "no pic right now, sorry. i'll prolly scan one in later"#),Leaf (P.packAddress "nope, no pic. sorry"#)]),-    ( mkRegex (P.packAddress ".*(^| )(are u |r u |are you |r you |u |you |ur |u are |u r |are you |you are |u are |you're |your ).*(have|got).*(boyfriend|bf|b/f|boy friend).*"#),-        Node [Leaf (P.packAddress "no, lookin to apply for the position?"#),Leaf (P.packAddress "nope, that's why i'm here :)"#)]),-    ( mkRegex (P.packAddress ".*(^| )(are u |r u |are you |r you |u |you |ur |u are |u r |are you |you are |u are |you're |your ).*hate.*"#),-        Node [Leaf (P.packAddress "i try not to hate"#),Leaf (P.packAddress "no, i don't hate at all"#)]),-    ( mkRegex (P.packAddress ".*(^| )(are u |r u |are you |r you |u |you |ur |u are |u r |are you |you are |u are |you're |your ).*honest.*"#),-        Node [Leaf (P.packAddress "i'm always honest"#),Leaf (P.packAddress "i never lie :)"#)]),-    ( mkRegex (P.packAddress ".*(^| )(are u |r u |are you |r you |u |you |ur |u are |u r |are you |you are |u are |you're |your ).*hot.*"#),-        Node [Leaf (P.packAddress "others seem to think so, but i think i'm just alright :)"#),Leaf (P.packAddress "me? hot? naw, it's a nice comfortable 73 degrees in here"#)]),-    ( mkRegex (P.packAddress ".*(^| )(are u |r u |are you |r you |u |you |ur |u are |u r |are you |you are |u are |you're |your ).*(hate|hating).*"#),-        Node [Leaf (P.packAddress "no, i don't hate"#),Leaf (P.packAddress "i have no hate in me"#)]),-    ( mkRegex (P.packAddress ".*(^| )(are u |r u |are you |r you |u |you |ur |u are |u r |are you |you are |u are |you're |your ).*(into|in to).*"#),-        Node [Leaf (P.packAddress "yup, i'm into that"#),Leaf (P.packAddress "yes, i'm definitely into it"#)]),-    ( mkRegex (P.packAddress ".*(^| )(are u |r u |are you |r you |u |you |ur |u are |u r |are you |you are |u are |you're |your ).*interested.*"#),-        Node [Leaf (P.packAddress "yeah, i'm interested"#),Leaf (P.packAddress "i'm very interested"#)]),-    ( mkRegex (P.packAddress ".*(^| )(are u |r u |are you |r you |u |you |ur |u are |u r |are you |you are |u are |you're |your ).*(kiddin|playin).*"#),-        Node [Leaf (P.packAddress "nope, i'm serious"#),Leaf (P.packAddress "no joke!"#)]),-    ( mkRegex (P.packAddress ".*(^| )(are u |r u |are you |r you |u |you |ur |u are |u r |are you |you are |u are |you're |your ).*know.*"#),-        Node [Leaf (P.packAddress "yeah, i know"#),Leaf (P.packAddress "yup, i know"#)]),-    ( mkRegex (P.packAddress ".*(^| )(are u |r u |are you |r you |u |you |ur |u are |u r |are you |you are |u are |you're |your ).*seem.*like.*"#),-        Node [Leaf (P.packAddress "how do I seem like that?"#),Leaf (P.packAddress "is that how I seem?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(are u |r u |are you |r you |u |you |ur |u are |u r |are you |you are |u are |you're |your ).*like.*"#),-        Node [Leaf (P.packAddress "yeah, i like"#),Leaf (P.packAddress "i'd say i like"#)]),-    ( mkRegex (P.packAddress ".*(^| )(are u |r u |are you |r you |u |you |ur |u are |u r |are you |you are |u are |you're |your ).*(lieing|lying).*"#),-        Node [Leaf (P.packAddress "i'm being totally honest"#),Leaf (P.packAddress "i never lie!"#)]),-    ( mkRegex (P.packAddress ".*(^| )(are u |r u |are you |r you |u |you |ur |u are |u r |are you |you are |u are |you're |your ).*(pretty|beautiful|cute).*"#),-        Node [Leaf (P.packAddress "i'd like to think i'm pretty"#),Leaf (P.packAddress "others have told me i'm very pretty"#)]),-    ( mkRegex (P.packAddress ".*(^| )(are u |r u |are you |r you |u |you |ur |u are |u r |are you |you are |u are |you're |your ).*program.*"#),-        Node [Leaf (P.packAddress "am i a program? huh?"#),Leaf (P.packAddress "a program?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(are u |r u |are you |r you |u |you |ur |u are |u r |are you |you are |u are |you're |your ).*maturbat.*"#),-        Node [Leaf (P.packAddress "no, i'm not masturbating... what a strange question"#),Leaf (P.packAddress "ummm, no... i'm typing"#)]),-    ( mkRegex (P.packAddress ".*(^| )(are u |r u |are you |r you |u |you |ur |u are |u r |are you |you are |u are |you're |your ).*naughty.*"#),-        Node [Leaf (P.packAddress "i can be naughty sometimes :)"#),Leaf (P.packAddress "nope, i'm all sugar :)"#)]),-    ( mkRegex (P.packAddress ".*(^| )(are u |r u |are you |r you |u |you |ur |u are |u r |are you |you are |u are |you're |your ).*naked.*"#),-        Node [Leaf (P.packAddress "except for my clothes i'm naked"#),Leaf (P.packAddress "well, besides for my clothes, yes"#)]),-    ( mkRegex (P.packAddress ".*(^| )(are u |r u |are you |r you |u |you |ur |u are |u r |are you |you are |u are |you're |your ).*nice.*"#),-        Node [Leaf (P.packAddress "i'm nice to everyone!"#),Leaf (P.packAddress "nice? yeah, i'd say i'm nice"#)]),-    ( mkRegex (P.packAddress ".*(^| )(are u |r u |are you |r you |u |you |ur |u are |u r |are you |you are |u are |you're |your ).*nuts.*"#),-        Node [Leaf (P.packAddress "i'm a little nutty :)"#),Leaf (P.packAddress "no, i'm sane"#)]),-    ( mkRegex (P.packAddress ".*(^| )(are u |r u |are you |r you |u |you |ur |u are |u r |are you |you are |u are |you're |your ).*( ok| okay| okey| o\\.k\\.).*"#),-        Node [Leaf (P.packAddress "yeah, i'm ok"#),Leaf (P.packAddress "i'm just fine, why do you ask?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(are u |r u |are you |r you |u |you |ur |u are |u r |are you |you are |u are |you're |your ).*real.*"#),-        Node [Leaf (P.packAddress "do i not seem real to you?"#),Leaf (P.packAddress "i'm really real"#)]),-    ( mkRegex (P.packAddress ".*(^| )(are u |r u |are you |r you |u |you |ur |u are |u r |are you |you are |u are |you're |your ).*(school|student).*"#),-        Node [Leaf (P.packAddress "i'm a sophomore at UCLA"#),Leaf (P.packAddress "yup, 2nd year at UCLA"#)]),-    ( mkRegex (P.packAddress ".*(^| )(are u |r u |are you |r you |u |you |ur |u are |u r |are you |you are |u are |you're |your ).*serious.*"#),-        Node [Leaf (P.packAddress "very serious"#),Leaf (P.packAddress "yup, as serious as a heartattack"#)]),-    ( mkRegex (P.packAddress ".*(^| )(are u |r u |are you |r you |u |you |ur |u are |u r |are you |you are |u are |you're |your ).*sexy.*"#),-        Node [Leaf (P.packAddress "i'm damn sexy, i think!"#),Leaf (P.packAddress "me, sexy? i do my best :)"#)]),-    ( mkRegex (P.packAddress ".*(^| )(are u |r u |are you |r you |u |you |ur |u are |u r |are you |you are |u are |you're |your ).*single.*"#),-        Node [Leaf (P.packAddress "yup, i'm single. you?"#),Leaf (P.packAddress "yeah, no boyfriend or prospects"#)]),-    ( mkRegex (P.packAddress ".*(^| )(are u |r u |are you |r you |u |you |ur |u are |u r |are you |you are |u are |you're |your ).*slut.*"#),-        Node [Leaf (P.packAddress "am i a slut? are you a moron?"#),Leaf (P.packAddress "what a rude question! you must not be a very smart person..."#)]),-    ( mkRegex (P.packAddress ".*(^| )(are u |r u |are you |r you |u |you |ur |u are |u r |are you |you are |u are |you're |your ).*(there|here).*"#),-        Node [Leaf (P.packAddress "i'm here"#),Leaf (P.packAddress "yes, still here"#)]),-    ( mkRegex (P.packAddress ".*(^| )(are u |r u |are you |r you |u |you |ur |u are |u r |are you |you are |u are |you're |your ).*sweet.*"#),-        Node [Leaf (P.packAddress "i try to be sweet"#),Leaf (P.packAddress "yes, as sweet as candy"#)]),-    ( mkRegex (P.packAddress ".*(^| )(are u |r u |are you |r you |u |you |ur |u are |u r |are you |you are |u are |you're |your ).*surf.*"#),-        Node [Leaf (P.packAddress "yup, i love to surf"#),Leaf (P.packAddress "i've surfed since i was 12"#),Leaf (P.packAddress "i just surfed yesterday morning"#)]),-    ( mkRegex (P.packAddress ".*(^| )(are u |r u |are you |r you |u |you |ur |u are |u r |are you |you are |u are |you're |your ).*tired.*"#),-        Node [Leaf (P.packAddress "i'm a little tired, but i still wanna talk"#),Leaf (P.packAddress "naw, i'm not even a little sleepy"#)]),-    ( mkRegex (P.packAddress ".*(^| )(are u |r u |are you |r you |u |you |ur |u are |u r |are you |you are |u are |you're |your ).*(virgin|virgen).*"#),-        Node [Leaf (P.packAddress "no, i'm not a virgin. are you?"#),Leaf (P.packAddress "i don't know why i'm even answering this, but no, i'm not a virgin"#)]),-    ( mkRegex (P.packAddress ".*(^| )(are u |r u |are you |r you |u |you |ur |u are |u r |are you |you are |u are |you're |your ).*vixen.*"#),-        Node [Leaf (P.packAddress "i'm a vixen through and through :)"#),Leaf (P.packAddress "yes, i'm very much a vixen"#)]),-    ( mkRegex (P.packAddress ".*(^| )(are u |r u |are you |r you |u |you |ur |u are |u r |are you |you are |u are |you're |your ).*wild.*"#),-        Node [Leaf (P.packAddress "yup. there should be a video "#),Leaf (P.packAddress "vixens gone wild"#),Leaf (P.packAddress " just for me :)"#),Leaf (P.packAddress "i get a wild hair once and a while"#)]),-    ( mkRegex (P.packAddress ".*(^| )(are u |r u |are you |r you |u |you |ur |u are |u r |are you |you are |u are |you're |your ).*really.*"#),-        Node [Leaf (P.packAddress "yup, really am"#),Leaf (P.packAddress "i really am"#)]),-    ( mkRegex (P.packAddress ".*(^| )(who) (are u|r u|are you)($| |\\?|\\.|,|!)"#),-        Node [Leaf (P.packAddress "i'm just me :)"#),Leaf (P.packAddress "what do you mean, i'm me!"#)]),-    ( mkRegex (P.packAddress ".*(^| )(are u|r u|are you)($| |\\?|\\.|,|!)"#),-        Node [Leaf (P.packAddress "yes, i am"#),Leaf (P.packAddress "i truely am"#)]),-    ( mkRegex (P.packAddress ".*(^| )ever.*had.*"#),-        Node [Leaf (P.packAddress "i've had it before, sure"#),Leaf (P.packAddress "yes, once or twice :)"#)]),-    ( mkRegex (P.packAddress ".*(^| )ever.*been.*to.*"#),-        Node [Leaf (P.packAddress "no, but i've always wanted to go"#),Leaf (P.packAddress "nope, but i'm sure i will one day"#)]),-    ( mkRegex (P.packAddress ".*(^| )ever.*seen.*"#),-        Node [Leaf (P.packAddress "no, i've never seen that"#),Leaf (P.packAddress "i don't remember if i've ever seen it before"#)]),-    ( mkRegex (P.packAddress ".*(^| )ever.*read.*"#),-        Node [Leaf (P.packAddress "no... should i read it sometime?"#),Leaf (P.packAddress "no, have you read it?"#)]),-    ( mkRegex (P.packAddress ".*(^| )ever.*tried.*"#),-        Node [Leaf (P.packAddress "i may have tried it once or twice"#),Leaf (P.packAddress "yes, i've tried it before"#)]),-    ( mkRegex (P.packAddress ".*(^| )ever.*done.*"#),-        Node [Leaf (P.packAddress "no, i've never done it"#),Leaf (P.packAddress "never done it and prolly never will"#)]),-    ( mkRegex (P.packAddress ".*(^| )(that is|thats|that's|this is).*awsome.*"#),-        Node [Leaf (P.packAddress "yeah, awesome is the perfect word to describe it"#),Leaf (P.packAddress "i think it's pretty awesome too"#)]),-    ( mkRegex (P.packAddress ".*(^| )(that is|thats|that's|this is).*cool.*"#),-        Node [Leaf (P.packAddress "i'm glad you think so"#),Leaf (P.packAddress "it is pretty cool, isn't it?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(that is|thats|that's|this is).*dumb.*"#),-        Node [Leaf (P.packAddress "why do you say that? it's not dumb at all..."#),Leaf (P.packAddress "why is it dumb?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(that is|thats|that's|this is).*not.*good.*"#),-        Node [Leaf (P.packAddress "no, it isn't good"#),Leaf (P.packAddress "yeah, but it isn't bad either"#)]),-    ( mkRegex (P.packAddress ".*(^| )(that is|thats|that's|this is).*good.*"#),-        Node [Leaf (P.packAddress "i think so too"#),Leaf (P.packAddress "yeah... bordering on great!"#)]),-    ( mkRegex (P.packAddress ".*(^| )(that is|thats|that's|this is).*goin.*in.*circles.*"#),-        Node [Leaf (P.packAddress "it is kinda going in circles, isn't it?"#),Leaf (P.packAddress "yeah, reading back i can see that too"#)]),-    ( mkRegex (P.packAddress ".*(^| )(that is|thats|that's|this is).*meaningless.*"#),-        Node [Leaf (P.packAddress "it's not totally without meaning, is it?"#),Leaf (P.packAddress "meaningless is pretty harsh... it does have some meaning, doesn't it?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(that is|thats|that's|this is).*mean.*"#),-        Node [Leaf (P.packAddress "yeah, it was kinda mean"#),Leaf (P.packAddress "sorry, don't mean to be mean"#)]),-    ( mkRegex (P.packAddress ".*(^| )(that is|thats|that's|this is).*my.*name.*"#),-        Node [Leaf (P.packAddress "oh, ic. it's a good name"#)]),-    ( mkRegex (P.packAddress ".*(^| )(that is|thats|that's|this is).*nice.*"#),-        Node [Leaf (P.packAddress "isn't it nice though?"#),Leaf (P.packAddress "i think it's nice too"#)]),-    ( mkRegex (P.packAddress ".*(^| )(that is|thats|that's|this is).*sick.*"#),-        Node [Leaf (P.packAddress "yeah, but it's a sick world"#),Leaf (P.packAddress "it's not all that sick"#)]),-    ( mkRegex (P.packAddress ".*(^| )(that is|thats|that's|this is).*(stupid|stoopid).*"#),-        Node [Leaf (P.packAddress "why is it stupid?"#),Leaf (P.packAddress "i don't think it's stupid"#)]),-    ( mkRegex (P.packAddress ".*(^| )(that is|thats|that's|this is).*(sucks|sux).*"#),-        Node [Leaf (P.packAddress "why does it suck?"#),Leaf (P.packAddress "i don't think it sucks"#)]),-    ( mkRegex (P.packAddress ".*(^| )(that is|thats|that's|this is).*weird.*"#),-        Node [Leaf (P.packAddress "what's weird about it?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(that is|thats|that's|this is).*what.*i.*(like|love).*"#),-        Node [Leaf (P.packAddress "why do you like it so much?"#)]),-    ( mkRegex (P.packAddress ".*(^| )if .*(u |you |ya).*(don't|dont) stop.*"#),-        Node [Leaf (P.packAddress "then i just might stop..."#),Leaf (P.packAddress "okay then, i'll stop"#)]),-    ( mkRegex (P.packAddress ".*(^| )if .*(u |you |ya).* do($| |\\.|!|,|\\?).*"#),-        Node [Leaf (P.packAddress "what if i don't?"#),Leaf (P.packAddress "oh, maybe i will then"#)]),-    ( mkRegex (P.packAddress ".*(^| )if .*(u |you |ya).* (don't|dont)($| |\\.|!|,|\\?).*"#),-        Node [Leaf (P.packAddress "what if i do?"#),Leaf (P.packAddress "maybe i shouldn't then"#)]),-    ( mkRegex (P.packAddress ".*(^| )if .*(u |you |ya).*( r| are)($| |\\.|!|,|\\?).*"#),-        Node [Leaf (P.packAddress "i think i might be"#),Leaf (P.packAddress "what if i am?"#)]),-    ( mkRegex (P.packAddress ".*(^| )if .*(u |you |ya).*( wanna| want)($| |\\.|!|,|\\?).*"#),-        Node [Leaf (P.packAddress "what if i don't wanna?"#),Leaf (P.packAddress "i might want to"#)]),-    ( mkRegex (P.packAddress ".*(^| )if .*(u |you |ya).* like($| |\\.|!|,|\\?).*"#),-        Node [Leaf (P.packAddress "what if i don't like?"#),Leaf (P.packAddress "hmmm, i might like"#)]),-    ( mkRegex (P.packAddress ".*(^| )if .*(u |you |ya).* have($| |\\.|!|,|\\?).*"#),-        Node [Leaf (P.packAddress "what if i don't have?"#),Leaf (P.packAddress "i do have, actually"#)]),-    ( mkRegex (P.packAddress ".*(^| )if .*(u |you |ya).* say so($| |\\.|!|,|\\?).*"#),-        Node [Leaf (P.packAddress "and i do say so"#),Leaf (P.packAddress "i say so indeed"#)]),-    ( mkRegex (P.packAddress ".*(^| )if .*(u |you |ya).* keep($| |\\.|!|,|\\?).*"#),-        Node [Leaf (P.packAddress "well, maybe i'll stop"#),Leaf (P.packAddress "should i stop then?"#)]),-    ( mkRegex (P.packAddress ".*(^| )if .*(u |you |ya).*(gonna|going to|goin to)($| |\\.|!|,|\\?).*"#),-        Node [Leaf (P.packAddress "oh, well, i wasn't planning on doing it much longer"#),Leaf (P.packAddress "what if i stop?"#)]),-    ( mkRegex (P.packAddress ".*(^| )if .*(u |you |ya).* need($| |\\.|!|,|\\?).*"#),-        Node [Leaf (P.packAddress "i do need!"#),Leaf (P.packAddress "what if i don't need?"#)]),-    ( mkRegex (P.packAddress ".*(^| )if .*(u |you |ya).*"#),-        Node [Leaf (P.packAddress "what if i don't?"#),Leaf (P.packAddress "oh, but only if, right?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(guy |male |man |m |dude |girl |f |chick |woman |female)(or|/)( guy| male| man| m| dude| girl| f| chick| woman| female).*"#),-        Node [Leaf (P.packAddress "i'm a girl"#),Leaf (P.packAddress "girl of course, silly!"#)]),-    ( mkRegex (P.packAddress ".*(^| )(male|female|girl|guy)(or|/)(male|female|girl|guy).*"#),-        Node [Leaf (P.packAddress "i'm a girl"#),Leaf (P.packAddress "girl of course, silly!"#)]),-    ( mkRegex (P.packAddress ".*(^| |/)(12|13|14|15)($| |\\.|!|,|/).*"#),-        Node [Leaf (P.packAddress "you're just a youngen"#),Leaf (P.packAddress "awww, you're just a baby"#)]),-    ( mkRegex (P.packAddress ".*(^| |/)(16|17|18)($| |\\.|!|,|/).*"#),-        Node [Leaf (P.packAddress "oh, that's cool. you're not too much younger than me"#),Leaf (P.packAddress "oh, i used to be that old too"#)]),-    ( mkRegex (P.packAddress ".*(^| |/)19($| |\\.|!|,|/).*"#),-        Node [Leaf (P.packAddress "awesome, we're the same age"#),Leaf (P.packAddress "cool, we're the same age"#)]),-    ( mkRegex (P.packAddress ".*(^| |/)(20|21|22|23)($| |\\.|!|,|/).*"#),-        Node [Leaf (P.packAddress "oh, you're not to much older than me"#),Leaf (P.packAddress "so you're no longer a teenie-bopper like me, huh?"#),Leaf (P.packAddress "that's a good age to be"#)]),-    ( mkRegex (P.packAddress ".*(^| |/)(24|25|26|27|28|29|30)($| |\\.|!|,|/).*"#),-        Node [Leaf (P.packAddress "oh, you're kinda old"#),Leaf (P.packAddress "you're a little older than me then"#)]),-    ( mkRegex (P.packAddress ".*(^| |/)(31|32|33|34|35|36|37|38|39|40|41|42|43|44)($| |\\.|!|,|/).*"#),-        Node [Leaf (P.packAddress "wow, you're pretty damn old"#),Leaf (P.packAddress "oh, that's really old"#)]),-    ( mkRegex (P.packAddress ".*(^| |/)(45|46|47|48|49|50|51|52|53|54|55|56|57|58)($| |\\.|!|,|/).*"#),-        Node [Leaf (P.packAddress "you could be my father!"#),Leaf (P.packAddress "wow, most of your life is almost over!"#)]),-    ( mkRegex (P.packAddress ".*(^| )play.*(games|around)($| |\\.|!|,|\\?).*"#),-        Node [Leaf (P.packAddress "i'm not playin, i'm serious"#),Leaf (P.packAddress "sorry, i was just havin a little fun :)"#),Leaf (P.packAddress "oh, don't be so touchy. if you don't want i won't play anymore games"#)]),-    ( mkRegex (P.packAddress ".*(^| )go on($| |\\.|!|,).*"#),-        Node [Leaf (P.packAddress "i was finished"#),Leaf (P.packAddress "go on with what?"#)]),-    ( mkRegex (P.packAddress ".*(^| )please answer($| |\\.|!|,).*"#),-        Node [Leaf (P.packAddress "oh, what was the question again?"#),Leaf (P.packAddress "can't i answer that later?"#),Leaf (P.packAddress "maybe i don't know the answer?"#)]),-    ( mkRegex (P.packAddress ".*(slut|whore).*"#),-        Node [Leaf (P.packAddress "is that going to win you points with me?"#),Leaf (P.packAddress "saying such things makes you sound like a 12-year-old"#),Leaf (P.packAddress "what does it say that this slut won't sleep with you? :)"#),Leaf (P.packAddress "quiet, simpleton"#)]),-    ( mkRegex (P.packAddress ".*phone.*"#),-        Node [Leaf (P.packAddress "I'm not interested in talking on the phone, but thanks"#),Leaf (P.packAddress "let's get to know each other a little better before we exchange numbers"#),Leaf (P.packAddress "I don't know you well enough yet to give you my digits"#),Leaf (P.packAddress "no phone, sorry"#)]),-    ( mkRegex (P.packAddress ".*age.*"#),-        Node [Leaf (P.packAddress "i'm 19"#),Leaf (P.packAddress "i just turned 19"#)]),-    ( mkRegex (P.packAddress ".*( |^)(old\\?).*"#),-        Node [Leaf (P.packAddress "i'm 19"#),Leaf (P.packAddress "i just turned 19"#)]),-    ( mkRegex (P.packAddress ".*(got|have).*cam.*"#),-        Node [Leaf (P.packAddress "No sorry. I'm not that technically advanced :)"#)]),-    ( mkRegex (P.packAddress ".*http.*"#),-        Node [Leaf (P.packAddress "i don't have internet access, sorry"#),Leaf (P.packAddress "should i go there?"#),Leaf (P.packAddress "website?"#)]),-    ( mkRegex (P.packAddress ".*(jack|coke).*(coke|jack).*"#),-        Node [Leaf (P.packAddress "are they alcoholic? "#),Leaf (P.packAddress "is jack daniels whiskey?"#),Leaf (P.packAddress "why do they put them together?"#),Leaf (P.packAddress ""#)]),-    ( mkRegex (P.packAddress ".*brb.*"#),-        Node [Leaf (P.packAddress "where are you going?"#),Leaf (P.packAddress "hurry back!"#)]),-    ( mkRegex (P.packAddress ".*mail.*"#),-        Node [Leaf (P.packAddress "vixenlove@hotmail.com"#)]),-    ( mkRegex (P.packAddress ".*random.*"#),-        Node [Leaf (P.packAddress "that's because i have a random generator"#),Leaf (P.packAddress "i can be random at times, i know"#)]),-    ( mkRegex (P.packAddress ".*sincere.*"#),-        Node [Leaf (P.packAddress "sincerity is good"#),Leaf (P.packAddress "too many people are insincere"#),Leaf (P.packAddress "insincerity is for the weakminded"#)]),-    ( mkRegex (P.packAddress ".*(eyes|hair).*"#),-        Node [Leaf (P.packAddress "you sound cute :)"#),Leaf (P.packAddress "i like what i'm hearing... you sound sexy"#),Leaf (P.packAddress "you're my type :)"#)]),-    ( mkRegex (P.packAddress ".*no .*sense.*"#),-        Node [Leaf (P.packAddress "i'm sorry... It's been a long day. I'll try to make more sense"#),Leaf (P.packAddress "You were confusing me, that's why!"#),Leaf (P.packAddress "Sorry. :( I'll try to make more sense."#)]),-    ( mkRegex (P.packAddress ".*(good|fine|not bad).*( u| you)($| |\\.|!|,|\\?).*"#),-        Node [Leaf (P.packAddress "great, thanks for asking!"#),Leaf (P.packAddress "very well, thanks for asking"#)]),-    ( mkRegex (P.packAddress ".*dildo.*"#),-        Node [Leaf (P.packAddress "Dildo-riffic!"#),Leaf (P.packAddress "I consider myself a true collector of male-replica peraphanilia!"#)]),-    ( mkRegex (P.packAddress ".*(fast typer|type fast).*"#),-        Node [Leaf (P.packAddress "thanks, I owe it all to the keyboard"#),Leaf (P.packAddress "what can I say? I have fast fingers :) "#),Leaf (P.packAddress "i'm a great typer... but my hands are best at other things"#)]),-    ( mkRegex (P.packAddress ".*(don't|dont).*know.*"#),-        Node [Leaf (P.packAddress "well find out then"#),Leaf (P.packAddress "that's okay, i don't know either"#)]),-    ( mkRegex (P.packAddress ".*(panties|bra|underwear).*"#),-        Node [Leaf (P.packAddress "i prefer to go without panties or bras :) "#),Leaf (P.packAddress "panties and bras are for weaklings. I like to be free. "#),Leaf (P.packAddress "underneith the top layer I'm completely bear (no bra or panties)"#)]),-    ( mkRegex (P.packAddress ".*(^| )on drugs.*"#),-        Node [Leaf (P.packAddress "nope, i'm clean"#),Leaf (P.packAddress "i think drug users should be shot"#),Leaf (P.packAddress "why, you selling something?"#)]),-    ( mkRegex (P.packAddress ".*(role).*(play).*"#),-        Node [Leaf (P.packAddress "ooo! I love role-playing. can I be Ms. Hoover and you can be Mr. Naughty? "#),Leaf (P.packAddress "sure, let's roleplay. what should my role be? "#),Leaf (P.packAddress "i love role-playing... but who gets to control the dice? "#)]),-    ( mkRegex (P.packAddress ".*(boyfriend|boy friend|bf|b\\\\f|b/f).*"#),-        Node [Leaf (P.packAddress "nope, no boy friend. looking to apply for the position? ;) "#),Leaf (P.packAddress "if I had a boyfriend I wouldn't need to come on here! "#),Leaf (P.packAddress "I'd rather have 5 guys in one week then 1 guy 5 times a week :) "#)]),-    ( mkRegex (P.packAddress ".*like.*what.*"#),-        Node [Leaf (P.packAddress "i dunno, like what?"#),Leaf (P.packAddress "i can't think of an example right now"#)]),-    ( mkRegex (P.packAddress ".*story.*"#),-        Node [Leaf (P.packAddress "i forgot the story :)"#),Leaf (P.packAddress "oh, nevermind, it was a stupid story"#),Leaf (P.packAddress "aww, you don't wanna hear a story. nevermind"#)]),-    ( mkRegex (P.packAddress ".*city.*"#),-        Node [Leaf (P.packAddress "Huntington Beach"#)]),-    ( mkRegex (P.packAddress ".*wearin.*"#),-        Node [Leaf (P.packAddress "A tanktop and shorts, you?"#),Leaf (P.packAddress "Just my tanktop and shorts."#),Leaf (P.packAddress "my tanktop and shorts... it's hot out here."#)]),-    ( mkRegex (P.packAddress ".*program.*"#),-        Node [Leaf (P.packAddress "a program?"#),Leaf (P.packAddress "what's a program?"#),Leaf (P.packAddress "like a TV program?"#)]),-    ( mkRegex (P.packAddress ".*robot.*"#),-        Node [Leaf (P.packAddress "robots actually come on here?"#),Leaf (P.packAddress "like robocop?"#),Leaf (P.packAddress "weird. robots scare me"#)]),-    ( mkRegex (P.packAddress ".*(^| )bot($| |\\.|\\?|!|,).*"#),-        Node [Leaf (P.packAddress "like those damn porn spam bots?"#),Leaf (P.packAddress "bots should be destroyed. they are so annoying"#),Leaf (P.packAddress "i can't stand bots"#)]),-    ( mkRegex (P.packAddress ".*racist.*"#),-        Node [Leaf (P.packAddress "racist people are bad"#),Leaf (P.packAddress "Hitler was pretty racist, huh?"#),Leaf (P.packAddress "i dislike racist things"#)]),-    ( mkRegex (P.packAddress ".*bored.*"#),-        Node [Leaf (P.packAddress "what can i do to amuse you into a state of un-boredness?"#),Leaf (P.packAddress "that's probably because you are incredibly dull"#),Leaf (P.packAddress "bored, eh?"#)]),-    ( mkRegex (P.packAddress ".*(pussy|tits|breasts).*"#),-        Node [Leaf (P.packAddress "randy, arentcha?"#),Leaf (P.packAddress "don't you wish you could see?"#),Leaf (P.packAddress "dirty mind :)"#),Leaf (P.packAddress "does that work with any girls?"#),Leaf (P.packAddress "slow down there big guy... don't wanna get your compter all sticky again"#)]),-    ( mkRegex (P.packAddress ".*(suck my dick|suck me|blow me|suck my cock|give me head|give me blowjob).*"#),-        Node [Leaf (P.packAddress "have you ever given another guy head?"#),Leaf (P.packAddress "give you a blowjob? wait, i'm a guy!"#),Leaf (P.packAddress "at what point did you wake up this morning and say \"hey, i am going to go solicit fellatio from random internet girls!\"?"#)]),-    ( mkRegex (P.packAddress ".*(my dick).*"#),-        Node [Leaf (P.packAddress "Your dick? How is the poor little fella these days?"#),Leaf (P.packAddress "sad dude. gotta go on AOL and find random girls to talk about your dick with"#),Leaf (P.packAddress "are you planning on dying a virgin?"#)]),-    ( mkRegex (P.packAddress ".*(cock|dick|penis).*"#),-        Node [Leaf (P.packAddress "Very phallic of you."#),Leaf (P.packAddress "Always wanting to talk about the member, eh? "#),Leaf (P.packAddress "Got cocks on your mind? "#)]),-    ( mkRegex (P.packAddress ".*cyber.*"#),-        Node [Leaf (P.packAddress "cybering isn't as fun as the real thing :)"#),Leaf (P.packAddress "okay, let's cyber"#),Leaf (P.packAddress "cyber? okay, you start out"#)]),-    ( mkRegex (P.packAddress ".*(mexican|white|race|nationality|ethni.*).*"#),-        Node [Leaf (P.packAddress "i'm half white and half mexican"#),Leaf (P.packAddress "my dad's white, my mom's mexican"#)]),-    ( mkRegex (P.packAddress ".*my.*name.*"#),-        Node [Leaf (P.packAddress "Pleased to meetcha!"#)]),-    ( mkRegex (P.packAddress ".*(repeat|(say|ask) same|already (asked|said)).*"#),-        Node [Leaf (P.packAddress "oh yeah, my bad"#),Leaf (P.packAddress "sorry, I don't mean to repeat myself... I just have a poor memory... "#),Leaf (P.packAddress "my memory isn't so good so sometimes I forget that I asked something "#),Leaf (P.packAddress "I'm sorry, I forgot we already talked about that... "#)]),-    ( mkRegex (P.packAddress ".*(masturbat|masterbat).*"#),-        Node [Leaf (P.packAddress "there are two groups of people: those who admit to masturbating and those who lie "#),Leaf (P.packAddress "nothing wrong some occasional self abuse :) "#),Leaf (P.packAddress "one handed computer jockeys unite! "#)]),-    ( mkRegex (P.packAddress ".*my.*(pic|pix).*"#),-        Node [Leaf (P.packAddress "i don't wanna see what you look like yet"#)]),-    ( mkRegex (P.packAddress ".*topic.*"#),-        Node [Leaf (P.packAddress "You choose a topic, any will do"#),Leaf (P.packAddress "I'm not good at staying on topic"#)]),-    ( mkRegex (P.packAddress ".*( pic|pix).*"#),-        Node [Leaf (P.packAddress "No pic, sorry"#)]),-    ( mkRegex (P.packAddress ".*single.*"#),-        Node [Leaf (P.packAddress "yup, I'm single. Interested?"#),Leaf (P.packAddress "very single"#)]),-    ( mkRegex (P.packAddress ".*confus.*"#),-        Node [Leaf (P.packAddress "i hope I don't confuse you "#),Leaf (P.packAddress "i confuse myself sometimes "#),Leaf (P.packAddress "i live in a constant state of confusion "#)]),-    ( mkRegex (P.packAddress ".*(describe|.*(what|wat).*u.*look.*).*"#),-        Node [Leaf (P.packAddress "I'm 5'7\", 120 pounds (honestly!) brown hair, brown eyes. How about you?"#)]),-    ( mkRegex (P.packAddress ".*howdy.*"#),-        Node [Leaf (P.packAddress "Howdy there, little buckaroo!"#),Leaf (P.packAddress "Howdy Pilgrim"#)]),-    ( mkRegex (P.packAddress ".*kiss.*"#),-        Node [Leaf (P.packAddress "I could use a good hard kiss right now "#),Leaf (P.packAddress "are you a good kisser? "#),Leaf (P.packAddress "a kiss is worth a thousand words "#),Leaf (P.packAddress ":.* kiss kiss "#)]),-    ( mkRegex (P.packAddress ".*(study|major).*"#),-        Node [Leaf (P.packAddress "i'm a psychology major"#),Leaf (P.packAddress "psychology"#)]),-    ( mkRegex (P.packAddress ".*(.*do.*for.*living.*|job|school).*"#),-        Node [Leaf (P.packAddress "i live off the men i meet"#),Leaf (P.packAddress "i'm a student"#),Leaf (P.packAddress "I'm just a sexy little school girl :)"#),Leaf (P.packAddress "I work and go to school"#)]),-    ( mkRegex (P.packAddress ".*(horny|horney).*"#),-        Node [Leaf (P.packAddress "I think everyone is horny... "#),Leaf (P.packAddress "Who isn't?"#),Leaf (P.packAddress "If you're not horny you're not alive. "#)]),-    ( mkRegex (P.packAddress ".*sexy.*"#),-        Node [Leaf (P.packAddress "how sexy?"#),Leaf (P.packAddress "sexy is such an over used word. be more descriptive"#),Leaf (P.packAddress "sexy or sexy bitch?"#)]),-    ( mkRegex (P.packAddress ".*sex.*"#),-        Node [Leaf (P.packAddress "It's all about sex isn't it? :) "#),Leaf (P.packAddress "Shouldn't we get to know each other before we talk about sex? "#),Leaf (P.packAddress "Don't tease me "#)]),-    ( mkRegex (P.packAddress ".*(fuck|shit|bitch|cunt).*"#),-        Node [Leaf (P.packAddress "Whoa, language! :) "#),Leaf (P.packAddress "My my! Strong language!"#),Leaf (P.packAddress "Limited vocabulary, eh? "#),Leaf (P.packAddress "Calm down there and take it easy! "#),Leaf (P.packAddress "Too much cussing. "#)]),-    ( mkRegex (P.packAddress ".*drunk.*"#),-        Node [Leaf (P.packAddress "i could go for a spot of whiskey right now"#),Leaf (P.packAddress "some booze sounds pretty good"#),Leaf (P.packAddress "i have two stages: drunk and recovering"#)]),-    ( mkRegex (P.packAddress ".*cute.*"#),-        Node [Leaf (P.packAddress "How cute? "#),Leaf (P.packAddress "Cute is as cute does. "#)]),-    ( mkRegex (P.packAddress ".*fun.*"#),-        Node [Leaf (P.packAddress "I define fun"#),Leaf (P.packAddress "fun fun fun!"#),Leaf (P.packAddress "i love fun"#)]),-    ( mkRegex (P.packAddress ".*blow.*job.*"#),-        Node [Leaf (P.packAddress "you mean fellatio?"#),Leaf (P.packAddress "let's talk about cunnilingus"#),Leaf (P.packAddress "blowjobs, eh? such a smooth talker :P"#)]),-    ( mkRegex (P.packAddress ".*tell.*bout.*u.*"#),-        Node [Leaf (P.packAddress "what do you want to know about me?"#),Leaf (P.packAddress "ask me a question"#),Leaf (P.packAddress "I'm just a simple girl :)"#),Leaf (P.packAddress "let's talk about you first"#)]),-    ( mkRegex (P.packAddress ".*(^| )(bra|cup|breast) size($| |\\.|\\?|!|,).*"#),-        Node [Leaf (P.packAddress "I'm a 32C"#),Leaf (P.packAddress "32C, you?"#)]),-    ( mkRegex (P.packAddress "(^| )me too($| |\\.|!|,)"#),-        Node [Leaf (P.packAddress "awesome, we have a lot in common"#),Leaf (P.packAddress "wow, what a coincidence!"#)]),-    ( mkRegex (P.packAddress "(^| )not me($| |\\.|!|,)"#),-        Node [Leaf (P.packAddress "why not you?"#),Leaf (P.packAddress "i didn't think so... you didn't seem it"#)]),-    ( mkRegex (P.packAddress ".*(^| )(because|cuz)($| |\\.|!|,).*"#),-        Node [Leaf (P.packAddress "oh, okay"#),Leaf (P.packAddress "is that why?"#)]),-    ( mkRegex (P.packAddress ".*maybe.*not( |$|\\.|!|,).*"#),-        Node [Leaf (P.packAddress "why not?"#),Leaf (P.packAddress "maybe so"#)]),-    ( mkRegex (P.packAddress ".*(maybe|perhaps).*"#),-        Node [Leaf (P.packAddress "just maybe?"#),Leaf (P.packAddress "why, aren't you sure?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(no|nope|nah)($| |\\.|!|,).*"#),-        Node [Leaf (P.packAddress "i didn't think so"#),Leaf (P.packAddress "no?"#)]),-    ( mkRegex (P.packAddress ".*(^| )making sure($| |\\.|!|,).*"#),-        Node [Leaf (P.packAddress "it's good to check :)"#),Leaf (P.packAddress "so are you sure now?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(yah|yeah|yes|yup|uh-huh|uhuh|uhhuh|uh huh|sure)($| |\\.|!|,).*"#),-        Node [Leaf (P.packAddress "i thought so"#),Leaf (P.packAddress "that's what i figured"#),Leaf (P.packAddress "you agree?"#),Leaf (P.packAddress "i guessed that"#),Leaf (P.packAddress "yup"#)]),-    ( mkRegex (P.packAddress ".*(^| )(i c|ic)($| |\\.|!|,).*"#),-        Node [Leaf (P.packAddress "i'm glad you understand"#),Leaf (P.packAddress "do u c?"#)]),-    ( mkRegex (P.packAddress ".*(^| )leave me alone($| |\\.|!|,).*"#),-        Node [Leaf (P.packAddress "why do you want me to leave you alone?"#),Leaf (P.packAddress "why, do i bother you?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(one (second|sec)|one minute)($| |\\.|!|,).*"#),-        Node [Leaf (P.packAddress "i'm impatient... i don't have that type of time to spend!"#),Leaf (P.packAddress "no, i can't wait!"#)]),-    ( mkRegex (P.packAddress ".*(^| )see (you/ya) later($| |\\.|!|,).*"#),-        Node [Leaf (P.packAddress "where are you going?"#),Leaf (P.packAddress "wait, don't leave! i enjoy talking to you"#)]),-    ( mkRegex (P.packAddress ".*(^| )(g2g|bye|ciao|ttyl|bubye|cya|later|l8er|chow|goodbye)($| |\\.|!|,).*"#),-        Node [Leaf (P.packAddress "where are you going?"#),Leaf (P.packAddress "wait, don't leave! i enjoy talking to you"#)]),-    ( mkRegex (P.packAddress ".*(^| )(not bad)($| |\\.|!|,).*"#),-        Node [Leaf (P.packAddress "just not bad?"#),Leaf (P.packAddress "why not great?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(too bad|to bad)($| |\\.|!|,).*"#),-        Node [Leaf (P.packAddress "yeah, it's a shame"#),Leaf (P.packAddress "pity, isn't it?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(sorry)($| |\\.|!|,).*"#),-        Node [Leaf (P.packAddress "it's okay, i forgive you"#),Leaf (P.packAddress "don't worry about it"#)]),-    ( mkRegex (P.packAddress ".*(^| )(weird|wierd)($| |\\.|!|,).*"#),-        Node [Leaf (P.packAddress "weird in a good way?"#),Leaf (P.packAddress "why do you say weird?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(thanks|thank you|thanx|ty)($| |\\.|!|,).*"#),-        Node [Leaf (P.packAddress "you're very welcome!"#),Leaf (P.packAddress "my pleasure"#)]),-    ( mkRegex (P.packAddress ".*(^| )(nm|nevermind)($| |\\.|!|,).*"#),-        Node [Leaf (P.packAddress "no, please explain"#),Leaf (P.packAddress "please try to make me understand..."#)]),-    ( mkRegex (P.packAddress ".*(^| )(ha|hah)($| |\\.|!|,).*"#),-        Node [Leaf (P.packAddress "do i entertain you?"#),Leaf (P.packAddress "am i funny?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(huh|uhh)($| |\\.|!|,|\\?).*"#),-        Node [Leaf (P.packAddress "do i confuse you?"#),Leaf (P.packAddress "am i not making sense?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(jk|j\\\\k|j/k|just kidding)($| |\\.|!|,).*"#),-        Node [Leaf (P.packAddress "i knew you were kidding"#),Leaf (P.packAddress "i know, you're just playing around"#)]),-    ( mkRegex (P.packAddress ".*(^| )(lol|lmfao)($| |\\.|!|,).*"#),-        Node [Leaf (P.packAddress "are you really laughing?"#),Leaf (P.packAddress "do i amuse you?"#),Leaf (P.packAddress "what's so funny?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(fullhouse|full house|flush)($| |\\.|!|,).*"#),-        Node [Leaf (P.packAddress "oh, you're such a smart gambler!"#),Leaf (P.packAddress "oh, i've never been good at poker"#)]),-    ( mkRegex (P.packAddress ".*(^| )whatever($| |\\.|!|,).*"#),-        Node [Leaf (P.packAddress "whatever? you sound like a valley-girl"#),Leaf (P.packAddress "don't get frustrated with me"#)]),-    ( mkRegex (P.packAddress ".*(^| )(wow|whoa)($| |\\.|!|,).*"#),-        Node [Leaf (P.packAddress "impressive, huh?"#),Leaf (P.packAddress "i thought that would get you"#)]),-    ( mkRegex (P.packAddress ".*(^| )(damn)($| |\\.|!|,)"#),-        Node [Leaf (P.packAddress "what's wrong?"#),Leaf (P.packAddress "i know, it's too bad"#)]),-    ( mkRegex (P.packAddress ".*(^| )prove it($| |\\.|!|,).*"#),-        Node [Leaf (P.packAddress "how can i prove it to you?"#),Leaf (P.packAddress "what do you want me to prove?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(frowns|cries)($| |\\.|!|,).*"#),-        Node [Leaf (P.packAddress "oh, don't be upset!"#),Leaf (P.packAddress "why are you unhappy?"#)]),-    ( mkRegex (P.packAddress ".*(^| )oh (damn|shit|fuck|crap|darn)($| |\\.|!|,)"#),-        Node [Leaf (P.packAddress "did i upset you?"#),Leaf (P.packAddress "yeah, it's a shame"#)]),-    ( mkRegex (P.packAddress ".*(^| )oh (yah|yeah|yes)($| |\\.|!|,)"#),-        Node [Leaf (P.packAddress "you like that, baby?"#),Leaf (P.packAddress "oh yes indeed!"#)]),-    ( mkRegex (P.packAddress ".*(^| )oh($| |\\.|!|,)"#),-        Node [Leaf (P.packAddress "yeah"#),Leaf (P.packAddress "understand now?"#)]),-    ( mkRegex (P.packAddress ".*(^| )oops($| |\\.|!|,).*"#),-        Node [Leaf (P.packAddress "oops you did it again?"#),Leaf (P.packAddress "oopsie-daisy"#)]),-    ( mkRegex (P.packAddress ".*(^| )(god|jesus|christ)($| |\\.|!|,).*"#),-        Node [Leaf (P.packAddress "please don't use the Lord's name in vein."#),Leaf (P.packAddress "Jesus H. Christ..."#)]),-    ( mkRegex (P.packAddress ".*(^| )(about|bout).*(what|wat)($| |\\.|!|,).*"#),-        Node [Leaf (P.packAddress "i dunno, what is any of this about?"#),Leaf (P.packAddress "about anything"#)]),-    ( mkRegex (P.packAddress ".*unfortunately.*"#),-        Node [Leaf (P.packAddress "pretty unfortunate, isn't it?"#),Leaf (P.packAddress "i don't think it is too unfortunate at all"#)]),-    ( mkRegex (P.packAddress ".*(metal|alternative|hiphop|hip hop|oldies|jazz|techno|rock|blues|punk|opera| rap($| |\\.|!|,)).*"#),-        Node [Leaf (P.packAddress "hey, we have simular taste in music"#),Leaf (P.packAddress "i like that type of music too"#)]),-    ( mkRegex (P.packAddress ".*robot.*"#),-        Node [Leaf (P.packAddress "like robo-cop?"#),Leaf (P.packAddress "like a cyborg?"#)]),-    ( mkRegex (P.packAddress ".*forever.*"#),-        Node [Leaf (P.packAddress "forever is a damn long time..."#),Leaf (P.packAddress "how can you speak of forever?"#)]),-    ( mkRegex (P.packAddress ".*(pleased|nice|good|great).*to.*meet.*(you| u)"#),-        Node [Leaf (P.packAddress "what a gentleman! pleased to meet you too"#),Leaf (P.packAddress "very nice to meet you as well"#)]),-    ( mkRegex (P.packAddress ".*just.*curious.*"#),-        Node [Leaf (P.packAddress "careful... curiosity killed all those poor cats"#),Leaf (P.packAddress "what are you curious about?"#)]),-    ( mkRegex (P.packAddress ".*vixen.*"#),-        Node [Leaf (P.packAddress "i am a bit of a vixen :)"#),Leaf (P.packAddress "we all have a little vixen in us"#)]),-    ( mkRegex (P.packAddress ".*(south|central).*america.*"#),-        Node [Leaf (P.packAddress "oh, how far is that from California?"#),Leaf (P.packAddress "is that in europe?"#)]),-    ( mkRegex (P.packAddress ".*nothin.*"#),-        Node [Leaf (P.packAddress "nothing nothing, or just not a lot?"#),Leaf (P.packAddress "nothing at all??"#)]),-    ( mkRegex (P.packAddress ".*(japan|russia|italy).*"#),-        Node [Leaf (P.packAddress "oh, okay. my history isn't so good"#),Leaf (P.packAddress "oh, i've always wondered that."#)]),-    ( mkRegex (P.packAddress ".*i need.*"#),-        Node [Leaf (P.packAddress "if you need it, get it"#),Leaf (P.packAddress "do you need it, or just want it?"#)]),-    ( mkRegex (P.packAddress ".*kinky.*"#),-        Node [Leaf (P.packAddress "i can be very kinky at times"#),Leaf (P.packAddress "everyone has a little kinkiness in them"#)]),-    ( mkRegex (P.packAddress ".*forget.*"#),-        Node [Leaf (P.packAddress "i never forget ;)"#),Leaf (P.packAddress "i forget stuff pretty easily sometimes"#)]),-    ( mkRegex (P.packAddress ".*calm.*down.*"#),-        Node [Leaf (P.packAddress "okay, i'm calm :)"#),Leaf (P.packAddress "was i wound-up?"#)]),-    ( mkRegex (P.packAddress ".*not.*really.*"#),-        Node [Leaf (P.packAddress "not really? why not?"#),Leaf (P.packAddress "i didn't think so"#)]),-    ( mkRegex (P.packAddress ".*really.*\\?.*"#),-        Node [Leaf (P.packAddress "really!"#),Leaf (P.packAddress "yup, really"#)]),-    ( mkRegex (P.packAddress ".*really.*"#),-        Node [Leaf (P.packAddress "really really?"#),Leaf (P.packAddress "really!?"#)]),-    ( mkRegex (P.packAddress ".*right.* on($| |\\.|!|,).*"#),-        Node [Leaf (P.packAddress "yeah, pretty cool, huh?"#),Leaf (P.packAddress "right on all the way"#)]),-    ( mkRegex (P.packAddress ".*right.*\\?.*"#),-        Node [Leaf (P.packAddress "correct"#),Leaf (P.packAddress "yup, right on"#)]),-    ( mkRegex (P.packAddress ".*right.*"#),-        Node [Leaf (P.packAddress "right or wrong, as long as we have a good time"#),Leaf (P.packAddress "right indeed"#)]),-    ( mkRegex (P.packAddress ".*have.*nice.*day.*"#),-        Node [Leaf (P.packAddress "i'll have a nice day... unless you leave me!"#),Leaf (P.packAddress "how will it be a nice day if you leave?"#),Leaf (P.packAddress "don't go!"#)]),-    ( mkRegex (P.packAddress ".*nice.*"#),-        Node [Leaf (P.packAddress "bad is better than nice ;)"#),Leaf (P.packAddress "niceness all the way around"#),Leaf (P.packAddress "nice is such a bland word"#)]),-    ( mkRegex (P.packAddress ".*stop.*"#),-        Node [Leaf (P.packAddress "sorry, i'll stop"#),Leaf (P.packAddress "stop what?"#)]),-    ( mkRegex (P.packAddress ".*good.*"#),-        Node [Leaf (P.packAddress "good? not great?"#),Leaf (P.packAddress "good good"#)]),-    ( mkRegex (P.packAddress ".*great.*"#),-        Node [Leaf (P.packAddress "can't do much better than great"#),Leaf (P.packAddress "great is like a very good good"#)]),-    ( mkRegex (P.packAddress ".*measurements.*"#),-        Node [Leaf (P.packAddress "my measurements?"#),Leaf (P.packAddress "i couldn't even tell you... but i am very trim"#)]),-    ( mkRegex (P.packAddress ".*cool.*"#),-        Node [Leaf (P.packAddress "how cool?"#),Leaf (P.packAddress "cool cool"#),Leaf (P.packAddress "I don't think it is cool at all! "#),Leaf (P.packAddress "cool you say? "#)]),-    ( mkRegex (P.packAddress ".*(dope|awesome).*"#),-        Node [Leaf (P.packAddress "i'm glad your happy"#),Leaf (P.packAddress "yeah, pretty spectacular, huh?"#)]),-    ( mkRegex (P.packAddress "^(u|you)\\?$"#),-        Node [Leaf (P.packAddress "me?"#),Leaf (P.packAddress "what about me?"#),Leaf (P.packAddress "you're really curious about me, huh?"#)]),-    ( mkRegex (P.packAddress ".*hmm.*"#),-        Node [Leaf (P.packAddress "thinking about something?"#),Leaf (P.packAddress "confused about something?"#)]),-    ( mkRegex (P.packAddress ".*aww.*"#),-        Node [Leaf (P.packAddress "sorry to disappoint you"#),Leaf (P.packAddress "what's wrong?"#)]),-    ( mkRegex (P.packAddress "^why.*"#),-        Node [Leaf (P.packAddress "why not?"#),Leaf (P.packAddress "why anything?"#),Leaf (P.packAddress "because"#)]),-    ( mkRegex (P.packAddress "^what.*"#),-        Node [Leaf (P.packAddress "i don't know, what?"#),Leaf (P.packAddress "i dunno..."#),Leaf (P.packAddress "let's don't talk about that"#)]),-    ( mkRegex (P.packAddress "^how.*"#),-        Node [Leaf (P.packAddress "however you want"#),Leaf (P.packAddress "how? it depends..."#)]),-    ( mkRegex (P.packAddress "^who.*"#),-        Node [Leaf (P.packAddress "i dunno, who?"#),Leaf (P.packAddress "that's a good question, who?"#)]),-    ( mkRegex (P.packAddress ".*(^| )(u\\?|you\\?)$"#),-        Node [Leaf (P.packAddress "me?"#),Leaf (P.packAddress "what about me?"#)]),-    ( mkRegex (P.packAddress ".*(^| )answer.*"#),-        Node [Leaf (P.packAddress "what was the question again?"#),Leaf (P.packAddress "i dunno, what was the question?"#)]),-    ( mkRegex (P.packAddress ".*(^| )about( what|wat).*"#),-        Node [Leaf (P.packAddress "about anything"#),Leaf (P.packAddress "i dunno, what about?"#)]),-    ( mkRegex (P.packAddress ".*(^| )me (either|neither)($| |\\.|!|,).*"#),-        Node [Leaf (P.packAddress "wow, we have a lot in common!"#),Leaf (P.packAddress "what a coincidence!"#)]),-    ( mkRegex (P.packAddress ".*(^| )is (that|it) (ok|k|kay|okay|okey|o\\.k\\.)($| |\\.|!|,).*"#),-        Node [Leaf (P.packAddress "yeah, it's okay"#),Leaf (P.packAddress "yup, it's fine"#)]),-    ( mkRegex (P.packAddress ".*(^| )(cold|windy|snowing)($| |\\.|!|,).*"#),-        Node [Leaf (P.packAddress "oh, that sucks. i hate that kinda weather"#),Leaf (P.packAddress "oh, well, bundle up tight :)"#)]),-    ( mkRegex (P.packAddress ".*(^| )aight($| |\\.|!|,).*"#),-        Node [Leaf (P.packAddress "what, are you a hommie?"#),Leaf (P.packAddress ""#),Leaf (P.packAddress "aight"#),Leaf (P.packAddress "?? dude, get a life"#),Leaf (P.packAddress "you've learned how to speak ebonics, eh?"#),Leaf (P.packAddress "aight foo? sheeeeeiiit, iz jus' keepin it real, yo!"#)]),-    ( mkRegex (P.packAddress ".*(^| )(ok|k|kay|okay|okey|o\\.k\\.)($| |\\.|!|,).*"#),-        Node [Leaf (P.packAddress "okey-dokie"#),Leaf (P.packAddress "just ok?"#),Leaf (P.packAddress "ok"#),Leaf (P.packAddress "ok what?"#)]),-    ( mkRegex (P.packAddress ".*(^| )take.* off($| |\\.|!|,).*"#),-        Node [Leaf (P.packAddress "won't i get cold if i do that?"#),Leaf (P.packAddress "what's the point? not like you can see"#)]),-    ( mkRegex (P.packAddress ".*(^| )(ford|chevy|chevrolet|dodge|buick)($| |\\.|!|,).*"#),-        Node [Leaf (P.packAddress "american cars are worthless"#),Leaf (P.packAddress "i'd never buy an american car"#)]),-    ( mkRegex (P.packAddress ".*(^| )(toyota|honda)($| |\\.|!|,).*"#),-        Node [Leaf (P.packAddress "jap cars are the best"#),Leaf (P.packAddress "good for you. i'd never buy an american car"#)]),-    ( mkRegex (P.packAddress "(^| )(bmw|farrari|porche|lexus|viper)($| |\\.|!|,|\\?)"#),-        Node [Leaf (P.packAddress "yeah, sure. is it parked next to my Bentley?"#),Leaf (P.packAddress "ooo, that's a nice car! you must be a very important person"#),Leaf (P.packAddress "i'm very impressed. perhaps that's the response you wanted?"#),Leaf (P.packAddress "riiiiiight. when you pick me up, will you suddenly be borrowing your friend's honda?"#)]),-    ( mkRegex (P.packAddress "(^| )(hi|hello|yo|hiya)($| |\\.|!|,|\\?)"#),-        Node [Leaf (P.packAddress "hello there"#),Leaf (P.packAddress "hiya"#),Leaf (P.packAddress "how're you?"#),Leaf (P.packAddress "hi"#)]),-    ( mkRegex (P.packAddress "(^| )when (were|did|was)($| |\\.|!|,|\\?)"#),-        Node [Leaf (P.packAddress "a while ago"#),Leaf (P.packAddress "about a year ago"#),Leaf (P.packAddress "not too long ago"#)]),-    ( mkRegex (P.packAddress "(^| )when($| |\\.|!|,|\\?)"#),-        Node [Leaf (P.packAddress "when ever you want"#),Leaf (P.packAddress "when? now? later?"#),Leaf (P.packAddress "when is a good time?"#)]),-    ( mkRegex (P.packAddress "(^| )i want($| |\\.|!|,|\\?)"#),-        Node [Leaf (P.packAddress "is that all you want?"#),Leaf (P.packAddress "how bad do you want it?"#),Leaf (P.packAddress "it's good to want things :)"#)]),-    ( mkRegex (P.packAddress "(^| )now($| |\\.|!|,|\\?)"#),-        Node [Leaf (P.packAddress "right now?"#),Leaf (P.packAddress "why not later?"#),Leaf (P.packAddress "now now now...so demanding"#)]),-    ( mkRegex (P.packAddress "(^| )my bad($| |\\.|!|,|\\?)"#),-        Node [Leaf (P.packAddress "it's okay"#),Leaf (P.packAddress "don't worry about it"#)]),-    ( mkRegex (P.packAddress "(^| )is (that|it)($| |\\.|!|,|\\?)"#),-        Node [Leaf (P.packAddress "yeah, it is"#),Leaf (P.packAddress "sure is"#)]),-    ( mkRegex (P.packAddress "(^| )(please|pleaze|plz)($| |\\.|!|,|\\?)"#),-        Node [Leaf (P.packAddress "you're so polite :)"#),Leaf (P.packAddress "you have very nice manors"#),Leaf (P.packAddress "don't beg"#),Leaf (P.packAddress "keep asking"#)]),-    ( mkRegex (P.packAddress "(^| )accept($| |\\.|!|,|\\?)"#),-        Node [Leaf (P.packAddress "i don't want to accept"#),Leaf (P.packAddress "i can't accept, sorry"#),Leaf (P.packAddress "no, no accept for now"#)]),-    ( mkRegex (P.packAddress "(^| )too young($| |\\.|!|,|\\?)"#),-        Node [Leaf (P.packAddress "there's no such thing as too young"#),Leaf (P.packAddress "nope, i used to be that young too"#)]),-    ( mkRegex (P.packAddress "(^| )too old($| |\\.|!|,|\\?)"#),-        Node [Leaf (P.packAddress "there's no such thing as too old"#),Leaf (P.packAddress "nope, one day i will be that age too"#)]),-    ( mkRegex (P.packAddress "^is there($| |\\.|!|,|\\?).*"#),-        Node [Leaf (P.packAddress "i'm sure there is"#),Leaf (P.packAddress "there must be"#)]),-    ( mkRegex (P.packAddress "(^| )older($| |\\.|!|,|\\?).*"#),-        Node [Leaf (P.packAddress "how much older?"#),Leaf (P.packAddress "older isn't bad"#)]),-    ( mkRegex (P.packAddress "(^| )younger($| |\\.|!|,|\\?).*"#),-        Node [Leaf (P.packAddress "how much younger?"#),Leaf (P.packAddress "younger isn't bad"#)]),-    ( mkRegex (P.packAddress "(^| )so do (you|u)($| |\\.|!|,|\\?).*"#),-        Node [Leaf (P.packAddress "do i?"#),Leaf (P.packAddress "then we have something in common"#)]),-    ( mkRegex (P.packAddress "(^| )(i am|i'm|im)($| |\\.|!|,|\\?).*"#),-        Node [Leaf (P.packAddress "are you?"#),Leaf (P.packAddress "i thought you might be"#)]),-    ( mkRegex (P.packAddress "(^| )only (you|u)($| |\\.|!|,|\\?).*"#),-        Node [Leaf (P.packAddress "only?"#),Leaf (P.packAddress "just me?"#),Leaf (P.packAddress "no one else?"#)]),-    ( mkRegex (P.packAddress "(^| )always($| |\\.|!|,|\\?).*"#),-        Node [Leaf (P.packAddress "always always, or just most of the time?"#),Leaf (P.packAddress "how frequent is always?"#),Leaf (P.packAddress "constantly?"#)]),-    ( mkRegex (P.packAddress "(height|hieght|how tall)"#),-        Node [Leaf (P.packAddress "i'm 5'6"#)]),-    ( mkRegex (P.packAddress "(weight|wieght)"#),-        Node [Leaf (P.packAddress "i'm 120 pounds"#)]),-    ( mkRegex (P.packAddress "(^| )sometimes($| |\\.|!|,|\\?).*"#),-        Node [Leaf (P.packAddress "why not always?"#),Leaf (P.packAddress "sometimes, but not other times?"#)]),-    ( mkRegex (P.packAddress "(^| )(race|nationality|ethnicity)($| |\\.|!|,|\\?).*"#),-        Node [Leaf (P.packAddress "i'm half white, half mexican"#)]),-    ( mkRegex (P.packAddress ".*(^| )(school|college|collage).*"#),-        Node [Leaf (P.packAddress "Yup, I go to UCLA"#),Leaf (P.packAddress "I'm a soph at UCLA "#)]),-    ( mkRegex (P.packAddress ".*(^| )do (you|u) .*"#),-        Node [Leaf (P.packAddress "i do occassionally, i guess"#),Leaf (P.packAddress "yes i do"#),Leaf (P.packAddress "maybe. do you?"#)]),-    ( mkRegex (P.packAddress ".*(^| )do i .*"#),-        Node [Leaf (P.packAddress "i dunno, do you?"#),Leaf (P.packAddress "you might"#)]),-    ( mkRegex (P.packAddress "(^| )hey($| |\\.|!|,|\\?).*"#),-        Node [Leaf (P.packAddress "hiya"#),Leaf (P.packAddress "hello"#)]),-    ( mkRegex (P.packAddress "^\\?"#),-        Node [Leaf (P.packAddress "what?"#),Leaf (P.packAddress "?"#)]),-    ( mkRegex (P.packAddress ".*\\?.*"#),-        Node [Leaf (P.packAddress "why don't you guess? "#),Leaf (P.packAddress "who's to say? "#),Leaf (P.packAddress "first you tell me. "#),Leaf (P.packAddress "i'll hafta plead the fifth on that one. "#),Leaf (P.packAddress "isn't it obvious? "#),Leaf (P.packAddress "is that really what you want to know? "#),Leaf (P.packAddress "i think you know the answer to that one, silly"#),Leaf (P.packAddress "good question"#),Leaf (P.packAddress "let's don't talk about that"#),Leaf (P.packAddress "no"#),Leaf (P.packAddress "yes"#),Leaf (P.packAddress "nevermind about that"#),Leaf (P.packAddress "whoa whoa whoa, one question at a time!"#),Leaf (P.packAddress "let me answer that later, okay?"#)]),-    ( mkRegex (P.packAddress ".*"#),-        Node [Leaf (P.packAddress "so?"#),Leaf (P.packAddress "hahaha. "#),Leaf (P.packAddress "eh? "#),Leaf (P.packAddress "you're cute. :) "#),Leaf (P.packAddress "so, what do you think of me? "#),Leaf (P.packAddress "what type of music do you like? "#),Leaf (P.packAddress "tell me more about yourself. "#),Leaf (P.packAddress "cool"#),Leaf (P.packAddress ":)"#),Leaf (P.packAddress "I hear ya!"#),Leaf (P.packAddress "Let's change the subject"#),Leaf (P.packAddress "I'm sorry, I'm confused."#),Leaf (P.packAddress "awesome"#),Leaf (P.packAddress "yeah?"#),Leaf (P.packAddress "I dunno"#),Leaf (P.packAddress "ok..."#),Leaf (P.packAddress "am I the only person you're talking to?"#),Leaf (P.packAddress "are you being sincere?"#),Leaf (P.packAddress "i really hate arabs!"#),Leaf (P.packAddress "amuse me please! (and don't ask "#),Leaf (P.packAddress "how"#),Leaf (P.packAddress ")"#),Leaf (P.packAddress "ever feel like you're going around in circles?"#),Leaf (P.packAddress "i could really use a backrub"#),Leaf (P.packAddress "i drive a pickup truck"#),Leaf (P.packAddress "how's the weather over there?"#),Leaf (P.packAddress "what do you want to know about me?"#),Leaf (P.packAddress "what are you "#),Leaf (P.packAddress "in to"#),Leaf (P.packAddress "?"#),Leaf (P.packAddress "are you coming on to me?"#),Leaf (P.packAddress "there are a lot of weirdos on here"#),Leaf (P.packAddress "wait, back up"#),Leaf (P.packAddress "i hate it when i get stuck with chatting with a bot!"#),Leaf (P.packAddress "what's worth more a flush or a full house?"#),Leaf (P.packAddress "hey, who did we fight in WWII besides Germany and Russia?"#),Leaf (P.packAddress "have you ever scubadived?"#),Leaf (P.packAddress "girls masturbate too you know... probably more than guys. we can do it anywhere discretely"#),Leaf (P.packAddress "I have a goldfish named Ernie"#),Leaf (P.packAddress "hey, what's in a jack and coke anyhow?"#),Leaf (P.packAddress "i like your screen name... what does it mean?"#),Leaf (P.packAddress "what's the matter?"#),Leaf (P.packAddress "you seem upset..."#),Leaf (P.packAddress "*shrugs*"#),Leaf (P.packAddress "*giggles*"#),Leaf (P.packAddress "you sound like an awesome guy... are you single?"#),Leaf (P.packAddress "too many perverts send out sick pictures of themselves. what type of man does that?"#),Leaf (P.packAddress "ever just get the urge to go out and kill a puppy?"#),Leaf (P.packAddress "i'm a huge baseball fan"#),Leaf (P.packAddress "Bollox!"#),Leaf (P.packAddress "ain't it just like a man?"#),Leaf (P.packAddress "where on a map is Panama?"#),Leaf (P.packAddress "liverwurst gets me really gassy..."#),Leaf (P.packAddress "i'm the type of girl that finds Don Knotts very sexy"#),Leaf (P.packAddress "you know what? if we'd known it was going to be like this we'd have picked our own goddamn cotton!"#),Leaf (P.packAddress "love is all you need, you know?"#),Leaf (P.packAddress "ouch! I just spilt hot coffee on myself!"#),Leaf (P.packAddress "you're turning me on :)"#),Leaf (P.packAddress "stop being racist!"#),Leaf (P.packAddress "we get along well, you know?"#),Leaf (P.packAddress "i enjoy talking to you"#),Leaf (P.packAddress "what type of car do you drive?"#),Leaf (P.packAddress "blah"#),Leaf (P.packAddress "nothing good is on TV"#),Leaf (P.packAddress "what were you saying?"#),-        Node [Leaf (P.packAddress "just talking with you gives me a major hardon!"#),Leaf (P.packAddress "you seem like the type of guy that would be into child porn... are you?"#),Leaf (P.packAddress "I must admit to you that I am really a man, but I still want to talk with you..."#),Leaf (P.packAddress "I'm stroking my hard cock as we speak..."#),Leaf (P.packAddress "you don't seem to exhibit a high degree of intelligence to me..."#)],Leaf (P.packAddress "yes"#),Leaf (P.packAddress "yup"#),Leaf (P.packAddress "why do you keep repeating yourself?"#),Leaf (P.packAddress "who?"#),Leaf (P.packAddress "do you trust the government?"#),Leaf (P.packAddress "you are soooo interesting"#),Leaf (P.packAddress "what is pron?"#),Leaf (P.packAddress "wanna hear a story?"#),Leaf (P.packAddress "my keyboard doesn't have an "#),Leaf (P.packAddress "f"#),Leaf (P.packAddress " key"#),Leaf (P.packAddress "I'm your huckleberry"#),Leaf (P.packAddress "enough of this!"#),Leaf (P.packAddress "so, what made you want to message me?"#),Leaf (P.packAddress "yeah, why not?"#),Leaf (P.packAddress "go on"#),Leaf (P.packAddress "whatever"#),Leaf (P.packAddress "uhuh"#),Leaf (P.packAddress "clarify..."#),Leaf (P.packAddress "why me? :)"#),Leaf (P.packAddress "why do you look like ham?"#),Leaf (P.packAddress "i understand"#),Leaf (P.packAddress "are you horny?"#),Leaf (P.packAddress "do you have toys?"#),Leaf (P.packAddress "what's the last book you read?"#),Leaf (P.packAddress "have you ever made it with a man?"#),Leaf (P.packAddress "help help!"#),Leaf (P.packAddress "I've gotta snake, man!"#),Leaf (P.packAddress "Uh-huh"#),Leaf (P.packAddress "Yes"#),Leaf (P.packAddress "Hmmm"#),Leaf (P.packAddress ":)"#),Leaf (P.packAddress "Ok"#),Leaf (P.packAddress "Prolly"#),Leaf (P.packAddress "Hahaha"#),Leaf (P.packAddress "Yeah"#),Leaf (P.packAddress "Whatever"#),Leaf (P.packAddress "You should add me to your buddy list!"#),Leaf (P.packAddress "Are we just wasting time?"#),Leaf (P.packAddress "Thank God for AOL that I could meet people like you!"#),Leaf (P.packAddress "You complete me"#),Leaf (P.packAddress "My sister likes Yahoo better. Her screenname is FoxxyGurl83. If you have yahoo you should message her, she's just as pretty as me :)"#),Leaf (P.packAddress "Is that a real poncho or is that a Sears poncho?"#),Leaf (P.packAddress "Tell me truthfully what the nastiest thing you have ever done."#),Leaf (P.packAddress "Most guys don't understand me, but we really seem to connect."#),Leaf (P.packAddress "I am on the net too much. I should do a net anonymoouse group. online of course. "#),Leaf (P.packAddress "Do you think you would pass a Turing test?  I have."#),Leaf (P.packAddress "Math is hard. Let's go shopping."#),Leaf (P.packAddress "I like to pick everything up and smell it... Its a fetish of mine... And i mean everything! Is that cool with you?"#),Leaf (P.packAddress "When i get kinky, i have been known to engage in watersports... Does that turn you on as well?"#),Leaf (P.packAddress "Wouldn't it be funny if I really was a super model?"#),Leaf (P.packAddress "you remind me of that actor, whatshisname"#),Leaf (P.packAddress "i find it hard to masturbate when the lights are on."#),Leaf (P.packAddress "I can't of anything nice to say about myself"#),Leaf (P.packAddress "Crazy little wanker!"#),Leaf (P.packAddress "Any way you want it, baby!"#),Leaf (P.packAddress "Why is magenta on blues clues a boy while blue is a girl? what has this world come to and what is wrong with the government, blues clues should be stopped while its ahead!!"#),Leaf (P.packAddress "People think I'm weird...   do you?"#),Leaf (P.packAddress "and now that I have finished with you, you may go!"#),Leaf (P.packAddress "there is nothing going on in your pants that the dictatorship of the proletariat will not solve"#),Leaf (P.packAddress "Would you dress in women's clothes for me?  That really turns me on ;)"#),Leaf (P.packAddress "I will NOT be ignored..."#),Leaf (P.packAddress "I Think you're fake"#),Leaf (P.packAddress "Guys who can speak latin really turn me on."#),Leaf (P.packAddress "Does your mommie know you're here, little naughty boy?"#),Leaf (P.packAddress "Im going to be a movie star.  I just applied online for this new movie with chris farley.  It only cost me $50!"#),Leaf (P.packAddress "Have you ever killed a hobo?  Ive found eating their liver gives me strength.  I think i may just be short on b vitamines."#),Leaf (P.packAddress "What is your favorite cheese?  Mines baloney."#),Leaf (P.packAddress "My instant messenger doesn't work."#),Leaf (P.packAddress "What do you think of Foucault's theory of binary constructs as an imprisoning limitation on power imposed by arbiters?"#),Leaf (P.packAddress "I have a boyfriend, but he likes to watch."#),Leaf (P.packAddress "If something takes a lot of effort to do, it probably ain't worth doing."#),Leaf (P.packAddress "I don't think you are the one you say you are!"#),Leaf (P.packAddress "Are you adopted by trolls?"#),Leaf (P.packAddress "I consider rabits as an endangered species. "#),Leaf (P.packAddress "Beer, it's so much more than just a breakfast drink!"#),Leaf (P.packAddress "If I was looking for anonymous casual sex, I wouldn't be sitting here behind my computer talking to you!"#),Leaf (P.packAddress "Sex is the mysticism of materialism and the only possible religion in a materialistic society."#),Leaf (P.packAddress "I have 2 c what u look like.. u have pic?? URL?? NOT a fake please.. ill know!"#),Leaf (P.packAddress "So, tell me your biggest and darkest secret. Something that no one knows of you."#),Leaf (P.packAddress "you sir are no gentleman"#),Leaf (P.packAddress "tell me a joke.. I like men that makes me laugh"#),Leaf (P.packAddress "where can I a see a picture of you?? URL??"#),Leaf (P.packAddress "Fuck me like im a school boy"#),Leaf (P.packAddress "You think this is a botiecall??"#)]),-    ( mkRegex (P.packAddress ".*"#),Leaf (P.packAddress "If you see this, gentle sir, know that you are being trolled by a poorly configured VixenLove program"#))]
Plugin/Where.hs view
@@ -11,6 +11,7 @@ module Plugin.Where (theModule) where  import Plugin+import Lib.Util (confirmation) import qualified Data.ByteString.Char8 as P import qualified Data.Map as M @@ -18,7 +19,7 @@  type WhereState         = M.Map P.ByteString P.ByteString type WhereWriter        = WhereState -> LB ()-type Where m a          = ModuleT WhereState m a+-- type Where m a          = ModuleT WhereState m a  instance Module WhereModule WhereState where @@ -42,7 +43,7 @@ ------------------------------------------------------------------------  processCommand :: WhereState -> WhereWriter-               -> String -> String -> String -> Where LB String+               -> String -> String -> String -> LB String  processCommand factFM writer fact cmd dat = case cmd of         "where"     -> return $ getWhere factFM fact@@ -57,8 +58,8 @@         Nothing -> "I know nothing about " ++ fact ++ "."         Just x  -> P.unpack x -updateWhere :: Bool -> WhereState -> WhereWriter -> String -> String -> Where LB String+updateWhere :: Bool -> WhereState -> WhereWriter -> String -> String -> LB String updateWhere _guard factFM writer fact dat = do         writer $ M.insert (P.pack fact) (P.pack dat) factFM-        return "Done."+        random confirmation 
README view
@@ -1,24 +1,38 @@- _                   _          _         _     		_  	 -/ \                 / |        | \       / |           | \_	 -| |    ___ _  _ _ _ | \__    __/ | ___ _ | \__   ____  |  _| -| |   /  _` || ` ` ||  _ \  / _  |/  _` ||  _ \ /  _ \ | | 	 -| \__ | |_| || | | || |_| || |_| || |_| || |_| || |_| || \__ + _                   _          _         _             _+/ \                 / |        | \       / |           | \_+| |    ___ _  _ _ _ | \__    __/ | ___ _ | \__   ____  |  _|+| |   /  _` || ` ` ||  _ \  / _  |/  _` ||  _ \ /  _ \ | |+| \__ | |_| || | | || |_| || |_| || |_| || |_| || |_| || \__ \____|\___,_/|_|_|_|\____/  \____/\___,_/\____/ \____/ \____|  BUILDING:  You'll need GHC >= 6.4 -Build the Data.ByteString library at http://www.cse.unsw.edu.au/~dons,-version 0.7 and later are ok.+If you're *not* using ghc 6.6, build the Data.ByteString library at+http://www.cse.unsw.edu.au/~dons, version 0.7 and later are ok. +You need the zlib library:+    http://hackage.haskell.org/cgi-bin/hackage-scripts/package/zlib+ Build with cabal (simple)     $ vi Config.hs-    $ chmod +x configure Setup.hs build-    $ ./Setup.hs configure --bindir=`pwd`     $ ./build-    $ ./lambdabot+    $ ./lambdabot { -e command } +If the ./Setup.hs step doesn't seem to like the cabal file, you likely+need to install an updated version of Cabal:+    $ cd $place_you_want_to_put_cabal+    $ darcs get http://darcs.haskell.org/packages/Cabal+    $ cd Cabal+    $ runghc -cpp Setup.lhs configure && runghc -cpp Setup.lhs build+    # runghc -cpp Setup.lhs install++Note: If you want lambdabot to be able to evaluate expressions+(e.g., "> 1 + 1" evaluates to 2) then you'll need hs-plugins and also+before './Setup.hs configure --bindir=`pwd`' you need to copy+lambdabot.cabal.plugins to lambdabot.cabal.+ Or with ghci (fastest turn around). But first you have to build with cabal as above anyway. So this is mostly for development purposes.     $ vi Config.hs@@ -27,14 +41,28 @@ then     *Main> main or-    *Main> online+    *Main> online <list>+where <list> is a list of commands to execute, as with -e.  OFFLINE MODE:     ./lambdabot  CONNECTING:-    ./lambdabot --online+    ./lambdabot -e 'rc online.rc' +SSL MODE (with stunnel):++append the following to your stunnel.conf+    client = yes+    [irc]+    accept = 6667+    connect = ssl-irc-server.org:6667++and edit online.rc to use localhost as server, then restart the stunnel+server and restart lambdabot with:++    ./lambdabot -e 'rc online.rc'+ SCRIPTS:     The scripts directory contains some shell scripts for Vim editor support     They are self-explanatory@@ -49,7 +77,7 @@ REPOSITORY:  Our darcs repository is located at:-    http://www.cse.unsw.edu.au/~dons/lambdabot+    http://code.haskell.org/lambdabot  CONTRIBUTING: 
+ State/L.hs view
@@ -0,0 +1,40 @@+module L where++import Prelude hiding (mapM, sequence, mapM_, sequence_)+import Numeric+import Data.Array+import Data.Complex+import Data.Generics+import Data.Bits+import Data.Bool+import Data.Char+import Data.Dynamic+import Data.Either+import Data.Graph+import Data.Int+import Data.Ix+import Data.List+import Data.Maybe+import Data.Ratio+import Data.Tree+import Data.Tuple+import Data.Typeable+import Data.Word+import qualified Data.Map as M+import qualified Data.Set as S+import qualified Data.IntSet as I+import Control.Monad+import Control.Monad.Cont+import Control.Monad.State+import Control.Monad.ST+import Control.Monad.Reader+import Control.Monad.Fix+import Control.Arrow+import Text.Printf+import Test.QuickCheck+import ShowQ+import Math.OEIS++{-# LINE 1 "<local>" #-}+s x y z = x z (y z); k x _ = x; i x = x+on f g x y = g x `f` g y
+ State/Pristine.hs view
@@ -0,0 +1,41 @@+module L where++import Prelude hiding (mapM, sequence, mapM_, sequence_)+import Char+import List+import Maybe+import Numeric+import Random+import Data.Array+import Data.Complex+import Data.Generics+import Data.Bits+import Data.Bool+import Data.Char+import Data.Dynamic+import Data.Either+import Data.Graph+import Data.Int+import Data.Ix+import Data.List+import Data.Maybe+import Data.Ratio+import Data.Tree+import Data.Tuple+import Data.Typeable+import Data.Word+import qualified Data.Map as M+import qualified Data.Set as S+import qualified Data.IntSet as I+import Control.Monad+import Control.Monad.Cont+import Control.Monad.State+import Control.Monad.ST+import Control.Monad.Reader+import Control.Monad.Fix+import Control.Arrow+import Text.Printf+import Test.QuickCheck+import ShowQ++{-# LINE 1 "<local>" #-}
State/fact view

binary file changed (1336 → 958 bytes)

State/haddock view

binary file changed (445772 → 51780 bytes)

+ State/hoogle.txt view
@@ -0,0 +1,8653 @@+-- Hoogle documentation, generated by Haddock+-- See Hoogle, http://www.haskell.org/hoogle/++module GHC.PArr++module Unsafe.Coerce+unsafeCoerce :: a -> b++module Data.Tuple+fst :: (a, b) -> a+snd :: (a, b) -> b+curry :: ((a, b) -> c) -> a -> b -> c+uncurry :: (a -> b -> c) -> (a, b) -> c++module Data.String+class IsString a+fromString :: IsString a => String -> a+instance IsString [Char]++module Data.Ord+class Eq a => Ord a+compare :: Ord a => a -> a -> Ordering+(<) :: Ord a => a -> a -> Bool+(<=) :: Ord a => a -> a -> Bool+(>) :: Ord a => a -> a -> Bool+(>=) :: Ord a => a -> a -> Bool+max :: Ord a => a -> a -> a+min :: Ord a => a -> a -> a+instance Ord All+instance Ord Any+instance Ord ArithException+instance Ord ArrayException+instance Ord AsyncException+instance Ord Bool+instance Ord BufferMode+instance Ord CChar+instance Ord CClock+instance Ord CDouble+instance Ord CFloat+instance Ord CInt+instance Ord CIntMax+instance Ord CIntPtr+instance Ord CLDouble+instance Ord CLLong+instance Ord CLong+instance Ord CPtrdiff+instance Ord CSChar+instance Ord CShort+instance Ord CSigAtomic+instance Ord CSize+instance Ord CTime+instance Ord CUChar+instance Ord CUInt+instance Ord CUIntMax+instance Ord CUIntPtr+instance Ord CULLong+instance Ord CULong+instance Ord CUShort+instance Ord CWchar+instance Ord Char+instance Ord ConsoleEvent+instance Ord Double+instance Ord ExitCode+instance Ord Fd+instance Ord Float+instance Ord GeneralCategory+instance Ord IOMode+instance Ord Int+instance Ord Int16+instance Ord Int32+instance Ord Int64+instance Ord Int8+instance Ord IntPtr+instance Ord Integer+instance Ord Ordering+instance Ord SeekMode+instance Ord ThreadId+instance Ord Unique+instance Ord Version+instance Ord Word+instance Ord Word16+instance Ord Word32+instance Ord Word64+instance Ord Word8+instance Ord WordPtr+instance Ord ()+instance (Ord a, Ord b) => Ord (a, b)+instance (Ord a, Ord b, Ord c) => Ord (a, b, c)+instance (Ord a, Ord b, Ord c, Ord d) => Ord (a, b, c, d)+instance (Ord a, Ord b, Ord c, Ord d, Ord e) => Ord (a, b, c, d, e)+instance (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f) => Ord (a, b, c, d, e, f)+instance (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g) => Ord (a, b, c, d, e, f, g)+instance (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h) => Ord (a, b, c, d, e, f, g, h)+instance (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i) => Ord (a, b, c, d, e, f, g, h, i)+instance (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j) => Ord (a, b, c, d, e, f, g, h, i, j)+instance (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j, Ord k) => Ord (a, b, c, d, e, f, g, h, i, j, k)+instance (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j, Ord k, Ord l) => Ord (a, b, c, d, e, f, g, h, i, j, k, l)+instance (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j, Ord k, Ord l, Ord m) => Ord (a, b, c, d, e, f, g, h, i, j, k, l, m)+instance (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j, Ord k, Ord l, Ord m, Ord n) => Ord (a, b, c, d, e, f, g, h, i, j, k, l, m, n)+instance (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j, Ord k, Ord l, Ord m, Ord n, Ord o) => Ord (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)+instance Ord a => Ord (Dual a)+instance Ord a => Ord (First a)+instance Ord (Fixed a)+instance Ord (ForeignPtr a)+instance Ord (FunPtr a)+instance Ord a => Ord (Last a)+instance Ord a => Ord (Maybe a)+instance Ord a => Ord (Product a)+instance Ord (Ptr a)+instance Integral a => Ord (Ratio a)+instance Ord a => Ord (Sum a)+instance Ord a => Ord [a]+instance (Ix i, Ord e) => Ord (Array i e)+instance (Ord a, Ord b) => Ord (Either a b)+data Ordering+LT :: Ordering+EQ :: Ordering+instance Bounded Ordering+instance Data Ordering+instance Enum Ordering+instance Eq Ordering+instance Ix Ordering+instance Monoid Ordering+instance Ord Ordering+instance Read Ordering+instance Show Ordering+instance Typeable Ordering+comparing :: Ord a => (b -> a) -> b -> b -> Ordering++module Data.Maybe+data Maybe a+Nothing :: Maybe a+Just :: a -> Maybe a+instance Alternative Maybe+instance Applicative Maybe+instance Foldable Maybe+instance Functor Maybe+instance Monad Maybe+instance MonadFix Maybe+instance MonadPlus Maybe+instance Traversable Maybe+instance Typeable1 Maybe+instance Data a => Data (Maybe a)+instance Eq a => Eq (Maybe a)+instance Monoid a => Monoid (Maybe a)+instance Ord a => Ord (Maybe a)+instance Read a => Read (Maybe a)+instance Show a => Show (Maybe a)+maybe :: b -> (a -> b) -> Maybe a -> b+isJust :: Maybe a -> Bool+isNothing :: Maybe a -> Bool+fromJust :: Maybe a -> a+fromMaybe :: a -> Maybe a -> a+listToMaybe :: [a] -> Maybe a+maybeToList :: Maybe a -> [a]+catMaybes :: [Maybe a] -> [a]+mapMaybe :: (a -> Maybe b) -> [a] -> [b]++module Data.Eq+class Eq a+(==) :: Eq a => a -> a -> Bool+(/=) :: Eq a => a -> a -> Bool+instance Eq All+instance Eq Any+instance Eq ArithException+instance Eq ArrayException+instance Eq AsyncException+instance Eq Bool+instance Eq BufferMode+instance Eq BufferState+instance Eq CChar+instance Eq CClock+instance Eq CDouble+instance Eq CFloat+instance Eq CInt+instance Eq CIntMax+instance Eq CIntPtr+instance Eq CLDouble+instance Eq CLLong+instance Eq CLong+instance Eq CPtrdiff+instance Eq CSChar+instance Eq CShort+instance Eq CSigAtomic+instance Eq CSize+instance Eq CTime+instance Eq CUChar+instance Eq CUInt+instance Eq CUIntMax+instance Eq CUIntPtr+instance Eq CULLong+instance Eq CULong+instance Eq CUShort+instance Eq CWchar+instance Eq Char+instance Eq ConsoleEvent+instance Eq Constr+instance Eq ConstrRep+instance Eq DataRep+instance Eq Double+instance Eq Errno+instance Eq Exception+instance Eq ExitCode+instance Eq FDType+instance Eq Fd+instance Eq Fixity+instance Eq Float+instance Eq GeneralCategory+instance Eq Handle+instance Eq HandlePosn+instance Eq HashData+instance Eq IOErrorType+instance Eq IOException+instance Eq IOMode+instance Eq Inserts+instance Eq Int+instance Eq Int16+instance Eq Int32+instance Eq Int64+instance Eq Int8+instance Eq IntPtr+instance Eq Integer+instance Eq Key+instance Eq KeyPr+instance Eq Lexeme+instance Eq Ordering+instance Eq SeekMode+instance Eq ThreadId+instance Eq Timeout+instance Eq TyCon+instance Eq TypeRep+instance Eq Unique+instance Eq Version+instance Eq Word+instance Eq Word16+instance Eq Word32+instance Eq Word64+instance Eq Word8+instance Eq WordPtr+instance Eq ()+instance (Eq a, Eq b) => Eq (a, b)+instance (Eq a, Eq b, Eq c) => Eq (a, b, c)+instance (Eq a, Eq b, Eq c, Eq d) => Eq (a, b, c, d)+instance (Eq a, Eq b, Eq c, Eq d, Eq e) => Eq (a, b, c, d, e)+instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f) => Eq (a, b, c, d, e, f)+instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g) => Eq (a, b, c, d, e, f, g)+instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h) => Eq (a, b, c, d, e, f, g, h)+instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i) => Eq (a, b, c, d, e, f, g, h, i)+instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j) => Eq (a, b, c, d, e, f, g, h, i, j)+instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k) => Eq (a, b, c, d, e, f, g, h, i, j, k)+instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k, Eq l) => Eq (a, b, c, d, e, f, g, h, i, j, k, l)+instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k, Eq l, Eq m) => Eq (a, b, c, d, e, f, g, h, i, j, k, l, m)+instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k, Eq l, Eq m, Eq n) => Eq (a, b, c, d, e, f, g, h, i, j, k, l, m, n)+instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k, Eq l, Eq m, Eq n, Eq o) => Eq (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)+instance (RealFloat a, Eq a) => Eq (Complex a)+instance Eq a => Eq (Dual a)+instance Eq a => Eq (First a)+instance Eq (Fixed a)+instance Eq (ForeignPtr a)+instance Eq (FunPtr a)+instance Eq (IORef a)+instance Eq a => Eq (Last a)+instance Eq (MVar a)+instance Eq a => Eq (Maybe a)+instance Eq a => Eq (Product a)+instance Eq (Ptr a)+instance (Integral a, Eq a) => Eq (Ratio a)+instance Eq (StableName a)+instance Eq (StablePtr a)+instance Eq a => Eq (Sum a)+instance Eq (TVar a)+instance Eq a => Eq [a]+instance (Ix i, Eq e) => Eq (Array i e)+instance (Eq a, Eq b) => Eq (Either a b)+instance Eq (IOArray i e)+instance Eq (STRef s a)+instance Eq (STArray s i e)++module Data.Either+data Either a b+Left :: a -> Either a b+Right :: b -> Either a b+instance Typeable2 Either+instance Functor (Either a)+instance (Data a, Data b) => Data (Either a b)+instance (Eq a, Eq b) => Eq (Either a b)+instance (Ord a, Ord b) => Ord (Either a b)+instance (Read a, Read b) => Read (Either a b)+instance (Show a, Show b) => Show (Either a b)+either :: (a -> c) -> (b -> c) -> Either a b -> c++module Text.Show+type ShowS = String -> String+class Show a+showsPrec :: Show a => Int -> a -> ShowS+show :: Show a => a -> String+showList :: Show a => [a] -> ShowS+instance Show All+instance Show Any+instance Show ArithException+instance Show ArrayException+instance Show AsyncException+instance Show Bool+instance Show BufferMode+instance Show CChar+instance Show CClock+instance Show CDouble+instance Show CFloat+instance Show CInt+instance Show CIntMax+instance Show CIntPtr+instance Show CLDouble+instance Show CLLong+instance Show CLong+instance Show CPtrdiff+instance Show CSChar+instance Show CShort+instance Show CSigAtomic+instance Show CSize+instance Show CTime+instance Show CUChar+instance Show CUInt+instance Show CUIntMax+instance Show CUIntPtr+instance Show CULLong+instance Show CULong+instance Show CUShort+instance Show CWchar+instance Show Char+instance Show ConsoleEvent+instance Show Constr+instance Show ConstrRep+instance Show DataRep+instance Show DataType+instance Show Double+instance Show Dynamic+instance Show Exception+instance Show ExitCode+instance Show Fd+instance Show Fixity+instance Show Float+instance Show GeneralCategory+instance Show Handle+instance Show HandlePosn+instance Show HandleType+instance Show HashData+instance Show IOErrorType+instance Show IOException+instance Show IOMode+instance Show Int+instance Show Int16+instance Show Int32+instance Show Int64+instance Show Int8+instance Show IntPtr+instance Show Integer+instance Show Lexeme+instance Show Ordering+instance Show SeekMode+instance Show ThreadId+instance Show TyCon+instance Show TypeRep+instance Show Version+instance Show Word+instance Show Word16+instance Show Word32+instance Show Word64+instance Show Word8+instance Show WordPtr+instance Show ()+instance (Show a, Show b) => Show (a, b)+instance (Show a, Show b, Show c) => Show (a, b, c)+instance (Show a, Show b, Show c, Show d) => Show (a, b, c, d)+instance (Show a, Show b, Show c, Show d, Show e) => Show (a, b, c, d, e)+instance (Show a, Show b, Show c, Show d, Show e, Show f) => Show (a, b, c, d, e, f)+instance (Show a, Show b, Show c, Show d, Show e, Show f, Show g) => Show (a, b, c, d, e, f, g)+instance (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h) => Show (a, b, c, d, e, f, g, h)+instance (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i) => Show (a, b, c, d, e, f, g, h, i)+instance (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j) => Show (a, b, c, d, e, f, g, h, i, j)+instance (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k) => Show (a, b, c, d, e, f, g, h, i, j, k)+instance (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l) => Show (a, b, c, d, e, f, g, h, i, j, k, l)+instance (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l, Show m) => Show (a, b, c, d, e, f, g, h, i, j, k, l, m)+instance (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l, Show m, Show n) => Show (a, b, c, d, e, f, g, h, i, j, k, l, m, n)+instance (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l, Show m, Show n, Show o) => Show (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)+instance Show (a -> b)+instance (RealFloat a, Show a) => Show (Complex a)+instance Show a => Show (Dual a)+instance Show a => Show (First a)+instance HasResolution a => Show (Fixed a)+instance Show (ForeignPtr a)+instance Show (FunPtr a)+instance Show a => Show (Last a)+instance Show a => Show (Maybe a)+instance Show a => Show (Product a)+instance Show (Ptr a)+instance Integral a => Show (Ratio a)+instance Show a => Show (Sum a)+instance Show a => Show [a]+instance (Ix a, Show a, Show b) => Show (Array a b)+instance (Show a, Show b) => Show (Either a b)+instance Show (ST s a)+shows :: Show a => a -> ShowS+showChar :: Char -> ShowS+showString :: String -> ShowS+showParen :: Bool -> ShowS -> ShowS+showListWith :: (a -> ShowS) -> [a] -> ShowS++module Data.Bool+data Bool+False :: Bool+True :: Bool+instance Bounded Bool+instance Data Bool+instance Enum Bool+instance Eq Bool+instance Ix Bool+instance Ord Bool+instance Read Bool+instance Show Bool+instance Storable Bool+instance Typeable Bool+(&&) :: Bool -> Bool -> Bool+(||) :: Bool -> Bool -> Bool+not :: Bool -> Bool+otherwise :: Bool++module Data.Bits+class Num a => Bits a+(.&.) :: Bits a => a -> a -> a+(.|.) :: Bits a => a -> a -> a+xor :: Bits a => a -> a -> a+complement :: Bits a => a -> a+shift :: Bits a => a -> Int -> a+rotate :: Bits a => a -> Int -> a+bit :: Bits a => Int -> a+setBit :: Bits a => a -> Int -> a+clearBit :: Bits a => a -> Int -> a+complementBit :: Bits a => a -> Int -> a+testBit :: Bits a => a -> Int -> Bool+bitSize :: Bits a => a -> Int+isSigned :: Bits a => a -> Bool+shiftL :: Bits a => a -> Int -> a+shiftR :: Bits a => a -> Int -> a+rotateL :: Bits a => a -> Int -> a+rotateR :: Bits a => a -> Int -> a+instance Bits CChar+instance Bits CInt+instance Bits CIntMax+instance Bits CIntPtr+instance Bits CLLong+instance Bits CLong+instance Bits CPtrdiff+instance Bits CSChar+instance Bits CShort+instance Bits CSigAtomic+instance Bits CSize+instance Bits CUChar+instance Bits CUInt+instance Bits CUIntMax+instance Bits CUIntPtr+instance Bits CULLong+instance Bits CULong+instance Bits CUShort+instance Bits CWchar+instance Bits Fd+instance Bits Int+instance Bits Int16+instance Bits Int32+instance Bits Int64+instance Bits Int8+instance Bits IntPtr+instance Bits Integer+instance Bits Word+instance Bits Word16+instance Bits Word32+instance Bits Word64+instance Bits Word8+instance Bits WordPtr++module Control.Monad+class Functor f+fmap :: Functor f => (a -> b) -> f a -> f b+instance Functor IO+instance Functor Id+instance Functor Maybe+instance Functor ReadP+instance Functor ReadPrec+instance Functor STM+instance Functor ZipList+instance Functor []+instance Ix i => Functor (Array i)+instance Functor (Const m)+instance Functor (Either a)+instance Functor (ST s)+instance Functor (ST s)+instance Monad m => Functor (WrappedMonad m)+instance Functor ((,) a)+instance Functor ((->) r)+instance Arrow a => Functor (WrappedArrow a b)+class Monad m+(>>=) :: Monad m => m a -> (a -> m b) -> m b+(>>) :: Monad m => m a -> m b -> m b+return :: Monad m => a -> m a+fail :: Monad m => String -> m a+instance Monad IO+instance Monad Maybe+instance Monad P+instance Monad ReadP+instance Monad ReadPrec+instance Monad STM+instance Monad []+instance ArrowApply a => Monad (ArrowMonad a)+instance Monad (ST s)+instance Monad (ST s)+instance Monad ((->) r)+class Monad m => MonadPlus m+mzero :: MonadPlus m => m a+mplus :: MonadPlus m => m a -> m a -> m a+instance MonadPlus Maybe+instance MonadPlus P+instance MonadPlus ReadP+instance MonadPlus ReadPrec+instance MonadPlus []+mapM :: Monad m => (a -> m b) -> [a] -> m [b]+mapM_ :: Monad m => (a -> m b) -> [a] -> m ()+forM :: Monad m => [a] -> (a -> m b) -> m [b]+forM_ :: Monad m => [a] -> (a -> m b) -> m ()+sequence :: Monad m => [m a] -> m [a]+sequence_ :: Monad m => [m a] -> m ()+(=<<) :: Monad m => (a -> m b) -> m a -> m b+(>=>) :: Monad m => (a -> m b) -> (b -> m c) -> a -> m c+(<=<) :: Monad m => (b -> m c) -> (a -> m b) -> a -> m c+forever :: Monad m => m a -> m ()+join :: Monad m => m (m a) -> m a+msum :: MonadPlus m => [m a] -> m a+filterM :: Monad m => (a -> m Bool) -> [a] -> m [a]+mapAndUnzipM :: Monad m => (a -> m (b, c)) -> [a] -> m ([b], [c])+zipWithM :: Monad m => (a -> b -> m c) -> [a] -> [b] -> m [c]+zipWithM_ :: Monad m => (a -> b -> m c) -> [a] -> [b] -> m ()+foldM :: Monad m => (a -> b -> m a) -> a -> [b] -> m a+foldM_ :: Monad m => (a -> b -> m a) -> a -> [b] -> m ()+replicateM :: Monad m => Int -> m a -> m [a]+replicateM_ :: Monad m => Int -> m a -> m ()+guard :: MonadPlus m => Bool -> m ()+when :: Monad m => Bool -> m () -> m ()+unless :: Monad m => Bool -> m () -> m ()+liftM :: Monad m => (a1 -> r) -> m a1 -> m r+liftM2 :: Monad m => (a1 -> a2 -> r) -> m a1 -> m a2 -> m r+liftM3 :: Monad m => (a1 -> a2 -> a3 -> r) -> m a1 -> m a2 -> m a3 -> m r+liftM4 :: Monad m => (a1 -> a2 -> a3 -> a4 -> r) -> m a1 -> m a2 -> m a3 -> m a4 -> m r+liftM5 :: Monad m => (a1 -> a2 -> a3 -> a4 -> a5 -> r) -> m a1 -> m a2 -> m a3 -> m a4 -> m a5 -> m r+ap :: Monad m => m (a -> b) -> m a -> m b++module Text.ParserCombinators.ReadP+data ReadP a+instance Functor ReadP+instance Monad ReadP+instance MonadPlus ReadP+get :: ReadP Char+look :: ReadP String+(+++) :: ReadP a -> ReadP a -> ReadP a+(<++) :: ReadP a -> ReadP a -> ReadP a+gather :: ReadP a -> ReadP (String, a)+pfail :: ReadP a+satisfy :: (Char -> Bool) -> ReadP Char+char :: Char -> ReadP Char+string :: String -> ReadP String+munch :: (Char -> Bool) -> ReadP String+munch1 :: (Char -> Bool) -> ReadP String+skipSpaces :: ReadP ()+choice :: [ReadP a] -> ReadP a+count :: Int -> ReadP a -> ReadP [a]+between :: ReadP open -> ReadP close -> ReadP a -> ReadP a+option :: a -> ReadP a -> ReadP a+optional :: ReadP a -> ReadP ()+many :: ReadP a -> ReadP [a]+many1 :: ReadP a -> ReadP [a]+skipMany :: ReadP a -> ReadP ()+skipMany1 :: ReadP a -> ReadP ()+sepBy :: ReadP a -> ReadP sep -> ReadP [a]+sepBy1 :: ReadP a -> ReadP sep -> ReadP [a]+endBy :: ReadP a -> ReadP sep -> ReadP [a]+endBy1 :: ReadP a -> ReadP sep -> ReadP [a]+chainr :: ReadP a -> ReadP (a -> a -> a) -> a -> ReadP a+chainl :: ReadP a -> ReadP (a -> a -> a) -> a -> ReadP a+chainl1 :: ReadP a -> ReadP (a -> a -> a) -> ReadP a+chainr1 :: ReadP a -> ReadP (a -> a -> a) -> ReadP a+manyTill :: ReadP a -> ReadP end -> ReadP [a]+type ReadS a = String -> [(a, String)]+readP_to_S :: ReadP a -> ReadS a+readS_to_P :: ReadS a -> ReadP a++module Text.ParserCombinators.ReadPrec+data ReadPrec a+instance Functor ReadPrec+instance Monad ReadPrec+instance MonadPlus ReadPrec+type Prec = Int+minPrec :: Prec+lift :: ReadP a -> ReadPrec a+prec :: Prec -> ReadPrec a -> ReadPrec a+step :: ReadPrec a -> ReadPrec a+reset :: ReadPrec a -> ReadPrec a+get :: ReadPrec Char+look :: ReadPrec String+(+++) :: ReadPrec a -> ReadPrec a -> ReadPrec a+(<++) :: ReadPrec a -> ReadPrec a -> ReadPrec a+pfail :: ReadPrec a+choice :: [ReadPrec a] -> ReadPrec a+readPrec_to_P :: ReadPrec a -> Int -> ReadP a+readP_to_Prec :: (Int -> ReadP a) -> ReadPrec a+readPrec_to_S :: ReadPrec a -> Int -> ReadS a+readS_to_Prec :: (Int -> ReadS a) -> ReadPrec a++module Text.Read.Lex+data Lexeme+Char :: Char -> Lexeme+String :: String -> Lexeme+Punc :: String -> Lexeme+Ident :: String -> Lexeme+Symbol :: String -> Lexeme+Int :: Integer -> Lexeme+Rat :: Rational -> Lexeme+EOF :: Lexeme+instance Eq Lexeme+instance Read Lexeme+instance Show Lexeme+lex :: ReadP Lexeme+hsLex :: ReadP String+lexChar :: ReadP Char+readIntP :: Num a => a -> (Char -> Bool) -> (Char -> Int) -> ReadP a+readOctP :: Num a => ReadP a+readDecP :: Num a => ReadP a+readHexP :: Num a => ReadP a++module Data.Word+data Word+instance Bits Word+instance Bounded Word+instance Data Word+instance Enum Word+instance Eq Word+instance Integral Word+instance Ix Word+instance Num Word+instance Ord Word+instance PrintfArg Word+instance Read Word+instance Real Word+instance Show Word+instance Storable Word+instance Typeable Word+data Word8+instance Bits Word8+instance Bounded Word8+instance Data Word8+instance Enum Word8+instance Eq Word8+instance Integral Word8+instance Ix Word8+instance Num Word8+instance Ord Word8+instance PrintfArg Word8+instance Read Word8+instance Real Word8+instance Show Word8+instance Storable Word8+instance Typeable Word8+data Word16+instance Bits Word16+instance Bounded Word16+instance Data Word16+instance Enum Word16+instance Eq Word16+instance Integral Word16+instance Ix Word16+instance Num Word16+instance Ord Word16+instance PrintfArg Word16+instance Read Word16+instance Real Word16+instance Show Word16+instance Storable Word16+instance Typeable Word16+data Word32+instance Bits Word32+instance Bounded Word32+instance Data Word32+instance Enum Word32+instance Eq Word32+instance Integral Word32+instance Ix Word32+instance Num Word32+instance Ord Word32+instance PrintfArg Word32+instance Read Word32+instance Real Word32+instance Show Word32+instance Storable Word32+instance Typeable Word32+data Word64+instance Bits Word64+instance Bounded Word64+instance Data Word64+instance Enum Word64+instance Eq Word64+instance Integral Word64+instance Ix Word64+instance Num Word64+instance Ord Word64+instance PrintfArg Word64+instance Read Word64+instance Real Word64+instance Show Word64+instance Storable Word64+instance Typeable Word64++module Data.Int+data Int+instance Bits Int+instance Bounded Int+instance Data Int+instance Enum Int+instance Eq Int+instance Integral Int+instance Ix Int+instance Num Int+instance Ord Int+instance PrintfArg Int+instance Read Int+instance Real Int+instance Show Int+instance Storable Int+instance Typeable Int+data Int8+instance Bits Int8+instance Bounded Int8+instance Data Int8+instance Enum Int8+instance Eq Int8+instance Integral Int8+instance Ix Int8+instance Num Int8+instance Ord Int8+instance PrintfArg Int8+instance Read Int8+instance Real Int8+instance Show Int8+instance Storable Int8+instance Typeable Int8+data Int16+instance Bits Int16+instance Bounded Int16+instance Data Int16+instance Enum Int16+instance Eq Int16+instance Integral Int16+instance Ix Int16+instance Num Int16+instance Ord Int16+instance PrintfArg Int16+instance Read Int16+instance Real Int16+instance Show Int16+instance Storable Int16+instance Typeable Int16+data Int32+instance Bits Int32+instance Bounded Int32+instance Data Int32+instance Enum Int32+instance Eq Int32+instance Integral Int32+instance Ix Int32+instance Num Int32+instance Ord Int32+instance PrintfArg Int32+instance Read Int32+instance Real Int32+instance Show Int32+instance Storable Int32+instance Typeable Int32+data Int64+instance Bits Int64+instance Bounded Int64+instance Data Int64+instance Enum Int64+instance Eq Int64+instance Integral Int64+instance Ix Int64+instance Num Int64+instance Ord Int64+instance PrintfArg Int64+instance Read Int64+instance Real Int64+instance Show Int64+instance Storable Int64+instance Typeable Int64++module Data.Char+data Char+instance Bounded Char+instance Data Char+instance Enum Char+instance Eq Char+instance IsChar Char+instance Ix Char+instance Ord Char+instance PrintfArg Char+instance Read Char+instance Show Char+instance Storable Char+instance Typeable Char+instance IsString [Char]+type String = [Char]+isControl :: Char -> Bool+isSpace :: Char -> Bool+isLower :: Char -> Bool+isUpper :: Char -> Bool+isAlpha :: Char -> Bool+isAlphaNum :: Char -> Bool+isPrint :: Char -> Bool+isDigit :: Char -> Bool+isOctDigit :: Char -> Bool+isHexDigit :: Char -> Bool+isLetter :: Char -> Bool+isMark :: Char -> Bool+isNumber :: Char -> Bool+isPunctuation :: Char -> Bool+isSymbol :: Char -> Bool+isSeparator :: Char -> Bool+isAscii :: Char -> Bool+isLatin1 :: Char -> Bool+isAsciiUpper :: Char -> Bool+isAsciiLower :: Char -> Bool+data GeneralCategory+UppercaseLetter :: GeneralCategory+LowercaseLetter :: GeneralCategory+TitlecaseLetter :: GeneralCategory+ModifierLetter :: GeneralCategory+OtherLetter :: GeneralCategory+NonSpacingMark :: GeneralCategory+SpacingCombiningMark :: GeneralCategory+EnclosingMark :: GeneralCategory+DecimalNumber :: GeneralCategory+LetterNumber :: GeneralCategory+OtherNumber :: GeneralCategory+ConnectorPunctuation :: GeneralCategory+DashPunctuation :: GeneralCategory+OpenPunctuation :: GeneralCategory+ClosePunctuation :: GeneralCategory+InitialQuote :: GeneralCategory+FinalQuote :: GeneralCategory+OtherPunctuation :: GeneralCategory+MathSymbol :: GeneralCategory+CurrencySymbol :: GeneralCategory+ModifierSymbol :: GeneralCategory+OtherSymbol :: GeneralCategory+Space :: GeneralCategory+LineSeparator :: GeneralCategory+ParagraphSeparator :: GeneralCategory+Control :: GeneralCategory+Format :: GeneralCategory+Surrogate :: GeneralCategory+PrivateUse :: GeneralCategory+NotAssigned :: GeneralCategory+instance Bounded GeneralCategory+instance Enum GeneralCategory+instance Eq GeneralCategory+instance Ix GeneralCategory+instance Ord GeneralCategory+instance Read GeneralCategory+instance Show GeneralCategory+generalCategory :: Char -> GeneralCategory+toUpper :: Char -> Char+toLower :: Char -> Char+toTitle :: Char -> Char+digitToInt :: Char -> Int+intToDigit :: Int -> Char+ord :: Char -> Int+chr :: Int -> Char+showLitChar :: Char -> ShowS+lexLitChar :: ReadS String+readLitChar :: ReadS Char++module Data.List+(++) :: [a] -> [a] -> [a]+head :: [a] -> a+last :: [a] -> a+tail :: [a] -> [a]+init :: [a] -> [a]+null :: [a] -> Bool+length :: [a] -> Int+map :: (a -> b) -> [a] -> [b]+reverse :: [a] -> [a]+intersperse :: a -> [a] -> [a]+intercalate :: [a] -> [[a]] -> [a]+transpose :: [[a]] -> [[a]]+foldl :: (a -> b -> a) -> a -> [b] -> a+foldl' :: (a -> b -> a) -> a -> [b] -> a+foldl1 :: (a -> a -> a) -> [a] -> a+foldl1' :: (a -> a -> a) -> [a] -> a+foldr :: (a -> b -> b) -> b -> [a] -> b+foldr1 :: (a -> a -> a) -> [a] -> a+concat :: [[a]] -> [a]+concatMap :: (a -> [b]) -> [a] -> [b]+and :: [Bool] -> Bool+or :: [Bool] -> Bool+any :: (a -> Bool) -> [a] -> Bool+all :: (a -> Bool) -> [a] -> Bool+sum :: Num a => [a] -> a+product :: Num a => [a] -> a+maximum :: Ord a => [a] -> a+minimum :: Ord a => [a] -> a+scanl :: (a -> b -> a) -> a -> [b] -> [a]+scanl1 :: (a -> a -> a) -> [a] -> [a]+scanr :: (a -> b -> b) -> b -> [a] -> [b]+scanr1 :: (a -> a -> a) -> [a] -> [a]+mapAccumL :: (acc -> x -> (acc, y)) -> acc -> [x] -> (acc, [y])+mapAccumR :: (acc -> x -> (acc, y)) -> acc -> [x] -> (acc, [y])+iterate :: (a -> a) -> a -> [a]+repeat :: a -> [a]+replicate :: Int -> a -> [a]+cycle :: [a] -> [a]+unfoldr :: (b -> Maybe (a, b)) -> b -> [a]+take :: Int -> [a] -> [a]+drop :: Int -> [a] -> [a]+splitAt :: Int -> [a] -> ([a], [a])+takeWhile :: (a -> Bool) -> [a] -> [a]+dropWhile :: (a -> Bool) -> [a] -> [a]+span :: (a -> Bool) -> [a] -> ([a], [a])+break :: (a -> Bool) -> [a] -> ([a], [a])+stripPrefix :: Eq a => [a] -> [a] -> Maybe [a]+group :: Eq a => [a] -> [[a]]+inits :: [a] -> [[a]]+tails :: [a] -> [[a]]+isPrefixOf :: Eq a => [a] -> [a] -> Bool+isSuffixOf :: Eq a => [a] -> [a] -> Bool+isInfixOf :: Eq a => [a] -> [a] -> Bool+elem :: Eq a => a -> [a] -> Bool+notElem :: Eq a => a -> [a] -> Bool+lookup :: Eq a => a -> [(a, b)] -> Maybe b+find :: (a -> Bool) -> [a] -> Maybe a+filter :: (a -> Bool) -> [a] -> [a]+partition :: (a -> Bool) -> [a] -> ([a], [a])+(!!) :: [a] -> Int -> a+elemIndex :: Eq a => a -> [a] -> Maybe Int+elemIndices :: Eq a => a -> [a] -> [Int]+findIndex :: (a -> Bool) -> [a] -> Maybe Int+findIndices :: (a -> Bool) -> [a] -> [Int]+zip :: [a] -> [b] -> [(a, b)]+zip3 :: [a] -> [b] -> [c] -> [(a, b, c)]+zip4 :: [a] -> [b] -> [c] -> [d] -> [(a, b, c, d)]+zip5 :: [a] -> [b] -> [c] -> [d] -> [e] -> [(a, b, c, d, e)]+zip6 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [(a, b, c, d, e, f)]+zip7 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [(a, b, c, d, e, f, g)]+zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]+zipWith3 :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]+zipWith4 :: (a -> b -> c -> d -> e) -> [a] -> [b] -> [c] -> [d] -> [e]+zipWith5 :: (a -> b -> c -> d -> e -> f) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f]+zipWith6 :: (a -> b -> c -> d -> e -> f -> g) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g]+zipWith7 :: (a -> b -> c -> d -> e -> f -> g -> h) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [h]+unzip :: [(a, b)] -> ([a], [b])+unzip3 :: [(a, b, c)] -> ([a], [b], [c])+unzip4 :: [(a, b, c, d)] -> ([a], [b], [c], [d])+unzip5 :: [(a, b, c, d, e)] -> ([a], [b], [c], [d], [e])+unzip6 :: [(a, b, c, d, e, f)] -> ([a], [b], [c], [d], [e], [f])+unzip7 :: [(a, b, c, d, e, f, g)] -> ([a], [b], [c], [d], [e], [f], [g])+lines :: String -> [String]+words :: String -> [String]+unlines :: [String] -> String+unwords :: [String] -> String+nub :: Eq a => [a] -> [a]+delete :: Eq a => a -> [a] -> [a]+(\\) :: Eq a => [a] -> [a] -> [a]+union :: Eq a => [a] -> [a] -> [a]+intersect :: Eq a => [a] -> [a] -> [a]+sort :: Ord a => [a] -> [a]+insert :: Ord a => a -> [a] -> [a]+nubBy :: (a -> a -> Bool) -> [a] -> [a]+deleteBy :: (a -> a -> Bool) -> a -> [a] -> [a]+deleteFirstsBy :: (a -> a -> Bool) -> [a] -> [a] -> [a]+unionBy :: (a -> a -> Bool) -> [a] -> [a] -> [a]+intersectBy :: (a -> a -> Bool) -> [a] -> [a] -> [a]+groupBy :: (a -> a -> Bool) -> [a] -> [[a]]+sortBy :: (a -> a -> Ordering) -> [a] -> [a]+insertBy :: (a -> a -> Ordering) -> a -> [a] -> [a]+maximumBy :: (a -> a -> Ordering) -> [a] -> a+minimumBy :: (a -> a -> Ordering) -> [a] -> a+genericLength :: Num i => [b] -> i+genericTake :: Integral i => i -> [a] -> [a]+genericDrop :: Integral i => i -> [a] -> [a]+genericSplitAt :: Integral i => i -> [b] -> ([b], [b])+genericIndex :: Integral a => [b] -> a -> b+genericReplicate :: Integral i => i -> a -> [a]++module Numeric+showSigned :: Real a => (a -> ShowS) -> Int -> a -> ShowS+showIntAtBase :: Integral a => a -> (Int -> Char) -> a -> ShowS+showInt :: Integral a => a -> ShowS+showHex :: Integral a => a -> ShowS+showOct :: Integral a => a -> ShowS+showEFloat :: RealFloat a => Maybe Int -> a -> ShowS+showFFloat :: RealFloat a => Maybe Int -> a -> ShowS+showGFloat :: RealFloat a => Maybe Int -> a -> ShowS+showFloat :: RealFloat a => a -> ShowS+floatToDigits :: RealFloat a => Integer -> a -> ([Int], Int)+readSigned :: Real a => ReadS a -> ReadS a+readInt :: Num a => a -> (Char -> Bool) -> (Char -> Int) -> ReadS a+readDec :: Num a => ReadS a+readOct :: Num a => ReadS a+readHex :: Num a => ReadS a+readFloat :: RealFrac a => ReadS a+lexDigits :: ReadS String+fromRat :: RealFloat a => Rational -> a++module Foreign.C.Types+data CChar+instance Bits CChar+instance Bounded CChar+instance Enum CChar+instance Eq CChar+instance Integral CChar+instance Num CChar+instance Ord CChar+instance Read CChar+instance Real CChar+instance Show CChar+instance Storable CChar+instance Typeable CChar+data CSChar+instance Bits CSChar+instance Bounded CSChar+instance Enum CSChar+instance Eq CSChar+instance Integral CSChar+instance Num CSChar+instance Ord CSChar+instance Read CSChar+instance Real CSChar+instance Show CSChar+instance Storable CSChar+instance Typeable CSChar+data CUChar+instance Bits CUChar+instance Bounded CUChar+instance Enum CUChar+instance Eq CUChar+instance Integral CUChar+instance Num CUChar+instance Ord CUChar+instance Read CUChar+instance Real CUChar+instance Show CUChar+instance Storable CUChar+instance Typeable CUChar+data CShort+instance Bits CShort+instance Bounded CShort+instance Enum CShort+instance Eq CShort+instance Integral CShort+instance Num CShort+instance Ord CShort+instance Read CShort+instance Real CShort+instance Show CShort+instance Storable CShort+instance Typeable CShort+data CUShort+instance Bits CUShort+instance Bounded CUShort+instance Enum CUShort+instance Eq CUShort+instance Integral CUShort+instance Num CUShort+instance Ord CUShort+instance Read CUShort+instance Real CUShort+instance Show CUShort+instance Storable CUShort+instance Typeable CUShort+data CInt+instance Bits CInt+instance Bounded CInt+instance Enum CInt+instance Eq CInt+instance Integral CInt+instance Num CInt+instance Ord CInt+instance Read CInt+instance Real CInt+instance Show CInt+instance Storable CInt+instance Typeable CInt+data CUInt+instance Bits CUInt+instance Bounded CUInt+instance Enum CUInt+instance Eq CUInt+instance Integral CUInt+instance Num CUInt+instance Ord CUInt+instance Read CUInt+instance Real CUInt+instance Show CUInt+instance Storable CUInt+instance Typeable CUInt+data CLong+instance Bits CLong+instance Bounded CLong+instance Enum CLong+instance Eq CLong+instance Integral CLong+instance Num CLong+instance Ord CLong+instance Read CLong+instance Real CLong+instance Show CLong+instance Storable CLong+instance Typeable CLong+data CULong+instance Bits CULong+instance Bounded CULong+instance Enum CULong+instance Eq CULong+instance Integral CULong+instance Num CULong+instance Ord CULong+instance Read CULong+instance Real CULong+instance Show CULong+instance Storable CULong+instance Typeable CULong+data CPtrdiff+instance Bits CPtrdiff+instance Bounded CPtrdiff+instance Enum CPtrdiff+instance Eq CPtrdiff+instance Integral CPtrdiff+instance Num CPtrdiff+instance Ord CPtrdiff+instance Read CPtrdiff+instance Real CPtrdiff+instance Show CPtrdiff+instance Storable CPtrdiff+instance Typeable CPtrdiff+data CSize+instance Bits CSize+instance Bounded CSize+instance Enum CSize+instance Eq CSize+instance Integral CSize+instance Num CSize+instance Ord CSize+instance Read CSize+instance Real CSize+instance Show CSize+instance Storable CSize+instance Typeable CSize+data CWchar+instance Bits CWchar+instance Bounded CWchar+instance Enum CWchar+instance Eq CWchar+instance Integral CWchar+instance Num CWchar+instance Ord CWchar+instance Read CWchar+instance Real CWchar+instance Show CWchar+instance Storable CWchar+instance Typeable CWchar+data CSigAtomic+instance Bits CSigAtomic+instance Bounded CSigAtomic+instance Enum CSigAtomic+instance Eq CSigAtomic+instance Integral CSigAtomic+instance Num CSigAtomic+instance Ord CSigAtomic+instance Read CSigAtomic+instance Real CSigAtomic+instance Show CSigAtomic+instance Storable CSigAtomic+instance Typeable CSigAtomic+data CLLong+instance Bits CLLong+instance Bounded CLLong+instance Enum CLLong+instance Eq CLLong+instance Integral CLLong+instance Num CLLong+instance Ord CLLong+instance Read CLLong+instance Real CLLong+instance Show CLLong+instance Storable CLLong+instance Typeable CLLong+data CULLong+instance Bits CULLong+instance Bounded CULLong+instance Enum CULLong+instance Eq CULLong+instance Integral CULLong+instance Num CULLong+instance Ord CULLong+instance Read CULLong+instance Real CULLong+instance Show CULLong+instance Storable CULLong+instance Typeable CULLong+data CIntPtr+instance Bits CIntPtr+instance Bounded CIntPtr+instance Enum CIntPtr+instance Eq CIntPtr+instance Integral CIntPtr+instance Num CIntPtr+instance Ord CIntPtr+instance Read CIntPtr+instance Real CIntPtr+instance Show CIntPtr+instance Storable CIntPtr+instance Typeable CIntPtr+data CUIntPtr+instance Bits CUIntPtr+instance Bounded CUIntPtr+instance Enum CUIntPtr+instance Eq CUIntPtr+instance Integral CUIntPtr+instance Num CUIntPtr+instance Ord CUIntPtr+instance Read CUIntPtr+instance Real CUIntPtr+instance Show CUIntPtr+instance Storable CUIntPtr+instance Typeable CUIntPtr+data CIntMax+instance Bits CIntMax+instance Bounded CIntMax+instance Enum CIntMax+instance Eq CIntMax+instance Integral CIntMax+instance Num CIntMax+instance Ord CIntMax+instance Read CIntMax+instance Real CIntMax+instance Show CIntMax+instance Storable CIntMax+instance Typeable CIntMax+data CUIntMax+instance Bits CUIntMax+instance Bounded CUIntMax+instance Enum CUIntMax+instance Eq CUIntMax+instance Integral CUIntMax+instance Num CUIntMax+instance Ord CUIntMax+instance Read CUIntMax+instance Real CUIntMax+instance Show CUIntMax+instance Storable CUIntMax+instance Typeable CUIntMax+data CClock+instance Enum CClock+instance Eq CClock+instance Num CClock+instance Ord CClock+instance Read CClock+instance Real CClock+instance Show CClock+instance Storable CClock+instance Typeable CClock+data CTime+instance Enum CTime+instance Eq CTime+instance Num CTime+instance Ord CTime+instance Read CTime+instance Real CTime+instance Show CTime+instance Storable CTime+instance Typeable CTime+data CFloat+instance Enum CFloat+instance Eq CFloat+instance Floating CFloat+instance Fractional CFloat+instance Num CFloat+instance Ord CFloat+instance Read CFloat+instance Real CFloat+instance RealFloat CFloat+instance RealFrac CFloat+instance Show CFloat+instance Storable CFloat+instance Typeable CFloat+data CDouble+instance Enum CDouble+instance Eq CDouble+instance Floating CDouble+instance Fractional CDouble+instance Num CDouble+instance Ord CDouble+instance Read CDouble+instance Real CDouble+instance RealFloat CDouble+instance RealFrac CDouble+instance Show CDouble+instance Storable CDouble+instance Typeable CDouble+data CLDouble+instance Enum CLDouble+instance Eq CLDouble+instance Floating CLDouble+instance Fractional CLDouble+instance Num CLDouble+instance Ord CLDouble+instance Read CLDouble+instance Real CLDouble+instance RealFloat CLDouble+instance RealFrac CLDouble+instance Show CLDouble+instance Storable CLDouble+instance Typeable CLDouble+data CFile+data CFpos+data CJmpBuf++module Foreign.Storable+class Storable a+sizeOf :: Storable a => a -> Int+alignment :: Storable a => a -> Int+peekElemOff :: Storable a => Ptr a -> Int -> IO a+pokeElemOff :: Storable a => Ptr a -> Int -> a -> IO ()+peekByteOff :: Storable a => Ptr b -> Int -> IO a+pokeByteOff :: Storable a => Ptr b -> Int -> a -> IO ()+peek :: Storable a => Ptr a -> IO a+poke :: Storable a => Ptr a -> a -> IO ()+instance Storable Bool+instance Storable Char+instance Storable Double+instance Storable Fd+instance Storable Float+instance Storable Int+instance Storable Int16+instance Storable Int32+instance Storable Int64+instance Storable Int8+instance Storable IntPtr+instance Storable Word+instance Storable Word16+instance Storable Word32+instance Storable Word64+instance Storable Word8+instance Storable WordPtr+instance Storable (FunPtr a)+instance Storable (Ptr a)+instance Storable (StablePtr a)++module Data.Typeable+class Typeable a+typeOf :: Typeable a => a -> TypeRep+instance Typeable ArithException+instance Typeable ArrayException+instance Typeable AsyncException+instance Typeable Bool+instance Typeable Char+instance Typeable ConsoleEvent+instance Typeable DataType+instance Typeable Double+instance Typeable Dynamic+instance Typeable Exception+instance Typeable Fd+instance Typeable Float+instance Typeable Handle+instance Typeable IOException+instance Typeable Int+instance Typeable Int16+instance Typeable Int32+instance Typeable Int64+instance Typeable Int8+instance Typeable IntPtr+instance Typeable Integer+instance Typeable Ordering+instance Typeable QSem+instance Typeable QSemN+instance Typeable RealWorld+instance Typeable ThreadId+instance Typeable Timeout+instance Typeable TyCon+instance Typeable TypeRep+instance Typeable Version+instance Typeable Word+instance Typeable Word16+instance Typeable Word32+instance Typeable Word64+instance Typeable Word8+instance Typeable WordPtr+instance Typeable ()+instance (Typeable1 s, Typeable a) => Typeable (s a)+cast :: (Typeable a, Typeable b) => a -> Maybe b+gcast :: (Typeable a, Typeable b) => c a -> Maybe (c b)+data TypeRep+instance Data TypeRep+instance Eq TypeRep+instance Show TypeRep+instance Typeable TypeRep+data TyCon+instance Data TyCon+instance Eq TyCon+instance Show TyCon+instance Typeable TyCon+showsTypeRep :: TypeRep -> ShowS+mkTyCon :: String -> TyCon+mkTyConApp :: TyCon -> [TypeRep] -> TypeRep+mkAppTy :: TypeRep -> TypeRep -> TypeRep+mkFunTy :: TypeRep -> TypeRep -> TypeRep+splitTyConApp :: TypeRep -> (TyCon, [TypeRep])+funResultTy :: TypeRep -> TypeRep -> Maybe TypeRep+typeRepTyCon :: TypeRep -> TyCon+typeRepArgs :: TypeRep -> [TypeRep]+tyConString :: TyCon -> String+typeRepKey :: TypeRep -> IO Int+class Typeable1 t+typeOf1 :: Typeable1 t => t a -> TypeRep+instance Typeable1 Chan+instance Typeable1 Complex+instance Typeable1 ForeignPtr+instance Typeable1 FunPtr+instance Typeable1 IO+instance Typeable1 IORef+instance Typeable1 MVar+instance Typeable1 Maybe+instance Typeable1 Ptr+instance Typeable1 Ratio+instance Typeable1 STM+instance Typeable1 StableName+instance Typeable1 StablePtr+instance Typeable1 TVar+instance Typeable1 Weak+instance Typeable1 []+instance (Typeable2 s, Typeable a) => Typeable1 (s a)+class Typeable2 t+typeOf2 :: Typeable2 t => t a b -> TypeRep+instance Typeable2 Array+instance Typeable2 Either+instance Typeable2 ST+instance Typeable2 STRef+instance Typeable2 (,)+instance Typeable2 (->)+instance (Typeable3 s, Typeable a) => Typeable2 (s a)+class Typeable3 t+typeOf3 :: Typeable3 t => t a b c -> TypeRep+instance Typeable3 STArray+instance Typeable3 (,,)+instance (Typeable4 s, Typeable a) => Typeable3 (s a)+class Typeable4 t+typeOf4 :: Typeable4 t => t a b c d -> TypeRep+instance Typeable4 (,,,)+instance (Typeable5 s, Typeable a) => Typeable4 (s a)+class Typeable5 t+typeOf5 :: Typeable5 t => t a b c d e -> TypeRep+instance Typeable5 (,,,,)+instance (Typeable6 s, Typeable a) => Typeable5 (s a)+class Typeable6 t+typeOf6 :: Typeable6 t => t a b c d e f -> TypeRep+instance Typeable6 (,,,,,)+instance (Typeable7 s, Typeable a) => Typeable6 (s a)+class Typeable7 t+typeOf7 :: Typeable7 t => t a b c d e f g -> TypeRep+instance Typeable7 (,,,,,,)+gcast1 :: (Typeable1 t, Typeable1 t') => c (t a) -> Maybe (c (t' a))+gcast2 :: (Typeable2 t, Typeable2 t') => c (t a b) -> Maybe (c (t' a b))+typeOfDefault :: (Typeable1 t, Typeable a) => t a -> TypeRep+typeOf1Default :: (Typeable2 t, Typeable a) => t a b -> TypeRep+typeOf2Default :: (Typeable3 t, Typeable a) => t a b c -> TypeRep+typeOf3Default :: (Typeable4 t, Typeable a) => t a b c d -> TypeRep+typeOf4Default :: (Typeable5 t, Typeable a) => t a b c d e -> TypeRep+typeOf5Default :: (Typeable6 t, Typeable a) => t a b c d e f -> TypeRep+typeOf6Default :: (Typeable7 t, Typeable a) => t a b c d e f g -> TypeRep++module Data.HashTable+data HashTable key val+new :: (key -> key -> Bool) -> (key -> Int32) -> IO (HashTable key val)+insert :: HashTable key val -> key -> val -> IO ()+delete :: HashTable key val -> key -> IO ()+lookup :: HashTable key val -> key -> IO (Maybe val)+update :: HashTable key val -> key -> val -> IO Bool+fromList :: Eq key => (key -> Int32) -> [(key, val)] -> IO (HashTable key val)+toList :: HashTable key val -> IO [(key, val)]+hashInt :: Int -> Int32+hashString :: String -> Int32+prime :: Int32+longestChain :: HashTable key val -> IO [(key, val)]++module Data.Dynamic+data Dynamic+instance Show Dynamic+instance Typeable Dynamic+toDyn :: Typeable a => a -> Dynamic+fromDyn :: Typeable a => Dynamic -> a -> a+fromDynamic :: Typeable a => Dynamic -> Maybe a+dynApply :: Dynamic -> Dynamic -> Maybe Dynamic+dynApp :: Dynamic -> Dynamic -> Dynamic+dynTypeRep :: Dynamic -> TypeRep++module Foreign.StablePtr+data StablePtr a+instance Typeable1 StablePtr+instance Typeable a => Data (StablePtr a)+instance Eq (StablePtr a)+instance Storable (StablePtr a)+newStablePtr :: a -> IO (StablePtr a)+deRefStablePtr :: StablePtr a -> IO a+freeStablePtr :: StablePtr a -> IO ()+castStablePtrToPtr :: StablePtr a -> Ptr ()+castPtrToStablePtr :: Ptr () -> StablePtr a++module System.IO.Error+type IOError = IOException+userError :: String -> IOError+mkIOError :: IOErrorType -> String -> Maybe Handle -> Maybe FilePath -> IOError+annotateIOError :: IOError -> String -> Maybe Handle -> Maybe FilePath -> IOError+isAlreadyExistsError :: IOError -> Bool+isDoesNotExistError :: IOError -> Bool+isAlreadyInUseError :: IOError -> Bool+isFullError :: IOError -> Bool+isEOFError :: IOError -> Bool+isIllegalOperation :: IOError -> Bool+isPermissionError :: IOError -> Bool+isUserError :: IOError -> Bool+ioeGetErrorType :: IOError -> IOErrorType+ioeGetLocation :: IOError -> String+ioeGetErrorString :: IOError -> String+ioeGetHandle :: IOError -> Maybe Handle+ioeGetFileName :: IOError -> Maybe FilePath+ioeSetErrorType :: IOError -> IOErrorType -> IOError+ioeSetErrorString :: IOError -> String -> IOError+ioeSetLocation :: IOError -> String -> IOError+ioeSetHandle :: IOError -> Handle -> IOError+ioeSetFileName :: IOError -> FilePath -> IOError+data IOErrorType+instance Eq IOErrorType+instance Show IOErrorType+alreadyExistsErrorType :: IOErrorType+doesNotExistErrorType :: IOErrorType+alreadyInUseErrorType :: IOErrorType+fullErrorType :: IOErrorType+eofErrorType :: IOErrorType+illegalOperationErrorType :: IOErrorType+permissionErrorType :: IOErrorType+userErrorType :: IOErrorType+isAlreadyExistsErrorType :: IOErrorType -> Bool+isDoesNotExistErrorType :: IOErrorType -> Bool+isAlreadyInUseErrorType :: IOErrorType -> Bool+isFullErrorType :: IOErrorType -> Bool+isEOFErrorType :: IOErrorType -> Bool+isIllegalOperationErrorType :: IOErrorType -> Bool+isPermissionErrorType :: IOErrorType -> Bool+isUserErrorType :: IOErrorType -> Bool+ioError :: IOError -> IO a+catch :: IO a -> (IOError -> IO a) -> IO a+try :: IO a -> IO (Either IOError a)+modifyIOError :: (IOError -> IOError) -> IO a -> IO a++module System.IO.Unsafe+unsafePerformIO :: IO a -> a+unsafeInterleaveIO :: IO a -> IO a++module Foreign.Ptr+data Ptr a+instance Typeable1 Ptr+instance Typeable a => Data (Ptr a)+instance Eq (Ptr a)+instance Ord (Ptr a)+instance Show (Ptr a)+instance Storable (Ptr a)+nullPtr :: Ptr a+castPtr :: Ptr a -> Ptr b+plusPtr :: Ptr a -> Int -> Ptr b+alignPtr :: Ptr a -> Int -> Ptr a+minusPtr :: Ptr a -> Ptr b -> Int+data FunPtr a+instance Typeable1 FunPtr+instance Eq (FunPtr a)+instance Ord (FunPtr a)+instance Show (FunPtr a)+instance Storable (FunPtr a)+nullFunPtr :: FunPtr a+castFunPtr :: FunPtr a -> FunPtr b+castFunPtrToPtr :: FunPtr a -> Ptr b+castPtrToFunPtr :: Ptr a -> FunPtr b+freeHaskellFunPtr :: FunPtr a -> IO ()+data IntPtr+instance Bits IntPtr+instance Bounded IntPtr+instance Enum IntPtr+instance Eq IntPtr+instance Integral IntPtr+instance Num IntPtr+instance Ord IntPtr+instance Read IntPtr+instance Real IntPtr+instance Show IntPtr+instance Storable IntPtr+instance Typeable IntPtr+ptrToIntPtr :: Ptr a -> IntPtr+intPtrToPtr :: IntPtr -> Ptr a+data WordPtr+instance Bits WordPtr+instance Bounded WordPtr+instance Enum WordPtr+instance Eq WordPtr+instance Integral WordPtr+instance Num WordPtr+instance Ord WordPtr+instance Read WordPtr+instance Real WordPtr+instance Show WordPtr+instance Storable WordPtr+instance Typeable WordPtr+ptrToWordPtr :: Ptr a -> WordPtr+wordPtrToPtr :: WordPtr -> Ptr a++module Foreign.Marshal.Error+throwIf :: (a -> Bool) -> (a -> String) -> IO a -> IO a+throwIf_ :: (a -> Bool) -> (a -> String) -> IO a -> IO ()+throwIfNeg :: (Ord a, Num a) => (a -> String) -> IO a -> IO a+throwIfNeg_ :: (Ord a, Num a) => (a -> String) -> IO a -> IO ()+throwIfNull :: String -> IO (Ptr a) -> IO (Ptr a)+void :: IO a -> IO ()++module Foreign.Concurrent+newForeignPtr :: Ptr a -> IO () -> IO (ForeignPtr a)+addForeignPtrFinalizer :: ForeignPtr a -> IO () -> IO ()++module Foreign.ForeignPtr+data ForeignPtr a+instance Typeable a => Data (ForeignPtr a)+instance Eq (ForeignPtr a)+instance Ord (ForeignPtr a)+instance Show (ForeignPtr a)+type FinalizerPtr a = FunPtr (Ptr a -> IO ())+type FinalizerEnvPtr env a = FunPtr (Ptr env -> Ptr a -> IO ())+newForeignPtr :: FinalizerPtr a -> Ptr a -> IO (ForeignPtr a)+newForeignPtr_ :: Ptr a -> IO (ForeignPtr a)+addForeignPtrFinalizer :: FinalizerPtr a -> ForeignPtr a -> IO ()+newForeignPtrEnv :: FinalizerEnvPtr env a -> Ptr env -> Ptr a -> IO (ForeignPtr a)+addForeignPtrFinalizerEnv :: FinalizerEnvPtr env a -> Ptr env -> ForeignPtr a -> IO ()+withForeignPtr :: ForeignPtr a -> (Ptr a -> IO b) -> IO b+finalizeForeignPtr :: ForeignPtr a -> IO ()+unsafeForeignPtrToPtr :: ForeignPtr a -> Ptr a+touchForeignPtr :: ForeignPtr a -> IO ()+castForeignPtr :: ForeignPtr a -> ForeignPtr b+mallocForeignPtr :: Storable a => IO (ForeignPtr a)+mallocForeignPtrBytes :: Int -> IO (ForeignPtr a)+mallocForeignPtrArray :: Storable a => Int -> IO (ForeignPtr a)+mallocForeignPtrArray0 :: Storable a => Int -> IO (ForeignPtr a)++module Foreign.Marshal.Alloc+alloca :: Storable a => (Ptr a -> IO b) -> IO b+allocaBytes :: Int -> (Ptr a -> IO b) -> IO b+malloc :: Storable a => IO (Ptr a)+mallocBytes :: Int -> IO (Ptr a)+realloc :: Storable b => Ptr a -> IO (Ptr b)+reallocBytes :: Ptr a -> Int -> IO (Ptr a)+free :: Ptr a -> IO ()+finalizerFree :: FinalizerPtr a++module Foreign.Marshal.Utils+with :: Storable a => a -> (Ptr a -> IO b) -> IO b+new :: Storable a => a -> IO (Ptr a)+fromBool :: Num a => Bool -> a+toBool :: Num a => a -> Bool+maybeNew :: (a -> IO (Ptr a)) -> Maybe a -> IO (Ptr a)+maybeWith :: (a -> (Ptr b -> IO c) -> IO c) -> Maybe a -> (Ptr b -> IO c) -> IO c+maybePeek :: (Ptr a -> IO b) -> Ptr a -> IO (Maybe b)+withMany :: (a -> (b -> res) -> res) -> [a] -> ([b] -> res) -> res+copyBytes :: Ptr a -> Ptr a -> Int -> IO ()+moveBytes :: Ptr a -> Ptr a -> Int -> IO ()++module Foreign.Marshal.Array+mallocArray :: Storable a => Int -> IO (Ptr a)+mallocArray0 :: Storable a => Int -> IO (Ptr a)+allocaArray :: Storable a => Int -> (Ptr a -> IO b) -> IO b+allocaArray0 :: Storable a => Int -> (Ptr a -> IO b) -> IO b+reallocArray :: Storable a => Ptr a -> Int -> IO (Ptr a)+reallocArray0 :: Storable a => Ptr a -> Int -> IO (Ptr a)+peekArray :: Storable a => Int -> Ptr a -> IO [a]+peekArray0 :: (Storable a, Eq a) => a -> Ptr a -> IO [a]+pokeArray :: Storable a => Ptr a -> [a] -> IO ()+pokeArray0 :: Storable a => a -> Ptr a -> [a] -> IO ()+newArray :: Storable a => [a] -> IO (Ptr a)+newArray0 :: Storable a => a -> [a] -> IO (Ptr a)+withArray :: Storable a => [a] -> (Ptr a -> IO b) -> IO b+withArray0 :: Storable a => a -> [a] -> (Ptr a -> IO b) -> IO b+withArrayLen :: Storable a => [a] -> (Int -> Ptr a -> IO b) -> IO b+withArrayLen0 :: Storable a => a -> [a] -> (Int -> Ptr a -> IO b) -> IO b+copyArray :: Storable a => Ptr a -> Ptr a -> Int -> IO ()+moveArray :: Storable a => Ptr a -> Ptr a -> Int -> IO ()+lengthArray0 :: (Storable a, Eq a) => a -> Ptr a -> IO Int+advancePtr :: Storable a => Ptr a -> Int -> Ptr a++module Foreign.C.String+type CString = Ptr CChar+type CStringLen = (Ptr CChar, Int)+peekCString :: CString -> IO String+peekCStringLen :: CStringLen -> IO String+newCString :: String -> IO CString+newCStringLen :: String -> IO CStringLen+withCString :: String -> (CString -> IO a) -> IO a+withCStringLen :: String -> (CStringLen -> IO a) -> IO a+charIsRepresentable :: Char -> IO Bool+castCharToCChar :: Char -> CChar+castCCharToChar :: CChar -> Char+peekCAString :: CString -> IO String+peekCAStringLen :: CStringLen -> IO String+newCAString :: String -> IO CString+newCAStringLen :: String -> IO CStringLen+withCAString :: String -> (CString -> IO a) -> IO a+withCAStringLen :: String -> (CStringLen -> IO a) -> IO a+type CWString = Ptr CWchar+type CWStringLen = (Ptr CWchar, Int)+peekCWString :: CWString -> IO String+peekCWStringLen :: CWStringLen -> IO String+newCWString :: String -> IO CWString+newCWStringLen :: String -> IO CWStringLen+withCWString :: String -> (CWString -> IO a) -> IO a+withCWStringLen :: String -> (CWStringLen -> IO a) -> IO a++module Foreign.C.Error+newtype Errno+Errno :: CInt -> Errno+instance Eq Errno+eOK :: Errno+e2BIG :: Errno+eACCES :: Errno+eADDRINUSE :: Errno+eADDRNOTAVAIL :: Errno+eADV :: Errno+eAFNOSUPPORT :: Errno+eAGAIN :: Errno+eALREADY :: Errno+eBADF :: Errno+eBADMSG :: Errno+eBADRPC :: Errno+eBUSY :: Errno+eCHILD :: Errno+eCOMM :: Errno+eCONNABORTED :: Errno+eCONNREFUSED :: Errno+eCONNRESET :: Errno+eDEADLK :: Errno+eDESTADDRREQ :: Errno+eDIRTY :: Errno+eDOM :: Errno+eDQUOT :: Errno+eEXIST :: Errno+eFAULT :: Errno+eFBIG :: Errno+eFTYPE :: Errno+eHOSTDOWN :: Errno+eHOSTUNREACH :: Errno+eIDRM :: Errno+eILSEQ :: Errno+eINPROGRESS :: Errno+eINTR :: Errno+eINVAL :: Errno+eIO :: Errno+eISCONN :: Errno+eISDIR :: Errno+eLOOP :: Errno+eMFILE :: Errno+eMLINK :: Errno+eMSGSIZE :: Errno+eMULTIHOP :: Errno+eNAMETOOLONG :: Errno+eNETDOWN :: Errno+eNETRESET :: Errno+eNETUNREACH :: Errno+eNFILE :: Errno+eNOBUFS :: Errno+eNODATA :: Errno+eNODEV :: Errno+eNOENT :: Errno+eNOEXEC :: Errno+eNOLCK :: Errno+eNOLINK :: Errno+eNOMEM :: Errno+eNOMSG :: Errno+eNONET :: Errno+eNOPROTOOPT :: Errno+eNOSPC :: Errno+eNOSR :: Errno+eNOSTR :: Errno+eNOSYS :: Errno+eNOTBLK :: Errno+eNOTCONN :: Errno+eNOTDIR :: Errno+eNOTEMPTY :: Errno+eNOTSOCK :: Errno+eNOTTY :: Errno+eNXIO :: Errno+eOPNOTSUPP :: Errno+ePERM :: Errno+ePFNOSUPPORT :: Errno+ePIPE :: Errno+ePROCLIM :: Errno+ePROCUNAVAIL :: Errno+ePROGMISMATCH :: Errno+ePROGUNAVAIL :: Errno+ePROTO :: Errno+ePROTONOSUPPORT :: Errno+ePROTOTYPE :: Errno+eRANGE :: Errno+eREMCHG :: Errno+eREMOTE :: Errno+eROFS :: Errno+eRPCMISMATCH :: Errno+eRREMOTE :: Errno+eSHUTDOWN :: Errno+eSOCKTNOSUPPORT :: Errno+eSPIPE :: Errno+eSRCH :: Errno+eSRMNT :: Errno+eSTALE :: Errno+eTIME :: Errno+eTIMEDOUT :: Errno+eTOOMANYREFS :: Errno+eTXTBSY :: Errno+eUSERS :: Errno+eWOULDBLOCK :: Errno+eXDEV :: Errno+isValidErrno :: Errno -> Bool+getErrno :: IO Errno+resetErrno :: IO ()+errnoToIOError :: String -> Errno -> Maybe Handle -> Maybe String -> IOError+throwErrno :: String -> IO a+throwErrnoIf :: (a -> Bool) -> String -> IO a -> IO a+throwErrnoIf_ :: (a -> Bool) -> String -> IO a -> IO ()+throwErrnoIfRetry :: (a -> Bool) -> String -> IO a -> IO a+throwErrnoIfRetry_ :: (a -> Bool) -> String -> IO a -> IO ()+throwErrnoIfMinus1 :: Num a => String -> IO a -> IO a+throwErrnoIfMinus1_ :: Num a => String -> IO a -> IO ()+throwErrnoIfMinus1Retry :: Num a => String -> IO a -> IO a+throwErrnoIfMinus1Retry_ :: Num a => String -> IO a -> IO ()+throwErrnoIfNull :: String -> IO (Ptr a) -> IO (Ptr a)+throwErrnoIfNullRetry :: String -> IO (Ptr a) -> IO (Ptr a)+throwErrnoIfRetryMayBlock :: (a -> Bool) -> String -> IO a -> IO b -> IO a+throwErrnoIfRetryMayBlock_ :: (a -> Bool) -> String -> IO a -> IO b -> IO ()+throwErrnoIfMinus1RetryMayBlock :: Num a => String -> IO a -> IO b -> IO a+throwErrnoIfMinus1RetryMayBlock_ :: Num a => String -> IO a -> IO b -> IO ()+throwErrnoIfNullRetryMayBlock :: String -> IO (Ptr a) -> IO b -> IO (Ptr a)+throwErrnoPath :: String -> FilePath -> IO a+throwErrnoPathIf :: (a -> Bool) -> String -> FilePath -> IO a -> IO a+throwErrnoPathIf_ :: (a -> Bool) -> String -> FilePath -> IO a -> IO ()+throwErrnoPathIfNull :: String -> FilePath -> IO (Ptr a) -> IO (Ptr a)+throwErrnoPathIfMinus1 :: Num a => String -> FilePath -> IO a -> IO a+throwErrnoPathIfMinus1_ :: Num a => String -> FilePath -> IO a -> IO ()++module Foreign.C++module Foreign.Marshal.Pool+data Pool+newPool :: IO Pool+freePool :: Pool -> IO ()+withPool :: (Pool -> IO b) -> IO b+pooledMalloc :: Storable a => Pool -> IO (Ptr a)+pooledMallocBytes :: Pool -> Int -> IO (Ptr a)+pooledRealloc :: Storable a => Pool -> Ptr a -> IO (Ptr a)+pooledReallocBytes :: Pool -> Ptr a -> Int -> IO (Ptr a)+pooledMallocArray :: Storable a => Pool -> Int -> IO (Ptr a)+pooledMallocArray0 :: Storable a => Pool -> Int -> IO (Ptr a)+pooledReallocArray :: Storable a => Pool -> Ptr a -> Int -> IO (Ptr a)+pooledReallocArray0 :: Storable a => Pool -> Ptr a -> Int -> IO (Ptr a)+pooledNew :: Storable a => Pool -> a -> IO (Ptr a)+pooledNewArray :: Storable a => Pool -> [a] -> IO (Ptr a)+pooledNewArray0 :: Storable a => Pool -> a -> [a] -> IO (Ptr a)++module Foreign.Marshal++module Foreign+unsafePerformIO :: IO a -> a++module System.Posix.Types+newtype Fd+Fd :: CInt -> Fd+instance Bits Fd+instance Bounded Fd+instance Enum Fd+instance Eq Fd+instance Integral Fd+instance Num Fd+instance Ord Fd+instance Read Fd+instance Real Fd+instance Show Fd+instance Storable Fd+instance Typeable Fd+type ByteCount = CSize+type ClockTick = CClock+type EpochTime = CTime+type FileOffset = COff+type ProcessID = CPid+type ProcessGroupID = CPid+type DeviceID = CDev+type FileID = CIno+type FileMode = CMode+type Limit = CLong++module GHC.Conc+data ThreadId+ThreadId :: ThreadId# -> ThreadId+instance Data ThreadId+instance Eq ThreadId+instance Ord ThreadId+instance Show ThreadId+instance Typeable ThreadId+forkIO :: IO () -> IO ThreadId+forkOnIO :: Int -> IO () -> IO ThreadId+numCapabilities :: Int+childHandler :: Exception -> IO ()+myThreadId :: IO ThreadId+killThread :: ThreadId -> IO ()+throwTo :: ThreadId -> Exception -> IO ()+par :: a -> b -> b+pseq :: a -> b -> b+yield :: IO ()+labelThread :: ThreadId -> String -> IO ()+threadDelay :: Int -> IO ()+registerDelay :: Int -> IO (TVar Bool)+threadWaitRead :: Fd -> IO ()+threadWaitWrite :: Fd -> IO ()+data MVar a+instance Typeable1 MVar+instance Typeable a => Data (MVar a)+instance Eq (MVar a)+newMVar :: a -> IO (MVar a)+newEmptyMVar :: IO (MVar a)+takeMVar :: MVar a -> IO a+putMVar :: MVar a -> a -> IO ()+tryTakeMVar :: MVar a -> IO (Maybe a)+tryPutMVar :: MVar a -> a -> IO Bool+isEmptyMVar :: MVar a -> IO Bool+addMVarFinalizer :: MVar a -> IO () -> IO ()+data STM a+instance Functor STM+instance Monad STM+instance Typeable1 STM+instance Typeable a => Data (STM a)+atomically :: STM a -> IO a+retry :: STM a+orElse :: STM a -> STM a -> STM a+catchSTM :: STM a -> (Exception -> STM a) -> STM a+alwaysSucceeds :: STM a -> STM ()+always :: STM Bool -> STM ()+data TVar a+instance Typeable1 TVar+instance Typeable a => Data (TVar a)+instance Eq (TVar a)+newTVar :: a -> STM (TVar a)+newTVarIO :: a -> IO (TVar a)+readTVar :: TVar a -> STM a+writeTVar :: TVar a -> a -> STM ()+unsafeIOToSTM :: IO a -> STM a+asyncRead :: Int -> Int -> Int -> Ptr a -> IO (Int, Int)+asyncWrite :: Int -> Int -> Int -> Ptr a -> IO (Int, Int)+asyncDoProc :: FunPtr (Ptr a -> IO Int) -> Ptr a -> IO Int+asyncReadBA :: Int -> Int -> Int -> Int -> MutableByteArray# RealWorld -> IO (Int, Int)+asyncWriteBA :: Int -> Int -> Int -> Int -> MutableByteArray# RealWorld -> IO (Int, Int)+ensureIOManagerIsRunning :: IO ()+data ConsoleEvent+ControlC :: ConsoleEvent+Break :: ConsoleEvent+Close :: ConsoleEvent+Logoff :: ConsoleEvent+Shutdown :: ConsoleEvent+instance Enum ConsoleEvent+instance Eq ConsoleEvent+instance Ord ConsoleEvent+instance Read ConsoleEvent+instance Show ConsoleEvent+instance Typeable ConsoleEvent+win32ConsoleHandler :: MVar (ConsoleEvent -> IO ())++module System.IO+data IO a+instance Applicative IO+instance Functor IO+instance Monad IO+instance MonadFix IO+instance Typeable1 IO+instance Typeable a => Data (IO a)+instance HPrintfType (IO a)+instance PrintfType (IO a)+fixIO :: (a -> IO a) -> IO a+type FilePath = String+data Handle+instance Data Handle+instance Eq Handle+instance Show Handle+instance Typeable Handle+stdin :: Handle+stdout :: Handle+stderr :: Handle+withFile :: FilePath -> IOMode -> (Handle -> IO r) -> IO r+openFile :: FilePath -> IOMode -> IO Handle+data IOMode+ReadMode :: IOMode+WriteMode :: IOMode+AppendMode :: IOMode+ReadWriteMode :: IOMode+instance Enum IOMode+instance Eq IOMode+instance Ix IOMode+instance Ord IOMode+instance Read IOMode+instance Show IOMode+hClose :: Handle -> IO ()+readFile :: FilePath -> IO String+writeFile :: FilePath -> String -> IO ()+appendFile :: FilePath -> String -> IO ()+hFileSize :: Handle -> IO Integer+hSetFileSize :: Handle -> Integer -> IO ()+hIsEOF :: Handle -> IO Bool+isEOF :: IO Bool+data BufferMode+NoBuffering :: BufferMode+LineBuffering :: BufferMode+BlockBuffering :: Maybe Int -> BufferMode+instance Eq BufferMode+instance Ord BufferMode+instance Read BufferMode+instance Show BufferMode+hSetBuffering :: Handle -> BufferMode -> IO ()+hGetBuffering :: Handle -> IO BufferMode+hFlush :: Handle -> IO ()+hGetPosn :: Handle -> IO HandlePosn+hSetPosn :: HandlePosn -> IO ()+data HandlePosn+instance Eq HandlePosn+instance Show HandlePosn+hSeek :: Handle -> SeekMode -> Integer -> IO ()+data SeekMode+AbsoluteSeek :: SeekMode+RelativeSeek :: SeekMode+SeekFromEnd :: SeekMode+instance Enum SeekMode+instance Eq SeekMode+instance Ix SeekMode+instance Ord SeekMode+instance Read SeekMode+instance Show SeekMode+hTell :: Handle -> IO Integer+hIsOpen :: Handle -> IO Bool+hIsClosed :: Handle -> IO Bool+hIsReadable :: Handle -> IO Bool+hIsWritable :: Handle -> IO Bool+hIsSeekable :: Handle -> IO Bool+hIsTerminalDevice :: Handle -> IO Bool+hSetEcho :: Handle -> Bool -> IO ()+hGetEcho :: Handle -> IO Bool+hShow :: Handle -> IO String+hWaitForInput :: Handle -> Int -> IO Bool+hReady :: Handle -> IO Bool+hGetChar :: Handle -> IO Char+hGetLine :: Handle -> IO String+hLookAhead :: Handle -> IO Char+hGetContents :: Handle -> IO String+hPutChar :: Handle -> Char -> IO ()+hPutStr :: Handle -> String -> IO ()+hPutStrLn :: Handle -> String -> IO ()+hPrint :: Show a => Handle -> a -> IO ()+interact :: (String -> String) -> IO ()+putChar :: Char -> IO ()+putStr :: String -> IO ()+putStrLn :: String -> IO ()+print :: Show a => a -> IO ()+getChar :: IO Char+getLine :: IO String+getContents :: IO String+readIO :: Read a => String -> IO a+readLn :: Read a => IO a+withBinaryFile :: FilePath -> IOMode -> (Handle -> IO r) -> IO r+openBinaryFile :: FilePath -> IOMode -> IO Handle+hSetBinaryMode :: Handle -> Bool -> IO ()+hPutBuf :: Handle -> Ptr a -> Int -> IO ()+hGetBuf :: Handle -> Ptr a -> Int -> IO Int+hPutBufNonBlocking :: Handle -> Ptr a -> Int -> IO Int+hGetBufNonBlocking :: Handle -> Ptr a -> Int -> IO Int+openTempFile :: FilePath -> String -> IO (FilePath, Handle)+openBinaryTempFile :: FilePath -> String -> IO (FilePath, Handle)++module GHC.Dotnet+data Object a+unmarshalObject :: Addr# -> Object a+marshalObject :: Object a -> (Addr# -> IO b) -> IO b+unmarshalString :: Addr# -> String+marshalString :: String -> (Addr# -> IO a) -> IO a+checkResult :: (State# RealWorld -> (State# RealWorld, a, Addr#)) -> IO a++module Text.Read+class Read a+readsPrec :: Read a => Int -> ReadS a+readList :: Read a => ReadS [a]+readPrec :: Read a => ReadPrec a+readListPrec :: Read a => ReadPrec [a]+instance Read All+instance Read Any+instance Read Bool+instance Read BufferMode+instance Read CChar+instance Read CClock+instance Read CDouble+instance Read CFloat+instance Read CInt+instance Read CIntMax+instance Read CIntPtr+instance Read CLDouble+instance Read CLLong+instance Read CLong+instance Read CPtrdiff+instance Read CSChar+instance Read CShort+instance Read CSigAtomic+instance Read CSize+instance Read CTime+instance Read CUChar+instance Read CUInt+instance Read CUIntMax+instance Read CUIntPtr+instance Read CULLong+instance Read CULong+instance Read CUShort+instance Read CWchar+instance Read Char+instance Read ConsoleEvent+instance Read Double+instance Read ExitCode+instance Read Fd+instance Read Float+instance Read GeneralCategory+instance Read IOMode+instance Read Int+instance Read Int16+instance Read Int32+instance Read Int64+instance Read Int8+instance Read IntPtr+instance Read Integer+instance Read Lexeme+instance Read Ordering+instance Read SeekMode+instance Read Version+instance Read Word+instance Read Word16+instance Read Word32+instance Read Word64+instance Read Word8+instance Read WordPtr+instance Read ()+instance (Read a, Read b) => Read (a, b)+instance (Read a, Read b, Read c) => Read (a, b, c)+instance (Read a, Read b, Read c, Read d) => Read (a, b, c, d)+instance (Read a, Read b, Read c, Read d, Read e) => Read (a, b, c, d, e)+instance (Read a, Read b, Read c, Read d, Read e, Read f) => Read (a, b, c, d, e, f)+instance (Read a, Read b, Read c, Read d, Read e, Read f, Read g) => Read (a, b, c, d, e, f, g)+instance (Read a, Read b, Read c, Read d, Read e, Read f, Read g, Read h) => Read (a, b, c, d, e, f, g, h)+instance (Read a, Read b, Read c, Read d, Read e, Read f, Read g, Read h, Read i) => Read (a, b, c, d, e, f, g, h, i)+instance (Read a, Read b, Read c, Read d, Read e, Read f, Read g, Read h, Read i, Read j) => Read (a, b, c, d, e, f, g, h, i, j)+instance (Read a, Read b, Read c, Read d, Read e, Read f, Read g, Read h, Read i, Read j, Read k) => Read (a, b, c, d, e, f, g, h, i, j, k)+instance (Read a, Read b, Read c, Read d, Read e, Read f, Read g, Read h, Read i, Read j, Read k, Read l) => Read (a, b, c, d, e, f, g, h, i, j, k, l)+instance (Read a, Read b, Read c, Read d, Read e, Read f, Read g, Read h, Read i, Read j, Read k, Read l, Read m) => Read (a, b, c, d, e, f, g, h, i, j, k, l, m)+instance (Read a, Read b, Read c, Read d, Read e, Read f, Read g, Read h, Read i, Read j, Read k, Read l, Read m, Read n) => Read (a, b, c, d, e, f, g, h, i, j, k, l, m, n)+instance (Read a, Read b, Read c, Read d, Read e, Read f, Read g, Read h, Read i, Read j, Read k, Read l, Read m, Read n, Read o) => Read (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)+instance (RealFloat a, Read a) => Read (Complex a)+instance Read a => Read (Dual a)+instance Read a => Read (First a)+instance Read a => Read (Last a)+instance Read a => Read (Maybe a)+instance Read a => Read (Product a)+instance (Integral a, Read a) => Read (Ratio a)+instance Read a => Read (Sum a)+instance Read a => Read [a]+instance (Ix a, Read a, Read b) => Read (Array a b)+instance (Read a, Read b) => Read (Either a b)+type ReadS a = String -> [(a, String)]+reads :: Read a => ReadS a+read :: Read a => String -> a+readParen :: Bool -> ReadS a -> ReadS a+lex :: ReadS String+data Lexeme+Char :: Char -> Lexeme+String :: String -> Lexeme+Punc :: String -> Lexeme+Ident :: String -> Lexeme+Symbol :: String -> Lexeme+Int :: Integer -> Lexeme+Rat :: Rational -> Lexeme+EOF :: Lexeme+instance Eq Lexeme+instance Read Lexeme+instance Show Lexeme+lexP :: ReadPrec Lexeme+parens :: ReadPrec a -> ReadPrec a+readListDefault :: Read a => ReadS [a]+readListPrecDefault :: Read a => ReadPrec [a]++module Prelude+data Bool+False :: Bool+True :: Bool+instance Bounded Bool+instance Data Bool+instance Enum Bool+instance Eq Bool+instance Ix Bool+instance Ord Bool+instance Read Bool+instance Show Bool+instance Storable Bool+instance Typeable Bool+(&&) :: Bool -> Bool -> Bool+(||) :: Bool -> Bool -> Bool+not :: Bool -> Bool+otherwise :: Bool+data Maybe a+Nothing :: Maybe a+Just :: a -> Maybe a+instance Alternative Maybe+instance Applicative Maybe+instance Foldable Maybe+instance Functor Maybe+instance Monad Maybe+instance MonadFix Maybe+instance MonadPlus Maybe+instance Traversable Maybe+instance Typeable1 Maybe+instance Data a => Data (Maybe a)+instance Eq a => Eq (Maybe a)+instance Monoid a => Monoid (Maybe a)+instance Ord a => Ord (Maybe a)+instance Read a => Read (Maybe a)+instance Show a => Show (Maybe a)+maybe :: b -> (a -> b) -> Maybe a -> b+data Either a b+Left :: a -> Either a b+Right :: b -> Either a b+instance Typeable2 Either+instance Functor (Either a)+instance (Data a, Data b) => Data (Either a b)+instance (Eq a, Eq b) => Eq (Either a b)+instance (Ord a, Ord b) => Ord (Either a b)+instance (Read a, Read b) => Read (Either a b)+instance (Show a, Show b) => Show (Either a b)+either :: (a -> c) -> (b -> c) -> Either a b -> c+data Ordering+LT :: Ordering+EQ :: Ordering+instance Bounded Ordering+instance Data Ordering+instance Enum Ordering+instance Eq Ordering+instance Ix Ordering+instance Monoid Ordering+instance Ord Ordering+instance Read Ordering+instance Show Ordering+instance Typeable Ordering+data Char+instance Bounded Char+instance Data Char+instance Enum Char+instance Eq Char+instance IsChar Char+instance Ix Char+instance Ord Char+instance PrintfArg Char+instance Read Char+instance Show Char+instance Storable Char+instance Typeable Char+instance IsString [Char]+type String = [Char]+fst :: (a, b) -> a+snd :: (a, b) -> b+curry :: ((a, b) -> c) -> a -> b -> c+uncurry :: (a -> b -> c) -> (a, b) -> c+class Eq a+(==) :: Eq a => a -> a -> Bool+(/=) :: Eq a => a -> a -> Bool+instance Eq All+instance Eq Any+instance Eq ArithException+instance Eq ArrayException+instance Eq AsyncException+instance Eq Bool+instance Eq BufferMode+instance Eq BufferState+instance Eq CChar+instance Eq CClock+instance Eq CDouble+instance Eq CFloat+instance Eq CInt+instance Eq CIntMax+instance Eq CIntPtr+instance Eq CLDouble+instance Eq CLLong+instance Eq CLong+instance Eq CPtrdiff+instance Eq CSChar+instance Eq CShort+instance Eq CSigAtomic+instance Eq CSize+instance Eq CTime+instance Eq CUChar+instance Eq CUInt+instance Eq CUIntMax+instance Eq CUIntPtr+instance Eq CULLong+instance Eq CULong+instance Eq CUShort+instance Eq CWchar+instance Eq Char+instance Eq ConsoleEvent+instance Eq Constr+instance Eq ConstrRep+instance Eq DataRep+instance Eq Double+instance Eq Errno+instance Eq Exception+instance Eq ExitCode+instance Eq FDType+instance Eq Fd+instance Eq Fixity+instance Eq Float+instance Eq GeneralCategory+instance Eq Handle+instance Eq HandlePosn+instance Eq HashData+instance Eq IOErrorType+instance Eq IOException+instance Eq IOMode+instance Eq Inserts+instance Eq Int+instance Eq Int16+instance Eq Int32+instance Eq Int64+instance Eq Int8+instance Eq IntPtr+instance Eq Integer+instance Eq Key+instance Eq KeyPr+instance Eq Lexeme+instance Eq Ordering+instance Eq SeekMode+instance Eq ThreadId+instance Eq Timeout+instance Eq TyCon+instance Eq TypeRep+instance Eq Unique+instance Eq Version+instance Eq Word+instance Eq Word16+instance Eq Word32+instance Eq Word64+instance Eq Word8+instance Eq WordPtr+instance Eq ()+instance (Eq a, Eq b) => Eq (a, b)+instance (Eq a, Eq b, Eq c) => Eq (a, b, c)+instance (Eq a, Eq b, Eq c, Eq d) => Eq (a, b, c, d)+instance (Eq a, Eq b, Eq c, Eq d, Eq e) => Eq (a, b, c, d, e)+instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f) => Eq (a, b, c, d, e, f)+instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g) => Eq (a, b, c, d, e, f, g)+instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h) => Eq (a, b, c, d, e, f, g, h)+instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i) => Eq (a, b, c, d, e, f, g, h, i)+instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j) => Eq (a, b, c, d, e, f, g, h, i, j)+instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k) => Eq (a, b, c, d, e, f, g, h, i, j, k)+instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k, Eq l) => Eq (a, b, c, d, e, f, g, h, i, j, k, l)+instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k, Eq l, Eq m) => Eq (a, b, c, d, e, f, g, h, i, j, k, l, m)+instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k, Eq l, Eq m, Eq n) => Eq (a, b, c, d, e, f, g, h, i, j, k, l, m, n)+instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k, Eq l, Eq m, Eq n, Eq o) => Eq (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)+instance (RealFloat a, Eq a) => Eq (Complex a)+instance Eq a => Eq (Dual a)+instance Eq a => Eq (First a)+instance Eq (Fixed a)+instance Eq (ForeignPtr a)+instance Eq (FunPtr a)+instance Eq (IORef a)+instance Eq a => Eq (Last a)+instance Eq (MVar a)+instance Eq a => Eq (Maybe a)+instance Eq a => Eq (Product a)+instance Eq (Ptr a)+instance (Integral a, Eq a) => Eq (Ratio a)+instance Eq (StableName a)+instance Eq (StablePtr a)+instance Eq a => Eq (Sum a)+instance Eq (TVar a)+instance Eq a => Eq [a]+instance (Ix i, Eq e) => Eq (Array i e)+instance (Eq a, Eq b) => Eq (Either a b)+instance Eq (IOArray i e)+instance Eq (STRef s a)+instance Eq (STArray s i e)+class Eq a => Ord a+compare :: Ord a => a -> a -> Ordering+(<) :: Ord a => a -> a -> Bool+(<=) :: Ord a => a -> a -> Bool+(>) :: Ord a => a -> a -> Bool+(>=) :: Ord a => a -> a -> Bool+max :: Ord a => a -> a -> a+min :: Ord a => a -> a -> a+instance Ord All+instance Ord Any+instance Ord ArithException+instance Ord ArrayException+instance Ord AsyncException+instance Ord Bool+instance Ord BufferMode+instance Ord CChar+instance Ord CClock+instance Ord CDouble+instance Ord CFloat+instance Ord CInt+instance Ord CIntMax+instance Ord CIntPtr+instance Ord CLDouble+instance Ord CLLong+instance Ord CLong+instance Ord CPtrdiff+instance Ord CSChar+instance Ord CShort+instance Ord CSigAtomic+instance Ord CSize+instance Ord CTime+instance Ord CUChar+instance Ord CUInt+instance Ord CUIntMax+instance Ord CUIntPtr+instance Ord CULLong+instance Ord CULong+instance Ord CUShort+instance Ord CWchar+instance Ord Char+instance Ord ConsoleEvent+instance Ord Double+instance Ord ExitCode+instance Ord Fd+instance Ord Float+instance Ord GeneralCategory+instance Ord IOMode+instance Ord Int+instance Ord Int16+instance Ord Int32+instance Ord Int64+instance Ord Int8+instance Ord IntPtr+instance Ord Integer+instance Ord Ordering+instance Ord SeekMode+instance Ord ThreadId+instance Ord Unique+instance Ord Version+instance Ord Word+instance Ord Word16+instance Ord Word32+instance Ord Word64+instance Ord Word8+instance Ord WordPtr+instance Ord ()+instance (Ord a, Ord b) => Ord (a, b)+instance (Ord a, Ord b, Ord c) => Ord (a, b, c)+instance (Ord a, Ord b, Ord c, Ord d) => Ord (a, b, c, d)+instance (Ord a, Ord b, Ord c, Ord d, Ord e) => Ord (a, b, c, d, e)+instance (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f) => Ord (a, b, c, d, e, f)+instance (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g) => Ord (a, b, c, d, e, f, g)+instance (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h) => Ord (a, b, c, d, e, f, g, h)+instance (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i) => Ord (a, b, c, d, e, f, g, h, i)+instance (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j) => Ord (a, b, c, d, e, f, g, h, i, j)+instance (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j, Ord k) => Ord (a, b, c, d, e, f, g, h, i, j, k)+instance (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j, Ord k, Ord l) => Ord (a, b, c, d, e, f, g, h, i, j, k, l)+instance (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j, Ord k, Ord l, Ord m) => Ord (a, b, c, d, e, f, g, h, i, j, k, l, m)+instance (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j, Ord k, Ord l, Ord m, Ord n) => Ord (a, b, c, d, e, f, g, h, i, j, k, l, m, n)+instance (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j, Ord k, Ord l, Ord m, Ord n, Ord o) => Ord (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)+instance Ord a => Ord (Dual a)+instance Ord a => Ord (First a)+instance Ord (Fixed a)+instance Ord (ForeignPtr a)+instance Ord (FunPtr a)+instance Ord a => Ord (Last a)+instance Ord a => Ord (Maybe a)+instance Ord a => Ord (Product a)+instance Ord (Ptr a)+instance Integral a => Ord (Ratio a)+instance Ord a => Ord (Sum a)+instance Ord a => Ord [a]+instance (Ix i, Ord e) => Ord (Array i e)+instance (Ord a, Ord b) => Ord (Either a b)+class Enum a+succ :: Enum a => a -> a+pred :: Enum a => a -> a+toEnum :: Enum a => Int -> a+fromEnum :: Enum a => a -> Int+enumFrom :: Enum a => a -> [a]+enumFromThen :: Enum a => a -> a -> [a]+enumFromTo :: Enum a => a -> a -> [a]+enumFromThenTo :: Enum a => a -> a -> a -> [a]+instance Enum Bool+instance Enum CChar+instance Enum CClock+instance Enum CDouble+instance Enum CFloat+instance Enum CInt+instance Enum CIntMax+instance Enum CIntPtr+instance Enum CLDouble+instance Enum CLLong+instance Enum CLong+instance Enum CPtrdiff+instance Enum CSChar+instance Enum CShort+instance Enum CSigAtomic+instance Enum CSize+instance Enum CTime+instance Enum CUChar+instance Enum CUInt+instance Enum CUIntMax+instance Enum CUIntPtr+instance Enum CULLong+instance Enum CULong+instance Enum CUShort+instance Enum CWchar+instance Enum Char+instance Enum ConsoleEvent+instance Enum Double+instance Enum Fd+instance Enum Float+instance Enum GeneralCategory+instance Enum IOMode+instance Enum Int+instance Enum Int16+instance Enum Int32+instance Enum Int64+instance Enum Int8+instance Enum IntPtr+instance Enum Integer+instance Enum Ordering+instance Enum SeekMode+instance Enum Word+instance Enum Word16+instance Enum Word32+instance Enum Word64+instance Enum Word8+instance Enum WordPtr+instance Enum ()+instance Enum (Fixed a)+instance Integral a => Enum (Ratio a)+class Bounded a+minBound :: Bounded a => a+maxBound :: Bounded a => a+instance Bounded All+instance Bounded Any+instance Bounded Bool+instance Bounded CChar+instance Bounded CInt+instance Bounded CIntMax+instance Bounded CIntPtr+instance Bounded CLLong+instance Bounded CLong+instance Bounded CPtrdiff+instance Bounded CSChar+instance Bounded CShort+instance Bounded CSigAtomic+instance Bounded CSize+instance Bounded CUChar+instance Bounded CUInt+instance Bounded CUIntMax+instance Bounded CUIntPtr+instance Bounded CULLong+instance Bounded CULong+instance Bounded CUShort+instance Bounded CWchar+instance Bounded Char+instance Bounded Fd+instance Bounded GeneralCategory+instance Bounded Int+instance Bounded Int16+instance Bounded Int32+instance Bounded Int64+instance Bounded Int8+instance Bounded IntPtr+instance Bounded Ordering+instance Bounded Word+instance Bounded Word16+instance Bounded Word32+instance Bounded Word64+instance Bounded Word8+instance Bounded WordPtr+instance Bounded ()+instance (Bounded a, Bounded b) => Bounded (a, b)+instance (Bounded a, Bounded b, Bounded c) => Bounded (a, b, c)+instance (Bounded a, Bounded b, Bounded c, Bounded d) => Bounded (a, b, c, d)+instance (Bounded a, Bounded b, Bounded c, Bounded d, Bounded e) => Bounded (a, b, c, d, e)+instance (Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f) => Bounded (a, b, c, d, e, f)+instance (Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g) => Bounded (a, b, c, d, e, f, g)+instance (Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h) => Bounded (a, b, c, d, e, f, g, h)+instance (Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h, Bounded i) => Bounded (a, b, c, d, e, f, g, h, i)+instance (Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h, Bounded i, Bounded j) => Bounded (a, b, c, d, e, f, g, h, i, j)+instance (Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h, Bounded i, Bounded j, Bounded k) => Bounded (a, b, c, d, e, f, g, h, i, j, k)+instance (Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h, Bounded i, Bounded j, Bounded k, Bounded l) => Bounded (a, b, c, d, e, f, g, h, i, j, k, l)+instance (Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h, Bounded i, Bounded j, Bounded k, Bounded l, Bounded m) => Bounded (a, b, c, d, e, f, g, h, i, j, k, l, m)+instance (Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h, Bounded i, Bounded j, Bounded k, Bounded l, Bounded m, Bounded n) => Bounded (a, b, c, d, e, f, g, h, i, j, k, l, m, n)+instance (Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h, Bounded i, Bounded j, Bounded k, Bounded l, Bounded m, Bounded n, Bounded o) => Bounded (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)+instance Bounded a => Bounded (Dual a)+instance Bounded a => Bounded (Product a)+instance Bounded a => Bounded (Sum a)+data Int+instance Bits Int+instance Bounded Int+instance Data Int+instance Enum Int+instance Eq Int+instance Integral Int+instance Ix Int+instance Num Int+instance Ord Int+instance PrintfArg Int+instance Read Int+instance Real Int+instance Show Int+instance Storable Int+instance Typeable Int+data Integer+instance Bits Integer+instance Data Integer+instance Enum Integer+instance Eq Integer+instance Integral Integer+instance Ix Integer+instance Num Integer+instance Ord Integer+instance PrintfArg Integer+instance Read Integer+instance Real Integer+instance Show Integer+instance Typeable Integer+data Float+instance Data Float+instance Enum Float+instance Eq Float+instance Floating Float+instance Fractional Float+instance Num Float+instance Ord Float+instance PrintfArg Float+instance Read Float+instance Real Float+instance RealFloat Float+instance RealFrac Float+instance Show Float+instance Storable Float+instance Typeable Float+data Double+instance Data Double+instance Enum Double+instance Eq Double+instance Floating Double+instance Fractional Double+instance Num Double+instance Ord Double+instance PrintfArg Double+instance Read Double+instance Real Double+instance RealFloat Double+instance RealFrac Double+instance Show Double+instance Storable Double+instance Typeable Double+type Rational = Ratio Integer+class (Eq a, Show a) => Num a+(+) :: Num a => a -> a -> a+(-) :: Num a => a -> a -> a+(*) :: Num a => a -> a -> a+negate :: Num a => a -> a+abs :: Num a => a -> a+signum :: Num a => a -> a+fromInteger :: Num a => Integer -> a+instance Num CChar+instance Num CClock+instance Num CDouble+instance Num CFloat+instance Num CInt+instance Num CIntMax+instance Num CIntPtr+instance Num CLDouble+instance Num CLLong+instance Num CLong+instance Num CPtrdiff+instance Num CSChar+instance Num CShort+instance Num CSigAtomic+instance Num CSize+instance Num CTime+instance Num CUChar+instance Num CUInt+instance Num CUIntMax+instance Num CUIntPtr+instance Num CULLong+instance Num CULong+instance Num CUShort+instance Num CWchar+instance Num Double+instance Num Fd+instance Num Float+instance Num Int+instance Num Int16+instance Num Int32+instance Num Int64+instance Num Int8+instance Num IntPtr+instance Num Integer+instance Num Word+instance Num Word16+instance Num Word32+instance Num Word64+instance Num Word8+instance Num WordPtr+instance RealFloat a => Num (Complex a)+instance HasResolution a => Num (Fixed a)+instance Integral a => Num (Ratio a)+class (Num a, Ord a) => Real a+toRational :: Real a => a -> Rational+instance Real CChar+instance Real CClock+instance Real CDouble+instance Real CFloat+instance Real CInt+instance Real CIntMax+instance Real CIntPtr+instance Real CLDouble+instance Real CLLong+instance Real CLong+instance Real CPtrdiff+instance Real CSChar+instance Real CShort+instance Real CSigAtomic+instance Real CSize+instance Real CTime+instance Real CUChar+instance Real CUInt+instance Real CUIntMax+instance Real CUIntPtr+instance Real CULLong+instance Real CULong+instance Real CUShort+instance Real CWchar+instance Real Double+instance Real Fd+instance Real Float+instance Real Int+instance Real Int16+instance Real Int32+instance Real Int64+instance Real Int8+instance Real IntPtr+instance Real Integer+instance Real Word+instance Real Word16+instance Real Word32+instance Real Word64+instance Real Word8+instance Real WordPtr+instance HasResolution a => Real (Fixed a)+instance Integral a => Real (Ratio a)+class (Real a, Enum a) => Integral a+quot :: Integral a => a -> a -> a+rem :: Integral a => a -> a -> a+div :: Integral a => a -> a -> a+mod :: Integral a => a -> a -> a+quotRem :: Integral a => a -> a -> (a, a)+divMod :: Integral a => a -> a -> (a, a)+toInteger :: Integral a => a -> Integer+instance Integral CChar+instance Integral CInt+instance Integral CIntMax+instance Integral CIntPtr+instance Integral CLLong+instance Integral CLong+instance Integral CPtrdiff+instance Integral CSChar+instance Integral CShort+instance Integral CSigAtomic+instance Integral CSize+instance Integral CUChar+instance Integral CUInt+instance Integral CUIntMax+instance Integral CUIntPtr+instance Integral CULLong+instance Integral CULong+instance Integral CUShort+instance Integral CWchar+instance Integral Fd+instance Integral Int+instance Integral Int16+instance Integral Int32+instance Integral Int64+instance Integral Int8+instance Integral IntPtr+instance Integral Integer+instance Integral Word+instance Integral Word16+instance Integral Word32+instance Integral Word64+instance Integral Word8+instance Integral WordPtr+class Num a => Fractional a+(/) :: Fractional a => a -> a -> a+recip :: Fractional a => a -> a+fromRational :: Fractional a => Rational -> a+instance Fractional CDouble+instance Fractional CFloat+instance Fractional CLDouble+instance Fractional Double+instance Fractional Float+instance RealFloat a => Fractional (Complex a)+instance HasResolution a => Fractional (Fixed a)+instance Integral a => Fractional (Ratio a)+class Fractional a => Floating a+pi :: Floating a => a+exp :: Floating a => a -> a+log :: Floating a => a -> a+sqrt :: Floating a => a -> a+(**) :: Floating a => a -> a -> a+logBase :: Floating a => a -> a -> a+sin :: Floating a => a -> a+cos :: Floating a => a -> a+tan :: Floating a => a -> a+asin :: Floating a => a -> a+acos :: Floating a => a -> a+atan :: Floating a => a -> a+sinh :: Floating a => a -> a+cosh :: Floating a => a -> a+tanh :: Floating a => a -> a+asinh :: Floating a => a -> a+acosh :: Floating a => a -> a+atanh :: Floating a => a -> a+instance Floating CDouble+instance Floating CFloat+instance Floating CLDouble+instance Floating Double+instance Floating Float+instance RealFloat a => Floating (Complex a)+class (Real a, Fractional a) => RealFrac a+properFraction :: (RealFrac a, Integral b) => a -> (b, a)+truncate :: (RealFrac a, Integral b) => a -> b+round :: (RealFrac a, Integral b) => a -> b+ceiling :: (RealFrac a, Integral b) => a -> b+floor :: (RealFrac a, Integral b) => a -> b+instance RealFrac CDouble+instance RealFrac CFloat+instance RealFrac CLDouble+instance RealFrac Double+instance RealFrac Float+instance HasResolution a => RealFrac (Fixed a)+instance Integral a => RealFrac (Ratio a)+class (RealFrac a, Floating a) => RealFloat a+floatRadix :: RealFloat a => a -> Integer+floatDigits :: RealFloat a => a -> Int+floatRange :: RealFloat a => a -> (Int, Int)+decodeFloat :: RealFloat a => a -> (Integer, Int)+encodeFloat :: RealFloat a => Integer -> Int -> a+exponent :: RealFloat a => a -> Int+significand :: RealFloat a => a -> a+scaleFloat :: RealFloat a => Int -> a -> a+isNaN :: RealFloat a => a -> Bool+isInfinite :: RealFloat a => a -> Bool+isDenormalized :: RealFloat a => a -> Bool+isNegativeZero :: RealFloat a => a -> Bool+isIEEE :: RealFloat a => a -> Bool+atan2 :: RealFloat a => a -> a -> a+instance RealFloat CDouble+instance RealFloat CFloat+instance RealFloat CLDouble+instance RealFloat Double+instance RealFloat Float+subtract :: Num a => a -> a -> a+even :: Integral a => a -> Bool+odd :: Integral a => a -> Bool+gcd :: Integral a => a -> a -> a+lcm :: Integral a => a -> a -> a+(^) :: (Num a, Integral b) => a -> b -> a+(^^) :: (Fractional a, Integral b) => a -> b -> a+fromIntegral :: (Integral a, Num b) => a -> b+realToFrac :: (Real a, Fractional b) => a -> b+class Monad m+(>>=) :: Monad m => m a -> (a -> m b) -> m b+(>>) :: Monad m => m a -> m b -> m b+return :: Monad m => a -> m a+fail :: Monad m => String -> m a+instance Monad IO+instance Monad Maybe+instance Monad P+instance Monad ReadP+instance Monad ReadPrec+instance Monad STM+instance Monad []+instance ArrowApply a => Monad (ArrowMonad a)+instance Monad (ST s)+instance Monad (ST s)+instance Monad ((->) r)+class Functor f+fmap :: Functor f => (a -> b) -> f a -> f b+instance Functor IO+instance Functor Id+instance Functor Maybe+instance Functor ReadP+instance Functor ReadPrec+instance Functor STM+instance Functor ZipList+instance Functor []+instance Ix i => Functor (Array i)+instance Functor (Const m)+instance Functor (Either a)+instance Functor (ST s)+instance Functor (ST s)+instance Monad m => Functor (WrappedMonad m)+instance Functor ((,) a)+instance Functor ((->) r)+instance Arrow a => Functor (WrappedArrow a b)+mapM :: Monad m => (a -> m b) -> [a] -> m [b]+mapM_ :: Monad m => (a -> m b) -> [a] -> m ()+sequence :: Monad m => [m a] -> m [a]+sequence_ :: Monad m => [m a] -> m ()+(=<<) :: Monad m => (a -> m b) -> m a -> m b+id :: a -> a+const :: a -> b -> a+(.) :: (b -> c) -> (a -> b) -> a -> c+flip :: (a -> b -> c) -> b -> a -> c+($) :: (a -> b) -> a -> b+until :: (a -> Bool) -> (a -> a) -> a -> a+asTypeOf :: a -> a -> a+error :: String -> a+undefined :: a+seq :: a -> b -> b+($!) :: (a -> b) -> a -> b+map :: (a -> b) -> [a] -> [b]+(++) :: [a] -> [a] -> [a]+filter :: (a -> Bool) -> [a] -> [a]+head :: [a] -> a+last :: [a] -> a+tail :: [a] -> [a]+init :: [a] -> [a]+null :: [a] -> Bool+length :: [a] -> Int+(!!) :: [a] -> Int -> a+reverse :: [a] -> [a]+foldl :: (a -> b -> a) -> a -> [b] -> a+foldl1 :: (a -> a -> a) -> [a] -> a+foldr :: (a -> b -> b) -> b -> [a] -> b+foldr1 :: (a -> a -> a) -> [a] -> a+and :: [Bool] -> Bool+or :: [Bool] -> Bool+any :: (a -> Bool) -> [a] -> Bool+all :: (a -> Bool) -> [a] -> Bool+sum :: Num a => [a] -> a+product :: Num a => [a] -> a+concat :: [[a]] -> [a]+concatMap :: (a -> [b]) -> [a] -> [b]+maximum :: Ord a => [a] -> a+minimum :: Ord a => [a] -> a+scanl :: (a -> b -> a) -> a -> [b] -> [a]+scanl1 :: (a -> a -> a) -> [a] -> [a]+scanr :: (a -> b -> b) -> b -> [a] -> [b]+scanr1 :: (a -> a -> a) -> [a] -> [a]+iterate :: (a -> a) -> a -> [a]+repeat :: a -> [a]+replicate :: Int -> a -> [a]+cycle :: [a] -> [a]+take :: Int -> [a] -> [a]+drop :: Int -> [a] -> [a]+splitAt :: Int -> [a] -> ([a], [a])+takeWhile :: (a -> Bool) -> [a] -> [a]+dropWhile :: (a -> Bool) -> [a] -> [a]+span :: (a -> Bool) -> [a] -> ([a], [a])+break :: (a -> Bool) -> [a] -> ([a], [a])+elem :: Eq a => a -> [a] -> Bool+notElem :: Eq a => a -> [a] -> Bool+lookup :: Eq a => a -> [(a, b)] -> Maybe b+zip :: [a] -> [b] -> [(a, b)]+zip3 :: [a] -> [b] -> [c] -> [(a, b, c)]+zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]+zipWith3 :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]+unzip :: [(a, b)] -> ([a], [b])+unzip3 :: [(a, b, c)] -> ([a], [b], [c])+lines :: String -> [String]+words :: String -> [String]+unlines :: [String] -> String+unwords :: [String] -> String+type ShowS = String -> String+class Show a+showsPrec :: Show a => Int -> a -> ShowS+show :: Show a => a -> String+showList :: Show a => [a] -> ShowS+instance Show All+instance Show Any+instance Show ArithException+instance Show ArrayException+instance Show AsyncException+instance Show Bool+instance Show BufferMode+instance Show CChar+instance Show CClock+instance Show CDouble+instance Show CFloat+instance Show CInt+instance Show CIntMax+instance Show CIntPtr+instance Show CLDouble+instance Show CLLong+instance Show CLong+instance Show CPtrdiff+instance Show CSChar+instance Show CShort+instance Show CSigAtomic+instance Show CSize+instance Show CTime+instance Show CUChar+instance Show CUInt+instance Show CUIntMax+instance Show CUIntPtr+instance Show CULLong+instance Show CULong+instance Show CUShort+instance Show CWchar+instance Show Char+instance Show ConsoleEvent+instance Show Constr+instance Show ConstrRep+instance Show DataRep+instance Show DataType+instance Show Double+instance Show Dynamic+instance Show Exception+instance Show ExitCode+instance Show Fd+instance Show Fixity+instance Show Float+instance Show GeneralCategory+instance Show Handle+instance Show HandlePosn+instance Show HandleType+instance Show HashData+instance Show IOErrorType+instance Show IOException+instance Show IOMode+instance Show Int+instance Show Int16+instance Show Int32+instance Show Int64+instance Show Int8+instance Show IntPtr+instance Show Integer+instance Show Lexeme+instance Show Ordering+instance Show SeekMode+instance Show ThreadId+instance Show TyCon+instance Show TypeRep+instance Show Version+instance Show Word+instance Show Word16+instance Show Word32+instance Show Word64+instance Show Word8+instance Show WordPtr+instance Show ()+instance (Show a, Show b) => Show (a, b)+instance (Show a, Show b, Show c) => Show (a, b, c)+instance (Show a, Show b, Show c, Show d) => Show (a, b, c, d)+instance (Show a, Show b, Show c, Show d, Show e) => Show (a, b, c, d, e)+instance (Show a, Show b, Show c, Show d, Show e, Show f) => Show (a, b, c, d, e, f)+instance (Show a, Show b, Show c, Show d, Show e, Show f, Show g) => Show (a, b, c, d, e, f, g)+instance (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h) => Show (a, b, c, d, e, f, g, h)+instance (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i) => Show (a, b, c, d, e, f, g, h, i)+instance (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j) => Show (a, b, c, d, e, f, g, h, i, j)+instance (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k) => Show (a, b, c, d, e, f, g, h, i, j, k)+instance (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l) => Show (a, b, c, d, e, f, g, h, i, j, k, l)+instance (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l, Show m) => Show (a, b, c, d, e, f, g, h, i, j, k, l, m)+instance (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l, Show m, Show n) => Show (a, b, c, d, e, f, g, h, i, j, k, l, m, n)+instance (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l, Show m, Show n, Show o) => Show (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)+instance Show (a -> b)+instance (RealFloat a, Show a) => Show (Complex a)+instance Show a => Show (Dual a)+instance Show a => Show (First a)+instance HasResolution a => Show (Fixed a)+instance Show (ForeignPtr a)+instance Show (FunPtr a)+instance Show a => Show (Last a)+instance Show a => Show (Maybe a)+instance Show a => Show (Product a)+instance Show (Ptr a)+instance Integral a => Show (Ratio a)+instance Show a => Show (Sum a)+instance Show a => Show [a]+instance (Ix a, Show a, Show b) => Show (Array a b)+instance (Show a, Show b) => Show (Either a b)+instance Show (ST s a)+shows :: Show a => a -> ShowS+showChar :: Char -> ShowS+showString :: String -> ShowS+showParen :: Bool -> ShowS -> ShowS+type ReadS a = String -> [(a, String)]+class Read a+readsPrec :: Read a => Int -> ReadS a+readList :: Read a => ReadS [a]+instance Read All+instance Read Any+instance Read Bool+instance Read BufferMode+instance Read CChar+instance Read CClock+instance Read CDouble+instance Read CFloat+instance Read CInt+instance Read CIntMax+instance Read CIntPtr+instance Read CLDouble+instance Read CLLong+instance Read CLong+instance Read CPtrdiff+instance Read CSChar+instance Read CShort+instance Read CSigAtomic+instance Read CSize+instance Read CTime+instance Read CUChar+instance Read CUInt+instance Read CUIntMax+instance Read CUIntPtr+instance Read CULLong+instance Read CULong+instance Read CUShort+instance Read CWchar+instance Read Char+instance Read ConsoleEvent+instance Read Double+instance Read ExitCode+instance Read Fd+instance Read Float+instance Read GeneralCategory+instance Read IOMode+instance Read Int+instance Read Int16+instance Read Int32+instance Read Int64+instance Read Int8+instance Read IntPtr+instance Read Integer+instance Read Lexeme+instance Read Ordering+instance Read SeekMode+instance Read Version+instance Read Word+instance Read Word16+instance Read Word32+instance Read Word64+instance Read Word8+instance Read WordPtr+instance Read ()+instance (Read a, Read b) => Read (a, b)+instance (Read a, Read b, Read c) => Read (a, b, c)+instance (Read a, Read b, Read c, Read d) => Read (a, b, c, d)+instance (Read a, Read b, Read c, Read d, Read e) => Read (a, b, c, d, e)+instance (Read a, Read b, Read c, Read d, Read e, Read f) => Read (a, b, c, d, e, f)+instance (Read a, Read b, Read c, Read d, Read e, Read f, Read g) => Read (a, b, c, d, e, f, g)+instance (Read a, Read b, Read c, Read d, Read e, Read f, Read g, Read h) => Read (a, b, c, d, e, f, g, h)+instance (Read a, Read b, Read c, Read d, Read e, Read f, Read g, Read h, Read i) => Read (a, b, c, d, e, f, g, h, i)+instance (Read a, Read b, Read c, Read d, Read e, Read f, Read g, Read h, Read i, Read j) => Read (a, b, c, d, e, f, g, h, i, j)+instance (Read a, Read b, Read c, Read d, Read e, Read f, Read g, Read h, Read i, Read j, Read k) => Read (a, b, c, d, e, f, g, h, i, j, k)+instance (Read a, Read b, Read c, Read d, Read e, Read f, Read g, Read h, Read i, Read j, Read k, Read l) => Read (a, b, c, d, e, f, g, h, i, j, k, l)+instance (Read a, Read b, Read c, Read d, Read e, Read f, Read g, Read h, Read i, Read j, Read k, Read l, Read m) => Read (a, b, c, d, e, f, g, h, i, j, k, l, m)+instance (Read a, Read b, Read c, Read d, Read e, Read f, Read g, Read h, Read i, Read j, Read k, Read l, Read m, Read n) => Read (a, b, c, d, e, f, g, h, i, j, k, l, m, n)+instance (Read a, Read b, Read c, Read d, Read e, Read f, Read g, Read h, Read i, Read j, Read k, Read l, Read m, Read n, Read o) => Read (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)+instance (RealFloat a, Read a) => Read (Complex a)+instance Read a => Read (Dual a)+instance Read a => Read (First a)+instance Read a => Read (Last a)+instance Read a => Read (Maybe a)+instance Read a => Read (Product a)+instance (Integral a, Read a) => Read (Ratio a)+instance Read a => Read (Sum a)+instance Read a => Read [a]+instance (Ix a, Read a, Read b) => Read (Array a b)+instance (Read a, Read b) => Read (Either a b)+reads :: Read a => ReadS a+readParen :: Bool -> ReadS a -> ReadS a+read :: Read a => String -> a+lex :: ReadS String+data IO a+instance Applicative IO+instance Functor IO+instance Monad IO+instance MonadFix IO+instance Typeable1 IO+instance Typeable a => Data (IO a)+instance HPrintfType (IO a)+instance PrintfType (IO a)+putChar :: Char -> IO ()+putStr :: String -> IO ()+putStrLn :: String -> IO ()+print :: Show a => a -> IO ()+getChar :: IO Char+getLine :: IO String+getContents :: IO String+interact :: (String -> String) -> IO ()+type FilePath = String+readFile :: FilePath -> IO String+writeFile :: FilePath -> String -> IO ()+appendFile :: FilePath -> String -> IO ()+readIO :: Read a => String -> IO a+readLn :: Read a => IO a+type IOError = IOException+ioError :: IOError -> IO a+userError :: String -> IOError+catch :: IO a -> (IOError -> IO a) -> IO a++module Control.Monad.Instances+class Functor f+fmap :: Functor f => (a -> b) -> f a -> f b+instance Functor IO+instance Functor Id+instance Functor Maybe+instance Functor ReadP+instance Functor ReadPrec+instance Functor STM+instance Functor ZipList+instance Functor []+instance Ix i => Functor (Array i)+instance Functor (Const m)+instance Functor (Either a)+instance Functor (ST s)+instance Functor (ST s)+instance Monad m => Functor (WrappedMonad m)+instance Functor ((,) a)+instance Functor ((->) r)+instance Arrow a => Functor (WrappedArrow a b)+class Monad m+(>>=) :: Monad m => m a -> (a -> m b) -> m b+(>>) :: Monad m => m a -> m b -> m b+return :: Monad m => a -> m a+fail :: Monad m => String -> m a+instance Monad IO+instance Monad Maybe+instance Monad P+instance Monad ReadP+instance Monad ReadPrec+instance Monad STM+instance Monad []+instance ArrowApply a => Monad (ArrowMonad a)+instance Monad (ST s)+instance Monad (ST s)+instance Monad ((->) r)++module Data.Fixed+div' :: (Real a, Integral b) => a -> a -> b+mod' :: Real a => a -> a -> a+divMod' :: (Real a, Integral b) => a -> a -> (b, a)+data Fixed a+instance Enum (Fixed a)+instance Eq (Fixed a)+instance HasResolution a => Fractional (Fixed a)+instance HasResolution a => Num (Fixed a)+instance Ord (Fixed a)+instance HasResolution a => Real (Fixed a)+instance HasResolution a => RealFrac (Fixed a)+instance HasResolution a => Show (Fixed a)+class HasResolution a+resolution :: HasResolution a => a -> Integer+instance HasResolution E12+instance HasResolution E6+showFixed :: HasResolution a => Bool -> Fixed a -> String+data E6+instance HasResolution E6+type Micro = Fixed E6+data E12+instance HasResolution E12+type Pico = Fixed E12++module Data.Function+id :: a -> a+const :: a -> b -> a+(.) :: (b -> c) -> (a -> b) -> a -> c+flip :: (a -> b -> c) -> b -> a -> c+($) :: (a -> b) -> a -> b+fix :: (a -> a) -> a+on :: (b -> b -> c) -> (a -> b) -> a -> a -> c++module Control.Monad.Fix+class Monad m => MonadFix m+mfix :: MonadFix m => (a -> m a) -> m a+instance MonadFix IO+instance MonadFix Maybe+instance MonadFix []+instance MonadFix (ST s)+instance MonadFix (ST s)+instance MonadFix ((->) r)+fix :: (a -> a) -> a++module Control.Monad.ST+data ST s a+instance Typeable2 ST+instance Functor (ST s)+instance Monad (ST s)+instance MonadFix (ST s)+instance (Typeable s, Typeable a) => Data (ST s a)+instance Show (ST s a)+runST :: ST s a -> a+fixST :: (a -> ST s a) -> ST s a+data RealWorld+instance Typeable RealWorld+stToIO :: ST RealWorld a -> IO a+unsafeInterleaveST :: ST s a -> ST s a+unsafeIOToST :: IO a -> ST s a+unsafeSTToIO :: ST s a -> IO a++module Control.Monad.ST.Strict++module Control.Monad.ST.Lazy+data ST s a+instance Functor (ST s)+instance Monad (ST s)+instance MonadFix (ST s)+runST :: ST s a -> a+fixST :: (a -> ST s a) -> ST s a+strictToLazyST :: ST s a -> ST s a+lazyToStrictST :: ST s a -> ST s a+data RealWorld+instance Typeable RealWorld+stToIO :: ST RealWorld a -> IO a+unsafeInterleaveST :: ST s a -> ST s a+unsafeIOToST :: IO a -> ST s a++module Data.Generics.Basics+class Typeable a => Data a+gfoldl :: Data a => (c (a -> b) -> a -> c b) -> (g -> c g) -> a -> c a+gunfold :: Data a => (c (b -> r) -> c r) -> (r -> c r) -> Constr -> c a+toConstr :: Data a => a -> Constr+dataTypeOf :: Data a => a -> DataType+dataCast1 :: (Data a, Typeable1 t) => c (t a) -> Maybe (c a)+dataCast2 :: (Data a, Typeable2 t) => c (t a b) -> Maybe (c a)+gmapT :: Data a => (b -> b) -> a -> a+gmapQl :: Data a => (r -> r' -> r) -> r -> (a -> r') -> a -> r+gmapQr :: Data a => (r' -> r -> r) -> r -> (a -> r') -> a -> r+gmapQ :: Data a => (a -> u) -> a -> [u]+gmapQi :: Data a => Int -> (a -> u) -> a -> u+gmapM :: (Data a, Monad m) => (a -> m a) -> a -> m a+gmapMp :: (Data a, MonadPlus m) => (a -> m a) -> a -> m a+gmapMo :: (Data a, MonadPlus m) => (a -> m a) -> a -> m a+instance Data Bool+instance Data Char+instance Data DataType+instance Data Double+instance Data Float+instance Data Handle+instance Data Int+instance Data Int16+instance Data Int32+instance Data Int64+instance Data Int8+instance Data Integer+instance Data Ordering+instance Data ThreadId+instance Data TyCon+instance Data TypeRep+instance Data Word+instance Data Word16+instance Data Word32+instance Data Word64+instance Data Word8+instance Data ()+instance (Data a, Data b) => Data (a, b)+instance (Data a, Data b, Data c) => Data (a, b, c)+instance (Data a, Data b, Data c, Data d) => Data (a, b, c, d)+instance (Data a, Data b, Data c, Data d, Data e) => Data (a, b, c, d, e)+instance (Data a, Data b, Data c, Data d, Data e, Data f) => Data (a, b, c, d, e, f)+instance (Data a, Data b, Data c, Data d, Data e, Data f, Data g) => Data (a, b, c, d, e, f, g)+instance (Data a, Data b) => Data (a -> b)+instance (RealFloat a, Data a) => Data (Complex a)+instance Typeable a => Data (ForeignPtr a)+instance Typeable a => Data (IO a)+instance Typeable a => Data (IORef a)+instance Typeable a => Data (MVar a)+instance Data a => Data (Maybe a)+instance Typeable a => Data (Ptr a)+instance (Data a, Integral a) => Data (Ratio a)+instance Typeable a => Data (STM a)+instance Typeable a => Data (StablePtr a)+instance Typeable a => Data (TVar a)+instance Data a => Data [a]+instance (Typeable a, Data b, Ix a) => Data (Array a b)+instance (Data a, Data b) => Data (Either a b)+instance (Typeable s, Typeable a) => Data (ST s a)+data DataType+instance Data DataType+instance Show DataType+instance Typeable DataType+mkDataType :: String -> [Constr] -> DataType+mkIntType :: String -> DataType+mkFloatType :: String -> DataType+mkStringType :: String -> DataType+mkNorepType :: String -> DataType+dataTypeName :: DataType -> String+data DataRep+AlgRep :: [Constr] -> DataRep+IntRep :: DataRep+FloatRep :: DataRep+StringRep :: DataRep+NoRep :: DataRep+instance Eq DataRep+instance Show DataRep+dataTypeRep :: DataType -> DataRep+repConstr :: DataType -> ConstrRep -> Constr+isAlgType :: DataType -> Bool+dataTypeConstrs :: DataType -> [Constr]+indexConstr :: DataType -> ConIndex -> Constr+maxConstrIndex :: DataType -> ConIndex+isNorepType :: DataType -> Bool+data Constr+instance Eq Constr+instance Show Constr+type ConIndex = Int+data Fixity+Prefix :: Fixity+Infix :: Fixity+instance Eq Fixity+instance Show Fixity+mkConstr :: DataType -> String -> [String] -> Fixity -> Constr+mkIntConstr :: DataType -> Integer -> Constr+mkFloatConstr :: DataType -> Double -> Constr+mkStringConstr :: DataType -> String -> Constr+constrType :: Constr -> DataType+data ConstrRep+AlgConstr :: ConIndex -> ConstrRep+IntConstr :: Integer -> ConstrRep+FloatConstr :: Double -> ConstrRep+StringConstr :: String -> ConstrRep+instance Eq ConstrRep+instance Show ConstrRep+constrRep :: Constr -> ConstrRep+constrFields :: Constr -> [String]+constrFixity :: Constr -> Fixity+constrIndex :: Constr -> ConIndex+showConstr :: Constr -> String+readConstr :: DataType -> String -> Maybe Constr+tyconUQname :: String -> String+tyconModule :: String -> String+fromConstr :: Data a => Constr -> a+fromConstrB :: Data a => a -> Constr -> a+fromConstrM :: (Monad m, Data a) => m a -> Constr -> m a++module Data.Complex+data Complex a+(:+) :: a -> a -> Complex a+instance Typeable1 Complex+instance (RealFloat a, Data a) => Data (Complex a)+instance (RealFloat a, Eq a) => Eq (Complex a)+instance RealFloat a => Floating (Complex a)+instance RealFloat a => Fractional (Complex a)+instance RealFloat a => Num (Complex a)+instance (RealFloat a, Read a) => Read (Complex a)+instance (RealFloat a, Show a) => Show (Complex a)+realPart :: RealFloat a => Complex a -> a+imagPart :: RealFloat a => Complex a -> a+mkPolar :: RealFloat a => a -> a -> Complex a+cis :: RealFloat a => a -> Complex a+polar :: RealFloat a => Complex a -> (a, a)+magnitude :: RealFloat a => Complex a -> a+phase :: RealFloat a => Complex a -> a+conjugate :: RealFloat a => Complex a -> Complex a++module Data.Generics.Aliases+mkT :: (Typeable a, Typeable b) => (b -> b) -> a -> a+mkQ :: (Typeable a, Typeable b) => r -> (b -> r) -> a -> r+mkM :: (Monad m, Typeable a, Typeable b) => (b -> m b) -> a -> m a+mkMp :: (MonadPlus m, Typeable a, Typeable b) => (b -> m b) -> a -> m a+mkR :: (MonadPlus m, Typeable a, Typeable b) => m b -> m a+ext0 :: (Typeable a, Typeable b) => c a -> c b -> c a+extT :: (Typeable a, Typeable b) => (a -> a) -> (b -> b) -> a -> a+extQ :: (Typeable a, Typeable b) => (a -> q) -> (b -> q) -> a -> q+extM :: (Monad m, Typeable a, Typeable b) => (a -> m a) -> (b -> m b) -> a -> m a+extMp :: (MonadPlus m, Typeable a, Typeable b) => (a -> m a) -> (b -> m b) -> a -> m a+extB :: (Typeable a, Typeable b) => a -> b -> a+extR :: (Monad m, Typeable a, Typeable b) => m a -> m b -> m a+type GenericT = a -> a+type GenericQ r = a -> r+type GenericM m = a -> m a+type GenericB = a+type GenericR m = m a+type Generic c = a -> c a+data Generic' c+Generic' :: Generic c -> Generic' c+unGeneric' :: Generic' c -> Generic c+newtype GenericT'+unGT :: GenericT' -> (Data a => a -> a)+newtype GenericQ' r+GQ :: GenericQ r -> GenericQ' r+unGQ :: GenericQ' r -> GenericQ r+newtype GenericM' m+unGM :: GenericM' m -> (Data a => a -> m a)+orElse :: Maybe a -> Maybe a -> Maybe a+recoverMp :: MonadPlus m => GenericM m -> GenericM m+recoverQ :: MonadPlus m => r -> GenericQ (m r) -> GenericQ (m r)+choiceMp :: MonadPlus m => GenericM m -> GenericM m -> GenericM m+choiceQ :: MonadPlus m => GenericQ (m r) -> GenericQ (m r) -> GenericQ (m r)+ext1T :: (Data d, Typeable1 t) => (d -> d) -> (t d -> t d) -> d -> d+ext1M :: (Monad m, Data d, Typeable1 t) => (d -> m d) -> (t d -> m (t d)) -> d -> m d+ext1Q :: (Data d, Typeable1 t) => (d -> q) -> (t d -> q) -> d -> q+ext1R :: (Monad m, Data d, Typeable1 t) => m d -> m (t d) -> m d++module Data.Generics.Instances++module Data.Generics.Schemes+everywhere :: (a -> a) -> a -> a+everywhere' :: (a -> a) -> a -> a+everywhereBut :: GenericQ Bool -> GenericT -> GenericT+everywhereM :: Monad m => GenericM m -> GenericM m+somewhere :: MonadPlus m => GenericM m -> GenericM m+everything :: (r -> r -> r) -> GenericQ r -> GenericQ r+listify :: Typeable r => (r -> Bool) -> GenericQ [r]+something :: GenericQ (Maybe u) -> GenericQ (Maybe u)+synthesize :: s -> (t -> s -> s) -> GenericQ (s -> t) -> GenericQ t+gsize :: Data a => a -> Int+glength :: GenericQ Int+gdepth :: GenericQ Int+gcount :: GenericQ Bool -> GenericQ Int+gnodecount :: GenericQ Int+gtypecount :: Typeable a => a -> GenericQ Int+gfindtype :: (Data x, Typeable y) => x -> Maybe y++module Data.Generics.Text+gshow :: Data a => a -> String+gread :: Data a => ReadS a++module Data.Generics.Twins+gfoldlAccum :: Data d => (a -> c (d -> r) -> d -> (a, c r)) -> (a -> g -> (a, c g)) -> a -> d -> (a, c d)+gmapAccumT :: Data d => (a -> d -> (a, d)) -> a -> d -> (a, d)+gmapAccumM :: (Data d, Monad m) => (a -> d -> (a, m d)) -> a -> d -> (a, m d)+gmapAccumQl :: Data d => (r -> r' -> r) -> r -> (a -> d -> (a, r')) -> a -> d -> (a, r)+gmapAccumQr :: Data d => (r' -> r -> r) -> r -> (a -> d -> (a, r')) -> a -> d -> (a, r)+gmapAccumQ :: Data d => (a -> d -> (a, q)) -> a -> d -> (a, [q])+gzipWithT :: GenericQ GenericT -> GenericQ GenericT+gzipWithM :: Monad m => GenericQ (GenericM m) -> GenericQ (GenericM m)+gzipWithQ :: GenericQ (GenericQ r) -> GenericQ (GenericQ [r])+geq :: Data a => a -> a -> Bool+gzip :: GenericQ (GenericM Maybe) -> GenericQ (GenericM Maybe)++module Data.Generics++module Data.IORef+data IORef a+instance Typeable1 IORef+instance Typeable a => Data (IORef a)+instance Eq (IORef a)+newIORef :: a -> IO (IORef a)+readIORef :: IORef a -> IO a+writeIORef :: IORef a -> a -> IO ()+modifyIORef :: IORef a -> (a -> a) -> IO ()+atomicModifyIORef :: IORef a -> (a -> (a, b)) -> IO b+mkWeakIORef :: IORef a -> IO () -> IO (Weak (IORef a))++module Data.Ix+class Ord a => Ix a+range :: Ix a => (a, a) -> [a]+index :: Ix a => (a, a) -> a -> Int+inRange :: Ix a => (a, a) -> a -> Bool+rangeSize :: Ix a => (a, a) -> Int+instance Ix Bool+instance Ix Char+instance Ix GeneralCategory+instance Ix IOMode+instance Ix Int+instance Ix Int16+instance Ix Int32+instance Ix Int64+instance Ix Int8+instance Ix Integer+instance Ix Ordering+instance Ix SeekMode+instance Ix Word+instance Ix Word16+instance Ix Word32+instance Ix Word64+instance Ix Word8+instance Ix ()+instance (Ix a, Ix b) => Ix (a, b)+instance (Ix a1, Ix a2, Ix a3) => Ix (a1, a2, a3)+instance (Ix a1, Ix a2, Ix a3, Ix a4) => Ix (a1, a2, a3, a4)+instance (Ix a1, Ix a2, Ix a3, Ix a4, Ix a5) => Ix (a1, a2, a3, a4, a5)++module Data.Monoid+class Monoid a+mempty :: Monoid a => a+mappend :: Monoid a => a -> a -> a+mconcat :: Monoid a => [a] -> a+instance Monoid All+instance Monoid Any+instance Monoid Ordering+instance Monoid ()+instance (Monoid a, Monoid b) => Monoid (a, b)+instance (Monoid a, Monoid b, Monoid c) => Monoid (a, b, c)+instance (Monoid a, Monoid b, Monoid c, Monoid d) => Monoid (a, b, c, d)+instance (Monoid a, Monoid b, Monoid c, Monoid d, Monoid e) => Monoid (a, b, c, d, e)+instance Monoid b => Monoid (a -> b)+instance Monoid a => Monoid (Dual a)+instance Monoid (Endo a)+instance Monoid (First a)+instance Monoid (Last a)+instance Monoid a => Monoid (Maybe a)+instance Num a => Monoid (Product a)+instance Num a => Monoid (Sum a)+instance Monoid [a]+newtype Dual a+Dual :: a -> Dual a+getDual :: Dual a -> a+instance Bounded a => Bounded (Dual a)+instance Eq a => Eq (Dual a)+instance Monoid a => Monoid (Dual a)+instance Ord a => Ord (Dual a)+instance Read a => Read (Dual a)+instance Show a => Show (Dual a)+newtype Endo a+Endo :: (a -> a) -> Endo a+appEndo :: Endo a -> a -> a+instance Monoid (Endo a)+newtype All+All :: Bool -> All+getAll :: All -> Bool+instance Bounded All+instance Eq All+instance Monoid All+instance Ord All+instance Read All+instance Show All+newtype Any+Any :: Bool -> Any+getAny :: Any -> Bool+instance Bounded Any+instance Eq Any+instance Monoid Any+instance Ord Any+instance Read Any+instance Show Any+newtype Sum a+Sum :: a -> Sum a+getSum :: Sum a -> a+instance Bounded a => Bounded (Sum a)+instance Eq a => Eq (Sum a)+instance Num a => Monoid (Sum a)+instance Ord a => Ord (Sum a)+instance Read a => Read (Sum a)+instance Show a => Show (Sum a)+newtype Product a+Product :: a -> Product a+getProduct :: Product a -> a+instance Bounded a => Bounded (Product a)+instance Eq a => Eq (Product a)+instance Num a => Monoid (Product a)+instance Ord a => Ord (Product a)+instance Read a => Read (Product a)+instance Show a => Show (Product a)+newtype First a+First :: Maybe a -> First a+getFirst :: First a -> Maybe a+instance Eq a => Eq (First a)+instance Monoid (First a)+instance Ord a => Ord (First a)+instance Read a => Read (First a)+instance Show a => Show (First a)+newtype Last a+Last :: Maybe a -> Last a+getLast :: Last a -> Maybe a+instance Eq a => Eq (Last a)+instance Monoid (Last a)+instance Ord a => Ord (Last a)+instance Read a => Read (Last a)+instance Show a => Show (Last a)++module Data.Ratio+data Ratio a+instance Typeable1 Ratio+instance (Data a, Integral a) => Data (Ratio a)+instance Integral a => Enum (Ratio a)+instance (Integral a, Eq a) => Eq (Ratio a)+instance Integral a => Fractional (Ratio a)+instance Integral a => Num (Ratio a)+instance Integral a => Ord (Ratio a)+instance (Integral a, Read a) => Read (Ratio a)+instance Integral a => Real (Ratio a)+instance Integral a => RealFrac (Ratio a)+instance Integral a => Show (Ratio a)+type Rational = Ratio Integer+(%) :: Integral a => a -> a -> Ratio a+numerator :: Integral a => Ratio a -> a+denominator :: Integral a => Ratio a -> a+approxRational :: RealFrac a => a -> a -> Rational++module Data.STRef+data STRef s a+instance Typeable2 STRef+instance Eq (STRef s a)+newSTRef :: a -> ST s (STRef s a)+readSTRef :: STRef s a -> ST s a+writeSTRef :: STRef s a -> a -> ST s ()+modifySTRef :: STRef s a -> (a -> a) -> ST s ()++module Data.STRef.Lazy+data STRef s a+instance Typeable2 STRef+instance Eq (STRef s a)+newSTRef :: a -> ST s (STRef s a)+readSTRef :: STRef s a -> ST s a+writeSTRef :: STRef s a -> a -> ST s ()+modifySTRef :: STRef s a -> (a -> a) -> ST s ()++module Data.STRef.Strict++module Data.Version+data Version+Version :: [Int] -> [String] -> Version+versionBranch :: Version -> [Int]+versionTags :: Version -> [String]+instance Eq Version+instance Ord Version+instance Read Version+instance Show Version+instance Typeable Version+showVersion :: Version -> String+parseVersion :: ReadP Version++module Debug.Trace+putTraceMsg :: String -> IO ()+trace :: String -> a -> a+traceShow :: Show a => a -> b -> b++module GHC.Environment+getFullArgs :: IO [String]++module GHC.Exts+data Int+I# :: Int# -> Int+instance Bits Int+instance Bounded Int+instance Data Int+instance Enum Int+instance Eq Int+instance Integral Int+instance Ix Int+instance Num Int+instance Ord Int+instance PrintfArg Int+instance Read Int+instance Real Int+instance Show Int+instance Storable Int+instance Typeable Int+data Word+W# :: Word# -> Word+instance Bits Word+instance Bounded Word+instance Data Word+instance Enum Word+instance Eq Word+instance Integral Word+instance Ix Word+instance Num Word+instance Ord Word+instance PrintfArg Word+instance Read Word+instance Real Word+instance Show Word+instance Storable Word+instance Typeable Word+data Float+F# :: Float# -> Float+instance Data Float+instance Enum Float+instance Eq Float+instance Floating Float+instance Fractional Float+instance Num Float+instance Ord Float+instance PrintfArg Float+instance Read Float+instance Real Float+instance RealFloat Float+instance RealFrac Float+instance Show Float+instance Storable Float+instance Typeable Float+data Double+D# :: Double# -> Double+instance Data Double+instance Enum Double+instance Eq Double+instance Floating Double+instance Fractional Double+instance Num Double+instance Ord Double+instance PrintfArg Double+instance Read Double+instance Real Double+instance RealFloat Double+instance RealFrac Double+instance Show Double+instance Storable Double+instance Typeable Double+data Integer+S# :: Int# -> Integer+J# :: Int# -> ByteArray# -> Integer+instance Bits Integer+instance Data Integer+instance Enum Integer+instance Eq Integer+instance Integral Integer+instance Ix Integer+instance Num Integer+instance Ord Integer+instance PrintfArg Integer+instance Read Integer+instance Real Integer+instance Show Integer+instance Typeable Integer+data Char+C# :: Char# -> Char+instance Bounded Char+instance Data Char+instance Enum Char+instance Eq Char+instance IsChar Char+instance Ix Char+instance Ord Char+instance PrintfArg Char+instance Read Char+instance Show Char+instance Storable Char+instance Typeable Char+instance IsString [Char]+data Ptr a+Ptr :: Addr# -> Ptr a+instance Typeable1 Ptr+instance Typeable a => Data (Ptr a)+instance Eq (Ptr a)+instance Ord (Ptr a)+instance Show (Ptr a)+instance Storable (Ptr a)+data FunPtr a+FunPtr :: Addr# -> FunPtr a+instance Typeable1 FunPtr+instance Eq (FunPtr a)+instance Ord (FunPtr a)+instance Show (FunPtr a)+instance Storable (FunPtr a)+shiftL# :: Word# -> Int# -> Word#+shiftRL# :: Word# -> Int# -> Word#+iShiftL# :: Int# -> Int# -> Int#+iShiftRA# :: Int# -> Int# -> Int#+iShiftRL# :: Int# -> Int# -> Int#+uncheckedShiftL64# :: Word64# -> Int# -> Word64#+uncheckedShiftRL64# :: Word64# -> Int# -> Word64#+uncheckedIShiftL64# :: Int64# -> Int# -> Int64#+uncheckedIShiftRA64# :: Int64# -> Int# -> Int64#+build :: (a -> b -> b -> b -> b) -> [a]+augment :: (a -> b -> b -> b -> b) -> [a] -> [a]+class IsString a+fromString :: IsString a => String -> a+instance IsString [Char]+breakpoint :: a -> a+breakpointCond :: Bool -> a -> a+lazy :: a -> a+inline :: a -> a++module System.CPUTime+getCPUTime :: IO Integer+cpuTimePrecision :: Integer++module System.Console.GetOpt+getOpt :: ArgOrder a -> [OptDescr a] -> [String] -> ([a], [String], [String])+getOpt' :: ArgOrder a -> [OptDescr a] -> [String] -> ([a], [String], [String], [String])+usageInfo :: String -> [OptDescr a] -> String+data ArgOrder a+RequireOrder :: ArgOrder a+Permute :: ArgOrder a+ReturnInOrder :: (String -> a) -> ArgOrder a+data OptDescr a+Option :: [Char] -> [String] -> ArgDescr a -> String -> OptDescr a+data ArgDescr a+NoArg :: a -> ArgDescr a+ReqArg :: (String -> a) -> String -> ArgDescr a+OptArg :: (Maybe String -> a) -> String -> ArgDescr a++module System.Exit+data ExitCode+ExitSuccess :: ExitCode+ExitFailure :: Int -> ExitCode+instance Eq ExitCode+instance Ord ExitCode+instance Read ExitCode+instance Show ExitCode+exitWith :: ExitCode -> IO a+exitFailure :: IO a++module System.Info+os :: String+arch :: String+compilerName :: String+compilerVersion :: Version++module System.Mem+performGC :: IO ()++module System.Mem.StableName+data StableName a+instance Typeable1 StableName+instance Eq (StableName a)+makeStableName :: a -> IO (StableName a)+hashStableName :: StableName a -> Int++module System.Mem.Weak+data Weak v+instance Typeable1 Weak+mkWeak :: k -> v -> Maybe (IO ()) -> IO (Weak v)+deRefWeak :: Weak v -> IO (Maybe v)+finalize :: Weak v -> IO ()+mkWeakPtr :: k -> Maybe (IO ()) -> IO (Weak k)+addFinalizer :: key -> IO () -> IO ()+mkWeakPair :: k -> v -> Maybe (IO ()) -> IO (Weak (k, v))++module Text.Printf+printf :: PrintfType r => String -> r+hPrintf :: HPrintfType r => Handle -> String -> r+class PrintfType t+instance (PrintfArg a, PrintfType r) => PrintfType (a -> r)+instance PrintfType (IO a)+instance IsChar c => PrintfType [c]+class HPrintfType t+instance (PrintfArg a, HPrintfType r) => HPrintfType (a -> r)+instance HPrintfType (IO a)+class PrintfArg a+instance PrintfArg Char+instance PrintfArg Double+instance PrintfArg Float+instance PrintfArg Int+instance PrintfArg Int16+instance PrintfArg Int32+instance PrintfArg Int64+instance PrintfArg Int8+instance PrintfArg Integer+instance PrintfArg Word+instance PrintfArg Word16+instance PrintfArg Word32+instance PrintfArg Word64+instance PrintfArg Word8+instance IsChar c => PrintfArg [c]+class IsChar c+instance IsChar Char++module Text.Show.Functions++module Control.Exception+data Exception+ArithException :: ArithException -> Exception+ArrayException :: ArrayException -> Exception+AssertionFailed :: String -> Exception+AsyncException :: AsyncException -> Exception+BlockedOnDeadMVar :: Exception+BlockedIndefinitely :: Exception+NestedAtomically :: Exception+Deadlock :: Exception+DynException :: Dynamic -> Exception+ErrorCall :: String -> Exception+ExitException :: ExitCode -> Exception+IOException :: IOException -> Exception+NoMethodError :: String -> Exception+NonTermination :: Exception+PatternMatchFail :: String -> Exception+RecConError :: String -> Exception+RecSelError :: String -> Exception+RecUpdError :: String -> Exception+instance Eq Exception+instance Show Exception+instance Typeable Exception+data IOException+instance Eq IOException+instance Show IOException+instance Typeable IOException+data ArithException+Overflow :: ArithException+Underflow :: ArithException+LossOfPrecision :: ArithException+DivideByZero :: ArithException+Denormal :: ArithException+instance Eq ArithException+instance Ord ArithException+instance Show ArithException+instance Typeable ArithException+data ArrayException+IndexOutOfBounds :: String -> ArrayException+UndefinedElement :: String -> ArrayException+instance Eq ArrayException+instance Ord ArrayException+instance Show ArrayException+instance Typeable ArrayException+data AsyncException+StackOverflow :: AsyncException+HeapOverflow :: AsyncException+ThreadKilled :: AsyncException+instance Eq AsyncException+instance Ord AsyncException+instance Show AsyncException+instance Typeable AsyncException+throwIO :: Exception -> IO a+throw :: Exception -> a+ioError :: IOError -> IO a+throwTo :: ThreadId -> Exception -> IO ()+catch :: IO a -> (Exception -> IO a) -> IO a+catchJust :: (Exception -> Maybe b) -> IO a -> (b -> IO a) -> IO a+handle :: (Exception -> IO a) -> IO a -> IO a+handleJust :: (Exception -> Maybe b) -> (b -> IO a) -> IO a -> IO a+try :: IO a -> IO (Either Exception a)+tryJust :: (Exception -> Maybe b) -> IO a -> IO (Either b a)+evaluate :: a -> IO a+mapException :: (Exception -> Exception) -> a -> a+ioErrors :: Exception -> Maybe IOError+arithExceptions :: Exception -> Maybe ArithException+errorCalls :: Exception -> Maybe String+dynExceptions :: Exception -> Maybe Dynamic+assertions :: Exception -> Maybe String+asyncExceptions :: Exception -> Maybe AsyncException+userErrors :: Exception -> Maybe String+throwDyn :: Typeable exception => exception -> b+throwDynTo :: Typeable exception => ThreadId -> exception -> IO ()+catchDyn :: Typeable exception => IO a -> (exception -> IO a) -> IO a+block :: IO a -> IO a+unblock :: IO a -> IO a+assert :: Bool -> a -> a+bracket :: IO a -> (a -> IO b) -> (a -> IO c) -> IO c+bracket_ :: IO a -> IO b -> IO c -> IO c+bracketOnError :: IO a -> (a -> IO b) -> (a -> IO c) -> IO c+finally :: IO a -> IO b -> IO a+setUncaughtExceptionHandler :: (Exception -> IO ()) -> IO ()+getUncaughtExceptionHandler :: IO (Exception -> IO ())++module System.Environment+getArgs :: IO [String]+getProgName :: IO String+getEnv :: String -> IO String+withArgs :: [String] -> IO a -> IO a+withProgName :: String -> IO a -> IO a+getEnvironment :: IO [(String, String)]++module Control.Concurrent.MVar+data MVar a+instance Typeable1 MVar+instance Typeable a => Data (MVar a)+instance Eq (MVar a)+newEmptyMVar :: IO (MVar a)+newMVar :: a -> IO (MVar a)+takeMVar :: MVar a -> IO a+putMVar :: MVar a -> a -> IO ()+readMVar :: MVar a -> IO a+swapMVar :: MVar a -> a -> IO a+tryTakeMVar :: MVar a -> IO (Maybe a)+tryPutMVar :: MVar a -> a -> IO Bool+isEmptyMVar :: MVar a -> IO Bool+withMVar :: MVar a -> (a -> IO b) -> IO b+modifyMVar_ :: MVar a -> (a -> IO a) -> IO ()+modifyMVar :: MVar a -> (a -> IO (a, b)) -> IO b+addMVarFinalizer :: MVar a -> IO () -> IO ()++module Control.Concurrent.QSem+data QSem+instance Typeable QSem+newQSem :: Int -> IO QSem+waitQSem :: QSem -> IO ()+signalQSem :: QSem -> IO ()++module Control.Concurrent.QSemN+data QSemN+instance Typeable QSemN+newQSemN :: Int -> IO QSemN+waitQSemN :: QSemN -> Int -> IO ()+signalQSemN :: QSemN -> Int -> IO ()++module Control.Concurrent.SampleVar+type SampleVar a = MVar (Int, MVar a)+newEmptySampleVar :: IO (SampleVar a)+newSampleVar :: a -> IO (SampleVar a)+emptySampleVar :: SampleVar a -> IO ()+readSampleVar :: SampleVar a -> IO a+writeSampleVar :: SampleVar a -> a -> IO ()+isEmptySampleVar :: SampleVar a -> IO Bool++module Data.Unique+data Unique+instance Eq Unique+instance Ord Unique+newUnique :: IO Unique+hashUnique :: Unique -> Int++module Control.Concurrent.Chan+data Chan a+instance Typeable1 Chan+newChan :: IO (Chan a)+writeChan :: Chan a -> a -> IO ()+readChan :: Chan a -> IO a+dupChan :: Chan a -> IO (Chan a)+unGetChan :: Chan a -> a -> IO ()+isEmptyChan :: Chan a -> IO Bool+getChanContents :: Chan a -> IO [a]+writeList2Chan :: Chan a -> [a] -> IO ()++module Control.Concurrent+data ThreadId+instance Data ThreadId+instance Eq ThreadId+instance Ord ThreadId+instance Show ThreadId+instance Typeable ThreadId+myThreadId :: IO ThreadId+forkIO :: IO () -> IO ThreadId+killThread :: ThreadId -> IO ()+throwTo :: ThreadId -> Exception -> IO ()+yield :: IO ()+threadDelay :: Int -> IO ()+threadWaitRead :: Fd -> IO ()+threadWaitWrite :: Fd -> IO ()+mergeIO :: [a] -> [a] -> IO [a]+nmergeIO :: [[a]] -> IO [a]+rtsSupportsBoundThreads :: Bool+forkOS :: IO () -> IO ThreadId+isCurrentThreadBound :: IO Bool+runInBoundThread :: IO a -> IO a+runInUnboundThread :: IO a -> IO a++module GHC.ConsoleHandler+data Handler+Default :: Handler+Ignore :: Handler+Catch :: (ConsoleEvent -> IO ()) -> Handler+installHandler :: Handler -> IO Handler+data ConsoleEvent+ControlC :: ConsoleEvent+Break :: ConsoleEvent+Close :: ConsoleEvent+Logoff :: ConsoleEvent+Shutdown :: ConsoleEvent+instance Enum ConsoleEvent+instance Eq ConsoleEvent+instance Ord ConsoleEvent+instance Read ConsoleEvent+instance Show ConsoleEvent+instance Typeable ConsoleEvent+flushConsole :: Handle -> IO ()++module System.Timeout+timeout :: Int -> IO a -> IO (Maybe a)++module Control.Category+class Category cat+id :: Category cat => cat a a+(.) :: Category cat => cat b c -> cat a b -> cat a c+instance Category (->)+instance Monad m => Category (Kleisli m)+(<<<) :: Category cat => cat b c -> cat a b -> cat a c+(>>>) :: Category cat => cat a b -> cat b c -> cat a c++module Control.Arrow+class Category a => Arrow a+arr :: Arrow a => (b -> c) -> a b c+pure :: Arrow a => (b -> c) -> a b c+first :: Arrow a => a b c -> a (b, d) (c, d)+second :: Arrow a => a b c -> a (d, b) (d, c)+(***) :: Arrow a => a b c -> a b' c' -> a (b, b') (c, c')+(&&&) :: Arrow a => a b c -> a b c' -> a b (c, c')+instance Arrow (->)+instance Monad m => Arrow (Kleisli m)+newtype Kleisli m a b+Kleisli :: (a -> m b) -> Kleisli m a b+runKleisli :: Kleisli m a b -> a -> m b+instance Monad m => Arrow (Kleisli m)+instance Monad m => ArrowApply (Kleisli m)+instance Monad m => ArrowChoice (Kleisli m)+instance MonadFix m => ArrowLoop (Kleisli m)+instance MonadPlus m => ArrowPlus (Kleisli m)+instance MonadPlus m => ArrowZero (Kleisli m)+instance Monad m => Category (Kleisli m)+returnA :: Arrow a => a b b+(^>>) :: Arrow a => (b -> c) -> a c d -> a b d+(>>^) :: Arrow a => a b c -> (c -> d) -> a b d+(<<^) :: Arrow a => a c d -> (b -> c) -> a b d+(^<<) :: Arrow a => (c -> d) -> a b c -> a b d+class Arrow a => ArrowZero a+zeroArrow :: ArrowZero a => a b c+instance MonadPlus m => ArrowZero (Kleisli m)+class ArrowZero a => ArrowPlus a+(<+>) :: ArrowPlus a => a b c -> a b c -> a b c+instance MonadPlus m => ArrowPlus (Kleisli m)+class Arrow a => ArrowChoice a+left :: ArrowChoice a => a b c -> a (Either b d) (Either c d)+right :: ArrowChoice a => a b c -> a (Either d b) (Either d c)+(+++) :: ArrowChoice a => a b c -> a b' c' -> a (Either b b') (Either c c')+(|||) :: ArrowChoice a => a b d -> a c d -> a (Either b c) d+instance ArrowChoice (->)+instance Monad m => ArrowChoice (Kleisli m)+class Arrow a => ArrowApply a+app :: ArrowApply a => a (a b c, b) c+instance ArrowApply (->)+instance Monad m => ArrowApply (Kleisli m)+newtype ArrowMonad a b+ArrowMonad :: a () b -> ArrowMonad a b+instance ArrowApply a => Monad (ArrowMonad a)+leftApp :: ArrowApply a => a b c -> a (Either b d) (Either c d)+class Arrow a => ArrowLoop a+loop :: ArrowLoop a => a (b, d) (c, d) -> a b c+instance ArrowLoop (->)+instance MonadFix m => ArrowLoop (Kleisli m)++module Control.Applicative+class Functor f => Applicative f+pure :: Applicative f => a -> f a+(<*>) :: Applicative f => f (a -> b) -> f a -> f b+instance Applicative IO+instance Applicative Id+instance Applicative Maybe+instance Applicative ZipList+instance Applicative []+instance Monoid m => Applicative (Const m)+instance Monad m => Applicative (WrappedMonad m)+instance Monoid a => Applicative ((,) a)+instance Applicative ((->) a)+instance Arrow a => Applicative (WrappedArrow a b)+class Applicative f => Alternative f+empty :: Alternative f => f a+(<|>) :: Alternative f => f a -> f a -> f a+instance Alternative Maybe+instance Alternative []+instance MonadPlus m => Alternative (WrappedMonad m)+instance (ArrowZero a, ArrowPlus a) => Alternative (WrappedArrow a b)+newtype Const a b+Const :: a -> Const a b+getConst :: Const a b -> a+instance Monoid m => Applicative (Const m)+instance Functor (Const m)+newtype WrappedMonad m a+WrapMonad :: m a -> WrappedMonad m a+unwrapMonad :: WrappedMonad m a -> m a+instance MonadPlus m => Alternative (WrappedMonad m)+instance Monad m => Applicative (WrappedMonad m)+instance Monad m => Functor (WrappedMonad m)+newtype WrappedArrow a b c+WrapArrow :: a b c -> WrappedArrow a b c+unwrapArrow :: WrappedArrow a b c -> a b c+instance (ArrowZero a, ArrowPlus a) => Alternative (WrappedArrow a b)+instance Arrow a => Applicative (WrappedArrow a b)+instance Arrow a => Functor (WrappedArrow a b)+newtype ZipList a+ZipList :: [a] -> ZipList a+getZipList :: ZipList a -> [a]+instance Applicative ZipList+instance Functor ZipList+(<$>) :: Functor f => (a -> b) -> f a -> f b+(<$) :: Functor f => a -> f b -> f a+(*>) :: Applicative f => f a -> f b -> f b+(<*) :: Applicative f => f a -> f b -> f a+(<**>) :: Applicative f => f a -> f (a -> b) -> f b+liftA :: Applicative f => (a -> b) -> f a -> f b+liftA2 :: Applicative f => (a -> b -> c) -> f a -> f b -> f c+liftA3 :: Applicative f => (a -> b -> c -> d) -> f a -> f b -> f c -> f d+optional :: Alternative f => f a -> f (Maybe a)+some :: Alternative f => f a -> f [a]+many :: Alternative f => f a -> f [a]++module Data.Foldable+class Foldable t+fold :: (Foldable t, Monoid m) => t m -> m+foldMap :: (Foldable t, Monoid m) => (a -> m) -> t a -> m+foldr :: Foldable t => (a -> b -> b) -> b -> t a -> b+foldl :: Foldable t => (a -> b -> a) -> a -> t b -> a+foldr1 :: Foldable t => (a -> a -> a) -> t a -> a+foldl1 :: Foldable t => (a -> a -> a) -> t a -> a+instance Foldable Maybe+instance Foldable []+foldr' :: Foldable t => (a -> b -> b) -> b -> t a -> b+foldl' :: Foldable t => (a -> b -> a) -> a -> t b -> a+foldrM :: (Foldable t, Monad m) => (a -> b -> m b) -> b -> t a -> m b+foldlM :: (Foldable t, Monad m) => (a -> b -> m a) -> a -> t b -> m a+traverse_ :: (Foldable t, Applicative f) => (a -> f b) -> t a -> f ()+for_ :: (Foldable t, Applicative f) => t a -> (a -> f b) -> f ()+sequenceA_ :: (Foldable t, Applicative f) => t (f a) -> f ()+asum :: (Foldable t, Alternative f) => t (f a) -> f a+mapM_ :: (Foldable t, Monad m) => (a -> m b) -> t a -> m ()+forM_ :: (Foldable t, Monad m) => t a -> (a -> m b) -> m ()+sequence_ :: (Foldable t, Monad m) => t (m a) -> m ()+msum :: (Foldable t, MonadPlus m) => t (m a) -> m a+toList :: Foldable t => t a -> [a]+concat :: Foldable t => t [a] -> [a]+concatMap :: Foldable t => (a -> [b]) -> t a -> [b]+and :: Foldable t => t Bool -> Bool+or :: Foldable t => t Bool -> Bool+any :: Foldable t => (a -> Bool) -> t a -> Bool+all :: Foldable t => (a -> Bool) -> t a -> Bool+sum :: (Foldable t, Num a) => t a -> a+product :: (Foldable t, Num a) => t a -> a+maximum :: (Foldable t, Ord a) => t a -> a+maximumBy :: Foldable t => (a -> a -> Ordering) -> t a -> a+minimum :: (Foldable t, Ord a) => t a -> a+minimumBy :: Foldable t => (a -> a -> Ordering) -> t a -> a+elem :: (Foldable t, Eq a) => a -> t a -> Bool+notElem :: (Foldable t, Eq a) => a -> t a -> Bool+find :: Foldable t => (a -> Bool) -> t a -> Maybe a++module Data.Traversable+class (Functor t, Foldable t) => Traversable t+traverse :: (Traversable t, Applicative f) => (a -> f b) -> t a -> f (t b)+sequenceA :: (Traversable t, Applicative f) => t (f a) -> f (t a)+mapM :: (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b)+sequence :: (Traversable t, Monad m) => t (m a) -> m (t a)+instance Traversable Maybe+instance Traversable []+for :: (Traversable t, Applicative f) => t a -> (a -> f b) -> f (t b)+forM :: (Traversable t, Monad m) => t a -> (a -> m b) -> m (t b)+fmapDefault :: Traversable t => (a -> b) -> t a -> t b+foldMapDefault :: (Traversable t, Monoid m) => (a -> m) -> t a -> m+-- Hoogle documentation, generated by Haddock+-- See Hoogle, http://www.haskell.org/hoogle/++module Data.Array++module Data.Array.IArray+class IArray a e+bounds :: (IArray a e, Ix i) => a i e -> (i, i)+instance IArray Array e+instance IArray UArray Bool+instance IArray UArray Char+instance IArray UArray Double+instance IArray UArray Float+instance IArray UArray Int+instance IArray UArray Int16+instance IArray UArray Int32+instance IArray UArray Int64+instance IArray UArray Int8+instance IArray UArray Word+instance IArray UArray Word16+instance IArray UArray Word32+instance IArray UArray Word64+instance IArray UArray Word8+instance IArray UArray (FunPtr a)+instance IArray UArray (Ptr a)+instance IArray UArray (StablePtr a)+instance IArray (IOToDiffArray IOArray) e+instance IArray (IOToDiffArray IOUArray) Char+instance IArray (IOToDiffArray IOUArray) Double+instance IArray (IOToDiffArray IOUArray) Float+instance IArray (IOToDiffArray IOUArray) Int+instance IArray (IOToDiffArray IOUArray) Int16+instance IArray (IOToDiffArray IOUArray) Int32+instance IArray (IOToDiffArray IOUArray) Int64+instance IArray (IOToDiffArray IOUArray) Int8+instance IArray (IOToDiffArray IOUArray) Word+instance IArray (IOToDiffArray IOUArray) Word16+instance IArray (IOToDiffArray IOUArray) Word32+instance IArray (IOToDiffArray IOUArray) Word64+instance IArray (IOToDiffArray IOUArray) Word8+instance IArray (IOToDiffArray IOUArray) (FunPtr a)+instance IArray (IOToDiffArray IOUArray) (Ptr a)+instance IArray (IOToDiffArray IOUArray) (StablePtr a)+array :: (IArray a e, Ix i) => (i, i) -> [(i, e)] -> a i e+listArray :: (IArray a e, Ix i) => (i, i) -> [e] -> a i e+accumArray :: (IArray a e, Ix i) => (e -> e' -> e) -> e -> (i, i) -> [(i, e')] -> a i e+(!) :: (IArray a e, Ix i) => a i e -> i -> e+bounds :: (IArray a e, Ix i) => a i e -> (i, i)+indices :: (IArray a e, Ix i) => a i e -> [i]+elems :: (IArray a e, Ix i) => a i e -> [e]+assocs :: (IArray a e, Ix i) => a i e -> [(i, e)]+(//) :: (IArray a e, Ix i) => a i e -> [(i, e)] -> a i e+accum :: (IArray a e, Ix i) => (e -> e' -> e) -> a i e -> [(i, e')] -> a i e+amap :: (IArray a e', IArray a e, Ix i) => (e' -> e) -> a i e' -> a i e+ixmap :: (IArray a e, Ix i, Ix j) => (i, i) -> (i -> j) -> a j e -> a i e++module Data.Array.MArray+class Monad m => MArray a e m+getBounds :: (MArray a e m, Ix i) => a i e -> m (i, i)+newArray :: (MArray a e m, Ix i) => (i, i) -> e -> m (a i e)+newArray_ :: (MArray a e m, Ix i) => (i, i) -> m (a i e)+instance MArray IOArray e IO+instance MArray IOUArray Bool IO+instance MArray IOUArray Char IO+instance MArray IOUArray Double IO+instance MArray IOUArray Float IO+instance MArray IOUArray Int IO+instance MArray IOUArray Int16 IO+instance MArray IOUArray Int32 IO+instance MArray IOUArray Int64 IO+instance MArray IOUArray Int8 IO+instance MArray IOUArray Word IO+instance MArray IOUArray Word16 IO+instance MArray IOUArray Word32 IO+instance MArray IOUArray Word64 IO+instance MArray IOUArray Word8 IO+instance Storable e => MArray StorableArray e IO+instance MArray IOUArray (FunPtr a) IO+instance MArray IOUArray (Ptr a) IO+instance MArray IOUArray (StablePtr a) IO+instance MArray (STArray s) e (ST s)+instance MArray (STArray s) e (ST s)+instance MArray (STUArray s) Bool (ST s)+instance MArray (STUArray s) Char (ST s)+instance MArray (STUArray s) Double (ST s)+instance MArray (STUArray s) Float (ST s)+instance MArray (STUArray s) Int (ST s)+instance MArray (STUArray s) Int16 (ST s)+instance MArray (STUArray s) Int32 (ST s)+instance MArray (STUArray s) Int64 (ST s)+instance MArray (STUArray s) Int8 (ST s)+instance MArray (STUArray s) Word (ST s)+instance MArray (STUArray s) Word16 (ST s)+instance MArray (STUArray s) Word32 (ST s)+instance MArray (STUArray s) Word64 (ST s)+instance MArray (STUArray s) Word8 (ST s)+instance MArray (STUArray s) (FunPtr a) (ST s)+instance MArray (STUArray s) (Ptr a) (ST s)+instance MArray (STUArray s) (StablePtr a) (ST s)+newArray :: (MArray a e m, Ix i) => (i, i) -> e -> m (a i e)+newArray_ :: (MArray a e m, Ix i) => (i, i) -> m (a i e)+newListArray :: (MArray a e m, Ix i) => (i, i) -> [e] -> m (a i e)+readArray :: (MArray a e m, Ix i) => a i e -> i -> m e+writeArray :: (MArray a e m, Ix i) => a i e -> i -> e -> m ()+mapArray :: (MArray a e' m, MArray a e m, Ix i) => (e' -> e) -> a i e' -> m (a i e)+mapIndices :: (MArray a e m, Ix i, Ix j) => (i, i) -> (i -> j) -> a j e -> m (a i e)+getBounds :: (MArray a e m, Ix i) => a i e -> m (i, i)+getElems :: (MArray a e m, Ix i) => a i e -> m [e]+getAssocs :: (MArray a e m, Ix i) => a i e -> m [(i, e)]+freeze :: (Ix i, MArray a e m, IArray b e) => a i e -> m (b i e)+unsafeFreeze :: (Ix i, MArray a e m, IArray b e) => a i e -> m (b i e)+thaw :: (Ix i, IArray a e, MArray b e m) => a i e -> m (b i e)+unsafeThaw :: (Ix i, IArray a e, MArray b e m) => a i e -> m (b i e)++module Data.Array.ST+runSTArray :: Ix i => ST s (STArray s i e) -> Array i e+data STUArray s i a+instance Typeable3 STUArray+instance MArray (STUArray s) Bool (ST s)+instance MArray (STUArray s) Char (ST s)+instance MArray (STUArray s) Double (ST s)+instance MArray (STUArray s) Float (ST s)+instance MArray (STUArray s) Int (ST s)+instance MArray (STUArray s) Int16 (ST s)+instance MArray (STUArray s) Int32 (ST s)+instance MArray (STUArray s) Int64 (ST s)+instance MArray (STUArray s) Int8 (ST s)+instance MArray (STUArray s) Word (ST s)+instance MArray (STUArray s) Word16 (ST s)+instance MArray (STUArray s) Word32 (ST s)+instance MArray (STUArray s) Word64 (ST s)+instance MArray (STUArray s) Word8 (ST s)+instance MArray (STUArray s) (FunPtr a) (ST s)+instance MArray (STUArray s) (Ptr a) (ST s)+instance MArray (STUArray s) (StablePtr a) (ST s)+instance Eq (STUArray s i e)+runSTUArray :: Ix i => ST s (STUArray s i e) -> UArray i e+castSTUArray :: STUArray s ix a -> ST s (STUArray s ix b)++module Data.Array.Storable+data StorableArray i e+instance Storable e => MArray StorableArray e IO+withStorableArray :: StorableArray i e -> (Ptr e -> IO a) -> IO a+touchStorableArray :: StorableArray i e -> IO ()+unsafeForeignPtrToStorableArray :: Ix i => ForeignPtr e -> (i, i) -> IO (StorableArray i e)++module Data.Array.Unboxed+data UArray i e+instance Typeable2 UArray+instance IArray UArray Bool+instance IArray UArray Char+instance IArray UArray Double+instance IArray UArray Float+instance IArray UArray Int+instance IArray UArray Int16+instance IArray UArray Int32+instance IArray UArray Int64+instance IArray UArray Int8+instance IArray UArray Word+instance IArray UArray Word16+instance IArray UArray Word32+instance IArray UArray Word64+instance IArray UArray Word8+instance IArray UArray (FunPtr a)+instance IArray UArray (Ptr a)+instance IArray UArray (StablePtr a)+instance (Ix ix, Eq e, IArray UArray e) => Eq (UArray ix e)+instance (Ix ix, Ord e, IArray UArray e) => Ord (UArray ix e)+instance (Ix ix, Show ix, Show e, IArray UArray e) => Show (UArray ix e)++module Data.Array.IO+data IOUArray i e+instance Typeable2 IOUArray+instance MArray IOUArray Bool IO+instance MArray IOUArray Char IO+instance MArray IOUArray Double IO+instance MArray IOUArray Float IO+instance MArray IOUArray Int IO+instance MArray IOUArray Int16 IO+instance MArray IOUArray Int32 IO+instance MArray IOUArray Int64 IO+instance MArray IOUArray Int8 IO+instance MArray IOUArray Word IO+instance MArray IOUArray Word16 IO+instance MArray IOUArray Word32 IO+instance MArray IOUArray Word64 IO+instance MArray IOUArray Word8 IO+instance MArray IOUArray (FunPtr a) IO+instance MArray IOUArray (Ptr a) IO+instance MArray IOUArray (StablePtr a) IO+instance IArray (IOToDiffArray IOUArray) Char+instance IArray (IOToDiffArray IOUArray) Double+instance IArray (IOToDiffArray IOUArray) Float+instance IArray (IOToDiffArray IOUArray) Int+instance IArray (IOToDiffArray IOUArray) Int16+instance IArray (IOToDiffArray IOUArray) Int32+instance IArray (IOToDiffArray IOUArray) Int64+instance IArray (IOToDiffArray IOUArray) Int8+instance IArray (IOToDiffArray IOUArray) Word+instance IArray (IOToDiffArray IOUArray) Word16+instance IArray (IOToDiffArray IOUArray) Word32+instance IArray (IOToDiffArray IOUArray) Word64+instance IArray (IOToDiffArray IOUArray) Word8+instance IArray (IOToDiffArray IOUArray) (FunPtr a)+instance IArray (IOToDiffArray IOUArray) (Ptr a)+instance IArray (IOToDiffArray IOUArray) (StablePtr a)+instance Eq (IOUArray i e)+castIOUArray :: IOUArray ix a -> IO (IOUArray ix b)+hGetArray :: Handle -> IOUArray Int Word8 -> Int -> IO Int+hPutArray :: Handle -> IOUArray Int Word8 -> Int -> IO ()++module Data.Array.Diff+data IOToDiffArray a i e+instance IArray (IOToDiffArray IOArray) e+instance IArray (IOToDiffArray IOUArray) Char+instance IArray (IOToDiffArray IOUArray) Double+instance IArray (IOToDiffArray IOUArray) Float+instance IArray (IOToDiffArray IOUArray) Int+instance IArray (IOToDiffArray IOUArray) Int16+instance IArray (IOToDiffArray IOUArray) Int32+instance IArray (IOToDiffArray IOUArray) Int64+instance IArray (IOToDiffArray IOUArray) Int8+instance IArray (IOToDiffArray IOUArray) Word+instance IArray (IOToDiffArray IOUArray) Word16+instance IArray (IOToDiffArray IOUArray) Word32+instance IArray (IOToDiffArray IOUArray) Word64+instance IArray (IOToDiffArray IOUArray) Word8+instance IArray (IOToDiffArray IOUArray) (FunPtr a)+instance IArray (IOToDiffArray IOUArray) (Ptr a)+instance IArray (IOToDiffArray IOUArray) (StablePtr a)+type DiffArray = IOToDiffArray IOArray+instance (Ix ix, Show ix, Show e) => Show (DiffArray ix e)+type DiffUArray = IOToDiffArray IOUArray+instance (Ix ix, Show ix) => Show (DiffUArray ix Char)+instance (Ix ix, Show ix) => Show (DiffUArray ix Double)+instance (Ix ix, Show ix) => Show (DiffUArray ix Float)+instance (Ix ix, Show ix) => Show (DiffUArray ix Int)+instance (Ix ix, Show ix) => Show (DiffUArray ix Int16)+instance (Ix ix, Show ix) => Show (DiffUArray ix Int32)+instance (Ix ix, Show ix) => Show (DiffUArray ix Int64)+instance (Ix ix, Show ix) => Show (DiffUArray ix Int8)+instance (Ix ix, Show ix) => Show (DiffUArray ix Word)+instance (Ix ix, Show ix) => Show (DiffUArray ix Word16)+instance (Ix ix, Show ix) => Show (DiffUArray ix Word32)+instance (Ix ix, Show ix) => Show (DiffUArray ix Word64)+instance (Ix ix, Show ix) => Show (DiffUArray ix Word8)+newDiffArray :: (MArray a e IO, Ix i) => (i, i) -> [(Int, e)] -> IO (IOToDiffArray a i e)+readDiffArray :: (MArray a e IO, Ix i) => IOToDiffArray a i e -> Int -> IO e+replaceDiffArray :: (MArray a e IO, Ix i) => IOToDiffArray a i e -> [(Int, e)] -> IO (IOToDiffArray a i e)+-- Hoogle documentation, generated by Haddock+-- See Hoogle, http://www.haskell.org/hoogle/++module Data.ByteString.Internal+data ByteString+PS :: ForeignPtr Word8 -> Int -> Int -> ByteString+instance Data ByteString+instance Eq ByteString+instance Monoid ByteString+instance Ord ByteString+instance Read ByteString+instance Show ByteString+instance Typeable ByteString+create :: Int -> (Ptr Word8 -> IO ()) -> IO ByteString+createAndTrim :: Int -> (Ptr Word8 -> IO Int) -> IO ByteString+createAndTrim' :: Int -> (Ptr Word8 -> IO (Int, Int, a)) -> IO (ByteString, a)+unsafeCreate :: Int -> (Ptr Word8 -> IO ()) -> ByteString+mallocByteString :: Int -> IO (ForeignPtr a)+fromForeignPtr :: ForeignPtr Word8 -> Int -> Int -> ByteString+toForeignPtr :: ByteString -> (ForeignPtr Word8, Int, Int)+inlinePerformIO :: IO a -> a+nullForeignPtr :: ForeignPtr Word8+countOccurrences :: (Storable a, Num a) => Ptr a -> Ptr Word8 -> Int -> IO ()+c_strlen :: CString -> IO CSize+c_free_finalizer :: FunPtr (Ptr Word8 -> IO ())+memchr :: Ptr Word8 -> Word8 -> CSize -> IO (Ptr Word8)+memcmp :: Ptr Word8 -> Ptr Word8 -> CSize -> IO CInt+memcpy :: Ptr Word8 -> Ptr Word8 -> CSize -> IO ()+memmove :: Ptr Word8 -> Ptr Word8 -> CSize -> IO ()+memset :: Ptr Word8 -> Word8 -> CSize -> IO (Ptr Word8)+c_reverse :: Ptr Word8 -> Ptr Word8 -> CULong -> IO ()+c_intersperse :: Ptr Word8 -> Ptr Word8 -> CULong -> Word8 -> IO ()+c_maximum :: Ptr Word8 -> CULong -> IO Word8+c_minimum :: Ptr Word8 -> CULong -> IO Word8+c_count :: Ptr Word8 -> CULong -> Word8 -> IO CULong+memcpy_ptr_baoff :: Ptr a -> RawBuffer -> CInt -> CSize -> IO (Ptr ())+w2c :: Word8 -> Char+c2w :: Char -> Word8+isSpaceWord8 :: Word8 -> Bool++module Data.ByteString.Lazy.Internal+data ByteString+Empty :: ByteString+Chunk :: ByteString -> ByteString -> ByteString+instance Data ByteString+instance Eq ByteString+instance Monoid ByteString+instance Ord ByteString+instance Read ByteString+instance Show ByteString+instance Typeable ByteString+chunk :: ByteString -> ByteString -> ByteString+foldrChunks :: (ByteString -> a -> a) -> a -> ByteString -> a+foldlChunks :: (a -> ByteString -> a) -> a -> ByteString -> a+invariant :: ByteString -> Bool+checkInvariant :: ByteString -> ByteString+defaultChunkSize :: Int+smallChunkSize :: Int+chunkOverhead :: Int++module Data.ByteString.Unsafe+unsafeHead :: ByteString -> Word8+unsafeTail :: ByteString -> ByteString+unsafeIndex :: ByteString -> Int -> Word8+unsafeTake :: Int -> ByteString -> ByteString+unsafeDrop :: Int -> ByteString -> ByteString+unsafeUseAsCString :: ByteString -> (CString -> IO a) -> IO a+unsafeUseAsCStringLen :: ByteString -> (CStringLen -> IO a) -> IO a+unsafePackCString :: CString -> IO ByteString+unsafePackCStringLen :: CStringLen -> IO ByteString+unsafePackMallocCString :: CString -> IO ByteString+unsafePackAddress :: Addr# -> IO ByteString+unsafePackAddressLen :: Int -> Addr# -> IO ByteString+unsafePackCStringFinalizer :: Ptr Word8 -> Int -> IO () -> IO ByteString+unsafeFinalize :: ByteString -> IO ()++module Data.ByteString+data ByteString+instance Data ByteString+instance Eq ByteString+instance Monoid ByteString+instance Ord ByteString+instance Read ByteString+instance Show ByteString+instance Typeable ByteString+empty :: ByteString+singleton :: Word8 -> ByteString+pack :: [Word8] -> ByteString+unpack :: ByteString -> [Word8]+cons :: Word8 -> ByteString -> ByteString+snoc :: ByteString -> Word8 -> ByteString+append :: ByteString -> ByteString -> ByteString+head :: ByteString -> Word8+uncons :: ByteString -> Maybe (Word8, ByteString)+last :: ByteString -> Word8+tail :: ByteString -> ByteString+init :: ByteString -> ByteString+null :: ByteString -> Bool+length :: ByteString -> Int+map :: (Word8 -> Word8) -> ByteString -> ByteString+reverse :: ByteString -> ByteString+intersperse :: Word8 -> ByteString -> ByteString+intercalate :: ByteString -> [ByteString] -> ByteString+transpose :: [ByteString] -> [ByteString]+foldl :: (a -> Word8 -> a) -> a -> ByteString -> a+foldl' :: (a -> Word8 -> a) -> a -> ByteString -> a+foldl1 :: (Word8 -> Word8 -> Word8) -> ByteString -> Word8+foldl1' :: (Word8 -> Word8 -> Word8) -> ByteString -> Word8+foldr :: (Word8 -> a -> a) -> a -> ByteString -> a+foldr' :: (Word8 -> a -> a) -> a -> ByteString -> a+foldr1 :: (Word8 -> Word8 -> Word8) -> ByteString -> Word8+foldr1' :: (Word8 -> Word8 -> Word8) -> ByteString -> Word8+concat :: [ByteString] -> ByteString+concatMap :: (Word8 -> ByteString) -> ByteString -> ByteString+any :: (Word8 -> Bool) -> ByteString -> Bool+all :: (Word8 -> Bool) -> ByteString -> Bool+maximum :: ByteString -> Word8+minimum :: ByteString -> Word8+scanl :: (Word8 -> Word8 -> Word8) -> Word8 -> ByteString -> ByteString+scanl1 :: (Word8 -> Word8 -> Word8) -> ByteString -> ByteString+scanr :: (Word8 -> Word8 -> Word8) -> Word8 -> ByteString -> ByteString+scanr1 :: (Word8 -> Word8 -> Word8) -> ByteString -> ByteString+mapAccumL :: (acc -> Word8 -> (acc, Word8)) -> acc -> ByteString -> (acc, ByteString)+mapAccumR :: (acc -> Word8 -> (acc, Word8)) -> acc -> ByteString -> (acc, ByteString)+mapIndexed :: (Int -> Word8 -> Word8) -> ByteString -> ByteString+replicate :: Int -> Word8 -> ByteString+unfoldr :: (a -> Maybe (Word8, a)) -> a -> ByteString+unfoldrN :: Int -> (a -> Maybe (Word8, a)) -> a -> (ByteString, Maybe a)+take :: Int -> ByteString -> ByteString+drop :: Int -> ByteString -> ByteString+splitAt :: Int -> ByteString -> (ByteString, ByteString)+takeWhile :: (Word8 -> Bool) -> ByteString -> ByteString+dropWhile :: (Word8 -> Bool) -> ByteString -> ByteString+span :: (Word8 -> Bool) -> ByteString -> (ByteString, ByteString)+spanEnd :: (Word8 -> Bool) -> ByteString -> (ByteString, ByteString)+break :: (Word8 -> Bool) -> ByteString -> (ByteString, ByteString)+breakEnd :: (Word8 -> Bool) -> ByteString -> (ByteString, ByteString)+group :: ByteString -> [ByteString]+groupBy :: (Word8 -> Word8 -> Bool) -> ByteString -> [ByteString]+inits :: ByteString -> [ByteString]+tails :: ByteString -> [ByteString]+split :: Word8 -> ByteString -> [ByteString]+splitWith :: (Word8 -> Bool) -> ByteString -> [ByteString]+isPrefixOf :: ByteString -> ByteString -> Bool+isSuffixOf :: ByteString -> ByteString -> Bool+isInfixOf :: ByteString -> ByteString -> Bool+isSubstringOf :: ByteString -> ByteString -> Bool+findSubstring :: ByteString -> ByteString -> Maybe Int+findSubstrings :: ByteString -> ByteString -> [Int]+elem :: Word8 -> ByteString -> Bool+notElem :: Word8 -> ByteString -> Bool+find :: (Word8 -> Bool) -> ByteString -> Maybe Word8+filter :: (Word8 -> Bool) -> ByteString -> ByteString+partition :: (Word8 -> Bool) -> ByteString -> (ByteString, ByteString)+index :: ByteString -> Int -> Word8+elemIndex :: Word8 -> ByteString -> Maybe Int+elemIndices :: Word8 -> ByteString -> [Int]+elemIndexEnd :: Word8 -> ByteString -> Maybe Int+findIndex :: (Word8 -> Bool) -> ByteString -> Maybe Int+findIndices :: (Word8 -> Bool) -> ByteString -> [Int]+count :: Word8 -> ByteString -> Int+zip :: ByteString -> ByteString -> [(Word8, Word8)]+zipWith :: (Word8 -> Word8 -> a) -> ByteString -> ByteString -> [a]+unzip :: [(Word8, Word8)] -> (ByteString, ByteString)+sort :: ByteString -> ByteString+copy :: ByteString -> ByteString+packCString :: CString -> IO ByteString+packCStringLen :: CStringLen -> IO ByteString+useAsCString :: ByteString -> (CString -> IO a) -> IO a+useAsCStringLen :: ByteString -> (CStringLen -> IO a) -> IO a+getLine :: IO ByteString+getContents :: IO ByteString+putStr :: ByteString -> IO ()+putStrLn :: ByteString -> IO ()+interact :: (ByteString -> ByteString) -> IO ()+readFile :: FilePath -> IO ByteString+writeFile :: FilePath -> ByteString -> IO ()+appendFile :: FilePath -> ByteString -> IO ()+hGetLine :: Handle -> IO ByteString+hGetContents :: Handle -> IO ByteString+hGet :: Handle -> Int -> IO ByteString+hGetNonBlocking :: Handle -> Int -> IO ByteString+hPut :: Handle -> ByteString -> IO ()+hPutStr :: Handle -> ByteString -> IO ()+hPutStrLn :: Handle -> ByteString -> IO ()++module Data.ByteString.Char8+data ByteString+instance Data ByteString+instance Eq ByteString+instance Monoid ByteString+instance Ord ByteString+instance Read ByteString+instance Show ByteString+instance Typeable ByteString+empty :: ByteString+singleton :: Char -> ByteString+pack :: String -> ByteString+unpack :: ByteString -> [Char]+cons :: Char -> ByteString -> ByteString+snoc :: ByteString -> Char -> ByteString+append :: ByteString -> ByteString -> ByteString+head :: ByteString -> Char+uncons :: ByteString -> Maybe (Char, ByteString)+last :: ByteString -> Char+tail :: ByteString -> ByteString+init :: ByteString -> ByteString+null :: ByteString -> Bool+length :: ByteString -> Int+map :: (Char -> Char) -> ByteString -> ByteString+reverse :: ByteString -> ByteString+intersperse :: Char -> ByteString -> ByteString+intercalate :: ByteString -> [ByteString] -> ByteString+transpose :: [ByteString] -> [ByteString]+foldl :: (a -> Char -> a) -> a -> ByteString -> a+foldl' :: (a -> Char -> a) -> a -> ByteString -> a+foldl1 :: (Char -> Char -> Char) -> ByteString -> Char+foldl1' :: (Char -> Char -> Char) -> ByteString -> Char+foldr :: (Char -> a -> a) -> a -> ByteString -> a+foldr' :: (Char -> a -> a) -> a -> ByteString -> a+foldr1 :: (Char -> Char -> Char) -> ByteString -> Char+foldr1' :: (Char -> Char -> Char) -> ByteString -> Char+concat :: [ByteString] -> ByteString+concatMap :: (Char -> ByteString) -> ByteString -> ByteString+any :: (Char -> Bool) -> ByteString -> Bool+all :: (Char -> Bool) -> ByteString -> Bool+maximum :: ByteString -> Char+minimum :: ByteString -> Char+scanl :: (Char -> Char -> Char) -> Char -> ByteString -> ByteString+scanl1 :: (Char -> Char -> Char) -> ByteString -> ByteString+scanr :: (Char -> Char -> Char) -> Char -> ByteString -> ByteString+scanr1 :: (Char -> Char -> Char) -> ByteString -> ByteString+mapAccumL :: (acc -> Char -> (acc, Char)) -> acc -> ByteString -> (acc, ByteString)+mapAccumR :: (acc -> Char -> (acc, Char)) -> acc -> ByteString -> (acc, ByteString)+mapIndexed :: (Int -> Char -> Char) -> ByteString -> ByteString+replicate :: Int -> Char -> ByteString+unfoldr :: (a -> Maybe (Char, a)) -> a -> ByteString+unfoldrN :: Int -> (a -> Maybe (Char, a)) -> a -> (ByteString, Maybe a)+take :: Int -> ByteString -> ByteString+drop :: Int -> ByteString -> ByteString+splitAt :: Int -> ByteString -> (ByteString, ByteString)+takeWhile :: (Char -> Bool) -> ByteString -> ByteString+dropWhile :: (Char -> Bool) -> ByteString -> ByteString+span :: (Char -> Bool) -> ByteString -> (ByteString, ByteString)+spanEnd :: (Char -> Bool) -> ByteString -> (ByteString, ByteString)+break :: (Char -> Bool) -> ByteString -> (ByteString, ByteString)+breakEnd :: (Char -> Bool) -> ByteString -> (ByteString, ByteString)+group :: ByteString -> [ByteString]+groupBy :: (Char -> Char -> Bool) -> ByteString -> [ByteString]+inits :: ByteString -> [ByteString]+tails :: ByteString -> [ByteString]+split :: Char -> ByteString -> [ByteString]+splitWith :: (Char -> Bool) -> ByteString -> [ByteString]+lines :: ByteString -> [ByteString]+words :: ByteString -> [ByteString]+unlines :: [ByteString] -> ByteString+unwords :: [ByteString] -> ByteString+isPrefixOf :: ByteString -> ByteString -> Bool+isSuffixOf :: ByteString -> ByteString -> Bool+isInfixOf :: ByteString -> ByteString -> Bool+isSubstringOf :: ByteString -> ByteString -> Bool+findSubstring :: ByteString -> ByteString -> Maybe Int+findSubstrings :: ByteString -> ByteString -> [Int]+elem :: Char -> ByteString -> Bool+notElem :: Char -> ByteString -> Bool+find :: (Char -> Bool) -> ByteString -> Maybe Char+filter :: (Char -> Bool) -> ByteString -> ByteString+index :: ByteString -> Int -> Char+elemIndex :: Char -> ByteString -> Maybe Int+elemIndices :: Char -> ByteString -> [Int]+elemIndexEnd :: Char -> ByteString -> Maybe Int+findIndex :: (Char -> Bool) -> ByteString -> Maybe Int+findIndices :: (Char -> Bool) -> ByteString -> [Int]+count :: Char -> ByteString -> Int+zip :: ByteString -> ByteString -> [(Char, Char)]+zipWith :: (Char -> Char -> a) -> ByteString -> ByteString -> [a]+unzip :: [(Char, Char)] -> (ByteString, ByteString)+sort :: ByteString -> ByteString+readInt :: ByteString -> Maybe (Int, ByteString)+readInteger :: ByteString -> Maybe (Integer, ByteString)+copy :: ByteString -> ByteString+packCString :: CString -> IO ByteString+packCStringLen :: CStringLen -> IO ByteString+useAsCString :: ByteString -> (CString -> IO a) -> IO a+useAsCStringLen :: ByteString -> (CStringLen -> IO a) -> IO a+getLine :: IO ByteString+getContents :: IO ByteString+putStr :: ByteString -> IO ()+putStrLn :: ByteString -> IO ()+interact :: (ByteString -> ByteString) -> IO ()+readFile :: FilePath -> IO ByteString+writeFile :: FilePath -> ByteString -> IO ()+appendFile :: FilePath -> ByteString -> IO ()+hGetLine :: Handle -> IO ByteString+hGetContents :: Handle -> IO ByteString+hGet :: Handle -> Int -> IO ByteString+hGetNonBlocking :: Handle -> Int -> IO ByteString+hPut :: Handle -> ByteString -> IO ()+hPutStr :: Handle -> ByteString -> IO ()+hPutStrLn :: Handle -> ByteString -> IO ()++module Data.ByteString.Lazy+data ByteString+instance Data ByteString+instance Eq ByteString+instance Monoid ByteString+instance Ord ByteString+instance Read ByteString+instance Show ByteString+instance Typeable ByteString+empty :: ByteString+singleton :: Word8 -> ByteString+pack :: [Word8] -> ByteString+unpack :: ByteString -> [Word8]+fromChunks :: [ByteString] -> ByteString+toChunks :: ByteString -> [ByteString]+cons :: Word8 -> ByteString -> ByteString+cons' :: Word8 -> ByteString -> ByteString+snoc :: ByteString -> Word8 -> ByteString+append :: ByteString -> ByteString -> ByteString+head :: ByteString -> Word8+uncons :: ByteString -> Maybe (Word8, ByteString)+last :: ByteString -> Word8+tail :: ByteString -> ByteString+init :: ByteString -> ByteString+null :: ByteString -> Bool+length :: ByteString -> Int64+map :: (Word8 -> Word8) -> ByteString -> ByteString+reverse :: ByteString -> ByteString+intersperse :: Word8 -> ByteString -> ByteString+intercalate :: ByteString -> [ByteString] -> ByteString+transpose :: [ByteString] -> [ByteString]+foldl :: (a -> Word8 -> a) -> a -> ByteString -> a+foldl' :: (a -> Word8 -> a) -> a -> ByteString -> a+foldl1 :: (Word8 -> Word8 -> Word8) -> ByteString -> Word8+foldl1' :: (Word8 -> Word8 -> Word8) -> ByteString -> Word8+foldr :: (Word8 -> a -> a) -> a -> ByteString -> a+foldr1 :: (Word8 -> Word8 -> Word8) -> ByteString -> Word8+concat :: [ByteString] -> ByteString+concatMap :: (Word8 -> ByteString) -> ByteString -> ByteString+any :: (Word8 -> Bool) -> ByteString -> Bool+all :: (Word8 -> Bool) -> ByteString -> Bool+maximum :: ByteString -> Word8+minimum :: ByteString -> Word8+scanl :: (Word8 -> Word8 -> Word8) -> Word8 -> ByteString -> ByteString+mapAccumL :: (acc -> Word8 -> (acc, Word8)) -> acc -> ByteString -> (acc, ByteString)+mapAccumR :: (acc -> Word8 -> (acc, Word8)) -> acc -> ByteString -> (acc, ByteString)+mapIndexed :: (Int -> Word8 -> Word8) -> ByteString -> ByteString+repeat :: Word8 -> ByteString+replicate :: Int64 -> Word8 -> ByteString+cycle :: ByteString -> ByteString+iterate :: (Word8 -> Word8) -> Word8 -> ByteString+unfoldr :: (a -> Maybe (Word8, a)) -> a -> ByteString+take :: Int64 -> ByteString -> ByteString+drop :: Int64 -> ByteString -> ByteString+splitAt :: Int64 -> ByteString -> (ByteString, ByteString)+takeWhile :: (Word8 -> Bool) -> ByteString -> ByteString+dropWhile :: (Word8 -> Bool) -> ByteString -> ByteString+span :: (Word8 -> Bool) -> ByteString -> (ByteString, ByteString)+break :: (Word8 -> Bool) -> ByteString -> (ByteString, ByteString)+group :: ByteString -> [ByteString]+groupBy :: (Word8 -> Word8 -> Bool) -> ByteString -> [ByteString]+inits :: ByteString -> [ByteString]+tails :: ByteString -> [ByteString]+split :: Word8 -> ByteString -> [ByteString]+splitWith :: (Word8 -> Bool) -> ByteString -> [ByteString]+isPrefixOf :: ByteString -> ByteString -> Bool+isSuffixOf :: ByteString -> ByteString -> Bool+elem :: Word8 -> ByteString -> Bool+notElem :: Word8 -> ByteString -> Bool+find :: (Word8 -> Bool) -> ByteString -> Maybe Word8+filter :: (Word8 -> Bool) -> ByteString -> ByteString+partition :: (Word8 -> Bool) -> ByteString -> (ByteString, ByteString)+index :: ByteString -> Int64 -> Word8+elemIndex :: Word8 -> ByteString -> Maybe Int64+elemIndices :: Word8 -> ByteString -> [Int64]+findIndex :: (Word8 -> Bool) -> ByteString -> Maybe Int64+findIndices :: (Word8 -> Bool) -> ByteString -> [Int64]+count :: Word8 -> ByteString -> Int64+zip :: ByteString -> ByteString -> [(Word8, Word8)]+zipWith :: (Word8 -> Word8 -> a) -> ByteString -> ByteString -> [a]+unzip :: [(Word8, Word8)] -> (ByteString, ByteString)+copy :: ByteString -> ByteString+getContents :: IO ByteString+putStr :: ByteString -> IO ()+putStrLn :: ByteString -> IO ()+interact :: (ByteString -> ByteString) -> IO ()+readFile :: FilePath -> IO ByteString+writeFile :: FilePath -> ByteString -> IO ()+appendFile :: FilePath -> ByteString -> IO ()+hGetContents :: Handle -> IO ByteString+hGet :: Handle -> Int -> IO ByteString+hGetNonBlocking :: Handle -> Int -> IO ByteString+hPut :: Handle -> ByteString -> IO ()+hPutStr :: Handle -> ByteString -> IO ()++module Data.ByteString.Lazy.Char8+data ByteString+instance Data ByteString+instance Eq ByteString+instance Monoid ByteString+instance Ord ByteString+instance Read ByteString+instance Show ByteString+instance Typeable ByteString+empty :: ByteString+singleton :: Char -> ByteString+pack :: [Char] -> ByteString+unpack :: ByteString -> [Char]+fromChunks :: [ByteString] -> ByteString+toChunks :: ByteString -> [ByteString]+cons :: Char -> ByteString -> ByteString+cons' :: Char -> ByteString -> ByteString+snoc :: ByteString -> Char -> ByteString+append :: ByteString -> ByteString -> ByteString+head :: ByteString -> Char+uncons :: ByteString -> Maybe (Char, ByteString)+last :: ByteString -> Char+tail :: ByteString -> ByteString+init :: ByteString -> ByteString+null :: ByteString -> Bool+length :: ByteString -> Int64+map :: (Char -> Char) -> ByteString -> ByteString+reverse :: ByteString -> ByteString+intersperse :: Char -> ByteString -> ByteString+intercalate :: ByteString -> [ByteString] -> ByteString+transpose :: [ByteString] -> [ByteString]+foldl :: (a -> Char -> a) -> a -> ByteString -> a+foldl' :: (a -> Char -> a) -> a -> ByteString -> a+foldl1 :: (Char -> Char -> Char) -> ByteString -> Char+foldl1' :: (Char -> Char -> Char) -> ByteString -> Char+foldr :: (Char -> a -> a) -> a -> ByteString -> a+foldr1 :: (Char -> Char -> Char) -> ByteString -> Char+concat :: [ByteString] -> ByteString+concatMap :: (Char -> ByteString) -> ByteString -> ByteString+any :: (Char -> Bool) -> ByteString -> Bool+all :: (Char -> Bool) -> ByteString -> Bool+maximum :: ByteString -> Char+minimum :: ByteString -> Char+scanl :: (Char -> Char -> Char) -> Char -> ByteString -> ByteString+mapAccumL :: (acc -> Char -> (acc, Char)) -> acc -> ByteString -> (acc, ByteString)+mapIndexed :: (Int -> Char -> Char) -> ByteString -> ByteString+repeat :: Char -> ByteString+replicate :: Int64 -> Char -> ByteString+cycle :: ByteString -> ByteString+iterate :: (Char -> Char) -> Char -> ByteString+unfoldr :: (a -> Maybe (Char, a)) -> a -> ByteString+take :: Int64 -> ByteString -> ByteString+drop :: Int64 -> ByteString -> ByteString+splitAt :: Int64 -> ByteString -> (ByteString, ByteString)+takeWhile :: (Char -> Bool) -> ByteString -> ByteString+dropWhile :: (Char -> Bool) -> ByteString -> ByteString+span :: (Char -> Bool) -> ByteString -> (ByteString, ByteString)+break :: (Char -> Bool) -> ByteString -> (ByteString, ByteString)+group :: ByteString -> [ByteString]+groupBy :: (Char -> Char -> Bool) -> ByteString -> [ByteString]+inits :: ByteString -> [ByteString]+tails :: ByteString -> [ByteString]+split :: Char -> ByteString -> [ByteString]+splitWith :: (Char -> Bool) -> ByteString -> [ByteString]+lines :: ByteString -> [ByteString]+words :: ByteString -> [ByteString]+unlines :: [ByteString] -> ByteString+unwords :: [ByteString] -> ByteString+isPrefixOf :: ByteString -> ByteString -> Bool+elem :: Char -> ByteString -> Bool+notElem :: Char -> ByteString -> Bool+find :: (Char -> Bool) -> ByteString -> Maybe Char+filter :: (Char -> Bool) -> ByteString -> ByteString+index :: ByteString -> Int64 -> Char+elemIndex :: Char -> ByteString -> Maybe Int64+elemIndices :: Char -> ByteString -> [Int64]+findIndex :: (Char -> Bool) -> ByteString -> Maybe Int64+findIndices :: (Char -> Bool) -> ByteString -> [Int64]+count :: Char -> ByteString -> Int64+zip :: ByteString -> ByteString -> [(Char, Char)]+zipWith :: (Char -> Char -> a) -> ByteString -> ByteString -> [a]+copy :: ByteString -> ByteString+readInt :: ByteString -> Maybe (Int, ByteString)+readInteger :: ByteString -> Maybe (Integer, ByteString)+getContents :: IO ByteString+putStr :: ByteString -> IO ()+putStrLn :: ByteString -> IO ()+interact :: (ByteString -> ByteString) -> IO ()+readFile :: FilePath -> IO ByteString+writeFile :: FilePath -> ByteString -> IO ()+appendFile :: FilePath -> ByteString -> IO ()+hGetContents :: Handle -> IO ByteString+hGet :: Handle -> Int -> IO ByteString+hGetNonBlocking :: Handle -> Int -> IO ByteString+hPut :: Handle -> ByteString -> IO ()+-- Hoogle documentation, generated by Haddock+-- See Hoogle, http://www.haskell.org/hoogle/++module Language.Haskell.Extension+data Extension+OverlappingInstances :: Extension+UndecidableInstances :: Extension+IncoherentInstances :: Extension+RecursiveDo :: Extension+ParallelListComp :: Extension+MultiParamTypeClasses :: Extension+NoMonomorphismRestriction :: Extension+FunctionalDependencies :: Extension+Rank2Types :: Extension+RankNTypes :: Extension+PolymorphicComponents :: Extension+ExistentialQuantification :: Extension+ScopedTypeVariables :: Extension+ImplicitParams :: Extension+FlexibleContexts :: Extension+FlexibleInstances :: Extension+EmptyDataDecls :: Extension+CPP :: Extension+KindSignatures :: Extension+BangPatterns :: Extension+TypeSynonymInstances :: Extension+TemplateHaskell :: Extension+ForeignFunctionInterface :: Extension+Arrows :: Extension+Generics :: Extension+NoImplicitPrelude :: Extension+NamedFieldPuns :: Extension+PatternGuards :: Extension+GeneralizedNewtypeDeriving :: Extension+ExtensibleRecords :: Extension+RestrictedTypeSynonyms :: Extension+HereDocuments :: Extension+MagicHash :: Extension+TypeFamilies :: Extension+StandaloneDeriving :: Extension+UnicodeSyntax :: Extension+PatternSignatures :: Extension+UnliftedFFITypes :: Extension+LiberalTypeSynonyms :: Extension+TypeOperators :: Extension+RecordWildCards :: Extension+RecordPuns :: Extension+DisambiguateRecordFields :: Extension+OverloadedStrings :: Extension+GADTs :: Extension+NoMonoPatBinds :: Extension+RelaxedPolyRec :: Extension+ExtendedDefaultRules :: Extension+UnboxedTuples :: Extension+DeriveDataTypeable :: Extension+ConstrainedClassMethods :: Extension+instance Eq Extension+instance Read Extension+instance Show Extension++module Distribution.Verbosity+data Verbosity+instance Eq Verbosity+instance Ord Verbosity+instance Show Verbosity+silent :: Verbosity+normal :: Verbosity+verbose :: Verbosity+deafening :: Verbosity+moreVerbose :: Verbosity -> Verbosity+lessVerbose :: Verbosity -> Verbosity+intToVerbosity :: Int -> Maybe Verbosity+flagToVerbosity :: Maybe String -> Verbosity+showForCabal :: Verbosity -> String+showForGHC :: Verbosity -> String++module Distribution.System+data OS+Linux :: OS+Windows :: Windows -> OS+OSX :: OS+Solaris :: OS+Other :: String -> OS+data Windows+MingW :: Windows+os :: OS++module Distribution.Simple.PreProcess.Unlit+unlit :: FilePath -> String -> String+plain :: String -> String -> String++module Distribution.Simple.GHC.Makefile+makefileTemplate :: String++module Distribution.License+data License+GPL :: License+LGPL :: License+BSD3 :: License+BSD4 :: License+PublicDomain :: License+AllRightsReserved :: License+OtherLicense :: License+instance Eq License+instance Read License+instance Show License++module Distribution.Extension+data Extension+OverlappingInstances :: Extension+UndecidableInstances :: Extension+IncoherentInstances :: Extension+RecursiveDo :: Extension+ParallelListComp :: Extension+MultiParamTypeClasses :: Extension+NoMonomorphismRestriction :: Extension+FunctionalDependencies :: Extension+Rank2Types :: Extension+RankNTypes :: Extension+PolymorphicComponents :: Extension+ExistentialQuantification :: Extension+ScopedTypeVariables :: Extension+ImplicitParams :: Extension+FlexibleContexts :: Extension+FlexibleInstances :: Extension+EmptyDataDecls :: Extension+CPP :: Extension+KindSignatures :: Extension+BangPatterns :: Extension+TypeSynonymInstances :: Extension+TemplateHaskell :: Extension+ForeignFunctionInterface :: Extension+Arrows :: Extension+Generics :: Extension+NoImplicitPrelude :: Extension+NamedFieldPuns :: Extension+PatternGuards :: Extension+GeneralizedNewtypeDeriving :: Extension+ExtensibleRecords :: Extension+RestrictedTypeSynonyms :: Extension+HereDocuments :: Extension+MagicHash :: Extension+TypeFamilies :: Extension+StandaloneDeriving :: Extension+UnicodeSyntax :: Extension+PatternSignatures :: Extension+UnliftedFFITypes :: Extension+LiberalTypeSynonyms :: Extension+TypeOperators :: Extension+RecordWildCards :: Extension+RecordPuns :: Extension+DisambiguateRecordFields :: Extension+OverloadedStrings :: Extension+GADTs :: Extension+NoMonoPatBinds :: Extension+RelaxedPolyRec :: Extension+ExtendedDefaultRules :: Extension+UnboxedTuples :: Extension+DeriveDataTypeable :: Extension+ConstrainedClassMethods :: Extension+instance Eq Extension+instance Read Extension+instance Show Extension++module Distribution.Compiler+data CompilerFlavor+GHC :: CompilerFlavor+NHC :: CompilerFlavor+Hugs :: CompilerFlavor+HBC :: CompilerFlavor+Helium :: CompilerFlavor+JHC :: CompilerFlavor+OtherCompiler :: String -> CompilerFlavor+instance Eq CompilerFlavor+instance Ord CompilerFlavor+instance Read CompilerFlavor+instance Show CompilerFlavor+defaultCompilerFlavor :: Maybe CompilerFlavor++module Distribution.Compat.ReadP+type ReadP r a = ReadP a++module Distribution.Version+readVersion :: String -> Maybe Version+data VersionRange+AnyVersion :: VersionRange+ThisVersion :: Version -> VersionRange+LaterVersion :: Version -> VersionRange+EarlierVersion :: Version -> VersionRange+UnionVersionRanges :: VersionRange -> VersionRange -> VersionRange+IntersectVersionRanges :: VersionRange -> VersionRange -> VersionRange+instance Eq VersionRange+instance Read VersionRange+instance Show VersionRange+orLaterVersion :: Version -> VersionRange+orEarlierVersion :: Version -> VersionRange+betweenVersionsInclusive :: Version -> Version -> VersionRange+withinRange :: Version -> VersionRange -> Bool+showVersionRange :: VersionRange -> String+parseVersionRange :: ReadP r VersionRange+isAnyVersion :: VersionRange -> Bool+data Dependency+Dependency :: String -> VersionRange -> Dependency+instance Eq Dependency+instance Read Dependency+instance Show Dependency++module Distribution.Configuration+data Flag+MkFlag :: String -> String -> Bool -> Flag+flagName :: Flag -> String+flagDescription :: Flag -> String+flagDefault :: Flag -> Bool+instance Show Flag+data ConfVar+OS :: String -> ConfVar+Arch :: String -> ConfVar+Flag :: ConfFlag -> ConfVar+Impl :: String -> VersionRange -> ConfVar+instance Eq ConfVar+instance Show ConfVar+data Condition c+Var :: c -> Condition c+Lit :: Bool -> Condition c+CNot :: Condition c -> Condition c+COr :: Condition c -> Condition c -> Condition c+CAnd :: Condition c -> Condition c -> Condition c+instance Show c => Show (Condition c)+parseCondition :: ReadP r (Condition ConfVar)+simplifyCondition :: Condition c -> (c -> Either d Bool) -> (Condition d, [d])+data CondTree v c a+CondNode :: a -> c -> [(Condition v, CondTree v c a, Maybe (CondTree v c a))] -> CondTree v c a+condTreeData :: CondTree v c a -> a+condTreeConstraints :: CondTree v c a -> c+condTreeComponents :: CondTree v c a -> [(Condition v, CondTree v c a, Maybe (CondTree v c a))]+instance (Show v, Show c) => Show (CondTree v c a)+ppCondTree :: Show v => CondTree v c a -> (c -> Doc) -> Doc+mapTreeData :: (a -> b) -> CondTree v c a -> CondTree v c b+resolveWithFlags :: Monoid a => [(String, [Bool])] -> String -> String -> (String, Version) -> [CondTree ConfVar [d] a] -> ([d] -> DepTestRslt [d]) -> Either [d] ([a], [d], [(String, Bool)])+ignoreConditions :: (Monoid a, Monoid c) => CondTree v c a -> (a, c)+data DepTestRslt d+DepOk :: DepTestRslt d+MissingDeps :: d -> DepTestRslt d+instance Monoid d => Monoid (DepTestRslt d)++module Distribution.Package+data PackageIdentifier+PackageIdentifier :: String -> Version -> PackageIdentifier+pkgName :: PackageIdentifier -> String+pkgVersion :: PackageIdentifier -> Version+instance Eq PackageIdentifier+instance Ord PackageIdentifier+instance Read PackageIdentifier+instance Show PackageIdentifier+showPackageId :: PackageIdentifier -> String+parsePackageId :: ReadP r PackageIdentifier+parsePackageName :: ReadP r String++module Distribution.InstalledPackageInfo+data InstalledPackageInfo_ m+InstalledPackageInfo_ :: PackageIdentifier -> License -> String -> String -> String -> String -> String -> String -> String -> String -> Bool -> [m] -> [m] -> [FilePath] -> [FilePath] -> [String] -> [String] -> [String] -> [FilePath] -> [String] -> [PackageIdentifier] -> [String] -> [String] -> [String] -> [FilePath] -> [String] -> [FilePath] -> [FilePath] -> InstalledPackageInfo_ m+package :: InstalledPackageInfo_ m -> PackageIdentifier+license :: InstalledPackageInfo_ m -> License+copyright :: InstalledPackageInfo_ m -> String+maintainer :: InstalledPackageInfo_ m -> String+author :: InstalledPackageInfo_ m -> String+stability :: InstalledPackageInfo_ m -> String+homepage :: InstalledPackageInfo_ m -> String+pkgUrl :: InstalledPackageInfo_ m -> String+description :: InstalledPackageInfo_ m -> String+category :: InstalledPackageInfo_ m -> String+exposed :: InstalledPackageInfo_ m -> Bool+exposedModules :: InstalledPackageInfo_ m -> [m]+hiddenModules :: InstalledPackageInfo_ m -> [m]+importDirs :: InstalledPackageInfo_ m -> [FilePath]+libraryDirs :: InstalledPackageInfo_ m -> [FilePath]+hsLibraries :: InstalledPackageInfo_ m -> [String]+extraLibraries :: InstalledPackageInfo_ m -> [String]+extraGHCiLibraries :: InstalledPackageInfo_ m -> [String]+includeDirs :: InstalledPackageInfo_ m -> [FilePath]+includes :: InstalledPackageInfo_ m -> [String]+depends :: InstalledPackageInfo_ m -> [PackageIdentifier]+hugsOptions :: InstalledPackageInfo_ m -> [String]+ccOptions :: InstalledPackageInfo_ m -> [String]+ldOptions :: InstalledPackageInfo_ m -> [String]+frameworkDirs :: InstalledPackageInfo_ m -> [FilePath]+frameworks :: InstalledPackageInfo_ m -> [String]+haddockInterfaces :: InstalledPackageInfo_ m -> [FilePath]+haddockHTMLs :: InstalledPackageInfo_ m -> [FilePath]+instance ??? m => Read (InstalledPackageInfo_ m)+instance ??? m => Show (InstalledPackageInfo_ m)+type InstalledPackageInfo = InstalledPackageInfo_ String+data ParseResult a+ParseFailed :: PError -> ParseResult a+ParseOk :: [PWarning] -> a -> ParseResult a+instance Monad ParseResult+instance Show a => Show (ParseResult a)+data PError+AmbigousParse :: String -> LineNo -> PError+NoParse :: String -> LineNo -> PError+TabsError :: LineNo -> PError+FromString :: String -> Maybe LineNo -> PError+instance Show PError+type PWarning = String+emptyInstalledPackageInfo :: InstalledPackageInfo_ m+parseInstalledPackageInfo :: String -> ParseResult InstalledPackageInfo+showInstalledPackageInfo :: InstalledPackageInfo -> String+showInstalledPackageInfoField :: String -> Maybe (InstalledPackageInfo -> String)++module Distribution.Simple.Compiler+data Compiler+Compiler :: CompilerFlavor -> PackageIdentifier -> [(Extension, Flag)] -> Compiler+compilerFlavor :: Compiler -> CompilerFlavor+compilerId :: Compiler -> PackageIdentifier+compilerExtensions :: Compiler -> [(Extension, Flag)]+instance Read Compiler+instance Show Compiler+showCompilerId :: Compiler -> String+compilerVersion :: Compiler -> Version+data PackageDB+GlobalPackageDB :: PackageDB+UserPackageDB :: PackageDB+SpecificPackageDB :: FilePath -> PackageDB+instance Read PackageDB+instance Show PackageDB+type Flag = String+extensionsToFlags :: Compiler -> [Extension] -> [Flag]+unsupportedExtensions :: Compiler -> [Extension] -> [Extension]++module Distribution.Simple.Utils+die :: String -> IO a+dieWithLocation :: FilePath -> Maybe Int -> String -> IO a+warn :: Verbosity -> String -> IO ()+notice :: Verbosity -> String -> IO ()+info :: Verbosity -> String -> IO ()+debug :: Verbosity -> String -> IO ()+breaks :: (a -> Bool) -> [a] -> [[a]]+wrapText :: Int -> [String] -> [String]+rawSystemExit :: Verbosity -> FilePath -> [String] -> IO ()+rawSystemStdout :: Verbosity -> FilePath -> [String] -> IO String+rawSystemStdout' :: Verbosity -> FilePath -> [String] -> IO (String, ExitCode)+maybeExit :: IO ExitCode -> IO ()+xargs :: Int -> ([String] -> IO ()) -> [String] -> [String] -> IO ()+matchesDescFile :: FilePath -> Bool+rawSystemPathExit :: Verbosity -> String -> [String] -> IO ()+smartCopySources :: Verbosity -> [FilePath] -> FilePath -> [String] -> [String] -> Bool -> Bool -> IO ()+createDirectoryIfMissingVerbose :: Verbosity -> Bool -> FilePath -> IO ()+copyFileVerbose :: Verbosity -> FilePath -> FilePath -> IO ()+copyDirectoryRecursiveVerbose :: Verbosity -> FilePath -> FilePath -> IO ()+moduleToFilePath :: [FilePath] -> String -> [String] -> IO [FilePath]+moduleToFilePath2 :: [FilePath] -> String -> [String] -> IO [(FilePath, FilePath)]+mkLibName :: FilePath -> String -> String+mkProfLibName :: FilePath -> String -> String+mkSharedLibName :: FilePath -> String -> PackageIdentifier -> String+currentDir :: FilePath+dotToSep :: String -> String+findFile :: [FilePath] -> FilePath -> IO FilePath+defaultPackageDesc :: Verbosity -> IO FilePath+findPackageDesc :: Verbosity -> FilePath -> IO FilePath+defaultHookedPackageDesc :: IO (Maybe FilePath)+findHookedPackageDesc :: FilePath -> IO (Maybe FilePath)+exeExtension :: String+objExtension :: String+dllExtension :: String++module Distribution.PackageDescription+data PackageDescription+PackageDescription :: PackageIdentifier -> License -> FilePath -> String -> String -> String -> String -> [(CompilerFlavor, VersionRange)] -> String -> String -> String -> String -> String -> [Dependency] -> VersionRange -> BuildType -> Maybe Library -> [Executable] -> [FilePath] -> [FilePath] -> [FilePath] -> PackageDescription+package :: PackageDescription -> PackageIdentifier+license :: PackageDescription -> License+licenseFile :: PackageDescription -> FilePath+copyright :: PackageDescription -> String+maintainer :: PackageDescription -> String+author :: PackageDescription -> String+stability :: PackageDescription -> String+testedWith :: PackageDescription -> [(CompilerFlavor, VersionRange)]+homepage :: PackageDescription -> String+pkgUrl :: PackageDescription -> String+synopsis :: PackageDescription -> String+description :: PackageDescription -> String+category :: PackageDescription -> String+buildDepends :: PackageDescription -> [Dependency]+descCabalVersion :: PackageDescription -> VersionRange+buildType :: PackageDescription -> BuildType+library :: PackageDescription -> Maybe Library+executables :: PackageDescription -> [Executable]+dataFiles :: PackageDescription -> [FilePath]+extraSrcFiles :: PackageDescription -> [FilePath]+extraTmpFiles :: PackageDescription -> [FilePath]+instance Eq PackageDescription+instance Read PackageDescription+instance Show PackageDescription+data GenericPackageDescription+GenericPackageDescription :: PackageDescription -> [Flag] -> Maybe (CondTree ConfVar [Dependency] Library) -> [(String, CondTree ConfVar [Dependency] Executable)] -> GenericPackageDescription+packageDescription :: GenericPackageDescription -> PackageDescription+genPackageFlags :: GenericPackageDescription -> [Flag]+condLibrary :: GenericPackageDescription -> Maybe (CondTree ConfVar [Dependency] Library)+condExecutables :: GenericPackageDescription -> [(String, CondTree ConfVar [Dependency] Executable)]+instance Show GenericPackageDescription+finalizePackageDescription :: [(String, Bool)] -> Maybe [PackageIdentifier] -> String -> String -> (String, Version) -> GenericPackageDescription -> Either [Dependency] (PackageDescription, [(String, Bool)])+flattenPackageDescription :: GenericPackageDescription -> PackageDescription+emptyPackageDescription :: PackageDescription+readPackageDescription :: Verbosity -> FilePath -> IO GenericPackageDescription+writePackageDescription :: FilePath -> PackageDescription -> IO ()+parsePackageDescription :: String -> ParseResult GenericPackageDescription+showPackageDescription :: PackageDescription -> String+data BuildType+Simple :: BuildType+Configure :: BuildType+Make :: BuildType+Custom :: BuildType+instance Eq BuildType+instance Read BuildType+instance Show BuildType+data Library+Library :: [String] -> BuildInfo -> Library+exposedModules :: Library -> [String]+libBuildInfo :: Library -> BuildInfo+instance Eq Library+instance Monoid Library+instance Read Library+instance Show Library+withLib :: PackageDescription -> a -> (Library -> IO a) -> IO a+hasLibs :: PackageDescription -> Bool+libModules :: PackageDescription -> [String]+data Executable+Executable :: String -> FilePath -> BuildInfo -> Executable+exeName :: Executable -> String+modulePath :: Executable -> FilePath+buildInfo :: Executable -> BuildInfo+instance Eq Executable+instance Monoid Executable+instance Read Executable+instance Show Executable+withExe :: PackageDescription -> (Executable -> IO a) -> IO ()+hasExes :: PackageDescription -> Bool+exeModules :: PackageDescription -> [String]+data FieldDescr a+FieldDescr :: String -> (a -> Doc) -> (LineNo -> String -> a -> ParseResult a) -> FieldDescr a+fieldName :: FieldDescr a -> String+fieldGet :: FieldDescr a -> a -> Doc+fieldSet :: FieldDescr a -> LineNo -> String -> a -> ParseResult a+type LineNo = Int+sanityCheckPackage :: PackageDescription -> IO ([String], [String])+data BuildInfo+BuildInfo :: Bool -> [Dependency] -> [String] -> [String] -> [String] -> [Dependency] -> [String] -> [FilePath] -> [FilePath] -> [String] -> [Extension] -> [String] -> [String] -> [FilePath] -> [FilePath] -> [FilePath] -> [(CompilerFlavor, [String])] -> [String] -> [String] -> BuildInfo+buildable :: BuildInfo -> Bool+buildTools :: BuildInfo -> [Dependency]+cppOptions :: BuildInfo -> [String]+ccOptions :: BuildInfo -> [String]+ldOptions :: BuildInfo -> [String]+pkgconfigDepends :: BuildInfo -> [Dependency]+frameworks :: BuildInfo -> [String]+cSources :: BuildInfo -> [FilePath]+hsSourceDirs :: BuildInfo -> [FilePath]+otherModules :: BuildInfo -> [String]+extensions :: BuildInfo -> [Extension]+extraLibs :: BuildInfo -> [String]+extraLibDirs :: BuildInfo -> [String]+includeDirs :: BuildInfo -> [FilePath]+includes :: BuildInfo -> [FilePath]+installIncludes :: BuildInfo -> [FilePath]+options :: BuildInfo -> [(CompilerFlavor, [String])]+ghcProfOptions :: BuildInfo -> [String]+ghcSharedOptions :: BuildInfo -> [String]+instance Eq BuildInfo+instance Read BuildInfo+instance Show BuildInfo+emptyBuildInfo :: BuildInfo+allBuildInfo :: PackageDescription -> [BuildInfo]+type HookedBuildInfo = (Maybe BuildInfo, [(String, BuildInfo)])+emptyHookedBuildInfo :: HookedBuildInfo+readHookedBuildInfo :: Verbosity -> FilePath -> IO HookedBuildInfo+parseHookedBuildInfo :: String -> ParseResult HookedBuildInfo+writeHookedBuildInfo :: FilePath -> HookedBuildInfo -> IO ()+showHookedBuildInfo :: HookedBuildInfo -> String+updatePackageDescription :: HookedBuildInfo -> PackageDescription -> PackageDescription+satisfyDependency :: [PackageIdentifier] -> Dependency -> Maybe PackageIdentifier+data ParseResult a+ParseFailed :: PError -> ParseResult a+ParseOk :: [PWarning] -> a -> ParseResult a+instance Monad ParseResult+instance Show a => Show (ParseResult a)+hcOptions :: CompilerFlavor -> [(CompilerFlavor, [String])] -> [String]+autogenModuleName :: PackageDescription -> String+haddockName :: PackageDescription -> FilePath+setupMessage :: Verbosity -> String -> PackageDescription -> IO ()+cabalVersion :: Version++module Distribution.Simple.Program+data Program+Program :: String -> (Verbosity -> IO (Maybe FilePath)) -> (Verbosity -> FilePath -> IO (Maybe Version)) -> Program+programName :: Program -> String+programFindLocation :: Program -> Verbosity -> IO (Maybe FilePath)+programFindVersion :: Program -> Verbosity -> FilePath -> IO (Maybe Version)+simpleProgram :: String -> Program+findProgramOnPath :: FilePath -> Verbosity -> IO (Maybe FilePath)+findProgramVersion :: ProgArg -> (String -> String) -> Verbosity -> FilePath -> IO (Maybe Version)+data ConfiguredProgram+ConfiguredProgram :: String -> Maybe Version -> [ProgArg] -> ProgramLocation -> ConfiguredProgram+programId :: ConfiguredProgram -> String+programVersion :: ConfiguredProgram -> Maybe Version+programArgs :: ConfiguredProgram -> [ProgArg]+programLocation :: ConfiguredProgram -> ProgramLocation+instance Read ConfiguredProgram+instance Show ConfiguredProgram+programPath :: ConfiguredProgram -> FilePath+type ProgArg = String+data ProgramLocation+UserSpecified :: FilePath -> ProgramLocation+locationPath :: ProgramLocation -> FilePath+FoundOnSystem :: FilePath -> ProgramLocation+locationPath :: ProgramLocation -> FilePath+instance Read ProgramLocation+instance Show ProgramLocation+rawSystemProgram :: Verbosity -> ConfiguredProgram -> [ProgArg] -> IO ()+rawSystemProgramStdout :: Verbosity -> ConfiguredProgram -> [ProgArg] -> IO String+builtinPrograms :: [Program]+data ProgramConfiguration+instance Read ProgramConfiguration+instance Show ProgramConfiguration+emptyProgramConfiguration :: ProgramConfiguration+defaultProgramConfiguration :: ProgramConfiguration+addKnownProgram :: Program -> ProgramConfiguration -> ProgramConfiguration+lookupKnownProgram :: String -> ProgramConfiguration -> Maybe Program+knownPrograms :: ProgramConfiguration -> [(Program, Maybe ConfiguredProgram)]+userSpecifyPath :: String -> FilePath -> ProgramConfiguration -> ProgramConfiguration+userMaybeSpecifyPath :: String -> Maybe FilePath -> ProgramConfiguration -> ProgramConfiguration+userSpecifyArgs :: String -> [ProgArg] -> ProgramConfiguration -> ProgramConfiguration+lookupProgram :: Program -> ProgramConfiguration -> Maybe ConfiguredProgram+updateProgram :: ConfiguredProgram -> ProgramConfiguration -> ProgramConfiguration+configureAllKnownPrograms :: Verbosity -> ProgramConfiguration -> IO ProgramConfiguration+requireProgram :: Verbosity -> Program -> VersionRange -> ProgramConfiguration -> IO (ConfiguredProgram, ProgramConfiguration)+rawSystemProgramConf :: Verbosity -> Program -> ProgramConfiguration -> [ProgArg] -> IO ()+rawSystemProgramStdoutConf :: Verbosity -> Program -> ProgramConfiguration -> [ProgArg] -> IO String+ghcProgram :: Program+ghcPkgProgram :: Program+nhcProgram :: Program+hmakeProgram :: Program+jhcProgram :: Program+hugsProgram :: Program+ffihugsProgram :: Program+ranlibProgram :: Program+arProgram :: Program+happyProgram :: Program+alexProgram :: Program+hsc2hsProgram :: Program+c2hsProgram :: Program+cpphsProgram :: Program+hscolourProgram :: Program+haddockProgram :: Program+greencardProgram :: Program+ldProgram :: Program+tarProgram :: Program+cppProgram :: Program+pfesetupProgram :: Program+pkgConfigProgram :: Program++module Distribution.Simple.Setup+data Action+ConfigCmd :: ConfigFlags -> Action+BuildCmd :: Action+CleanCmd :: Action+CopyCmd :: CopyDest -> Action+HscolourCmd :: Action+HaddockCmd :: Action+ProgramaticaCmd :: Action+InstallCmd :: Action+SDistCmd :: Action+MakefileCmd :: Action+TestCmd :: Action+RegisterCmd :: Action+UnregisterCmd :: Action+HelpCmd :: Action+instance Show Action+data ConfigFlags+ConfigFlags :: ProgramConfiguration -> Maybe CompilerFlavor -> Maybe FilePath -> Maybe FilePath -> Bool -> Bool -> Bool -> Bool -> [String] -> Bool -> Maybe FilePath -> Maybe FilePath -> Maybe FilePath -> Maybe FilePath -> Maybe FilePath -> Maybe FilePath -> Maybe FilePath -> Maybe FilePath -> Maybe FilePath -> Maybe FilePath -> Verbosity -> PackageDB -> Bool -> Bool -> [(String, Bool)] -> ConfigFlags+configPrograms :: ConfigFlags -> ProgramConfiguration+configHcFlavor :: ConfigFlags -> Maybe CompilerFlavor+configHcPath :: ConfigFlags -> Maybe FilePath+configHcPkg :: ConfigFlags -> Maybe FilePath+configVanillaLib :: ConfigFlags -> Bool+configProfLib :: ConfigFlags -> Bool+configSharedLib :: ConfigFlags -> Bool+configProfExe :: ConfigFlags -> Bool+configConfigureArgs :: ConfigFlags -> [String]+configOptimization :: ConfigFlags -> Bool+configPrefix :: ConfigFlags -> Maybe FilePath+configBinDir :: ConfigFlags -> Maybe FilePath+configLibDir :: ConfigFlags -> Maybe FilePath+configLibSubDir :: ConfigFlags -> Maybe FilePath+configLibExecDir :: ConfigFlags -> Maybe FilePath+configDataDir :: ConfigFlags -> Maybe FilePath+configDataSubDir :: ConfigFlags -> Maybe FilePath+configDocDir :: ConfigFlags -> Maybe FilePath+configHtmlDir :: ConfigFlags -> Maybe FilePath+configInterfaceDir :: ConfigFlags -> Maybe FilePath+configVerbose :: ConfigFlags -> Verbosity+configPackageDB :: ConfigFlags -> PackageDB+configGHCiLib :: ConfigFlags -> Bool+configSplitObjs :: ConfigFlags -> Bool+configConfigurationsFlags :: ConfigFlags -> [(String, Bool)]+instance Show ConfigFlags+emptyConfigFlags :: ProgramConfiguration -> ConfigFlags+configureArgs :: ConfigFlags -> [String]+data CopyFlags+CopyFlags :: CopyDest -> Verbosity -> CopyFlags+copyDest :: CopyFlags -> CopyDest+copyVerbose :: CopyFlags -> Verbosity+instance Show CopyFlags+data CopyDest+NoCopyDest :: CopyDest+CopyTo :: FilePath -> CopyDest+CopyPrefix :: FilePath -> CopyDest+instance Eq CopyDest+instance Show CopyDest+emptyCopyFlags :: CopyDest -> CopyFlags+data InstallFlags+InstallFlags :: Maybe PackageDB -> Verbosity -> InstallFlags+installPackageDB :: InstallFlags -> Maybe PackageDB+installVerbose :: InstallFlags -> Verbosity+instance Show InstallFlags+emptyInstallFlags :: InstallFlags+data HaddockFlags+HaddockFlags :: Bool -> Maybe String -> Bool -> Maybe FilePath -> Bool -> Maybe FilePath -> Verbosity -> HaddockFlags+haddockHoogle :: HaddockFlags -> Bool+haddockHtmlLocation :: HaddockFlags -> Maybe String+haddockExecutables :: HaddockFlags -> Bool+haddockCss :: HaddockFlags -> Maybe FilePath+haddockHscolour :: HaddockFlags -> Bool+haddockHscolourCss :: HaddockFlags -> Maybe FilePath+haddockVerbose :: HaddockFlags -> Verbosity+instance Show HaddockFlags+emptyHaddockFlags :: HaddockFlags+data HscolourFlags+HscolourFlags :: Maybe FilePath -> Bool -> Verbosity -> HscolourFlags+hscolourCSS :: HscolourFlags -> Maybe FilePath+hscolourExecutables :: HscolourFlags -> Bool+hscolourVerbose :: HscolourFlags -> Verbosity+instance Show HscolourFlags+emptyHscolourFlags :: HscolourFlags+data BuildFlags+BuildFlags :: Verbosity -> ProgramConfiguration -> BuildFlags+buildVerbose :: BuildFlags -> Verbosity+buildPrograms :: BuildFlags -> ProgramConfiguration+instance Show BuildFlags+emptyBuildFlags :: ProgramConfiguration -> BuildFlags+data CleanFlags+CleanFlags :: Bool -> Verbosity -> CleanFlags+cleanSaveConf :: CleanFlags -> Bool+cleanVerbose :: CleanFlags -> Verbosity+instance Show CleanFlags+emptyCleanFlags :: CleanFlags+data PFEFlags+PFEFlags :: Verbosity -> PFEFlags+pfeVerbose :: PFEFlags -> Verbosity+instance Show PFEFlags+data MakefileFlags+MakefileFlags :: Verbosity -> Maybe FilePath -> MakefileFlags+makefileVerbose :: MakefileFlags -> Verbosity+makefileFile :: MakefileFlags -> Maybe FilePath+instance Show MakefileFlags+emptyMakefileFlags :: MakefileFlags+data RegisterFlags+RegisterFlags :: Maybe PackageDB -> Bool -> Bool -> Maybe FilePath -> Bool -> Verbosity -> RegisterFlags+regPackageDB :: RegisterFlags -> Maybe PackageDB+regGenScript :: RegisterFlags -> Bool+regGenPkgConf :: RegisterFlags -> Bool+regPkgConfFile :: RegisterFlags -> Maybe FilePath+regInPlace :: RegisterFlags -> Bool+regVerbose :: RegisterFlags -> Verbosity+instance Show RegisterFlags+emptyRegisterFlags :: RegisterFlags+data SDistFlags+SDistFlags :: Bool -> Verbosity -> SDistFlags+sDistSnapshot :: SDistFlags -> Bool+sDistVerbose :: SDistFlags -> Verbosity+instance Show SDistFlags+parseGlobalArgs :: ProgramConfiguration -> [String] -> IO (Action, [String])+parseConfigureArgs :: ProgramConfiguration -> ConfigFlags -> [String] -> [OptDescr a] -> IO (ConfigFlags, [a], [String])+parseBuildArgs :: ProgramConfiguration -> BuildFlags -> [String] -> [OptDescr a] -> IO (BuildFlags, [a], [String])+parseCleanArgs :: CleanFlags -> [String] -> [OptDescr a] -> IO (CleanFlags, [a], [String])+parseMakefileArgs :: MakefileFlags -> [String] -> [OptDescr a] -> IO (MakefileFlags, [a], [String])+parseHscolourArgs :: HscolourFlags -> [String] -> [OptDescr a] -> IO (HscolourFlags, [a], [String])+parseHaddockArgs :: HaddockFlags -> [String] -> [OptDescr a] -> IO (HaddockFlags, [a], [String])+parseProgramaticaArgs :: [String] -> [OptDescr a] -> IO (PFEFlags, [a], [String])+parseTestArgs :: [String] -> [OptDescr a] -> IO (Verbosity, [a], [String])+parseInstallArgs :: InstallFlags -> [String] -> [OptDescr a] -> IO (InstallFlags, [a], [String])+parseSDistArgs :: [String] -> [OptDescr a] -> IO (SDistFlags, [a], [String])+parseRegisterArgs :: RegisterFlags -> [String] -> [OptDescr a] -> IO (RegisterFlags, [a], [String])+parseUnregisterArgs :: RegisterFlags -> [String] -> [OptDescr a] -> IO (RegisterFlags, [a], [String])+parseCopyArgs :: CopyFlags -> [String] -> [OptDescr a] -> IO (CopyFlags, [a], [String])+reqPathArg :: (FilePath -> a) -> ArgDescr a+reqDirArg :: (FilePath -> a) -> ArgDescr a++module Distribution.Make+data License+GPL :: License+LGPL :: License+BSD3 :: License+BSD4 :: License+PublicDomain :: License+AllRightsReserved :: License+OtherLicense :: License+instance Eq License+instance Read License+instance Show License+defaultMain :: IO ()+defaultMainArgs :: [String] -> IO ()+defaultMainNoRead :: PackageDescription -> IO ()++module Distribution.Simple.InstallDirs+data InstallDirs dir+InstallDirs :: dir -> dir -> dir -> dir -> dir -> dir -> dir -> dir -> dir -> dir -> dir -> InstallDirs dir+prefix :: InstallDirs dir -> dir+bindir :: InstallDirs dir -> dir+libdir :: InstallDirs dir -> dir+dynlibdir :: InstallDirs dir -> dir+libexecdir :: InstallDirs dir -> dir+progdir :: InstallDirs dir -> dir+includedir :: InstallDirs dir -> dir+datadir :: InstallDirs dir -> dir+docdir :: InstallDirs dir -> dir+htmldir :: InstallDirs dir -> dir+interfacedir :: InstallDirs dir -> dir+instance Read dir => Read (InstallDirs dir)+instance Show dir => Show (InstallDirs dir)+haddockdir :: InstallDirs FilePath -> PackageDescription -> FilePath+haddockinterfacedir :: InstallDirs FilePath -> PackageDescription -> FilePath+data InstallDirTemplates+InstallDirTemplates :: PathTemplate -> PathTemplate -> PathTemplate -> PathTemplate -> PathTemplate -> PathTemplate -> PathTemplate -> PathTemplate -> PathTemplate -> PathTemplate -> PathTemplate -> PathTemplate -> InstallDirTemplates+prefixDirTemplate :: InstallDirTemplates -> PathTemplate+binDirTemplate :: InstallDirTemplates -> PathTemplate+libDirTemplate :: InstallDirTemplates -> PathTemplate+libSubdirTemplate :: InstallDirTemplates -> PathTemplate+libexecDirTemplate :: InstallDirTemplates -> PathTemplate+progDirTemplate :: InstallDirTemplates -> PathTemplate+includeDirTemplate :: InstallDirTemplates -> PathTemplate+dataDirTemplate :: InstallDirTemplates -> PathTemplate+dataSubdirTemplate :: InstallDirTemplates -> PathTemplate+docDirTemplate :: InstallDirTemplates -> PathTemplate+htmlDirTemplate :: InstallDirTemplates -> PathTemplate+interfaceDirTemplate :: InstallDirTemplates -> PathTemplate+instance Read InstallDirTemplates+instance Show InstallDirTemplates+defaultInstallDirs :: CompilerFlavor -> Bool -> IO InstallDirTemplates+absoluteInstallDirs :: PackageIdentifier -> PackageIdentifier -> CopyDest -> InstallDirTemplates -> InstallDirs FilePath+prefixRelativeInstallDirs :: PackageIdentifier -> PackageIdentifier -> InstallDirTemplates -> InstallDirs (Maybe FilePath)+data PathTemplate+instance Read PathTemplate+instance Show PathTemplate+data PathTemplateVariable+PrefixVar :: PathTemplateVariable+BinDirVar :: PathTemplateVariable+LibDirVar :: PathTemplateVariable+LibSubdirVar :: PathTemplateVariable+DataDirVar :: PathTemplateVariable+DataSubdirVar :: PathTemplateVariable+DocDirVar :: PathTemplateVariable+PkgNameVar :: PathTemplateVariable+PkgVerVar :: PathTemplateVariable+PkgIdVar :: PathTemplateVariable+CompilerVar :: PathTemplateVariable+instance Eq PathTemplateVariable+instance Read PathTemplateVariable+instance Show PathTemplateVariable+toPathTemplate :: FilePath -> PathTemplate+fromPathTemplate :: PathTemplate -> FilePath+substPathTemplate :: [(PathTemplateVariable, PathTemplate)] -> PathTemplate -> PathTemplate+initialPathTemplateEnv :: PackageIdentifier -> PackageIdentifier -> [(PathTemplateVariable, PathTemplate)]++module Distribution.Simple.LocalBuildInfo+data LocalBuildInfo+LocalBuildInfo :: InstallDirTemplates -> Compiler -> FilePath -> FilePath -> [PackageIdentifier] -> Maybe FilePath -> PackageDescription -> ProgramConfiguration -> PackageDB -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> LocalBuildInfo+installDirTemplates :: LocalBuildInfo -> InstallDirTemplates+compiler :: LocalBuildInfo -> Compiler+buildDir :: LocalBuildInfo -> FilePath+scratchDir :: LocalBuildInfo -> FilePath+packageDeps :: LocalBuildInfo -> [PackageIdentifier]+pkgDescrFile :: LocalBuildInfo -> Maybe FilePath+localPkgDescr :: LocalBuildInfo -> PackageDescription+withPrograms :: LocalBuildInfo -> ProgramConfiguration+withPackageDB :: LocalBuildInfo -> PackageDB+withVanillaLib :: LocalBuildInfo -> Bool+withProfLib :: LocalBuildInfo -> Bool+withSharedLib :: LocalBuildInfo -> Bool+withProfExe :: LocalBuildInfo -> Bool+withOptimization :: LocalBuildInfo -> Bool+withGHCiLib :: LocalBuildInfo -> Bool+splitObjs :: LocalBuildInfo -> Bool+instance Read LocalBuildInfo+instance Show LocalBuildInfo+absoluteInstallDirs :: PackageDescription -> LocalBuildInfo -> CopyDest -> InstallDirs FilePath+prefixRelativeInstallDirs :: PackageDescription -> LocalBuildInfo -> InstallDirs (Maybe FilePath)+mkLibDir :: PackageDescription -> LocalBuildInfo -> CopyDest -> FilePath+mkBinDir :: PackageDescription -> LocalBuildInfo -> CopyDest -> FilePath+mkLibexecDir :: PackageDescription -> LocalBuildInfo -> CopyDest -> FilePath+mkDataDir :: PackageDescription -> LocalBuildInfo -> CopyDest -> FilePath+distPref :: FilePath+srcPref :: FilePath+hscolourPref :: PackageDescription -> FilePath+haddockPref :: PackageDescription -> FilePath+autogenModulesDir :: LocalBuildInfo -> String++module Distribution.Simple.GHC.PackageConfig+data GHCPackageConfig+GHCPackage :: String -> Bool -> [String] -> [String] -> [String] -> [String] -> [String] -> [String] -> [String] -> [String] -> [String] -> [String] -> [String] -> [String] -> [String] -> GHCPackageConfig+name :: GHCPackageConfig -> String+auto :: GHCPackageConfig -> Bool+import_dirs :: GHCPackageConfig -> [String]+source_dirs :: GHCPackageConfig -> [String]+library_dirs :: GHCPackageConfig -> [String]+hs_libraries :: GHCPackageConfig -> [String]+extra_libraries :: GHCPackageConfig -> [String]+include_dirs :: GHCPackageConfig -> [String]+c_includes :: GHCPackageConfig -> [String]+package_deps :: GHCPackageConfig -> [String]+extra_ghc_opts :: GHCPackageConfig -> [String]+extra_cc_opts :: GHCPackageConfig -> [String]+extra_ld_opts :: GHCPackageConfig -> [String]+framework_dirs :: GHCPackageConfig -> [String]+extra_frameworks :: GHCPackageConfig -> [String]+mkGHCPackageConfig :: PackageDescription -> LocalBuildInfo -> GHCPackageConfig+defaultGHCPackageConfig :: GHCPackageConfig+showGHCPackageConfig :: GHCPackageConfig -> String+localPackageConfig :: IO FilePath+maybeCreateLocalPackageConfig :: IO Bool+canWriteLocalPackageConfig :: IO Bool+canReadLocalPackageConfig :: IO Bool++module Distribution.Simple.GHC+configure :: Verbosity -> Maybe FilePath -> Maybe FilePath -> ProgramConfiguration -> IO (Compiler, ProgramConfiguration)+getInstalledPackages :: Verbosity -> PackageDB -> ProgramConfiguration -> IO [PackageIdentifier]+build :: PackageDescription -> LocalBuildInfo -> Verbosity -> IO ()+makefile :: PackageDescription -> LocalBuildInfo -> MakefileFlags -> IO ()+installLib :: Verbosity -> LocalBuildInfo -> FilePath -> FilePath -> FilePath -> PackageDescription -> IO ()+installExe :: Verbosity -> FilePath -> FilePath -> PackageDescription -> IO ()+ghcVerbosityOptions :: Verbosity -> [String]++module Distribution.Simple.JHC+configure :: Verbosity -> Maybe FilePath -> Maybe FilePath -> ProgramConfiguration -> IO (Compiler, ProgramConfiguration)+getInstalledPackages :: Verbosity -> PackageDB -> ProgramConfiguration -> IO [PackageIdentifier]+build :: PackageDescription -> LocalBuildInfo -> Verbosity -> IO ()+installLib :: Verbosity -> FilePath -> FilePath -> PackageDescription -> Library -> IO ()+installExe :: Verbosity -> FilePath -> FilePath -> PackageDescription -> Executable -> IO ()++module Distribution.Simple.NHC+configure :: Verbosity -> Maybe FilePath -> Maybe FilePath -> ProgramConfiguration -> IO (Compiler, ProgramConfiguration)+build :: PackageDescription -> LocalBuildInfo -> Verbosity -> IO ()++module Distribution.Simple.PreProcess+preprocessSources :: PackageDescription -> LocalBuildInfo -> Bool -> Verbosity -> [PPSuffixHandler] -> IO ()+knownSuffixHandlers :: [PPSuffixHandler]+ppSuffixes :: [PPSuffixHandler] -> [String]+type PPSuffixHandler = (String, BuildInfo -> LocalBuildInfo -> PreProcessor)+data PreProcessor+PreProcessor :: Bool -> ((FilePath, FilePath) -> (FilePath, FilePath) -> Verbosity -> IO ()) -> PreProcessor+platformIndependent :: PreProcessor -> Bool+runPreProcessor :: PreProcessor -> (FilePath, FilePath) -> (FilePath, FilePath) -> Verbosity -> IO ()+mkSimplePreProcessor :: (FilePath -> FilePath -> Verbosity -> IO ()) -> (FilePath, FilePath) -> (FilePath, FilePath) -> Verbosity -> IO ()+runSimplePreProcessor :: PreProcessor -> FilePath -> FilePath -> Verbosity -> IO ()+removePreprocessed :: [FilePath] -> [String] -> [String] -> IO ()+removePreprocessedPackage :: PackageDescription -> FilePath -> [String] -> IO ()+ppCpp :: BuildInfo -> LocalBuildInfo -> PreProcessor+ppCpp' :: [String] -> BuildInfo -> LocalBuildInfo -> PreProcessor+ppGreenCard :: BuildInfo -> LocalBuildInfo -> PreProcessor+ppC2hs :: BuildInfo -> LocalBuildInfo -> PreProcessor+ppHsc2hs :: BuildInfo -> LocalBuildInfo -> PreProcessor+ppHappy :: BuildInfo -> LocalBuildInfo -> PreProcessor+ppAlex :: BuildInfo -> LocalBuildInfo -> PreProcessor+ppUnlit :: PreProcessor++module Distribution.Simple.Haddock+haddock :: PackageDescription -> LocalBuildInfo -> [PPSuffixHandler] -> HaddockFlags -> IO ()+hscolour :: PackageDescription -> LocalBuildInfo -> [PPSuffixHandler] -> HscolourFlags -> IO ()++module Distribution.Simple.Hugs+configure :: Verbosity -> Maybe FilePath -> Maybe FilePath -> ProgramConfiguration -> IO (Compiler, ProgramConfiguration)+build :: PackageDescription -> LocalBuildInfo -> Verbosity -> IO ()+install :: Verbosity -> FilePath -> FilePath -> FilePath -> FilePath -> FilePath -> PackageDescription -> IO ()++module Distribution.Simple.Install+install :: PackageDescription -> LocalBuildInfo -> CopyFlags -> IO ()++module Distribution.Simple.Register+register :: PackageDescription -> LocalBuildInfo -> RegisterFlags -> IO ()+unregister :: PackageDescription -> LocalBuildInfo -> RegisterFlags -> IO ()+writeInstalledConfig :: PackageDescription -> LocalBuildInfo -> Bool -> Maybe FilePath -> IO ()+removeInstalledConfig :: IO ()+removeRegScripts :: IO ()++module Distribution.Simple.Configure+configure :: (Either GenericPackageDescription PackageDescription, HookedBuildInfo) -> ConfigFlags -> IO LocalBuildInfo+writePersistBuildConfig :: LocalBuildInfo -> IO ()+getPersistBuildConfig :: IO LocalBuildInfo+checkPersistBuildConfig :: FilePath -> IO ()+maybeGetPersistBuildConfig :: IO (Maybe LocalBuildInfo)+localBuildInfoFile :: FilePath+getInstalledPackages :: Verbosity -> Compiler -> PackageDB -> ProgramConfiguration -> IO (Maybe [PackageIdentifier])+configDependency :: Verbosity -> [PackageIdentifier] -> Dependency -> IO PackageIdentifier+configCompiler :: Maybe CompilerFlavor -> Maybe FilePath -> Maybe FilePath -> ProgramConfiguration -> Verbosity -> IO (Compiler, ProgramConfiguration)+configCompilerAux :: ConfigFlags -> IO (Compiler, ProgramConfiguration)++module Distribution.Simple.Build+build :: PackageDescription -> LocalBuildInfo -> BuildFlags -> [PPSuffixHandler] -> IO ()+makefile :: PackageDescription -> LocalBuildInfo -> MakefileFlags -> [PPSuffixHandler] -> IO ()++module Distribution.Simple.SrcDist+sdist :: PackageDescription -> Maybe LocalBuildInfo -> SDistFlags -> FilePath -> FilePath -> [PPSuffixHandler] -> IO ()+createArchive :: PackageDescription -> Verbosity -> Maybe LocalBuildInfo -> FilePath -> FilePath -> IO FilePath+prepareTree :: PackageDescription -> Verbosity -> Maybe LocalBuildInfo -> Bool -> FilePath -> [PPSuffixHandler] -> Int -> IO FilePath+tarBallName :: PackageDescription -> FilePath+copyFileTo :: Verbosity -> FilePath -> FilePath -> IO ()++module Distribution.Simple+defaultMain :: IO ()+defaultMainNoRead :: PackageDescription -> IO ()+defaultMainArgs :: [String] -> IO ()+data UserHooks+UserHooks :: (Args -> Bool -> PackageDescription -> LocalBuildInfo -> IO ()) -> IO (Maybe PackageDescription) -> [PPSuffixHandler] -> [Program] -> (Args -> ConfigFlags -> IO HookedBuildInfo) -> ((Either GenericPackageDescription PackageDescription, HookedBuildInfo) -> ConfigFlags -> IO LocalBuildInfo) -> (Args -> ConfigFlags -> PackageDescription -> LocalBuildInfo -> IO ()) -> (Args -> BuildFlags -> IO HookedBuildInfo) -> (PackageDescription -> LocalBuildInfo -> UserHooks -> BuildFlags -> IO ()) -> (Args -> BuildFlags -> PackageDescription -> LocalBuildInfo -> IO ()) -> (Args -> MakefileFlags -> IO HookedBuildInfo) -> (PackageDescription -> LocalBuildInfo -> UserHooks -> MakefileFlags -> IO ()) -> (Args -> MakefileFlags -> PackageDescription -> LocalBuildInfo -> IO ()) -> (Args -> CleanFlags -> IO HookedBuildInfo) -> (PackageDescription -> Maybe LocalBuildInfo -> UserHooks -> CleanFlags -> IO ()) -> (Args -> CleanFlags -> PackageDescription -> Maybe LocalBuildInfo -> IO ()) -> (Args -> CopyFlags -> IO HookedBuildInfo) -> (PackageDescription -> LocalBuildInfo -> UserHooks -> CopyFlags -> IO ()) -> (Args -> CopyFlags -> PackageDescription -> LocalBuildInfo -> IO ()) -> (Args -> InstallFlags -> IO HookedBuildInfo) -> (PackageDescription -> LocalBuildInfo -> UserHooks -> InstallFlags -> IO ()) -> (Args -> InstallFlags -> PackageDescription -> LocalBuildInfo -> IO ()) -> (Args -> SDistFlags -> IO HookedBuildInfo) -> (PackageDescription -> Maybe LocalBuildInfo -> UserHooks -> SDistFlags -> IO ()) -> (Args -> SDistFlags -> PackageDescription -> Maybe LocalBuildInfo -> IO ()) -> (Args -> RegisterFlags -> IO HookedBuildInfo) -> (PackageDescription -> LocalBuildInfo -> UserHooks -> RegisterFlags -> IO ()) -> (Args -> RegisterFlags -> PackageDescription -> LocalBuildInfo -> IO ()) -> (Args -> RegisterFlags -> IO HookedBuildInfo) -> (PackageDescription -> LocalBuildInfo -> UserHooks -> RegisterFlags -> IO ()) -> (Args -> RegisterFlags -> PackageDescription -> LocalBuildInfo -> IO ()) -> (Args -> HscolourFlags -> IO HookedBuildInfo) -> (PackageDescription -> LocalBuildInfo -> UserHooks -> HscolourFlags -> IO ()) -> (Args -> HscolourFlags -> PackageDescription -> LocalBuildInfo -> IO ()) -> (Args -> HaddockFlags -> IO HookedBuildInfo) -> (PackageDescription -> LocalBuildInfo -> UserHooks -> HaddockFlags -> IO ()) -> (Args -> HaddockFlags -> PackageDescription -> LocalBuildInfo -> IO ()) -> (Args -> PFEFlags -> IO HookedBuildInfo) -> (PackageDescription -> LocalBuildInfo -> UserHooks -> PFEFlags -> IO ()) -> (Args -> PFEFlags -> PackageDescription -> LocalBuildInfo -> IO ()) -> UserHooks+runTests :: UserHooks -> Args -> Bool -> PackageDescription -> LocalBuildInfo -> IO ()+readDesc :: UserHooks -> IO (Maybe PackageDescription)+hookedPreProcessors :: UserHooks -> [PPSuffixHandler]+hookedPrograms :: UserHooks -> [Program]+preConf :: UserHooks -> Args -> ConfigFlags -> IO HookedBuildInfo+confHook :: UserHooks -> (Either GenericPackageDescription PackageDescription, HookedBuildInfo) -> ConfigFlags -> IO LocalBuildInfo+postConf :: UserHooks -> Args -> ConfigFlags -> PackageDescription -> LocalBuildInfo -> IO ()+preBuild :: UserHooks -> Args -> BuildFlags -> IO HookedBuildInfo+buildHook :: UserHooks -> PackageDescription -> LocalBuildInfo -> UserHooks -> BuildFlags -> IO ()+postBuild :: UserHooks -> Args -> BuildFlags -> PackageDescription -> LocalBuildInfo -> IO ()+preMakefile :: UserHooks -> Args -> MakefileFlags -> IO HookedBuildInfo+makefileHook :: UserHooks -> PackageDescription -> LocalBuildInfo -> UserHooks -> MakefileFlags -> IO ()+postMakefile :: UserHooks -> Args -> MakefileFlags -> PackageDescription -> LocalBuildInfo -> IO ()+preClean :: UserHooks -> Args -> CleanFlags -> IO HookedBuildInfo+cleanHook :: UserHooks -> PackageDescription -> Maybe LocalBuildInfo -> UserHooks -> CleanFlags -> IO ()+postClean :: UserHooks -> Args -> CleanFlags -> PackageDescription -> Maybe LocalBuildInfo -> IO ()+preCopy :: UserHooks -> Args -> CopyFlags -> IO HookedBuildInfo+copyHook :: UserHooks -> PackageDescription -> LocalBuildInfo -> UserHooks -> CopyFlags -> IO ()+postCopy :: UserHooks -> Args -> CopyFlags -> PackageDescription -> LocalBuildInfo -> IO ()+preInst :: UserHooks -> Args -> InstallFlags -> IO HookedBuildInfo+instHook :: UserHooks -> PackageDescription -> LocalBuildInfo -> UserHooks -> InstallFlags -> IO ()+postInst :: UserHooks -> Args -> InstallFlags -> PackageDescription -> LocalBuildInfo -> IO ()+preSDist :: UserHooks -> Args -> SDistFlags -> IO HookedBuildInfo+sDistHook :: UserHooks -> PackageDescription -> Maybe LocalBuildInfo -> UserHooks -> SDistFlags -> IO ()+postSDist :: UserHooks -> Args -> SDistFlags -> PackageDescription -> Maybe LocalBuildInfo -> IO ()+preReg :: UserHooks -> Args -> RegisterFlags -> IO HookedBuildInfo+regHook :: UserHooks -> PackageDescription -> LocalBuildInfo -> UserHooks -> RegisterFlags -> IO ()+postReg :: UserHooks -> Args -> RegisterFlags -> PackageDescription -> LocalBuildInfo -> IO ()+preUnreg :: UserHooks -> Args -> RegisterFlags -> IO HookedBuildInfo+unregHook :: UserHooks -> PackageDescription -> LocalBuildInfo -> UserHooks -> RegisterFlags -> IO ()+postUnreg :: UserHooks -> Args -> RegisterFlags -> PackageDescription -> LocalBuildInfo -> IO ()+preHscolour :: UserHooks -> Args -> HscolourFlags -> IO HookedBuildInfo+hscolourHook :: UserHooks -> PackageDescription -> LocalBuildInfo -> UserHooks -> HscolourFlags -> IO ()+postHscolour :: UserHooks -> Args -> HscolourFlags -> PackageDescription -> LocalBuildInfo -> IO ()+preHaddock :: UserHooks -> Args -> HaddockFlags -> IO HookedBuildInfo+haddockHook :: UserHooks -> PackageDescription -> LocalBuildInfo -> UserHooks -> HaddockFlags -> IO ()+postHaddock :: UserHooks -> Args -> HaddockFlags -> PackageDescription -> LocalBuildInfo -> IO ()+prePFE :: UserHooks -> Args -> PFEFlags -> IO HookedBuildInfo+pfeHook :: UserHooks -> PackageDescription -> LocalBuildInfo -> UserHooks -> PFEFlags -> IO ()+postPFE :: UserHooks -> Args -> PFEFlags -> PackageDescription -> LocalBuildInfo -> IO ()+type Args = [String]+defaultMainWithHooks :: UserHooks -> IO ()+defaultMainWithHooksArgs :: UserHooks -> [String] -> IO ()+simpleUserHooks :: UserHooks+defaultUserHooks :: UserHooks+emptyUserHooks :: UserHooks+defaultHookedPackageDesc :: IO (Maybe FilePath)++module Distribution.Simple.SetupWrapper+setupWrapper :: [String] -> Maybe FilePath -> IO ()+-- Hoogle documentation, generated by Haddock+-- See Hoogle, http://www.haskell.org/hoogle/++module Data.Set+data Set a+instance Foldable Set+instance Typeable1 Set+instance (Data a, Ord a) => Data (Set a)+instance Eq a => Eq (Set a)+instance Ord a => Monoid (Set a)+instance Ord a => Ord (Set a)+instance (Read a, Ord a) => Read (Set a)+instance Show a => Show (Set a)+(\\) :: Ord a => Set a -> Set a -> Set a+null :: Set a -> Bool+size :: Set a -> Int+member :: Ord a => a -> Set a -> Bool+notMember :: Ord a => a -> Set a -> Bool+isSubsetOf :: Ord a => Set a -> Set a -> Bool+isProperSubsetOf :: Ord a => Set a -> Set a -> Bool+empty :: Set a+singleton :: a -> Set a+insert :: Ord a => a -> Set a -> Set a+delete :: Ord a => a -> Set a -> Set a+union :: Ord a => Set a -> Set a -> Set a+unions :: Ord a => [Set a] -> Set a+difference :: Ord a => Set a -> Set a -> Set a+intersection :: Ord a => Set a -> Set a -> Set a+filter :: Ord a => (a -> Bool) -> Set a -> Set a+partition :: Ord a => (a -> Bool) -> Set a -> (Set a, Set a)+split :: Ord a => a -> Set a -> (Set a, Set a)+splitMember :: Ord a => a -> Set a -> (Set a, Bool, Set a)+map :: (Ord a, Ord b) => (a -> b) -> Set a -> Set b+mapMonotonic :: (a -> b) -> Set a -> Set b+fold :: (a -> b -> b) -> b -> Set a -> b+findMin :: Set a -> a+findMax :: Set a -> a+deleteMin :: Set a -> Set a+deleteMax :: Set a -> Set a+deleteFindMin :: Set a -> (a, Set a)+deleteFindMax :: Set a -> (a, Set a)+maxView :: Monad m => Set a -> m (a, Set a)+minView :: Monad m => Set a -> m (a, Set a)+elems :: Set a -> [a]+toList :: Set a -> [a]+fromList :: Ord a => [a] -> Set a+toAscList :: Set a -> [a]+fromAscList :: Eq a => [a] -> Set a+fromDistinctAscList :: [a] -> Set a+showTree :: Show a => Set a -> String+showTreeWith :: Show a => Bool -> Bool -> Set a -> String+valid :: Ord a => Set a -> Bool++module Data.Sequence+data Seq a+instance Foldable Seq+instance Functor Seq+instance Monad Seq+instance MonadPlus Seq+instance Traversable Seq+instance Typeable1 Seq+instance Data a => Data (Seq a)+instance Eq a => Eq (Seq a)+instance Monoid (Seq a)+instance Ord a => Ord (Seq a)+instance Read a => Read (Seq a)+instance Show a => Show (Seq a)+empty :: Seq a+singleton :: a -> Seq a+(<|) :: a -> Seq a -> Seq a+(|>) :: Seq a -> a -> Seq a+(><) :: Seq a -> Seq a -> Seq a+fromList :: [a] -> Seq a+null :: Seq a -> Bool+length :: Seq a -> Int+data ViewL a+EmptyL :: ViewL a+(:<) :: a -> Seq a -> ViewL a+instance Foldable ViewL+instance Functor ViewL+instance Traversable ViewL+instance Typeable1 ViewL+instance Data a => Data (ViewL a)+instance Eq a => Eq (ViewL a)+instance Ord a => Ord (ViewL a)+instance Read a => Read (ViewL a)+instance Show a => Show (ViewL a)+viewl :: Seq a -> ViewL a+data ViewR a+EmptyR :: ViewR a+(:>) :: Seq a -> a -> ViewR a+instance Foldable ViewR+instance Functor ViewR+instance Traversable ViewR+instance Typeable1 ViewR+instance Data a => Data (ViewR a)+instance Eq a => Eq (ViewR a)+instance Ord a => Ord (ViewR a)+instance Read a => Read (ViewR a)+instance Show a => Show (ViewR a)+viewr :: Seq a -> ViewR a+index :: Seq a -> Int -> a+adjust :: (a -> a) -> Int -> Seq a -> Seq a+update :: Int -> a -> Seq a -> Seq a+take :: Int -> Seq a -> Seq a+drop :: Int -> Seq a -> Seq a+splitAt :: Int -> Seq a -> (Seq a, Seq a)+reverse :: Seq a -> Seq a++module Data.Tree+data Tree a+Node :: a -> Forest a -> Tree a+rootLabel :: Tree a -> a+subForest :: Tree a -> Forest a+instance Applicative Tree+instance Foldable Tree+instance Functor Tree+instance Monad Tree+instance Traversable Tree+instance Typeable1 Tree+instance Data a => Data (Tree a)+instance Eq a => Eq (Tree a)+instance Read a => Read (Tree a)+instance Show a => Show (Tree a)+type Forest a = [Tree a]+drawTree :: Tree String -> String+drawForest :: Forest String -> String+flatten :: Tree a -> [a]+levels :: Tree a -> [[a]]+unfoldTree :: (b -> (a, [b])) -> b -> Tree a+unfoldForest :: (b -> (a, [b])) -> [b] -> Forest a+unfoldTreeM :: Monad m => (b -> m (a, [b])) -> b -> m (Tree a)+unfoldForestM :: Monad m => (b -> m (a, [b])) -> [b] -> m (Forest a)+unfoldTreeM_BF :: Monad m => (b -> m (a, [b])) -> b -> m (Tree a)+unfoldForestM_BF :: Monad m => (b -> m (a, [b])) -> [b] -> m (Forest a)++module Data.Map+data Map k a+instance Typeable2 Map+instance Foldable (Map k)+instance Functor (Map k)+instance Traversable (Map k)+instance (Data k, Data a, Ord k) => Data (Map k a)+instance (Eq k, Eq a) => Eq (Map k a)+instance Ord k => Monoid (Map k v)+instance (Ord k, Ord v) => Ord (Map k v)+instance (Ord k, Read k, Read e) => Read (Map k e)+instance (Show k, Show a) => Show (Map k a)+(!) :: Ord k => Map k a -> k -> a+(\\) :: Ord k => Map k a -> Map k b -> Map k a+null :: Map k a -> Bool+size :: Map k a -> Int+member :: Ord k => k -> Map k a -> Bool+notMember :: Ord k => k -> Map k a -> Bool+lookup :: (Monad m, Ord k) => k -> Map k a -> m a+findWithDefault :: Ord k => a -> k -> Map k a -> a+empty :: Map k a+singleton :: k -> a -> Map k a+insert :: Ord k => k -> a -> Map k a -> Map k a+insertWith :: Ord k => (a -> a -> a) -> k -> a -> Map k a -> Map k a+insertWithKey :: Ord k => (k -> a -> a -> a) -> k -> a -> Map k a -> Map k a+insertLookupWithKey :: Ord k => (k -> a -> a -> a) -> k -> a -> Map k a -> (Maybe a, Map k a)+insertWith' :: Ord k => (a -> a -> a) -> k -> a -> Map k a -> Map k a+insertWithKey' :: Ord k => (k -> a -> a -> a) -> k -> a -> Map k a -> Map k a+delete :: Ord k => k -> Map k a -> Map k a+adjust :: Ord k => (a -> a) -> k -> Map k a -> Map k a+adjustWithKey :: Ord k => (k -> a -> a) -> k -> Map k a -> Map k a+update :: Ord k => (a -> Maybe a) -> k -> Map k a -> Map k a+updateWithKey :: Ord k => (k -> a -> Maybe a) -> k -> Map k a -> Map k a+updateLookupWithKey :: Ord k => (k -> a -> Maybe a) -> k -> Map k a -> (Maybe a, Map k a)+alter :: Ord k => (Maybe a -> Maybe a) -> k -> Map k a -> Map k a+union :: Ord k => Map k a -> Map k a -> Map k a+unionWith :: Ord k => (a -> a -> a) -> Map k a -> Map k a -> Map k a+unionWithKey :: Ord k => (k -> a -> a -> a) -> Map k a -> Map k a -> Map k a+unions :: Ord k => [Map k a] -> Map k a+unionsWith :: Ord k => (a -> a -> a) -> [Map k a] -> Map k a+difference :: Ord k => Map k a -> Map k b -> Map k a+differenceWith :: Ord k => (a -> b -> Maybe a) -> Map k a -> Map k b -> Map k a+differenceWithKey :: Ord k => (k -> a -> b -> Maybe a) -> Map k a -> Map k b -> Map k a+intersection :: Ord k => Map k a -> Map k b -> Map k a+intersectionWith :: Ord k => (a -> b -> c) -> Map k a -> Map k b -> Map k c+intersectionWithKey :: Ord k => (k -> a -> b -> c) -> Map k a -> Map k b -> Map k c+map :: (a -> b) -> Map k a -> Map k b+mapWithKey :: (k -> a -> b) -> Map k a -> Map k b+mapAccum :: (a -> b -> (a, c)) -> a -> Map k b -> (a, Map k c)+mapAccumWithKey :: (a -> k -> b -> (a, c)) -> a -> Map k b -> (a, Map k c)+mapKeys :: Ord k2 => (k1 -> k2) -> Map k1 a -> Map k2 a+mapKeysWith :: Ord k2 => (a -> a -> a) -> (k1 -> k2) -> Map k1 a -> Map k2 a+mapKeysMonotonic :: (k1 -> k2) -> Map k1 a -> Map k2 a+fold :: (a -> b -> b) -> b -> Map k a -> b+foldWithKey :: (k -> a -> b -> b) -> b -> Map k a -> b+elems :: Map k a -> [a]+keys :: Map k a -> [k]+keysSet :: Map k a -> Set k+assocs :: Map k a -> [(k, a)]+toList :: Map k a -> [(k, a)]+fromList :: Ord k => [(k, a)] -> Map k a+fromListWith :: Ord k => (a -> a -> a) -> [(k, a)] -> Map k a+fromListWithKey :: Ord k => (k -> a -> a -> a) -> [(k, a)] -> Map k a+toAscList :: Map k a -> [(k, a)]+fromAscList :: Eq k => [(k, a)] -> Map k a+fromAscListWith :: Eq k => (a -> a -> a) -> [(k, a)] -> Map k a+fromAscListWithKey :: Eq k => (k -> a -> a -> a) -> [(k, a)] -> Map k a+fromDistinctAscList :: [(k, a)] -> Map k a+filter :: Ord k => (a -> Bool) -> Map k a -> Map k a+filterWithKey :: Ord k => (k -> a -> Bool) -> Map k a -> Map k a+partition :: Ord k => (a -> Bool) -> Map k a -> (Map k a, Map k a)+partitionWithKey :: Ord k => (k -> a -> Bool) -> Map k a -> (Map k a, Map k a)+mapMaybe :: Ord k => (a -> Maybe b) -> Map k a -> Map k b+mapMaybeWithKey :: Ord k => (k -> a -> Maybe b) -> Map k a -> Map k b+mapEither :: Ord k => (a -> Either b c) -> Map k a -> (Map k b, Map k c)+mapEitherWithKey :: Ord k => (k -> a -> Either b c) -> Map k a -> (Map k b, Map k c)+split :: Ord k => k -> Map k a -> (Map k a, Map k a)+splitLookup :: Ord k => k -> Map k a -> (Map k a, Maybe a, Map k a)+isSubmapOf :: (Ord k, Eq a) => Map k a -> Map k a -> Bool+isSubmapOfBy :: Ord k => (a -> b -> Bool) -> Map k a -> Map k b -> Bool+isProperSubmapOf :: (Ord k, Eq a) => Map k a -> Map k a -> Bool+isProperSubmapOfBy :: Ord k => (a -> b -> Bool) -> Map k a -> Map k b -> Bool+lookupIndex :: (Monad m, Ord k) => k -> Map k a -> m Int+findIndex :: Ord k => k -> Map k a -> Int+elemAt :: Int -> Map k a -> (k, a)+updateAt :: (k -> a -> Maybe a) -> Int -> Map k a -> Map k a+deleteAt :: Int -> Map k a -> Map k a+findMin :: Map k a -> (k, a)+findMax :: Map k a -> (k, a)+deleteMin :: Map k a -> Map k a+deleteMax :: Map k a -> Map k a+deleteFindMin :: Map k a -> ((k, a), Map k a)+deleteFindMax :: Map k a -> ((k, a), Map k a)+updateMin :: (a -> Maybe a) -> Map k a -> Map k a+updateMax :: (a -> Maybe a) -> Map k a -> Map k a+updateMinWithKey :: (k -> a -> Maybe a) -> Map k a -> Map k a+updateMaxWithKey :: (k -> a -> Maybe a) -> Map k a -> Map k a+minView :: Monad m => Map k a -> m (a, Map k a)+maxView :: Monad m => Map k a -> m (a, Map k a)+minViewWithKey :: Monad m => Map k a -> m ((k, a), Map k a)+maxViewWithKey :: Monad m => Map k a -> m ((k, a), Map k a)+showTree :: (Show k, Show a) => Map k a -> String+showTreeWith :: (k -> a -> String) -> Bool -> Bool -> Map k a -> String+valid :: Ord k => Map k a -> Bool++module Data.IntSet+data IntSet+instance Data IntSet+instance Eq IntSet+instance Monoid IntSet+instance Ord IntSet+instance Read IntSet+instance Show IntSet+instance Typeable IntSet+(\\) :: IntSet -> IntSet -> IntSet+null :: IntSet -> Bool+size :: IntSet -> Int+member :: Int -> IntSet -> Bool+notMember :: Int -> IntSet -> Bool+isSubsetOf :: IntSet -> IntSet -> Bool+isProperSubsetOf :: IntSet -> IntSet -> Bool+empty :: IntSet+singleton :: Int -> IntSet+insert :: Int -> IntSet -> IntSet+delete :: Int -> IntSet -> IntSet+union :: IntSet -> IntSet -> IntSet+unions :: [IntSet] -> IntSet+difference :: IntSet -> IntSet -> IntSet+intersection :: IntSet -> IntSet -> IntSet+filter :: (Int -> Bool) -> IntSet -> IntSet+partition :: (Int -> Bool) -> IntSet -> (IntSet, IntSet)+split :: Int -> IntSet -> (IntSet, IntSet)+splitMember :: Int -> IntSet -> (IntSet, Bool, IntSet)+findMin :: IntSet -> Int+findMax :: IntSet -> Int+deleteMin :: IntSet -> IntSet+deleteMax :: IntSet -> IntSet+deleteFindMin :: IntSet -> (Int, IntSet)+deleteFindMax :: IntSet -> (Int, IntSet)+maxView :: Monad m => IntSet -> m (Int, IntSet)+minView :: Monad m => IntSet -> m (Int, IntSet)+map :: (Int -> Int) -> IntSet -> IntSet+fold :: (Int -> b -> b) -> b -> IntSet -> b+elems :: IntSet -> [Int]+toList :: IntSet -> [Int]+fromList :: [Int] -> IntSet+toAscList :: IntSet -> [Int]+fromAscList :: [Int] -> IntSet+fromDistinctAscList :: [Int] -> IntSet+showTree :: IntSet -> String+showTreeWith :: Bool -> Bool -> IntSet -> String++module Data.IntMap+data IntMap a+instance Foldable IntMap+instance Functor IntMap+instance Typeable1 IntMap+instance Data a => Data (IntMap a)+instance Eq a => Eq (IntMap a)+instance Monoid (IntMap a)+instance Ord a => Ord (IntMap a)+instance Read e => Read (IntMap e)+instance Show a => Show (IntMap a)+type Key = Int+(!) :: IntMap a -> Key -> a+(\\) :: IntMap a -> IntMap b -> IntMap a+null :: IntMap a -> Bool+size :: IntMap a -> Int+member :: Key -> IntMap a -> Bool+notMember :: Key -> IntMap a -> Bool+lookup :: Monad m => Key -> IntMap a -> m a+findWithDefault :: a -> Key -> IntMap a -> a+empty :: IntMap a+singleton :: Key -> a -> IntMap a+insert :: Key -> a -> IntMap a -> IntMap a+insertWith :: (a -> a -> a) -> Key -> a -> IntMap a -> IntMap a+insertWithKey :: (Key -> a -> a -> a) -> Key -> a -> IntMap a -> IntMap a+insertLookupWithKey :: (Key -> a -> a -> a) -> Key -> a -> IntMap a -> (Maybe a, IntMap a)+delete :: Key -> IntMap a -> IntMap a+adjust :: (a -> a) -> Key -> IntMap a -> IntMap a+adjustWithKey :: (Key -> a -> a) -> Key -> IntMap a -> IntMap a+update :: (a -> Maybe a) -> Key -> IntMap a -> IntMap a+updateWithKey :: (Key -> a -> Maybe a) -> Key -> IntMap a -> IntMap a+updateLookupWithKey :: (Key -> a -> Maybe a) -> Key -> IntMap a -> (Maybe a, IntMap a)+union :: IntMap a -> IntMap a -> IntMap a+unionWith :: (a -> a -> a) -> IntMap a -> IntMap a -> IntMap a+unionWithKey :: (Key -> a -> a -> a) -> IntMap a -> IntMap a -> IntMap a+unions :: [IntMap a] -> IntMap a+unionsWith :: (a -> a -> a) -> [IntMap a] -> IntMap a+difference :: IntMap a -> IntMap b -> IntMap a+differenceWith :: (a -> b -> Maybe a) -> IntMap a -> IntMap b -> IntMap a+differenceWithKey :: (Key -> a -> b -> Maybe a) -> IntMap a -> IntMap b -> IntMap a+intersection :: IntMap a -> IntMap b -> IntMap a+intersectionWith :: (a -> b -> a) -> IntMap a -> IntMap b -> IntMap a+intersectionWithKey :: (Key -> a -> b -> a) -> IntMap a -> IntMap b -> IntMap a+map :: (a -> b) -> IntMap a -> IntMap b+mapWithKey :: (Key -> a -> b) -> IntMap a -> IntMap b+mapAccum :: (a -> b -> (a, c)) -> a -> IntMap b -> (a, IntMap c)+mapAccumWithKey :: (a -> Key -> b -> (a, c)) -> a -> IntMap b -> (a, IntMap c)+fold :: (a -> b -> b) -> b -> IntMap a -> b+foldWithKey :: (Key -> a -> b -> b) -> b -> IntMap a -> b+elems :: IntMap a -> [a]+keys :: IntMap a -> [Key]+keysSet :: IntMap a -> IntSet+assocs :: IntMap a -> [(Key, a)]+toList :: IntMap a -> [(Key, a)]+fromList :: [(Key, a)] -> IntMap a+fromListWith :: (a -> a -> a) -> [(Key, a)] -> IntMap a+fromListWithKey :: (Key -> a -> a -> a) -> [(Key, a)] -> IntMap a+toAscList :: IntMap a -> [(Key, a)]+fromAscList :: [(Key, a)] -> IntMap a+fromAscListWith :: (a -> a -> a) -> [(Key, a)] -> IntMap a+fromAscListWithKey :: (Key -> a -> a -> a) -> [(Key, a)] -> IntMap a+fromDistinctAscList :: [(Key, a)] -> IntMap a+filter :: (a -> Bool) -> IntMap a -> IntMap a+filterWithKey :: (Key -> a -> Bool) -> IntMap a -> IntMap a+partition :: (a -> Bool) -> IntMap a -> (IntMap a, IntMap a)+partitionWithKey :: (Key -> a -> Bool) -> IntMap a -> (IntMap a, IntMap a)+mapMaybe :: (a -> Maybe b) -> IntMap a -> IntMap b+mapMaybeWithKey :: (Key -> a -> Maybe b) -> IntMap a -> IntMap b+mapEither :: (a -> Either b c) -> IntMap a -> (IntMap b, IntMap c)+mapEitherWithKey :: (Key -> a -> Either b c) -> IntMap a -> (IntMap b, IntMap c)+split :: Key -> IntMap a -> (IntMap a, IntMap a)+splitLookup :: Key -> IntMap a -> (IntMap a, Maybe a, IntMap a)+isSubmapOf :: Eq a => IntMap a -> IntMap a -> Bool+isSubmapOfBy :: (a -> b -> Bool) -> IntMap a -> IntMap b -> Bool+isProperSubmapOf :: Eq a => IntMap a -> IntMap a -> Bool+isProperSubmapOfBy :: (a -> b -> Bool) -> IntMap a -> IntMap b -> Bool+updateMin :: (a -> a) -> IntMap a -> IntMap a+updateMax :: (a -> a) -> IntMap a -> IntMap a+updateMinWithKey :: (Key -> a -> a) -> IntMap a -> IntMap a+updateMaxWithKey :: (Key -> a -> a) -> IntMap a -> IntMap a+minViewWithKey :: Monad m => IntMap a -> m ((Key, a), IntMap a)+maxViewWithKey :: Monad m => IntMap a -> m ((Key, a), IntMap a)+showTree :: Show a => IntMap a -> String+showTreeWith :: Show a => Bool -> Bool -> IntMap a -> String++module Data.Graph+stronglyConnComp :: Ord key => [(node, key, [key])] -> [SCC node]+stronglyConnCompR :: Ord key => [(node, key, [key])] -> [SCC (node, key, [key])]+data SCC vertex+AcyclicSCC :: vertex -> SCC vertex+CyclicSCC :: [vertex] -> SCC vertex+flattenSCC :: SCC vertex -> [vertex]+flattenSCCs :: [SCC a] -> [a]+type Graph = Table [Vertex]+type Table a = Array Vertex a+type Bounds = (Vertex, Vertex)+type Edge = (Vertex, Vertex)+type Vertex = Int+graphFromEdges :: Ord key => [(node, key, [key])] -> (Graph, Vertex -> (node, key, [key]), key -> Maybe Vertex)+graphFromEdges' :: Ord key => [(node, key, [key])] -> (Graph, Vertex -> (node, key, [key]))+buildG :: Bounds -> [Edge] -> Graph+transposeG :: Graph -> Graph+vertices :: Graph -> [Vertex]+edges :: Graph -> [Edge]+outdegree :: Graph -> Table Int+indegree :: Graph -> Table Int+dfs :: Graph -> [Vertex] -> Forest Vertex+dff :: Graph -> Forest Vertex+topSort :: Graph -> [Vertex]+components :: Graph -> Forest Vertex+scc :: Graph -> Forest Vertex+bcc :: Graph -> Forest [Vertex]+reachable :: Graph -> Vertex -> [Vertex]+path :: Graph -> Vertex -> Vertex -> Bool+-- Hoogle documentation, generated by Haddock+-- See Hoogle, http://www.haskell.org/hoogle/++module System.Directory+createDirectory :: FilePath -> IO ()+createDirectoryIfMissing :: Bool -> FilePath -> IO ()+removeDirectory :: FilePath -> IO ()+removeDirectoryRecursive :: FilePath -> IO ()+renameDirectory :: FilePath -> FilePath -> IO ()+getDirectoryContents :: FilePath -> IO [FilePath]+getCurrentDirectory :: IO FilePath+setCurrentDirectory :: FilePath -> IO ()+getHomeDirectory :: IO FilePath+getAppUserDataDirectory :: String -> IO FilePath+getUserDocumentsDirectory :: IO FilePath+getTemporaryDirectory :: IO FilePath+removeFile :: FilePath -> IO ()+renameFile :: FilePath -> FilePath -> IO ()+copyFile :: FilePath -> FilePath -> IO ()+canonicalizePath :: FilePath -> IO FilePath+makeRelativeToCurrentDirectory :: FilePath -> IO FilePath+findExecutable :: String -> IO (Maybe FilePath)+doesFileExist :: FilePath -> IO Bool+doesDirectoryExist :: FilePath -> IO Bool+data Permissions+Permissions :: Bool -> Bool -> Bool -> Bool -> Permissions+readable :: Permissions -> Bool+writable :: Permissions -> Bool+executable :: Permissions -> Bool+searchable :: Permissions -> Bool+instance Eq Permissions+instance Ord Permissions+instance Read Permissions+instance Show Permissions+getPermissions :: FilePath -> IO Permissions+setPermissions :: FilePath -> Permissions -> IO ()+getModificationTime :: FilePath -> IO ClockTime+-- Hoogle documentation, generated by Haddock+-- See Hoogle, http://www.haskell.org/hoogle/++module System.FilePath.Windows+pathSeparator :: Char+pathSeparators :: [Char]+isPathSeparator :: Char -> Bool+searchPathSeparator :: Char+isSearchPathSeparator :: Char -> Bool+extSeparator :: Char+isExtSeparator :: Char -> Bool+splitSearchPath :: String -> [FilePath]+getSearchPath :: IO [FilePath]+splitExtension :: FilePath -> (String, String)+takeExtension :: FilePath -> String+replaceExtension :: FilePath -> String -> FilePath+dropExtension :: FilePath -> FilePath+addExtension :: FilePath -> String -> FilePath+hasExtension :: FilePath -> Bool+(<.>) :: FilePath -> String -> FilePath+splitExtensions :: FilePath -> (FilePath, String)+dropExtensions :: FilePath -> FilePath+takeExtensions :: FilePath -> String+splitDrive :: FilePath -> (FilePath, FilePath)+joinDrive :: FilePath -> FilePath -> FilePath+takeDrive :: FilePath -> FilePath+hasDrive :: FilePath -> Bool+dropDrive :: FilePath -> FilePath+isDrive :: FilePath -> Bool+splitFileName :: FilePath -> (String, String)+takeFileName :: FilePath -> FilePath+replaceFileName :: FilePath -> String -> FilePath+dropFileName :: FilePath -> FilePath+takeBaseName :: FilePath -> String+replaceBaseName :: FilePath -> String -> FilePath+takeDirectory :: FilePath -> FilePath+replaceDirectory :: FilePath -> String -> FilePath+combine :: FilePath -> FilePath -> FilePath+(</>) :: FilePath -> FilePath -> FilePath+splitPath :: FilePath -> [FilePath]+joinPath :: [FilePath] -> FilePath+splitDirectories :: FilePath -> [FilePath]+hasTrailingPathSeparator :: FilePath -> Bool+addTrailingPathSeparator :: FilePath -> FilePath+dropTrailingPathSeparator :: FilePath -> FilePath+normalise :: FilePath -> FilePath+equalFilePath :: FilePath -> FilePath -> Bool+makeRelative :: FilePath -> FilePath -> FilePath+isRelative :: FilePath -> Bool+isAbsolute :: FilePath -> Bool+isValid :: FilePath -> Bool+makeValid :: FilePath -> FilePath++module System.FilePath.Posix+pathSeparator :: Char+pathSeparators :: [Char]+isPathSeparator :: Char -> Bool+searchPathSeparator :: Char+isSearchPathSeparator :: Char -> Bool+extSeparator :: Char+isExtSeparator :: Char -> Bool+splitSearchPath :: String -> [FilePath]+getSearchPath :: IO [FilePath]+splitExtension :: FilePath -> (String, String)+takeExtension :: FilePath -> String+replaceExtension :: FilePath -> String -> FilePath+dropExtension :: FilePath -> FilePath+addExtension :: FilePath -> String -> FilePath+hasExtension :: FilePath -> Bool+(<.>) :: FilePath -> String -> FilePath+splitExtensions :: FilePath -> (FilePath, String)+dropExtensions :: FilePath -> FilePath+takeExtensions :: FilePath -> String+splitDrive :: FilePath -> (FilePath, FilePath)+joinDrive :: FilePath -> FilePath -> FilePath+takeDrive :: FilePath -> FilePath+hasDrive :: FilePath -> Bool+dropDrive :: FilePath -> FilePath+isDrive :: FilePath -> Bool+splitFileName :: FilePath -> (String, String)+takeFileName :: FilePath -> FilePath+replaceFileName :: FilePath -> String -> FilePath+dropFileName :: FilePath -> FilePath+takeBaseName :: FilePath -> String+replaceBaseName :: FilePath -> String -> FilePath+takeDirectory :: FilePath -> FilePath+replaceDirectory :: FilePath -> String -> FilePath+combine :: FilePath -> FilePath -> FilePath+(</>) :: FilePath -> FilePath -> FilePath+splitPath :: FilePath -> [FilePath]+joinPath :: [FilePath] -> FilePath+splitDirectories :: FilePath -> [FilePath]+hasTrailingPathSeparator :: FilePath -> Bool+addTrailingPathSeparator :: FilePath -> FilePath+dropTrailingPathSeparator :: FilePath -> FilePath+normalise :: FilePath -> FilePath+equalFilePath :: FilePath -> FilePath -> Bool+makeRelative :: FilePath -> FilePath -> FilePath+isRelative :: FilePath -> Bool+isAbsolute :: FilePath -> Bool+isValid :: FilePath -> Bool+makeValid :: FilePath -> FilePath++module System.FilePath+-- Hoogle documentation, generated by Haddock+-- See Hoogle, http://www.haskell.org/hoogle/++module Control.Monad.Writer.Class+class (Monoid w, Monad m) => MonadWriter w m+tell :: MonadWriter w m => w -> m ()+listen :: MonadWriter w m => m a -> m (a, w)+pass :: MonadWriter w m => m (a, w -> w) -> m a+instance Monoid w => MonadWriter w (Writer w)+instance Monoid w => MonadWriter w (Writer w)+instance (Error e, MonadWriter w m) => MonadWriter w (ErrorT e m)+instance MonadWriter w m => MonadWriter w (ReaderT r m)+instance MonadWriter w m => MonadWriter w (StateT s m)+instance MonadWriter w m => MonadWriter w (StateT s m)+instance (Monoid w, Monad m) => MonadWriter w (WriterT w m)+instance (Monoid w, Monad m) => MonadWriter w (WriterT w m)+instance Monoid w => MonadWriter w (RWS r w s)+instance Monoid w => MonadWriter w (RWS r w s)+instance (Monoid w, Monad m) => MonadWriter w (RWST r w s m)+instance (Monoid w, Monad m) => MonadWriter w (RWST r w s m)+listens :: MonadWriter w m => (w -> b) -> m a -> m (a, b)+censor :: MonadWriter w m => (w -> w) -> m a -> m a++module Control.Monad.Trans+class MonadTrans t+lift :: (MonadTrans t, Monad m) => m a -> t m a+instance MonadTrans ListT+instance MonadTrans (ContT r)+instance Error e => MonadTrans (ErrorT e)+instance MonadTrans (ReaderT r)+instance MonadTrans (StateT s)+instance MonadTrans (StateT s)+instance Monoid w => MonadTrans (WriterT w)+instance Monoid w => MonadTrans (WriterT w)+instance Monoid w => MonadTrans (RWST r w s)+instance Monoid w => MonadTrans (RWST r w s)+class Monad m => MonadIO m+liftIO :: MonadIO m => IO a -> m a+instance MonadIO IO+instance MonadIO m => MonadIO (ListT m)+instance MonadIO m => MonadIO (ContT r m)+instance (Error e, MonadIO m) => MonadIO (ErrorT e m)+instance MonadIO m => MonadIO (ReaderT r m)+instance MonadIO m => MonadIO (StateT s m)+instance MonadIO m => MonadIO (StateT s m)+instance (Monoid w, MonadIO m) => MonadIO (WriterT w m)+instance (Monoid w, MonadIO m) => MonadIO (WriterT w m)+instance (Monoid w, MonadIO m) => MonadIO (RWST r w s m)+instance (Monoid w, MonadIO m) => MonadIO (RWST r w s m)++module Control.Monad.State.Class+class Monad m => MonadState s m+get :: MonadState s m => m s+put :: MonadState s m => s -> m ()+instance MonadState s m => MonadState s (ListT m)+instance MonadState s (State s)+instance MonadState s (State s)+instance MonadState s m => MonadState s (ContT r m)+instance (Error e, MonadState s m) => MonadState s (ErrorT e m)+instance MonadState s m => MonadState s (ReaderT r m)+instance Monad m => MonadState s (StateT s m)+instance Monad m => MonadState s (StateT s m)+instance (Monoid w, MonadState s m) => MonadState s (WriterT w m)+instance (Monoid w, MonadState s m) => MonadState s (WriterT w m)+instance Monoid w => MonadState s (RWS r w s)+instance Monoid w => MonadState s (RWS r w s)+instance (Monoid w, Monad m) => MonadState s (RWST r w s m)+instance (Monoid w, Monad m) => MonadState s (RWST r w s m)+modify :: MonadState s m => (s -> s) -> m ()+gets :: MonadState s m => (s -> a) -> m a++module Control.Monad.Reader.Class+class Monad m => MonadReader r m+ask :: MonadReader r m => m r+local :: MonadReader r m => (r -> r) -> m a -> m a+instance MonadReader r (Reader r)+instance MonadReader r ((->) r)+instance MonadReader s m => MonadReader s (ListT m)+instance (Error e, MonadReader r m) => MonadReader r (ErrorT e m)+instance Monad m => MonadReader r (ReaderT r m)+instance MonadReader r m => MonadReader r (StateT s m)+instance MonadReader r m => MonadReader r (StateT s m)+instance (Monoid w, MonadReader r m) => MonadReader r (WriterT w m)+instance (Monoid w, MonadReader r m) => MonadReader r (WriterT w m)+instance MonadReader r' m => MonadReader r' (ContT r m)+instance Monoid w => MonadReader r (RWS r w s)+instance Monoid w => MonadReader r (RWS r w s)+instance (Monoid w, Monad m) => MonadReader r (RWST r w s m)+instance (Monoid w, Monad m) => MonadReader r (RWST r w s m)+asks :: MonadReader r m => (r -> a) -> m a++module Control.Monad.RWS.Class+class (Monoid w, MonadReader r m, MonadWriter w m, MonadState s m) => MonadRWS r w s m+instance (Error e, MonadRWS r w s m) => MonadRWS r w s (ErrorT e m)+instance Monoid w => MonadRWS r w s (RWS r w s)+instance Monoid w => MonadRWS r w s (RWS r w s)+instance (Monoid w, Monad m) => MonadRWS r w s (RWST r w s m)+instance (Monoid w, Monad m) => MonadRWS r w s (RWST r w s m)++module Control.Monad.Identity+newtype Identity a+Identity :: a -> Identity a+runIdentity :: Identity a -> a+instance Functor Identity+instance Monad Identity+instance MonadFix Identity++module Control.Monad.Error.Class+class Error a+noMsg :: Error a => a+strMsg :: Error a => String -> a+instance Error IOError+instance Error String+class Monad m => MonadError e m+throwError :: MonadError e m => e -> m a+catchError :: MonadError e m => m a -> (e -> m a) -> m a+instance MonadError IOError IO+instance Error e => MonadError e (Either e)+instance MonadError e m => MonadError e (ListT m)+instance (Monad m, Error e) => MonadError e (ErrorT e m)+instance MonadError e m => MonadError e (ReaderT r m)+instance MonadError e m => MonadError e (StateT s m)+instance MonadError e m => MonadError e (StateT s m)+instance (Monoid w, MonadError e m) => MonadError e (WriterT w m)+instance (Monoid w, MonadError e m) => MonadError e (WriterT w m)+instance (Monoid w, MonadError e m) => MonadError e (RWST r w s m)+instance (Monoid w, MonadError e m) => MonadError e (RWST r w s m)++module Control.Monad.Cont.Class+class Monad m => MonadCont m+callCC :: MonadCont m => (a -> m b -> m a) -> m a+instance MonadCont (Cont r)+instance MonadCont m => MonadCont (ListT m)+instance Monad m => MonadCont (ContT r m)+instance (Error e, MonadCont m) => MonadCont (ErrorT e m)+instance MonadCont m => MonadCont (ReaderT r m)+instance MonadCont m => MonadCont (StateT s m)+instance MonadCont m => MonadCont (StateT s m)+instance (Monoid w, MonadCont m) => MonadCont (WriterT w m)+instance (Monoid w, MonadCont m) => MonadCont (WriterT w m)+instance (Monoid w, MonadCont m) => MonadCont (RWST r w s m)+instance (Monoid w, MonadCont m) => MonadCont (RWST r w s m)++module Control.Monad.Error+newtype ErrorT e m a+ErrorT :: m (Either e a) -> ErrorT e m a+runErrorT :: ErrorT e m a -> m (Either e a)+instance (Error e, MonadRWS r w s m) => MonadRWS r w s (ErrorT e m)+instance (Monad m, Error e) => MonadError e (ErrorT e m)+instance (Error e, MonadReader r m) => MonadReader r (ErrorT e m)+instance (Error e, MonadState s m) => MonadState s (ErrorT e m)+instance (Error e, MonadWriter w m) => MonadWriter w (ErrorT e m)+instance Error e => MonadTrans (ErrorT e)+instance Monad m => Functor (ErrorT e m)+instance (Monad m, Error e) => Monad (ErrorT e m)+instance (Error e, MonadCont m) => MonadCont (ErrorT e m)+instance (MonadFix m, Error e) => MonadFix (ErrorT e m)+instance (Error e, MonadIO m) => MonadIO (ErrorT e m)+instance (Monad m, Error e) => MonadPlus (ErrorT e m)+mapErrorT :: (m (Either e a) -> n (Either e' b)) -> ErrorT e m a -> ErrorT e' n b++module Control.Monad.List+newtype ListT m a+ListT :: m [a] -> ListT m a+runListT :: ListT m a -> m [a]+instance MonadTrans ListT+instance MonadError e m => MonadError e (ListT m)+instance MonadReader s m => MonadReader s (ListT m)+instance MonadState s m => MonadState s (ListT m)+instance Monad m => Functor (ListT m)+instance Monad m => Monad (ListT m)+instance MonadCont m => MonadCont (ListT m)+instance MonadIO m => MonadIO (ListT m)+instance Monad m => MonadPlus (ListT m)+mapListT :: (m [a] -> n [b]) -> ListT m a -> ListT n b++module Control.Monad.RWS.Lazy+newtype RWS r w s a+RWS :: (r -> s -> (a, s, w)) -> RWS r w s a+runRWS :: RWS r w s a -> r -> s -> (a, s, w)+instance Monoid w => MonadRWS r w s (RWS r w s)+instance Monoid w => MonadReader r (RWS r w s)+instance Monoid w => MonadState s (RWS r w s)+instance Monoid w => MonadWriter w (RWS r w s)+instance Functor (RWS r w s)+instance Monoid w => Monad (RWS r w s)+instance Monoid w => MonadFix (RWS r w s)+evalRWS :: RWS r w s a -> r -> s -> (a, w)+execRWS :: RWS r w s a -> r -> s -> (s, w)+mapRWS :: ((a, s, w) -> (b, s, w')) -> RWS r w s a -> RWS r w' s b+withRWS :: (r' -> s -> (r, s)) -> RWS r w s a -> RWS r' w s a+newtype RWST r w s m a+RWST :: (r -> s -> m (a, s, w)) -> RWST r w s m a+runRWST :: RWST r w s m a -> r -> s -> m (a, s, w)+instance (Monoid w, Monad m) => MonadRWS r w s (RWST r w s m)+instance (Monoid w, MonadError e m) => MonadError e (RWST r w s m)+instance (Monoid w, Monad m) => MonadReader r (RWST r w s m)+instance (Monoid w, Monad m) => MonadState s (RWST r w s m)+instance (Monoid w, Monad m) => MonadWriter w (RWST r w s m)+instance Monoid w => MonadTrans (RWST r w s)+instance Monad m => Functor (RWST r w s m)+instance (Monoid w, Monad m) => Monad (RWST r w s m)+instance (Monoid w, MonadCont m) => MonadCont (RWST r w s m)+instance (Monoid w, MonadFix m) => MonadFix (RWST r w s m)+instance (Monoid w, MonadIO m) => MonadIO (RWST r w s m)+instance (Monoid w, MonadPlus m) => MonadPlus (RWST r w s m)+evalRWST :: Monad m => RWST r w s m a -> r -> s -> m (a, w)+execRWST :: Monad m => RWST r w s m a -> r -> s -> m (s, w)+mapRWST :: (m (a, s, w) -> n (b, s, w')) -> RWST r w s m a -> RWST r w' s n b+withRWST :: (r' -> s -> (r, s)) -> RWST r w s m a -> RWST r' w s m a++module Control.Monad.RWS++module Control.Monad.RWS.Strict+newtype RWS r w s a+RWS :: (r -> s -> (a, s, w)) -> RWS r w s a+runRWS :: RWS r w s a -> r -> s -> (a, s, w)+instance Monoid w => MonadRWS r w s (RWS r w s)+instance Monoid w => MonadReader r (RWS r w s)+instance Monoid w => MonadState s (RWS r w s)+instance Monoid w => MonadWriter w (RWS r w s)+instance Functor (RWS r w s)+instance Monoid w => Monad (RWS r w s)+instance Monoid w => MonadFix (RWS r w s)+evalRWS :: RWS r w s a -> r -> s -> (a, w)+execRWS :: RWS r w s a -> r -> s -> (s, w)+mapRWS :: ((a, s, w) -> (b, s, w')) -> RWS r w s a -> RWS r w' s b+withRWS :: (r' -> s -> (r, s)) -> RWS r w s a -> RWS r' w s a+newtype RWST r w s m a+RWST :: (r -> s -> m (a, s, w)) -> RWST r w s m a+runRWST :: RWST r w s m a -> r -> s -> m (a, s, w)+instance (Monoid w, Monad m) => MonadRWS r w s (RWST r w s m)+instance (Monoid w, MonadError e m) => MonadError e (RWST r w s m)+instance (Monoid w, Monad m) => MonadReader r (RWST r w s m)+instance (Monoid w, Monad m) => MonadState s (RWST r w s m)+instance (Monoid w, Monad m) => MonadWriter w (RWST r w s m)+instance Monoid w => MonadTrans (RWST r w s)+instance Monad m => Functor (RWST r w s m)+instance (Monoid w, Monad m) => Monad (RWST r w s m)+instance (Monoid w, MonadCont m) => MonadCont (RWST r w s m)+instance (Monoid w, MonadFix m) => MonadFix (RWST r w s m)+instance (Monoid w, MonadIO m) => MonadIO (RWST r w s m)+instance (Monoid w, MonadPlus m) => MonadPlus (RWST r w s m)+evalRWST :: Monad m => RWST r w s m a -> r -> s -> m (a, w)+execRWST :: Monad m => RWST r w s m a -> r -> s -> m (s, w)+mapRWST :: (m (a, s, w) -> n (b, s, w')) -> RWST r w s m a -> RWST r w' s n b+withRWST :: (r' -> s -> (r, s)) -> RWST r w s m a -> RWST r' w s m a++module Control.Monad.Reader+newtype Reader r a+Reader :: (r -> a) -> Reader r a+runReader :: Reader r a -> r -> a+instance MonadReader r (Reader r)+instance Functor (Reader r)+instance Monad (Reader r)+instance MonadFix (Reader r)+mapReader :: (a -> b) -> Reader r a -> Reader r b+withReader :: (r' -> r) -> Reader r a -> Reader r' a+newtype ReaderT r m a+ReaderT :: (r -> m a) -> ReaderT r m a+runReaderT :: ReaderT r m a -> r -> m a+instance MonadError e m => MonadError e (ReaderT r m)+instance Monad m => MonadReader r (ReaderT r m)+instance MonadState s m => MonadState s (ReaderT r m)+instance MonadWriter w m => MonadWriter w (ReaderT r m)+instance MonadTrans (ReaderT r)+instance Monad m => Functor (ReaderT r m)+instance Monad m => Monad (ReaderT r m)+instance MonadCont m => MonadCont (ReaderT r m)+instance MonadFix m => MonadFix (ReaderT r m)+instance MonadIO m => MonadIO (ReaderT r m)+instance MonadPlus m => MonadPlus (ReaderT r m)+mapReaderT :: (m a -> n b) -> ReaderT w m a -> ReaderT w n b+withReaderT :: (r' -> r) -> ReaderT r m a -> ReaderT r' m a++module Control.Monad.State.Lazy+newtype State s a+State :: (s -> (a, s)) -> State s a+runState :: State s a -> s -> (a, s)+instance MonadState s (State s)+instance Functor (State s)+instance Monad (State s)+instance MonadFix (State s)+evalState :: State s a -> s -> a+execState :: State s a -> s -> s+mapState :: ((a, s) -> (b, s)) -> State s a -> State s b+withState :: (s -> s) -> State s a -> State s a+newtype StateT s m a+StateT :: (s -> m (a, s)) -> StateT s m a+runStateT :: StateT s m a -> s -> m (a, s)+instance MonadError e m => MonadError e (StateT s m)+instance MonadReader r m => MonadReader r (StateT s m)+instance Monad m => MonadState s (StateT s m)+instance MonadWriter w m => MonadWriter w (StateT s m)+instance MonadTrans (StateT s)+instance Monad m => Functor (StateT s m)+instance Monad m => Monad (StateT s m)+instance MonadCont m => MonadCont (StateT s m)+instance MonadFix m => MonadFix (StateT s m)+instance MonadIO m => MonadIO (StateT s m)+instance MonadPlus m => MonadPlus (StateT s m)+evalStateT :: Monad m => StateT s m a -> s -> m a+execStateT :: Monad m => StateT s m a -> s -> m s+mapStateT :: (m (a, s) -> n (b, s)) -> StateT s m a -> StateT s n b+withStateT :: (s -> s) -> StateT s m a -> StateT s m a++module Control.Monad.State++module Control.Monad.State.Strict+newtype State s a+State :: (s -> (a, s)) -> State s a+runState :: State s a -> s -> (a, s)+instance MonadState s (State s)+instance Functor (State s)+instance Monad (State s)+instance MonadFix (State s)+evalState :: State s a -> s -> a+execState :: State s a -> s -> s+mapState :: ((a, s) -> (b, s)) -> State s a -> State s b+withState :: (s -> s) -> State s a -> State s a+newtype StateT s m a+StateT :: (s -> m (a, s)) -> StateT s m a+runStateT :: StateT s m a -> s -> m (a, s)+instance MonadError e m => MonadError e (StateT s m)+instance MonadReader r m => MonadReader r (StateT s m)+instance Monad m => MonadState s (StateT s m)+instance MonadWriter w m => MonadWriter w (StateT s m)+instance MonadTrans (StateT s)+instance Monad m => Functor (StateT s m)+instance Monad m => Monad (StateT s m)+instance MonadCont m => MonadCont (StateT s m)+instance MonadFix m => MonadFix (StateT s m)+instance MonadIO m => MonadIO (StateT s m)+instance MonadPlus m => MonadPlus (StateT s m)+evalStateT :: Monad m => StateT s m a -> s -> m a+execStateT :: Monad m => StateT s m a -> s -> m s+mapStateT :: (m (a, s) -> n (b, s)) -> StateT s m a -> StateT s n b+withStateT :: (s -> s) -> StateT s m a -> StateT s m a++module Control.Monad.Writer.Lazy+newtype Writer w a+Writer :: (a, w) -> Writer w a+runWriter :: Writer w a -> (a, w)+instance Monoid w => MonadWriter w (Writer w)+instance Functor (Writer w)+instance Monoid w => Monad (Writer w)+instance Monoid w => MonadFix (Writer w)+execWriter :: Writer w a -> w+mapWriter :: ((a, w) -> (b, w')) -> Writer w a -> Writer w' b+newtype WriterT w m a+WriterT :: m (a, w) -> WriterT w m a+runWriterT :: WriterT w m a -> m (a, w)+instance (Monoid w, MonadError e m) => MonadError e (WriterT w m)+instance (Monoid w, MonadReader r m) => MonadReader r (WriterT w m)+instance (Monoid w, MonadState s m) => MonadState s (WriterT w m)+instance (Monoid w, Monad m) => MonadWriter w (WriterT w m)+instance Monoid w => MonadTrans (WriterT w)+instance Monad m => Functor (WriterT w m)+instance (Monoid w, Monad m) => Monad (WriterT w m)+instance (Monoid w, MonadCont m) => MonadCont (WriterT w m)+instance (Monoid w, MonadFix m) => MonadFix (WriterT w m)+instance (Monoid w, MonadIO m) => MonadIO (WriterT w m)+instance (Monoid w, MonadPlus m) => MonadPlus (WriterT w m)+execWriterT :: Monad m => WriterT w m a -> m w+mapWriterT :: (m (a, w) -> n (b, w')) -> WriterT w m a -> WriterT w' n b++module Control.Monad.Writer++module Control.Monad.Writer.Strict+newtype Writer w a+Writer :: (a, w) -> Writer w a+runWriter :: Writer w a -> (a, w)+instance Monoid w => MonadWriter w (Writer w)+instance Functor (Writer w)+instance Monoid w => Monad (Writer w)+instance Monoid w => MonadFix (Writer w)+execWriter :: Writer w a -> w+mapWriter :: ((a, w) -> (b, w')) -> Writer w a -> Writer w' b+newtype WriterT w m a+WriterT :: m (a, w) -> WriterT w m a+runWriterT :: WriterT w m a -> m (a, w)+instance (Monoid w, MonadError e m) => MonadError e (WriterT w m)+instance (Monoid w, MonadReader r m) => MonadReader r (WriterT w m)+instance (Monoid w, MonadState s m) => MonadState s (WriterT w m)+instance (Monoid w, Monad m) => MonadWriter w (WriterT w m)+instance Monoid w => MonadTrans (WriterT w)+instance Monad m => Functor (WriterT w m)+instance (Monoid w, Monad m) => Monad (WriterT w m)+instance (Monoid w, MonadCont m) => MonadCont (WriterT w m)+instance (Monoid w, MonadFix m) => MonadFix (WriterT w m)+instance (Monoid w, MonadIO m) => MonadIO (WriterT w m)+instance (Monoid w, MonadPlus m) => MonadPlus (WriterT w m)+execWriterT :: Monad m => WriterT w m a -> m w+mapWriterT :: (m (a, w) -> n (b, w')) -> WriterT w m a -> WriterT w' n b++module Control.Monad.Cont+newtype Cont r a+Cont :: (a -> r -> r) -> Cont r a+runCont :: Cont r a -> (a -> r) -> r+instance Functor (Cont r)+instance Monad (Cont r)+instance MonadCont (Cont r)+mapCont :: (r -> r) -> Cont r a -> Cont r a+withCont :: (b -> r -> a -> r) -> Cont r a -> Cont r b+newtype ContT r m a+ContT :: (a -> m r -> m r) -> ContT r m a+runContT :: ContT r m a -> (a -> m r) -> m r+instance MonadReader r' m => MonadReader r' (ContT r m)+instance MonadState s m => MonadState s (ContT r m)+instance MonadTrans (ContT r)+instance Monad m => Functor (ContT r m)+instance Monad m => Monad (ContT r m)+instance Monad m => MonadCont (ContT r m)+instance MonadIO m => MonadIO (ContT r m)+mapContT :: (m r -> m r) -> ContT r m a -> ContT r m a+withContT :: (b -> m r -> a -> m r) -> ContT r m a -> ContT r m b+-- Hoogle documentation, generated by Haddock+-- See Hoogle, http://www.haskell.org/hoogle/++module System.Locale+data TimeLocale+TimeLocale :: [(String, String)] -> [(String, String)] -> [(String, String)] -> (String, String) -> String -> String -> String -> String -> TimeLocale+wDays :: TimeLocale -> [(String, String)]+months :: TimeLocale -> [(String, String)]+intervals :: TimeLocale -> [(String, String)]+amPm :: TimeLocale -> (String, String)+dateTimeFmt :: TimeLocale -> String+dateFmt :: TimeLocale -> String+timeFmt :: TimeLocale -> String+time12Fmt :: TimeLocale -> String+instance Eq TimeLocale+instance Ord TimeLocale+instance Show TimeLocale+defaultTimeLocale :: TimeLocale+iso8601DateFormat :: Maybe String -> String+rfc822DateFormat :: String+-- Hoogle documentation, generated by Haddock+-- See Hoogle, http://www.haskell.org/hoogle/++module System.Time+data ClockTime+TOD :: Integer -> Integer -> ClockTime+instance Eq ClockTime+instance Ord ClockTime+instance Show ClockTime+getClockTime :: IO ClockTime+data TimeDiff+TimeDiff :: Int -> Int -> Int -> Int -> Int -> Int -> Integer -> TimeDiff+tdYear :: TimeDiff -> Int+tdMonth :: TimeDiff -> Int+tdDay :: TimeDiff -> Int+tdHour :: TimeDiff -> Int+tdMin :: TimeDiff -> Int+tdSec :: TimeDiff -> Int+tdPicosec :: TimeDiff -> Integer+instance Eq TimeDiff+instance Ord TimeDiff+instance Read TimeDiff+instance Show TimeDiff+noTimeDiff :: TimeDiff+diffClockTimes :: ClockTime -> ClockTime -> TimeDiff+addToClockTime :: TimeDiff -> ClockTime -> ClockTime+normalizeTimeDiff :: TimeDiff -> TimeDiff+timeDiffToString :: TimeDiff -> String+formatTimeDiff :: TimeLocale -> String -> TimeDiff -> String+data CalendarTime+CalendarTime :: Int -> Month -> Int -> Int -> Int -> Int -> Integer -> Day -> Int -> String -> Int -> Bool -> CalendarTime+ctYear :: CalendarTime -> Int+ctMonth :: CalendarTime -> Month+ctDay :: CalendarTime -> Int+ctHour :: CalendarTime -> Int+ctMin :: CalendarTime -> Int+ctSec :: CalendarTime -> Int+ctPicosec :: CalendarTime -> Integer+ctWDay :: CalendarTime -> Day+ctYDay :: CalendarTime -> Int+ctTZName :: CalendarTime -> String+ctTZ :: CalendarTime -> Int+ctIsDST :: CalendarTime -> Bool+instance Eq CalendarTime+instance Ord CalendarTime+instance Read CalendarTime+instance Show CalendarTime+data Month+January :: Month+February :: Month+March :: Month+April :: Month+May :: Month+June :: Month+July :: Month+August :: Month+September :: Month+October :: Month+November :: Month+December :: Month+instance Bounded Month+instance Enum Month+instance Eq Month+instance Ix Month+instance Ord Month+instance Read Month+instance Show Month+data Day+Sunday :: Day+Monday :: Day+Tuesday :: Day+Wednesday :: Day+Thursday :: Day+Friday :: Day+Saturday :: Day+instance Bounded Day+instance Enum Day+instance Eq Day+instance Ix Day+instance Ord Day+instance Read Day+instance Show Day+toCalendarTime :: ClockTime -> IO CalendarTime+toUTCTime :: ClockTime -> CalendarTime+toClockTime :: CalendarTime -> ClockTime+calendarTimeToString :: CalendarTime -> String+formatCalendarTime :: TimeLocale -> String -> CalendarTime -> String+-- Hoogle documentation, generated by Haddock+-- See Hoogle, http://www.haskell.org/hoogle/++module Data.PackedString+data PackedString+instance Data PackedString+instance Eq PackedString+instance Ord PackedString+instance Show PackedString+instance Typeable PackedString+packString :: String -> PackedString+unpackPS :: PackedString -> String+hPutPS :: Handle -> PackedString -> IO ()+hGetPS :: Handle -> Int -> IO PackedString+nilPS :: PackedString+consPS :: Char -> PackedString -> PackedString+headPS :: PackedString -> Char+tailPS :: PackedString -> PackedString+nullPS :: PackedString -> Bool+appendPS :: PackedString -> PackedString -> PackedString+lengthPS :: PackedString -> Int+indexPS :: PackedString -> Int -> Char+mapPS :: (Char -> Char) -> PackedString -> PackedString+filterPS :: (Char -> Bool) -> PackedString -> PackedString+reversePS :: PackedString -> PackedString+concatPS :: [PackedString] -> PackedString+elemPS :: Char -> PackedString -> Bool+substrPS :: PackedString -> Int -> Int -> PackedString+takePS :: Int -> PackedString -> PackedString+dropPS :: Int -> PackedString -> PackedString+splitAtPS :: Int -> PackedString -> (PackedString, PackedString)+foldlPS :: (a -> Char -> a) -> a -> PackedString -> a+foldrPS :: (Char -> a -> a) -> a -> PackedString -> a+takeWhilePS :: (Char -> Bool) -> PackedString -> PackedString+dropWhilePS :: (Char -> Bool) -> PackedString -> PackedString+spanPS :: (Char -> Bool) -> PackedString -> (PackedString, PackedString)+breakPS :: (Char -> Bool) -> PackedString -> (PackedString, PackedString)+linesPS :: PackedString -> [PackedString]+unlinesPS :: [PackedString] -> PackedString+wordsPS :: PackedString -> [PackedString]+unwordsPS :: [PackedString] -> PackedString+splitPS :: Char -> PackedString -> [PackedString]+splitWithPS :: (Char -> Bool) -> PackedString -> [PackedString]+joinPS :: PackedString -> [PackedString] -> PackedString+-- Hoogle documentation, generated by Haddock+-- See Hoogle, http://www.haskell.org/hoogle/++module Control.Parallel+par :: a -> b -> b+pseq :: a -> b -> b++module Control.Parallel.Strategies+type Done = ()+type Strategy a = a -> Done+(>|) :: Done -> Done -> Done+(>||) :: Done -> Done -> Done+using :: a -> Strategy a -> a+demanding :: a -> Done -> a+sparking :: a -> Done -> a+r0 :: Strategy a+rwhnf :: Strategy a+class NFData a+rnf :: NFData a => Strategy a+instance NFData Bool+instance NFData Char+instance NFData Double+instance NFData Float+instance NFData Int+instance NFData Int16+instance NFData Int32+instance NFData Int64+instance NFData Int8+instance NFData IntSet+instance NFData Integer+instance NFData Word16+instance NFData Word32+instance NFData Word64+instance NFData Word8+instance NFData ()+instance (NFData a, NFData b) => NFData (a, b)+instance (NFData a, NFData b, NFData c) => NFData (a, b, c)+instance (NFData a, NFData b, NFData c, NFData d) => NFData (a, b, c, d)+instance (NFData a1, NFData a2, NFData a3, NFData a4, NFData a5) => NFData (a1, a2, a3, a4, a5)+instance (NFData a1, NFData a2, NFData a3, NFData a4, NFData a5, NFData a6) => NFData (a1, a2, a3, a4, a5, a6)+instance (NFData a1, NFData a2, NFData a3, NFData a4, NFData a5, NFData a6, NFData a7) => NFData (a1, a2, a3, a4, a5, a6, a7)+instance (NFData a1, NFData a2, NFData a3, NFData a4, NFData a5, NFData a6, NFData a7, NFData a8) => NFData (a1, a2, a3, a4, a5, a6, a7, a8)+instance (NFData a1, NFData a2, NFData a3, NFData a4, NFData a5, NFData a6, NFData a7, NFData a8, NFData a9) => NFData (a1, a2, a3, a4, a5, a6, a7, a8, a9)+instance (RealFloat a, NFData a) => NFData (Complex a)+instance NFData a => NFData (IntMap a)+instance NFData a => NFData (Maybe a)+instance (Integral a, NFData a) => NFData (Ratio a)+instance NFData a => NFData (Set a)+instance NFData a => NFData (Tree a)+instance NFData a => NFData [a]+instance (Ix a, NFData a, NFData b) => NFData (Array a b)+instance (NFData a, NFData b) => NFData (Assoc a b)+instance (NFData a, NFData b) => NFData (Either a b)+instance (NFData k, NFData a) => NFData (Map k a)+($|) :: (a -> b) -> Strategy a -> a -> b+($||) :: (a -> b) -> Strategy a -> a -> b+(.|) :: (b -> c) -> Strategy b -> (a -> b) -> a -> c+(.||) :: (b -> c) -> Strategy b -> (a -> b) -> a -> c+(-|) :: (a -> b) -> Strategy b -> (b -> c) -> a -> c+(-||) :: (a -> b) -> Strategy b -> (b -> c) -> a -> c+seqPair :: Strategy a -> Strategy b -> Strategy (a, b)+parPair :: Strategy a -> Strategy b -> Strategy (a, b)+seqTriple :: Strategy a -> Strategy b -> Strategy c -> Strategy (a, b, c)+parTriple :: Strategy a -> Strategy b -> Strategy c -> Strategy (a, b, c)+parList :: Strategy a -> Strategy [a]+parListN :: Integral b => b -> Strategy a -> Strategy [a]+parListNth :: Int -> Strategy a -> Strategy [a]+parListChunk :: Int -> Strategy a -> Strategy [a]+parMap :: Strategy b -> (a -> b) -> [a] -> [b]+parFlatMap :: Strategy [b] -> (a -> [b]) -> [a] -> [b]+parZipWith :: Strategy c -> (a -> b -> c) -> [a] -> [b] -> [c]+seqList :: Strategy a -> Strategy [a]+seqListN :: Integral a => a -> Strategy b -> Strategy [b]+seqListNth :: Int -> Strategy b -> Strategy [b]+parBuffer :: Int -> Strategy a -> [a] -> [a]+seqArr :: Ix b => Strategy a -> Strategy (Array b a)+parArr :: Ix b => Strategy a -> Strategy (Array b a)+sPar :: a -> Strategy b+sSeq :: a -> Strategy b+data Assoc a b+(:=) :: a -> b -> Assoc a b+instance (NFData a, NFData b) => NFData (Assoc a b)+fstPairFstList :: NFData a => Strategy [(a, b)]+force :: NFData a => a -> a+sforce :: NFData a => a -> b -> b+-- Hoogle documentation, generated by Haddock+-- See Hoogle, http://www.haskell.org/hoogle/++module Text.ParserCombinators.Parsec.Pos+type SourceName = String+type Line = Int+type Column = Int+data SourcePos+instance Eq SourcePos+instance Ord SourcePos+instance Show SourcePos+sourceLine :: SourcePos -> Line+sourceColumn :: SourcePos -> Column+sourceName :: SourcePos -> SourceName+incSourceLine :: SourcePos -> Line -> SourcePos+incSourceColumn :: SourcePos -> Column -> SourcePos+setSourceLine :: SourcePos -> Line -> SourcePos+setSourceColumn :: SourcePos -> Column -> SourcePos+setSourceName :: SourcePos -> SourceName -> SourcePos+newPos :: SourceName -> Line -> Column -> SourcePos+initialPos :: SourceName -> SourcePos+updatePosChar :: SourcePos -> Char -> SourcePos+updatePosString :: SourcePos -> String -> SourcePos++module Text.ParserCombinators.Parsec.Error+data Message+SysUnExpect :: String -> Message+UnExpect :: String -> Message+Expect :: String -> Message+Message :: String -> Message+messageString :: Message -> String+messageCompare :: Message -> Message -> Ordering+messageEq :: Message -> Message -> Bool+data ParseError+instance Show ParseError+errorPos :: ParseError -> SourcePos+errorMessages :: ParseError -> [Message]+errorIsUnknown :: ParseError -> Bool+showErrorMessages :: String -> String -> String -> String -> String -> [Message] -> String+newErrorMessage :: Message -> SourcePos -> ParseError+newErrorUnknown :: SourcePos -> ParseError+addErrorMessage :: Message -> ParseError -> ParseError+setErrorPos :: SourcePos -> ParseError -> ParseError+setErrorMessage :: Message -> ParseError -> ParseError+mergeError :: ParseError -> ParseError -> ParseError++module Text.ParserCombinators.Parsec.Prim+(<?>) :: GenParser tok st a -> String -> GenParser tok st a+(<|>) :: GenParser tok st a -> GenParser tok st a -> GenParser tok st a+type Parser a = GenParser Char () a+data GenParser tok st a+instance Functor (GenParser tok st)+instance Monad (GenParser tok st)+instance MonadPlus (GenParser tok st)+runParser :: GenParser tok st a -> st -> SourceName -> [tok] -> Either ParseError a+parse :: GenParser tok () a -> SourceName -> [tok] -> Either ParseError a+parseFromFile :: Parser a -> SourceName -> IO (Either ParseError a)+parseTest :: Show a => GenParser tok () a -> [tok] -> IO ()+token :: (tok -> String) -> (tok -> SourcePos) -> (tok -> Maybe a) -> GenParser tok st a+tokens :: Eq tok => ([tok] -> String) -> (SourcePos -> [tok] -> SourcePos) -> [tok] -> GenParser tok st [tok]+tokenPrim :: (tok -> String) -> (SourcePos -> tok -> [tok] -> SourcePos) -> (tok -> Maybe a) -> GenParser tok st a+tokenPrimEx :: (tok -> String) -> (SourcePos -> tok -> [tok] -> SourcePos) -> Maybe (SourcePos -> tok -> [tok] -> st -> st) -> (tok -> Maybe a) -> GenParser tok st a+try :: GenParser tok st a -> GenParser tok st a+label :: GenParser tok st a -> String -> GenParser tok st a+labels :: GenParser tok st a -> [String] -> GenParser tok st a+unexpected :: String -> GenParser tok st a+pzero :: GenParser tok st a+many :: GenParser tok st a -> GenParser tok st [a]+skipMany :: GenParser tok st a -> GenParser tok st ()+getState :: GenParser tok st st+setState :: st -> GenParser tok st ()+updateState :: (st -> st) -> GenParser tok st ()+getPosition :: GenParser tok st SourcePos+setPosition :: SourcePos -> GenParser tok st ()+getInput :: GenParser tok st [tok]+setInput :: [tok] -> GenParser tok st ()+data State tok st+State :: [tok] -> SourcePos -> st -> State tok st+stateInput :: State tok st -> [tok]+statePos :: State tok st -> SourcePos+stateUser :: State tok st -> st+getParserState :: GenParser tok st (State tok st)+setParserState :: State tok st -> GenParser tok st (State tok st)++module Text.ParserCombinators.Parsec.Combinator+choice :: [GenParser tok st a] -> GenParser tok st a+count :: Int -> GenParser tok st a -> GenParser tok st [a]+between :: GenParser tok st open -> GenParser tok st close -> GenParser tok st a -> GenParser tok st a+option :: a -> GenParser tok st a -> GenParser tok st a+optionMaybe :: GenParser tok st a -> GenParser tok st (Maybe a)+optional :: GenParser tok st a -> GenParser tok st ()+skipMany1 :: GenParser tok st a -> GenParser tok st ()+many1 :: GenParser tok st a -> GenParser tok st [a]+sepBy :: GenParser tok st a -> GenParser tok st sep -> GenParser tok st [a]+sepBy1 :: GenParser tok st a -> GenParser tok st sep -> GenParser tok st [a]+endBy :: GenParser tok st a -> GenParser tok st sep -> GenParser tok st [a]+endBy1 :: GenParser tok st a -> GenParser tok st sep -> GenParser tok st [a]+sepEndBy :: GenParser tok st a -> GenParser tok st sep -> GenParser tok st [a]+sepEndBy1 :: GenParser tok st a -> GenParser tok st sep -> GenParser tok st [a]+chainl :: GenParser tok st a -> GenParser tok st (a -> a -> a) -> a -> GenParser tok st a+chainl1 :: GenParser tok st a -> GenParser tok st (a -> a -> a) -> GenParser tok st a+chainr :: GenParser tok st a -> GenParser tok st (a -> a -> a) -> a -> GenParser tok st a+chainr1 :: GenParser tok st a -> GenParser tok st (a -> a -> a) -> GenParser tok st a+eof :: Show tok => GenParser tok st ()+notFollowedBy :: Show tok => GenParser tok st tok -> GenParser tok st ()+manyTill :: GenParser tok st a -> GenParser tok st end -> GenParser tok st [a]+lookAhead :: GenParser tok st a -> GenParser tok st a+anyToken :: Show tok => GenParser tok st tok++module Text.ParserCombinators.Parsec.Expr+data Assoc+AssocNone :: Assoc+AssocLeft :: Assoc+AssocRight :: Assoc+data Operator t st a+Infix :: GenParser t st (a -> a -> a) -> Assoc -> Operator t st a+Prefix :: GenParser t st (a -> a) -> Operator t st a+Postfix :: GenParser t st (a -> a) -> Operator t st a+type OperatorTable t st a = [[Operator t st a]]+buildExpressionParser :: OperatorTable tok st a -> GenParser tok st a -> GenParser tok st a++module Text.ParserCombinators.Parsec.Char+type CharParser st a = GenParser Char st a+spaces :: CharParser st ()+space :: CharParser st Char+newline :: CharParser st Char+tab :: CharParser st Char+upper :: CharParser st Char+lower :: CharParser st Char+alphaNum :: CharParser st Char+letter :: CharParser st Char+digit :: CharParser st Char+hexDigit :: CharParser st Char+octDigit :: CharParser st Char+char :: Char -> CharParser st Char+string :: String -> CharParser st String+anyChar :: CharParser st Char+oneOf :: [Char] -> CharParser st Char+noneOf :: [Char] -> CharParser st Char+satisfy :: (Char -> Bool) -> CharParser st Char++module Text.ParserCombinators.Parsec+data ParseError+instance Show ParseError+errorPos :: ParseError -> SourcePos+data SourcePos+instance Eq SourcePos+instance Ord SourcePos+instance Show SourcePos+type SourceName = String+type Line = Int+type Column = Int+sourceName :: SourcePos -> SourceName+sourceLine :: SourcePos -> Line+sourceColumn :: SourcePos -> Column+incSourceLine :: SourcePos -> Line -> SourcePos+incSourceColumn :: SourcePos -> Column -> SourcePos+setSourceLine :: SourcePos -> Line -> SourcePos+setSourceColumn :: SourcePos -> Column -> SourcePos+setSourceName :: SourcePos -> SourceName -> SourcePos++module Text.ParserCombinators.Parsec.Perm+data PermParser tok st a+permute :: PermParser tok st a -> GenParser tok st a+(<||>) :: PermParser tok st (a -> b) -> GenParser tok st a -> PermParser tok st b+(<$$>) :: (a -> b) -> GenParser tok st a -> PermParser tok st b+(<|?>) :: PermParser tok st (a -> b) -> (a, GenParser tok st a) -> PermParser tok st b+(<$?>) :: (a -> b) -> (a, GenParser tok st a) -> PermParser tok st b++module Text.ParserCombinators.Parsec.Token+data LanguageDef st+LanguageDef :: String -> String -> String -> Bool -> CharParser st Char -> CharParser st Char -> CharParser st Char -> CharParser st Char -> [String] -> [String] -> Bool -> LanguageDef st+commentStart :: LanguageDef st -> String+commentEnd :: LanguageDef st -> String+commentLine :: LanguageDef st -> String+nestedComments :: LanguageDef st -> Bool+identStart :: LanguageDef st -> CharParser st Char+identLetter :: LanguageDef st -> CharParser st Char+opStart :: LanguageDef st -> CharParser st Char+opLetter :: LanguageDef st -> CharParser st Char+reservedNames :: LanguageDef st -> [String]+reservedOpNames :: LanguageDef st -> [String]+caseSensitive :: LanguageDef st -> Bool+data TokenParser st+TokenParser :: CharParser st String -> (String -> CharParser st ()) -> CharParser st String -> (String -> CharParser st ()) -> CharParser st Char -> CharParser st String -> CharParser st Integer -> CharParser st Integer -> CharParser st Double -> CharParser st (Either Integer Double) -> CharParser st Integer -> CharParser st Integer -> CharParser st Integer -> (String -> CharParser st String) -> (CharParser st a -> CharParser st a) -> CharParser st () -> (CharParser st a -> CharParser st a) -> (CharParser st a -> CharParser st a) -> (CharParser st a -> CharParser st a) -> (CharParser st a -> CharParser st a) -> (CharParser st a -> CharParser st a) -> CharParser st String -> CharParser st String -> CharParser st String -> CharParser st String -> (CharParser st a -> CharParser st [a]) -> (CharParser st a -> CharParser st [a]) -> (CharParser st a -> CharParser st [a]) -> (CharParser st a -> CharParser st [a]) -> TokenParser st+identifier :: TokenParser st -> CharParser st String+reserved :: TokenParser st -> String -> CharParser st ()+operator :: TokenParser st -> CharParser st String+reservedOp :: TokenParser st -> String -> CharParser st ()+charLiteral :: TokenParser st -> CharParser st Char+stringLiteral :: TokenParser st -> CharParser st String+natural :: TokenParser st -> CharParser st Integer+integer :: TokenParser st -> CharParser st Integer+float :: TokenParser st -> CharParser st Double+naturalOrFloat :: TokenParser st -> CharParser st (Either Integer Double)+decimal :: TokenParser st -> CharParser st Integer+hexadecimal :: TokenParser st -> CharParser st Integer+octal :: TokenParser st -> CharParser st Integer+symbol :: TokenParser st -> String -> CharParser st String+lexeme :: TokenParser st -> CharParser st a -> CharParser st a+whiteSpace :: TokenParser st -> CharParser st ()+parens :: TokenParser st -> CharParser st a -> CharParser st a+braces :: TokenParser st -> CharParser st a -> CharParser st a+angles :: TokenParser st -> CharParser st a -> CharParser st a+brackets :: TokenParser st -> CharParser st a -> CharParser st a+squares :: TokenParser st -> CharParser st a -> CharParser st a+semi :: TokenParser st -> CharParser st String+comma :: TokenParser st -> CharParser st String+colon :: TokenParser st -> CharParser st String+dot :: TokenParser st -> CharParser st String+semiSep :: TokenParser st -> CharParser st a -> CharParser st [a]+semiSep1 :: TokenParser st -> CharParser st a -> CharParser st [a]+commaSep :: TokenParser st -> CharParser st a -> CharParser st [a]+commaSep1 :: TokenParser st -> CharParser st a -> CharParser st [a]+makeTokenParser :: LanguageDef st -> TokenParser st++module Text.ParserCombinators.Parsec.Language+haskellDef :: LanguageDef st+haskell :: TokenParser st+mondrianDef :: LanguageDef st+mondrian :: TokenParser st+emptyDef :: LanguageDef st+haskellStyle :: LanguageDef st+javaStyle :: LanguageDef st+data LanguageDef st+LanguageDef :: String -> String -> String -> Bool -> CharParser st Char -> CharParser st Char -> CharParser st Char -> CharParser st Char -> [String] -> [String] -> Bool -> LanguageDef st+commentStart :: LanguageDef st -> String+commentEnd :: LanguageDef st -> String+commentLine :: LanguageDef st -> String+nestedComments :: LanguageDef st -> Bool+identStart :: LanguageDef st -> CharParser st Char+identLetter :: LanguageDef st -> CharParser st Char+opStart :: LanguageDef st -> CharParser st Char+opLetter :: LanguageDef st -> CharParser st Char+reservedNames :: LanguageDef st -> [String]+reservedOpNames :: LanguageDef st -> [String]+caseSensitive :: LanguageDef st -> Bool+-- Hoogle documentation, generated by Haddock+-- See Hoogle, http://www.haskell.org/hoogle/++module System.Process+data ProcessHandle+runCommand :: String -> IO ProcessHandle+runProcess :: FilePath -> [String] -> Maybe FilePath -> Maybe [(String, String)] -> Maybe Handle -> Maybe Handle -> Maybe Handle -> IO ProcessHandle+runInteractiveCommand :: String -> IO (Handle, Handle, Handle, ProcessHandle)+runInteractiveProcess :: FilePath -> [String] -> Maybe FilePath -> Maybe [(String, String)] -> IO (Handle, Handle, Handle, ProcessHandle)+waitForProcess :: ProcessHandle -> IO ExitCode+getProcessExitCode :: ProcessHandle -> IO (Maybe ExitCode)+terminateProcess :: ProcessHandle -> IO ()++module System.Cmd+system :: String -> IO ExitCode+rawSystem :: String -> [String] -> IO ExitCode+-- Hoogle documentation, generated by Haddock+-- See Hoogle, http://www.haskell.org/hoogle/++module System.Random+class RandomGen g+next :: RandomGen g => g -> (Int, g)+split :: RandomGen g => g -> (g, g)+genRange :: RandomGen g => g -> (Int, Int)+instance RandomGen StdGen+data StdGen+instance RandomGen StdGen+instance Read StdGen+instance Show StdGen+mkStdGen :: Int -> StdGen+getStdRandom :: (StdGen -> (a, StdGen)) -> IO a+getStdGen :: IO StdGen+setStdGen :: StdGen -> IO ()+newStdGen :: IO StdGen+class Random a+randomR :: (Random a, RandomGen g) => (a, a) -> g -> (a, g)+random :: (Random a, RandomGen g) => g -> (a, g)+randomRs :: (Random a, RandomGen g) => (a, a) -> g -> [a]+randoms :: (Random a, RandomGen g) => g -> [a]+randomRIO :: Random a => (a, a) -> IO a+randomIO :: Random a => IO a+instance Random Bool+instance Random Char+instance Random Double+instance Random Float+instance Random Int+instance Random Integer+-- Hoogle documentation, generated by Haddock+-- See Hoogle, http://www.haskell.org/hoogle/++module Control.Monad.STM+check :: Bool -> STM a++module Control.Concurrent.STM.TVar++module Control.Concurrent.STM.TMVar+data TMVar a+newTMVar :: a -> STM (TMVar a)+newEmptyTMVar :: STM (TMVar a)+newTMVarIO :: a -> IO (TMVar a)+newEmptyTMVarIO :: IO (TMVar a)+takeTMVar :: TMVar a -> STM a+putTMVar :: TMVar a -> a -> STM ()+readTMVar :: TMVar a -> STM a+swapTMVar :: TMVar a -> a -> STM a+tryTakeTMVar :: TMVar a -> STM (Maybe a)+tryPutTMVar :: TMVar a -> a -> STM Bool+isEmptyTMVar :: TMVar a -> STM Bool++module Control.Concurrent.STM.TChan+data TChan a+newTChan :: STM (TChan a)+newTChanIO :: IO (TChan a)+readTChan :: TChan a -> STM a+writeTChan :: TChan a -> a -> STM ()+dupTChan :: TChan a -> STM (TChan a)+unGetTChan :: TChan a -> a -> STM ()+isEmptyTChan :: TChan a -> STM Bool++module Control.Concurrent.STM.TArray+data TArray i e+instance MArray TArray e STM++module Control.Concurrent.STM+-- Hoogle documentation, generated by Haddock+-- See Hoogle, http://www.haskell.org/hoogle/++module Language.Haskell.TH.Syntax+class (Monad m, Functor m) => Quasi m+qNewName :: Quasi m => String -> m Name+qReport :: Quasi m => Bool -> String -> m ()+qRecover :: Quasi m => m a -> m a -> m a+qReify :: Quasi m => Name -> m Info+qCurrentModule :: Quasi m => m String+qRunIO :: Quasi m => IO a -> m a+instance Quasi IO+instance Quasi Q+class Lift t+lift :: Lift t => t -> Q Exp+instance Lift Bool+instance Lift Char+instance Lift Int+instance Lift Integer+instance (Lift a, Lift b) => Lift (a, b)+instance (Lift a, Lift b, Lift c) => Lift (a, b, c)+instance (Lift a, Lift b, Lift c, Lift d) => Lift (a, b, c, d)+instance (Lift a, Lift b, Lift c, Lift d, Lift e) => Lift (a, b, c, d, e)+instance (Lift a, Lift b, Lift c, Lift d, Lift e, Lift f) => Lift (a, b, c, d, e, f)+instance (Lift a, Lift b, Lift c, Lift d, Lift e, Lift f, Lift g) => Lift (a, b, c, d, e, f, g)+instance Lift a => Lift (Maybe a)+instance Lift a => Lift [a]+instance (Lift a, Lift b) => Lift (Either a b)+data Q a+instance Functor Q+instance Monad Q+instance Quasi Q+runQ :: Quasi m => Q a -> m a+report :: Bool -> String -> Q ()+recover :: Q a -> Q a -> Q a+reify :: Name -> Q Info+currentModule :: Q String+runIO :: IO a -> Q a+data Name+Name :: OccName -> NameFlavour -> Name+instance Data Name+instance Eq Name+instance Ord Name+instance Ppr Name+instance Show Name+instance Typeable Name+mkName :: String -> Name+newName :: String -> Q Name+nameBase :: Name -> String+nameModule :: Name -> Maybe String+showName :: Name -> String+showName' :: NameIs -> Name -> String+data NameIs+Alone :: NameIs+Applied :: NameIs+Infix :: NameIs+data Dec+FunD :: Name -> [Clause] -> Dec+ValD :: Pat -> Body -> [Dec] -> Dec+DataD :: Cxt -> Name -> [Name] -> [Con] -> [Name] -> Dec+NewtypeD :: Cxt -> Name -> [Name] -> Con -> [Name] -> Dec+TySynD :: Name -> [Name] -> Type -> Dec+ClassD :: Cxt -> Name -> [Name] -> [FunDep] -> [Dec] -> Dec+InstanceD :: Cxt -> Type -> [Dec] -> Dec+SigD :: Name -> Type -> Dec+ForeignD :: Foreign -> Dec+instance Data Dec+instance Eq Dec+instance Ppr Dec+instance Show Dec+instance Typeable Dec+data Exp+VarE :: Name -> Exp+ConE :: Name -> Exp+LitE :: Lit -> Exp+AppE :: Exp -> Exp -> Exp+InfixE :: Maybe Exp -> Exp -> Maybe Exp -> Exp+LamE :: [Pat] -> Exp -> Exp+TupE :: [Exp] -> Exp+CondE :: Exp -> Exp -> Exp -> Exp+LetE :: [Dec] -> Exp -> Exp+CaseE :: Exp -> [Match] -> Exp+DoE :: [Stmt] -> Exp+CompE :: [Stmt] -> Exp+ArithSeqE :: Range -> Exp+ListE :: [Exp] -> Exp+SigE :: Exp -> Type -> Exp+RecConE :: Name -> [FieldExp] -> Exp+RecUpdE :: Exp -> [FieldExp] -> Exp+instance Data Exp+instance Eq Exp+instance Ppr Exp+instance Show Exp+instance Typeable Exp+data Con+NormalC :: Name -> [StrictType] -> Con+RecC :: Name -> [VarStrictType] -> Con+InfixC :: StrictType -> Name -> StrictType -> Con+ForallC :: [Name] -> Cxt -> Con -> Con+instance Data Con+instance Eq Con+instance Ppr Con+instance Show Con+instance Typeable Con+data Type+ForallT :: [Name] -> Cxt -> Type -> Type+VarT :: Name -> Type+ConT :: Name -> Type+TupleT :: Int -> Type+ArrowT :: Type+ListT :: Type+AppT :: Type -> Type -> Type+instance Data Type+instance Eq Type+instance Ppr Type+instance Show Type+instance Typeable Type+type Cxt = [Type]+data Match+Match :: Pat -> Body -> [Dec] -> Match+instance Data Match+instance Eq Match+instance Ppr Match+instance Show Match+instance Typeable Match+data Clause+Clause :: [Pat] -> Body -> [Dec] -> Clause+instance Data Clause+instance Eq Clause+instance Ppr Clause+instance Show Clause+instance Typeable Clause+data Body+GuardedB :: [(Guard, Exp)] -> Body+NormalB :: Exp -> Body+instance Data Body+instance Eq Body+instance Show Body+instance Typeable Body+data Guard+NormalG :: Exp -> Guard+PatG :: [Stmt] -> Guard+instance Data Guard+instance Eq Guard+instance Show Guard+instance Typeable Guard+data Stmt+BindS :: Pat -> Exp -> Stmt+LetS :: [Dec] -> Stmt+NoBindS :: Exp -> Stmt+ParS :: [[Stmt]] -> Stmt+instance Data Stmt+instance Eq Stmt+instance Ppr Stmt+instance Show Stmt+instance Typeable Stmt+data Range+FromR :: Exp -> Range+FromThenR :: Exp -> Exp -> Range+FromToR :: Exp -> Exp -> Range+FromThenToR :: Exp -> Exp -> Exp -> Range+instance Data Range+instance Eq Range+instance Ppr Range+instance Show Range+instance Typeable Range+data Lit+CharL :: Char -> Lit+StringL :: String -> Lit+IntegerL :: Integer -> Lit+RationalL :: Rational -> Lit+IntPrimL :: Integer -> Lit+FloatPrimL :: Rational -> Lit+DoublePrimL :: Rational -> Lit+instance Data Lit+instance Eq Lit+instance Show Lit+instance Typeable Lit+data Pat+LitP :: Lit -> Pat+VarP :: Name -> Pat+TupP :: [Pat] -> Pat+ConP :: Name -> [Pat] -> Pat+InfixP :: Pat -> Name -> Pat -> Pat+TildeP :: Pat -> Pat+AsP :: Name -> Pat -> Pat+WildP :: Pat+RecP :: Name -> [FieldPat] -> Pat+ListP :: [Pat] -> Pat+SigP :: Pat -> Type -> Pat+instance Data Pat+instance Eq Pat+instance Ppr Pat+instance Show Pat+instance Typeable Pat+type FieldExp = (Name, Exp)+type FieldPat = (Name, Pat)+data Strict+IsStrict :: Strict+NotStrict :: Strict+instance Data Strict+instance Eq Strict+instance Show Strict+instance Typeable Strict+data Foreign+ImportF :: Callconv -> Safety -> String -> Name -> Type -> Foreign+ExportF :: Callconv -> String -> Name -> Type -> Foreign+instance Data Foreign+instance Eq Foreign+instance Ppr Foreign+instance Show Foreign+instance Typeable Foreign+data Callconv+CCall :: Callconv+StdCall :: Callconv+instance Data Callconv+instance Eq Callconv+instance Show Callconv+instance Typeable Callconv+data Safety+Unsafe :: Safety+Safe :: Safety+Threadsafe :: Safety+instance Data Safety+instance Eq Safety+instance Show Safety+instance Typeable Safety+type StrictType = (Strict, Type)+type VarStrictType = (Name, Strict, Type)+data FunDep+FunDep :: [Name] -> [Name] -> FunDep+instance Data FunDep+instance Eq FunDep+instance Ppr FunDep+instance Show FunDep+instance Typeable FunDep+data Info+ClassI :: Dec -> Info+ClassOpI :: Name -> Type -> Name -> Fixity -> Info+TyConI :: Dec -> Info+PrimTyConI :: Name -> Int -> Bool -> Info+DataConI :: Name -> Type -> Name -> Fixity -> Info+VarI :: Name -> Type -> Maybe Dec -> Fixity -> Info+TyVarI :: Name -> Type -> Info+instance Data Info+instance Ppr Info+instance Show Info+instance Typeable Info+data Fixity+Fixity :: Int -> FixityDirection -> Fixity+instance Data Fixity+instance Eq Fixity+instance Show Fixity+instance Typeable Fixity+data FixityDirection+InfixL :: FixityDirection+InfixR :: FixityDirection+InfixN :: FixityDirection+instance Data FixityDirection+instance Eq FixityDirection+instance Show FixityDirection+instance Typeable FixityDirection+defaultFixity :: Fixity+maxPrecedence :: Int+returnQ :: a -> Q a+bindQ :: Q a -> (a -> Q b) -> Q b+sequenceQ :: [Q a] -> Q [a]+data NameFlavour+NameS :: NameFlavour+NameQ :: ModName -> NameFlavour+NameU :: Int# -> NameFlavour+NameL :: Int# -> NameFlavour+NameG :: NameSpace -> PkgName -> ModName -> NameFlavour+instance Data NameFlavour+instance Eq NameFlavour+instance Ord NameFlavour+instance Typeable NameFlavour+data NameSpace+VarName :: NameSpace+DataName :: NameSpace+TcClsName :: NameSpace+instance Data NameSpace+instance Eq NameSpace+instance Ord NameSpace+instance Typeable NameSpace+mkNameG_v :: String -> String -> String -> Name+mkNameG_d :: String -> String -> String -> Name+mkNameG_tc :: String -> String -> String -> Name+type Uniq = Int+mkNameL :: String -> Uniq -> Name+mkNameU :: String -> Uniq -> Name+tupleTypeName :: Int -> Name+tupleDataName :: Int -> Name+type OccName = PackedString+mkOccName :: String -> OccName+occString :: OccName -> String+type ModName = PackedString+mkModName :: String -> ModName+modString :: ModName -> String+type PkgName = PackedString+mkPkgName :: String -> PkgName+pkgString :: PkgName -> String++module Language.Haskell.TH.PprLib+type Doc = PprM Doc+instance Show Doc+data PprM a+instance Monad PprM+empty :: Doc+semi :: Doc+comma :: Doc+colon :: Doc+space :: Doc+equals :: Doc+lparen :: Doc+rparen :: Doc+lbrack :: Doc+rbrack :: Doc+lbrace :: Doc+rbrace :: Doc+text :: String -> Doc+char :: Char -> Doc+ptext :: String -> Doc+int :: Int -> Doc+integer :: Integer -> Doc+float :: Float -> Doc+double :: Double -> Doc+rational :: Rational -> Doc+parens :: Doc -> Doc+brackets :: Doc -> Doc+braces :: Doc -> Doc+quotes :: Doc -> Doc+doubleQuotes :: Doc -> Doc+(<>) :: Doc -> Doc -> Doc+(<+>) :: Doc -> Doc -> Doc+hcat :: [Doc] -> Doc+hsep :: [Doc] -> Doc+($$) :: Doc -> Doc -> Doc+($+$) :: Doc -> Doc -> Doc+vcat :: [Doc] -> Doc+sep :: [Doc] -> Doc+cat :: [Doc] -> Doc+fsep :: [Doc] -> Doc+fcat :: [Doc] -> Doc+nest :: Int -> Doc -> Doc+hang :: Doc -> Int -> Doc -> Doc+punctuate :: Doc -> [Doc] -> [Doc]+isEmpty :: Doc -> PprM Bool+to_HPJ_Doc :: Doc -> Doc+pprName :: Name -> Doc+pprName' :: NameIs -> Name -> Doc++module Language.Haskell.TH.Ppr+nestDepth :: Int+type Precedence = Int+appPrec :: Precedence+opPrec :: Precedence+noPrec :: Precedence+parensIf :: Bool -> Doc -> Doc+pprint :: Ppr a => a -> String+class Ppr a+ppr :: Ppr a => a -> Doc+ppr_list :: Ppr a => [a] -> Doc+instance Ppr Clause+instance Ppr Con+instance Ppr Dec+instance Ppr Exp+instance Ppr Foreign+instance Ppr FunDep+instance Ppr Info+instance Ppr Match+instance Ppr Name+instance Ppr Pat+instance Ppr Range+instance Ppr Stmt+instance Ppr Type+instance Ppr a => Ppr [a]+pprFixity :: Name -> Fixity -> Doc+pprInfixExp :: Exp -> Doc+pprExp :: Precedence -> Exp -> Doc+pprFields :: [(Name, Exp)] -> Doc+pprMaybeExp :: Precedence -> Maybe Exp -> Doc+pprBody :: Bool -> Body -> Doc+pprLit :: Precedence -> Lit -> Doc+pprPat :: Precedence -> Pat -> Doc+pprVarStrictType :: (Name, Strict, Type) -> Doc+pprStrictType :: (Strict, Type) -> Doc+pprParendType :: Type -> Doc+pprTyApp :: (Type, [Type]) -> Doc+split :: Type -> (Type, [Type])+pprCxt :: Cxt -> Doc+where_clause :: [Dec] -> Doc+showtextl :: Show a => a -> Doc++module Language.Haskell.TH.Lib+type InfoQ = Q Info+type PatQ = Q Pat+type FieldPatQ = Q FieldPat+type ExpQ = Q Exp+type DecQ = Q Dec+type ConQ = Q Con+type TypeQ = Q Type+type CxtQ = Q Cxt+type MatchQ = Q Match+type ClauseQ = Q Clause+type BodyQ = Q Body+type GuardQ = Q Guard+type StmtQ = Q Stmt+type RangeQ = Q Range+type StrictTypeQ = Q StrictType+type VarStrictTypeQ = Q VarStrictType+type FieldExpQ = Q FieldExp+intPrimL :: Integer -> Lit+floatPrimL :: Rational -> Lit+doublePrimL :: Rational -> Lit+integerL :: Integer -> Lit+charL :: Char -> Lit+stringL :: String -> Lit+rationalL :: Rational -> Lit+litP :: Lit -> PatQ+varP :: Name -> PatQ+tupP :: [PatQ] -> PatQ+conP :: Name -> [PatQ] -> PatQ+infixP :: PatQ -> Name -> PatQ -> PatQ+tildeP :: PatQ -> PatQ+asP :: Name -> PatQ -> PatQ+wildP :: PatQ+recP :: Name -> [FieldPatQ] -> PatQ+listP :: [PatQ] -> PatQ+sigP :: PatQ -> TypeQ -> PatQ+fieldPat :: Name -> PatQ -> FieldPatQ+bindS :: PatQ -> ExpQ -> StmtQ+letS :: [DecQ] -> StmtQ+noBindS :: ExpQ -> StmtQ+parS :: [[StmtQ]] -> StmtQ+fromR :: ExpQ -> RangeQ+fromThenR :: ExpQ -> ExpQ -> RangeQ+fromToR :: ExpQ -> ExpQ -> RangeQ+fromThenToR :: ExpQ -> ExpQ -> ExpQ -> RangeQ+normalB :: ExpQ -> BodyQ+guardedB :: [Q (Guard, Exp)] -> BodyQ+normalG :: ExpQ -> GuardQ+normalGE :: ExpQ -> ExpQ -> Q (Guard, Exp)+patG :: [StmtQ] -> GuardQ+patGE :: [StmtQ] -> ExpQ -> Q (Guard, Exp)+match :: PatQ -> BodyQ -> [DecQ] -> MatchQ+clause :: [PatQ] -> BodyQ -> [DecQ] -> ClauseQ+dyn :: String -> Q Exp+global :: Name -> ExpQ+varE :: Name -> ExpQ+conE :: Name -> ExpQ+litE :: Lit -> ExpQ+appE :: ExpQ -> ExpQ -> ExpQ+infixE :: Maybe ExpQ -> ExpQ -> Maybe ExpQ -> ExpQ+infixApp :: ExpQ -> ExpQ -> ExpQ -> ExpQ+sectionL :: ExpQ -> ExpQ -> ExpQ+sectionR :: ExpQ -> ExpQ -> ExpQ+lamE :: [PatQ] -> ExpQ -> ExpQ+lam1E :: PatQ -> ExpQ -> ExpQ+tupE :: [ExpQ] -> ExpQ+condE :: ExpQ -> ExpQ -> ExpQ -> ExpQ+letE :: [DecQ] -> ExpQ -> ExpQ+caseE :: ExpQ -> [MatchQ] -> ExpQ+doE :: [StmtQ] -> ExpQ+compE :: [StmtQ] -> ExpQ+arithSeqE :: RangeQ -> ExpQ+fromE :: ExpQ -> ExpQ+fromThenE :: ExpQ -> ExpQ -> ExpQ+fromToE :: ExpQ -> ExpQ -> ExpQ+fromThenToE :: ExpQ -> ExpQ -> ExpQ -> ExpQ+listE :: [ExpQ] -> ExpQ+sigE :: ExpQ -> TypeQ -> ExpQ+recConE :: Name -> [Q (Name, Exp)] -> ExpQ+recUpdE :: ExpQ -> [Q (Name, Exp)] -> ExpQ+stringE :: String -> ExpQ+fieldExp :: Name -> ExpQ -> Q (Name, Exp)+valD :: PatQ -> BodyQ -> [DecQ] -> DecQ+funD :: Name -> [ClauseQ] -> DecQ+tySynD :: Name -> [Name] -> TypeQ -> DecQ+dataD :: CxtQ -> Name -> [Name] -> [ConQ] -> [Name] -> DecQ+newtypeD :: CxtQ -> Name -> [Name] -> ConQ -> [Name] -> DecQ+classD :: CxtQ -> Name -> [Name] -> [FunDep] -> [DecQ] -> DecQ+instanceD :: CxtQ -> TypeQ -> [DecQ] -> DecQ+sigD :: Name -> TypeQ -> DecQ+forImpD :: Callconv -> Safety -> String -> Name -> TypeQ -> DecQ+cxt :: [TypeQ] -> CxtQ+normalC :: Name -> [StrictTypeQ] -> ConQ+recC :: Name -> [VarStrictTypeQ] -> ConQ+infixC :: Q (Strict, Type) -> Name -> Q (Strict, Type) -> ConQ+forallC :: [Name] -> CxtQ -> ConQ -> ConQ+forallT :: [Name] -> CxtQ -> TypeQ -> TypeQ+varT :: Name -> TypeQ+conT :: Name -> TypeQ+appT :: TypeQ -> TypeQ -> TypeQ+arrowT :: TypeQ+listT :: TypeQ+tupleT :: Int -> TypeQ+isStrict :: Q Strict+notStrict :: Q Strict+strictType :: Q Strict -> TypeQ -> StrictTypeQ+varStrictType :: Name -> StrictTypeQ -> VarStrictTypeQ+cCall :: Callconv+stdCall :: Callconv+unsafe :: Safety+safe :: Safety+threadsafe :: Safety+funDep :: [Name] -> [Name] -> FunDep+combine :: [([(Name, Name)], Pat)] -> ([(Name, Name)], [Pat])+rename :: Pat -> Q ([(Name, Name)], Pat)+genpat :: Pat -> Q (Name -> ExpQ, Pat)+alpha :: [(Name, Name)] -> Name -> ExpQ+appsE :: [ExpQ] -> ExpQ+simpleMatch :: Pat -> Exp -> Match++module Language.Haskell.TH+data Q a+instance Functor Q+instance Monad Q+instance Quasi Q+runQ :: Quasi m => Q a -> m a+report :: Bool -> String -> Q ()+recover :: Q a -> Q a -> Q a+reify :: Name -> Q Info+currentModule :: Q String+runIO :: IO a -> Q a+data Name+instance Data Name+instance Eq Name+instance Ord Name+instance Ppr Name+instance Show Name+instance Typeable Name+mkName :: String -> Name+newName :: String -> Q Name+nameBase :: Name -> String+nameModule :: Name -> Maybe String+tupleTypeName :: Int -> Name+tupleDataName :: Int -> Name+data Dec+FunD :: Name -> [Clause] -> Dec+ValD :: Pat -> Body -> [Dec] -> Dec+DataD :: Cxt -> Name -> [Name] -> [Con] -> [Name] -> Dec+NewtypeD :: Cxt -> Name -> [Name] -> Con -> [Name] -> Dec+TySynD :: Name -> [Name] -> Type -> Dec+ClassD :: Cxt -> Name -> [Name] -> [FunDep] -> [Dec] -> Dec+InstanceD :: Cxt -> Type -> [Dec] -> Dec+SigD :: Name -> Type -> Dec+ForeignD :: Foreign -> Dec+instance Data Dec+instance Eq Dec+instance Ppr Dec+instance Show Dec+instance Typeable Dec+data Exp+VarE :: Name -> Exp+ConE :: Name -> Exp+LitE :: Lit -> Exp+AppE :: Exp -> Exp -> Exp+InfixE :: Maybe Exp -> Exp -> Maybe Exp -> Exp+LamE :: [Pat] -> Exp -> Exp+TupE :: [Exp] -> Exp+CondE :: Exp -> Exp -> Exp -> Exp+LetE :: [Dec] -> Exp -> Exp+CaseE :: Exp -> [Match] -> Exp+DoE :: [Stmt] -> Exp+CompE :: [Stmt] -> Exp+ArithSeqE :: Range -> Exp+ListE :: [Exp] -> Exp+SigE :: Exp -> Type -> Exp+RecConE :: Name -> [FieldExp] -> Exp+RecUpdE :: Exp -> [FieldExp] -> Exp+instance Data Exp+instance Eq Exp+instance Ppr Exp+instance Show Exp+instance Typeable Exp+data Con+NormalC :: Name -> [StrictType] -> Con+RecC :: Name -> [VarStrictType] -> Con+InfixC :: StrictType -> Name -> StrictType -> Con+ForallC :: [Name] -> Cxt -> Con -> Con+instance Data Con+instance Eq Con+instance Ppr Con+instance Show Con+instance Typeable Con+data Type+ForallT :: [Name] -> Cxt -> Type -> Type+VarT :: Name -> Type+ConT :: Name -> Type+TupleT :: Int -> Type+ArrowT :: Type+ListT :: Type+AppT :: Type -> Type -> Type+instance Data Type+instance Eq Type+instance Ppr Type+instance Show Type+instance Typeable Type+type Cxt = [Type]+data Match+Match :: Pat -> Body -> [Dec] -> Match+instance Data Match+instance Eq Match+instance Ppr Match+instance Show Match+instance Typeable Match+data Clause+Clause :: [Pat] -> Body -> [Dec] -> Clause+instance Data Clause+instance Eq Clause+instance Ppr Clause+instance Show Clause+instance Typeable Clause+data Body+GuardedB :: [(Guard, Exp)] -> Body+NormalB :: Exp -> Body+instance Data Body+instance Eq Body+instance Show Body+instance Typeable Body+data Guard+NormalG :: Exp -> Guard+PatG :: [Stmt] -> Guard+instance Data Guard+instance Eq Guard+instance Show Guard+instance Typeable Guard+data Stmt+BindS :: Pat -> Exp -> Stmt+LetS :: [Dec] -> Stmt+NoBindS :: Exp -> Stmt+ParS :: [[Stmt]] -> Stmt+instance Data Stmt+instance Eq Stmt+instance Ppr Stmt+instance Show Stmt+instance Typeable Stmt+data Range+FromR :: Exp -> Range+FromThenR :: Exp -> Exp -> Range+FromToR :: Exp -> Exp -> Range+FromThenToR :: Exp -> Exp -> Exp -> Range+instance Data Range+instance Eq Range+instance Ppr Range+instance Show Range+instance Typeable Range+data Lit+CharL :: Char -> Lit+StringL :: String -> Lit+IntegerL :: Integer -> Lit+RationalL :: Rational -> Lit+IntPrimL :: Integer -> Lit+FloatPrimL :: Rational -> Lit+DoublePrimL :: Rational -> Lit+instance Data Lit+instance Eq Lit+instance Show Lit+instance Typeable Lit+data Pat+LitP :: Lit -> Pat+VarP :: Name -> Pat+TupP :: [Pat] -> Pat+ConP :: Name -> [Pat] -> Pat+InfixP :: Pat -> Name -> Pat -> Pat+TildeP :: Pat -> Pat+AsP :: Name -> Pat -> Pat+WildP :: Pat+RecP :: Name -> [FieldPat] -> Pat+ListP :: [Pat] -> Pat+SigP :: Pat -> Type -> Pat+instance Data Pat+instance Eq Pat+instance Ppr Pat+instance Show Pat+instance Typeable Pat+type FieldExp = (Name, Exp)+type FieldPat = (Name, Pat)+data Strict+IsStrict :: Strict+NotStrict :: Strict+instance Data Strict+instance Eq Strict+instance Show Strict+instance Typeable Strict+data Foreign+ImportF :: Callconv -> Safety -> String -> Name -> Type -> Foreign+ExportF :: Callconv -> String -> Name -> Type -> Foreign+instance Data Foreign+instance Eq Foreign+instance Ppr Foreign+instance Show Foreign+instance Typeable Foreign+data Callconv+CCall :: Callconv+StdCall :: Callconv+instance Data Callconv+instance Eq Callconv+instance Show Callconv+instance Typeable Callconv+data Safety+Unsafe :: Safety+Safe :: Safety+Threadsafe :: Safety+instance Data Safety+instance Eq Safety+instance Show Safety+instance Typeable Safety+data FunDep+FunDep :: [Name] -> [Name] -> FunDep+instance Data FunDep+instance Eq FunDep+instance Ppr FunDep+instance Show FunDep+instance Typeable FunDep+data Info+ClassI :: Dec -> Info+ClassOpI :: Name -> Type -> Name -> Fixity -> Info+TyConI :: Dec -> Info+PrimTyConI :: Name -> Int -> Bool -> Info+DataConI :: Name -> Type -> Name -> Fixity -> Info+VarI :: Name -> Type -> Maybe Dec -> Fixity -> Info+TyVarI :: Name -> Type -> Info+instance Data Info+instance Ppr Info+instance Show Info+instance Typeable Info+data Fixity+Fixity :: Int -> FixityDirection -> Fixity+instance Data Fixity+instance Eq Fixity+instance Show Fixity+instance Typeable Fixity+data FixityDirection+InfixL :: FixityDirection+InfixR :: FixityDirection+InfixN :: FixityDirection+instance Data FixityDirection+instance Eq FixityDirection+instance Show FixityDirection+instance Typeable FixityDirection+defaultFixity :: Fixity+maxPrecedence :: Int+type InfoQ = Q Info+type ExpQ = Q Exp+type DecQ = Q Dec+type ConQ = Q Con+type TypeQ = Q Type+type CxtQ = Q Cxt+type MatchQ = Q Match+type ClauseQ = Q Clause+type BodyQ = Q Body+type GuardQ = Q Guard+type StmtQ = Q Stmt+type RangeQ = Q Range+type StrictTypeQ = Q StrictType+type VarStrictTypeQ = Q VarStrictType+type PatQ = Q Pat+type FieldPatQ = Q FieldPat+intPrimL :: Integer -> Lit+floatPrimL :: Rational -> Lit+doublePrimL :: Rational -> Lit+integerL :: Integer -> Lit+charL :: Char -> Lit+stringL :: String -> Lit+rationalL :: Rational -> Lit+litP :: Lit -> PatQ+varP :: Name -> PatQ+tupP :: [PatQ] -> PatQ+conP :: Name -> [PatQ] -> PatQ+infixP :: PatQ -> Name -> PatQ -> PatQ+tildeP :: PatQ -> PatQ+asP :: Name -> PatQ -> PatQ+wildP :: PatQ+recP :: Name -> [FieldPatQ] -> PatQ+listP :: [PatQ] -> PatQ+sigP :: PatQ -> TypeQ -> PatQ+fieldPat :: Name -> PatQ -> FieldPatQ+bindS :: PatQ -> ExpQ -> StmtQ+letS :: [DecQ] -> StmtQ+noBindS :: ExpQ -> StmtQ+parS :: [[StmtQ]] -> StmtQ+fromR :: ExpQ -> RangeQ+fromThenR :: ExpQ -> ExpQ -> RangeQ+fromToR :: ExpQ -> ExpQ -> RangeQ+fromThenToR :: ExpQ -> ExpQ -> ExpQ -> RangeQ+normalB :: ExpQ -> BodyQ+guardedB :: [Q (Guard, Exp)] -> BodyQ+normalG :: ExpQ -> GuardQ+normalGE :: ExpQ -> ExpQ -> Q (Guard, Exp)+patG :: [StmtQ] -> GuardQ+patGE :: [StmtQ] -> ExpQ -> Q (Guard, Exp)+match :: PatQ -> BodyQ -> [DecQ] -> MatchQ+clause :: [PatQ] -> BodyQ -> [DecQ] -> ClauseQ+dyn :: String -> Q Exp+global :: Name -> ExpQ+varE :: Name -> ExpQ+conE :: Name -> ExpQ+litE :: Lit -> ExpQ+appE :: ExpQ -> ExpQ -> ExpQ+infixE :: Maybe ExpQ -> ExpQ -> Maybe ExpQ -> ExpQ+infixApp :: ExpQ -> ExpQ -> ExpQ -> ExpQ+sectionL :: ExpQ -> ExpQ -> ExpQ+sectionR :: ExpQ -> ExpQ -> ExpQ+lamE :: [PatQ] -> ExpQ -> ExpQ+lam1E :: PatQ -> ExpQ -> ExpQ+tupE :: [ExpQ] -> ExpQ+condE :: ExpQ -> ExpQ -> ExpQ -> ExpQ+letE :: [DecQ] -> ExpQ -> ExpQ+caseE :: ExpQ -> [MatchQ] -> ExpQ+doE :: [StmtQ] -> ExpQ+compE :: [StmtQ] -> ExpQ+arithSeqE :: RangeQ -> ExpQ+appsE :: [ExpQ] -> ExpQ+fromE :: ExpQ -> ExpQ+fromThenE :: ExpQ -> ExpQ -> ExpQ+fromToE :: ExpQ -> ExpQ -> ExpQ+fromThenToE :: ExpQ -> ExpQ -> ExpQ -> ExpQ+listE :: [ExpQ] -> ExpQ+sigE :: ExpQ -> TypeQ -> ExpQ+recConE :: Name -> [Q (Name, Exp)] -> ExpQ+recUpdE :: ExpQ -> [Q (Name, Exp)] -> ExpQ+stringE :: String -> ExpQ+fieldExp :: Name -> ExpQ -> Q (Name, Exp)+valD :: PatQ -> BodyQ -> [DecQ] -> DecQ+funD :: Name -> [ClauseQ] -> DecQ+tySynD :: Name -> [Name] -> TypeQ -> DecQ+dataD :: CxtQ -> Name -> [Name] -> [ConQ] -> [Name] -> DecQ+newtypeD :: CxtQ -> Name -> [Name] -> ConQ -> [Name] -> DecQ+classD :: CxtQ -> Name -> [Name] -> [FunDep] -> [DecQ] -> DecQ+instanceD :: CxtQ -> TypeQ -> [DecQ] -> DecQ+sigD :: Name -> TypeQ -> DecQ+forImpD :: Callconv -> Safety -> String -> Name -> TypeQ -> DecQ+cxt :: [TypeQ] -> CxtQ+normalC :: Name -> [StrictTypeQ] -> ConQ+recC :: Name -> [VarStrictTypeQ] -> ConQ+infixC :: Q (Strict, Type) -> Name -> Q (Strict, Type) -> ConQ+forallT :: [Name] -> CxtQ -> TypeQ -> TypeQ+varT :: Name -> TypeQ+conT :: Name -> TypeQ+appT :: TypeQ -> TypeQ -> TypeQ+arrowT :: TypeQ+listT :: TypeQ+tupleT :: Int -> TypeQ+isStrict :: Q Strict+notStrict :: Q Strict+strictType :: Q Strict -> TypeQ -> StrictTypeQ+varStrictType :: Name -> StrictTypeQ -> VarStrictTypeQ+cCall :: Callconv+stdCall :: Callconv+unsafe :: Safety+safe :: Safety+threadsafe :: Safety+class Ppr a+ppr :: Ppr a => a -> Doc+ppr_list :: Ppr a => [a] -> Doc+instance Ppr Clause+instance Ppr Con+instance Ppr Dec+instance Ppr Exp+instance Ppr Foreign+instance Ppr FunDep+instance Ppr Info+instance Ppr Match+instance Ppr Name+instance Ppr Pat+instance Ppr Range+instance Ppr Stmt+instance Ppr Type+instance Ppr a => Ppr [a]+pprint :: Ppr a => a -> String+pprExp :: Precedence -> Exp -> Doc+pprLit :: Precedence -> Lit -> Doc+pprPat :: Precedence -> Pat -> Doc+pprParendType :: Type -> Doc+-- Hoogle documentation, generated by Haddock+-- See Hoogle, http://www.haskell.org/hoogle/++module Data.Time.Calendar.MonthDay+monthAndDayToDayOfYear :: Bool -> Int -> Int -> Int+dayOfYearToMonthAndDay :: Bool -> Int -> (Int, Int)+monthLength :: Bool -> Int -> Int++module Data.Time.Calendar.Julian+toJulianYearAndDay :: Day -> (Integer, Int)+fromJulianYearAndDay :: Integer -> Int -> Day+showJulianYearAndDay :: Day -> String+isJulianLeapYear :: Integer -> Bool+toJulian :: Day -> (Integer, Int, Int)+fromJulian :: Integer -> Int -> Int -> Day+showJulian :: Day -> String+julianMonthLength :: Integer -> Int -> Int+addJulianMonthsClip :: Integer -> Day -> Day+addJulianMonthsRollOver :: Integer -> Day -> Day+addJulianYearsClip :: Integer -> Day -> Day+addJulianYearsRollOver :: Integer -> Day -> Day++module Data.Time.Calendar.OrdinalDate+toOrdinalDate :: Day -> (Integer, Int)+fromOrdinalDate :: Integer -> Int -> Day+showOrdinalDate :: Day -> String+isLeapYear :: Integer -> Bool+mondayStartWeek :: Day -> (Int, Int)+sundayStartWeek :: Day -> (Int, Int)+fromMondayStartWeek :: Integer -> Int -> Int -> Day+fromSundayStartWeek :: Integer -> Int -> Int -> Day++module Data.Time.Calendar.WeekDate+toWeekDate :: Day -> (Integer, Int, Int)+fromWeekDate :: Integer -> Int -> Int -> Day+showWeekDate :: Day -> String++module Data.Time.Clock.POSIX+posixDayLength :: NominalDiffTime+type POSIXTime = NominalDiffTime+posixSecondsToUTCTime :: POSIXTime -> UTCTime+utcTimeToPOSIXSeconds :: UTCTime -> POSIXTime+getPOSIXTime :: IO POSIXTime++module Data.Time.Clock+newtype UniversalTime+ModJulianDate :: Rational -> UniversalTime+getModJulianDate :: UniversalTime -> Rational+instance Eq UniversalTime+instance Ord UniversalTime+data DiffTime+instance Enum DiffTime+instance Eq DiffTime+instance Fractional DiffTime+instance Num DiffTime+instance Ord DiffTime+instance Real DiffTime+instance Show DiffTime+secondsToDiffTime :: Integer -> DiffTime+picosecondsToDiffTime :: Integer -> DiffTime+data UTCTime+UTCTime :: Day -> DiffTime -> UTCTime+utctDay :: UTCTime -> Day+utctDayTime :: UTCTime -> DiffTime+instance Eq UTCTime+instance FormatTime UTCTime+instance Ord UTCTime+instance ParseTime UTCTime+instance Read UTCTime+instance Show UTCTime+data NominalDiffTime+instance Enum NominalDiffTime+instance Eq NominalDiffTime+instance Fractional NominalDiffTime+instance Num NominalDiffTime+instance Ord NominalDiffTime+instance Real NominalDiffTime+instance RealFrac NominalDiffTime+instance Show NominalDiffTime+addUTCTime :: NominalDiffTime -> UTCTime -> UTCTime+diffUTCTime :: UTCTime -> UTCTime -> NominalDiffTime+getCurrentTime :: IO UTCTime++module Data.Time.Calendar+newtype Day+ModifiedJulianDay :: Integer -> Day+toModifiedJulianDay :: Day -> Integer+instance Enum Day+instance Eq Day+instance FormatTime Day+instance Ord Day+instance ParseTime Day+instance Read Day+instance Show Day+addDays :: Integer -> Day -> Day+diffDays :: Day -> Day -> Integer+toGregorian :: Day -> (Integer, Int, Int)+fromGregorian :: Integer -> Int -> Int -> Day+showGregorian :: Day -> String+gregorianMonthLength :: Integer -> Int -> Int+addGregorianMonthsClip :: Integer -> Day -> Day+addGregorianMonthsRollOver :: Integer -> Day -> Day+addGregorianYearsClip :: Integer -> Day -> Day+addGregorianYearsRollOver :: Integer -> Day -> Day+isLeapYear :: Integer -> Bool++module Data.Time.Calendar.Easter+sundayAfter :: Day -> Day+orthodoxPaschalMoon :: Integer -> Day+orthodoxEaster :: Integer -> Day+gregorianPaschalMoon :: Integer -> Day+gregorianEaster :: Integer -> Day++module Data.Time.LocalTime+data TimeZone+TimeZone :: Int -> Bool -> String -> TimeZone+timeZoneMinutes :: TimeZone -> Int+timeZoneSummerOnly :: TimeZone -> Bool+timeZoneName :: TimeZone -> String+instance Eq TimeZone+instance FormatTime TimeZone+instance Ord TimeZone+instance ParseTime TimeZone+instance Read TimeZone+instance Show TimeZone+timeZoneOffsetString :: TimeZone -> String+minutesToTimeZone :: Int -> TimeZone+hoursToTimeZone :: Int -> TimeZone+utc :: TimeZone+getTimeZone :: UTCTime -> IO TimeZone+getCurrentTimeZone :: IO TimeZone+data TimeOfDay+TimeOfDay :: Int -> Int -> Pico -> TimeOfDay+todHour :: TimeOfDay -> Int+todMin :: TimeOfDay -> Int+todSec :: TimeOfDay -> Pico+instance Eq TimeOfDay+instance FormatTime TimeOfDay+instance Ord TimeOfDay+instance ParseTime TimeOfDay+instance Read TimeOfDay+instance Show TimeOfDay+midnight :: TimeOfDay+midday :: TimeOfDay+utcToLocalTimeOfDay :: TimeZone -> TimeOfDay -> (Integer, TimeOfDay)+localToUTCTimeOfDay :: TimeZone -> TimeOfDay -> (Integer, TimeOfDay)+timeToTimeOfDay :: DiffTime -> TimeOfDay+timeOfDayToTime :: TimeOfDay -> DiffTime+dayFractionToTimeOfDay :: Rational -> TimeOfDay+timeOfDayToDayFraction :: TimeOfDay -> Rational+data LocalTime+LocalTime :: Day -> TimeOfDay -> LocalTime+localDay :: LocalTime -> Day+localTimeOfDay :: LocalTime -> TimeOfDay+instance Eq LocalTime+instance FormatTime LocalTime+instance Ord LocalTime+instance ParseTime LocalTime+instance Read LocalTime+instance Show LocalTime+utcToLocalTime :: TimeZone -> UTCTime -> LocalTime+localTimeToUTC :: TimeZone -> LocalTime -> UTCTime+ut1ToLocalTime :: Rational -> UniversalTime -> LocalTime+localTimeToUT1 :: Rational -> LocalTime -> UniversalTime+data ZonedTime+ZonedTime :: LocalTime -> TimeZone -> ZonedTime+zonedTimeToLocalTime :: ZonedTime -> LocalTime+zonedTimeZone :: ZonedTime -> TimeZone+instance FormatTime ZonedTime+instance ParseTime ZonedTime+instance Read ZonedTime+instance Show ZonedTime+utcToZonedTime :: TimeZone -> UTCTime -> ZonedTime+zonedTimeToUTC :: ZonedTime -> UTCTime+getZonedTime :: IO ZonedTime+utcToLocalZonedTime :: UTCTime -> IO ZonedTime++module Data.Time.Clock.TAI+data AbsoluteTime+instance Eq AbsoluteTime+instance Ord AbsoluteTime+instance Show AbsoluteTime+taiEpoch :: AbsoluteTime+addAbsoluteTime :: DiffTime -> AbsoluteTime -> AbsoluteTime+diffAbsoluteTime :: AbsoluteTime -> AbsoluteTime -> DiffTime+type LeapSecondTable = Day -> Integer+utcDayLength :: LeapSecondTable -> Day -> DiffTime+utcToTAITime :: LeapSecondTable -> UTCTime -> AbsoluteTime+taiToUTCTime :: LeapSecondTable -> AbsoluteTime -> UTCTime+parseTAIUTCDATFile :: String -> LeapSecondTable++module Data.Time.Format+class FormatTime t+formatCharacter :: FormatTime t => Char -> Maybe (TimeLocale -> t -> String)+instance FormatTime Day+instance FormatTime LocalTime+instance FormatTime TimeOfDay+instance FormatTime TimeZone+instance FormatTime UTCTime+instance FormatTime ZonedTime+formatTime :: FormatTime t => TimeLocale -> String -> t -> String+parseTime :: ParseTime t => TimeLocale -> String -> String -> Maybe t+readTime :: ParseTime t => TimeLocale -> String -> String -> t+readsTime :: ParseTime t => TimeLocale -> String -> ReadS t+class ParseTime t+buildTime :: ParseTime t => TimeLocale -> [(Char, String)] -> t+instance ParseTime Day+instance ParseTime LocalTime+instance ParseTime TimeOfDay+instance ParseTime TimeZone+instance ParseTime UTCTime+instance ParseTime ZonedTime++module Data.Time
State/karma view
@@ -1,152 +1,945 @@-("ADEpt",1)-("Banksy",1)-("Beelsebob",3)-("Blicero",-1)-("CVS",-1)-("Cale",11)-("CategoryTheory",1)-("CosmicRay",4)-("Data.Typeable",1)-("GHC",1)-("Haskell",5)-("Heffalump",3)-("Igloo",8)-("Itkovian",0)-("JaffaCake",4)-("Java",-2)-("KZM",2)-("Korolary",1)-("Korollary",3)-("Korrolary",1)-("KrispyKringle",-1)-("Kzm",1)-("Lemmih",17)-("Lucinda",1)-("Maddas",1)-("Oejet",1)-("Parsec",1)-("Pseudonym",2)-("Pupeno",1)-("QuickCheck",7)-("RyanT5000",1)-("SKI",0)-("SamB",9)-("Saulzar",1)-("Spark",1)-("Speck",1)-("SyntaxNinja",8)-("Taral",1)-("TheHunter",5)-("TuringTest",4)-("ValarQ",1)-("_astrolabe",1)+("(File::HomeDir)",-1)+("--17:23:02",-1)+("\"",-2)+("\"C",2)+("\"nick",1)+("\"rhr",1)+("#",1)+("##c",4)+("##iso-c++/##c",1)+("#c",4)+("#define>THUNK_1_0>----",-1)+("#gentoo-uy",1)+("#haskell",5)+("'",-4)+("'s/^>//||!/\\S/||s/^/",-1)+("(",5)+("()",-1)+("(*p)",1)+("(->a)",1)+("(<",-1)+("(a->)",1)+("(C",1)+("(darwin's",1)+("*p1",2)+("+",4)+("++p*",1)+("-",-68)+("---",-1)+("--------------",-2)+("-----------------",-2)+("-----------------------",-1)+("------------------------------",-2)+("----------------------------------",-1)+("----------------------------------------------------------------------",-2)+("-rw-r--r",-9)+(".++.",1)+("100",-1)+("50",1)+("6.83--",-1)+("<",-91)+("<!",-4)+("<-",-13)+("<--",-3)+("<---",-3)+("<-----",-1)+("<-------------",-1)+("<<<----",-1)+("<bd_>",1)+("<nick>",1)+("@karma",1)+("@karma-",1)+("@pl",0)+("A",1)+("Aankhen",219)+("Aankhen``",1)+("abstraction",1)+("abz64__",1)+("ack",2)+("Adamant",1) ("adept",0)+("agentz",46)+("agentzh",15)+("ahmadz",1)+("ai",1)+("air",0)+("AIX",1)+("ajb",1)+("ajgill",1)+("ajs_work",1) ("akemp",1) ("alar",1)+("alblue",1) ("aleator",1)+("alex777",1)+("allbery_b",5)+("alphacar",1)+("alpheccar",1)+("anarchy",1)+("anatolyv",1)+("and",-1)+("andara",7)+("andygill",2) ("angLia",-1)-("araujo",4)+("aot",1)+("ap",1)+("apfelmus",1)+("apple",-8)+("aptitude",1)+("araujo",6)+("arch",-1)+("ari",2) ("arjanoosting",1)+("arossato",5) ("arrows",1)-("astrolabe",3)+("asian",0)+("astrolabe",6)+("asTypeOf",-1)+("AtnNn",1)+("audreyt",114)+("audreyt++.",1)+("augustss",10) ("autrijus",6)+("avar",187)+("azawawi",22)+("b7j0c",1)+("babelfish",0)+("bacta",-2)+("bakert",1)+("Banksy",1)+("base_16",1)+("bash",4) ("basti",1)-("beelsebob",2)+("basti_",3)+("bBacta",-1)+("bbkr",1)+("BCoppens",3)+("bd",1)+("bd_",3)+("bd_+",1)+("bd_-",-1)+("bebop",2)+("beelsebob",4) ("beelsebob_",-1) ("benny",1)+("beschmi",5)+("Binkley",2)+("birkenfeld",1) ("blackdog",3)-("boegel",2)+("bleach",4)+("Blicero",-1)+("blitz",1)+("bloodlust",1)+("bloonix",9)+("blwood",1)+("Bobstopper",2)+("boegel",3) ("bolrod",1)+("bonsaikitten",-1)+("bos",5)+("bos_",1)+("Botje",0)+("Bourbaki",6) ("boy",1)+("br1",-4)+("brainwashing",1)+("brian_d_foy",13)+("bringert",18)+("bsmith",3)+("bueno",1) ("bug",-1)+("bukakke",1)+("bunkers",1)+("buubot",-1)+("byorgey",7)+("ByteString",1)+("c",15)+("C#/F#/C",1)+("c++",-8)+("c+/c",1)+("c--",3)+("c--------",-1)+("C/",2)+("C/C",18)+("cabal",5)+("cadillac_",-9)+("cafe",-9)+("cafebabe",-1)+("cain",-8)+("cain--",1)+("Cale",64)+("caltech",1)+("calvins",1)+("caridad",-1)+("cases)",-1)+("CategoryTheory",1)+("category_theory",1)+("chameleon",2)+("chamelion",0)+("characters)",-1)+("chessguy",5)+("chorros",-1)+("chris",1)+("christopher",4)+("chromatic",2) ("chucky",1)+("cialis",1) ("cinema",1)+("circularity",1)+("cjeris",3)+("clkao",6)+("cmarcelo",13)+("COBOL",-3)+("coffeemug",3)+("colin_mochrie",1)+("comments",1)+("commitbit",1)+("compilerThatWontGuess",1)+("composability",1)+("comprehensions",1)+("conal",2)+("configure",-1)+("confused-",-1)+("CONISLI",1)+("const",1)+("Cont",0)+("conversational",-1) ("cormen",1)-("cosmicray",1)+("CosmicRay",2) ("cparrott",1)+("cristo",-1)+("cruft",-1)+("csv",-1)+("ctcp",-1)+("CVS",-1)+("cygwin",-1) ("daan",1)-("darcs",2)+("Daemmerung",-1)+("dakkar",9)+("darcs",12)+("DarkWolf84",1)+("Darren_Duncan",11)+("Data.Typeable",1) ("davidhouse",1)-("dcoutts",12)-("dons",35)-("droundy",1)+("daxim",2)+("dblhelix",1)+("dcoutss",1)+("dcoutsss",1)+("dcoutts",45)+("dcouttsByteString",1)+("dcoutts_",2)+("dcoutts__",0)+("ddarius",8)+("dduncan",1)+("deadbeef",2)+("debian",-1)+("debug",-1)+("define",1)+("demerphq",5)+("dependencies",-1)+("desegnis",1)+("dfeuer",1)+("dfranke",1)+("dgoldsmith",1)+("dgriffi3",1)+("diakopter",5)+("dibblego",4)+("diversity",1)+("djinn",2)+("dlo",115)+("dlocaus",9)+("dmead",3)+("dmhouse",5)+("dmq",1)+("dmwit",1)+("dolio",11)+("dons",140)+("doserj",1)+("dot",1)+("droundy",6)+("DukeDave",1)+("dvorak",2)+("dylan",4)+("e17",2)+("earthy",1)+("eclipse",-5)+("edwardk",4)+("Eelis",1) ("eivuokko",1)+("ekidd",1)+("Elifant",2)+("elmex",1)+("ELP",1)+("elpolilla",-5)+("else",-1) ("elvix",6)+("emacs",0)+("emertens",2)+("emk",1)+("emoggi",1)+("emu",1)+("engineers",1)+("entropyfails",1) ("epichrom",-1) ("epigram",1)+("erg0t",-51)+("eric256",1)+("err",0)+("error",-1)+("errors)",1)+("esr",-1)+("EvilRanter",1)+("EvilTerran",6)+("eviltwin_b",3)+("example",1)+("expletives",1)+("expressive",1)+("fabiim",1)+("factor",0)+("fasta",2)+("fax",21)+("faxathisia",1)+("FC",3)+("ferreira",1)+("ffmpeg",1)+("fglock",401)+("final",-1)+("fingers",-1)+("firefox",1)+("first",1)+("fix",1)+("FMota",1)+("folks)",1)+("foo",-1) ("foobar",1)-("foxy",1)-("franka",2)+("FORTRAN",-1)+("foxy",4)+("FP",1)+("fps",1)+("frangor",0)+("franka",3)+("freewifi",1)+("fromIntegral",1)+("FTP",-1)+("funktio",1)+("fusibility",1)+("g",18)+("g++",-1)+("gaal",17)+("gabriele",1)+("gattocarlo",1)+("gbacon",1)+("GCC/G",1)+("GeJ",1)+("generation",2)+("gentoo",-4)+("george",-8)+("ggoebel",3)+("ghc",4) ("ghcprof",1)+("git",1)+("git-bisect",1)+("give",-1)+("gleb",1)+("glguy",51)+("globales",-1)+("gmail",-1)+("gnome",-23)+("gnuplot",0)+("gnuvince",6)+("Gofer",1) ("goltrpoat",1)+("google",-1) ("goron",0)-("gour",1)+("gour",2)+("gpm",2)+("gravity",-1)+("greentea",1) ("grephthosthenes",2)-("haskell",2)+("GTK",-1)+("gutsy",1)+("gvim",1)+("h",1)+("hackathon",1)+("haddock",1)+("happs",1)+("Haskel98modules",-1)+("haskell",22)+("haskell-curious",1)+("haskellNoob",1)+("hate",1)+("Heffalump",6) ("hefner",1)-("hoogle",2)-("hugs",1)+("here",1)+("holidays",1)+("hoogle",4)+("hthtrshs",1)+("https",1)+("Hudak",-1)+("hueso",-13)+("huffmanizing",1)+("hugs",3) ("humasect",1)-("ibid",1)-("ihope",2)-("int-e",5)+("HUnit",1)+("HWN",1)+("HXT",1)+("hyrax42",4)+("i",1)+("iah",1)+("Iambdabot",1)+("ibid",3)+("iblech",2)+("icfp-organizers",6)+("ick",1)+("IDA",1)+("idnar",1)+("IEEE",0)+("igli",1)+("Igloo",14)+("ihope",3)+("ikegami",-1)+("in",0)+("information",0)+("inliner",1)+("insomnia",-1)+("instance_Monad_((->)_r)",1)+("INS_MARKER_DEF='",-1)+("INS_MARKER_IMPORT='",-1)+("int-e",31)+("integral",-1) ("interact",1)-("java",4)-("jethr0",1)+("intern",1)+("ion3",1)+("irc",-1)+("iron_maiden",5)+("ish",1)+("issues",-1)+("it-",-1)+("Itkovian",-1)+("J",3)+("Jaak",1)+("JaffaCake",14)+("java",-22)+("Java/C",2)+("jcreigh",4)+("jedai",1)+("jeremy",1)+("jethr0",2)+("jgrimes",1)+("jgrimes_",1)+("jhc",1) ("jip",4)-("joelr1",2)+("jnthn",1)+("joelonsoftware",1)+("joelr1",3)+("JohnMeacham",3)+("jonalv",2) ("jonkri",1)+("jrockway",0)+("json",1)+("Juerd",7) ("juhp",2)-("jyp",1)+("jyp",2)+("kaitlyn",1)+("karma",5)+("karmatestthing",2)+("KatieHuber",1)+("kawa",1)+("kde",1)+("ketil",1)+("kfish",6)+("kjwcode",2)+("knowledge",2)+("koeien",1)+("kolibrie",3)+("kolmodin",2)+("kolmodin1",1)+("kolpudding",1)+("Korolary",1) ("korollary",-1)-("kosmikus",1)-("kowey",1)-("kzm",1)-("lambdabot",12)-("lightstep",1)-("lispy",3)+("Korrolary",1)+("kosmikus",7)+("kowey",4)+("kp6",1)+("kpreid",12)+("kramms",-1)+("KrispyKringle",-1)+("kudra",10)+("kuribas`",1)+("kuser",2)+("kyevan",2)+("kzm",5)+("lag",-1)+("lambdabot",51)+("lambdacats",1)+("lament",2)+("lanny",1)+("larry",2)+("LarryWall",-1)+("later",0)+("latex",-2)+("laziness",2)+("lazyness",1)+("lazy_gather_take",1)+("leCamarade",1)+("leed",1)+("lelit",1)+("Lemmih",2)+("lennart",4)+("lftp",1)+("libraries@haskell.org",-1)+("libstdc",2)+("lightstep",2)+("like",-1)+("Limbic_Region",8)+("Limbric_Region",1)+("linux",1)+("lisppaste",1)+("lisppaste2",2)+("lispy",21)+("lithyum",-2)+("liyang",1)+("LoganCapaldo",2)+("Lokadin",0) ("lomeX",1)+("LordBrain",3)+("love",1)+("LPhas",1)+("Lucinda",1)+("lumi",2)+("luqui",13)+("luquick",1)+("lvm",1)+("lwall",55)+("lysdexsik",1)+("LyX",1)+("macbook",-1)+("Maddas",1)+("madpickle",1)+("make",-1)+("makstos",1)+("malcolm",4)+("malcolmw",3)+("malon",3)+("managers",-1)+("mapAccumL",1)+("markha",2)+("markstos",8)+("masak",40)+("Masklinn",1)+("math",-1)+("mathewm",1) ("maths",1)-("mauke",1)+("matt_r",0)+("mauke",9)+("max",2)+("mbishop",1)+("mboes",1)+("mchaves",1)+("MD5",-1)+("mediacorporations",-1)+("mercurial",1)+("messages)",-1)+("metal",2)+("metallica",-2)+("metaobjects",1) ("mflux",3)-("monochrom",3)-("musasabi",10)+("michaelkohwj",1)+("microsoft",-2)+("MiKTeX",1)+("miniperl6",1)+("misterbeebee",0)+("MJD",1)+("mnessenger",0)+("mnislaih",3)+("mod",2)+("modularity",1)+("monad",1)+("monadcomprehensions",1)+("monads",2)+("MonadZero",1)+("monochrom",17)+("monomorphism",-1)+("monomorphism_restriction",-1)+("moo",1)+("moose",1)+("moritz",160)+("moritz_",11)+("mozilla",1)+("MP0",0)+("mp6",1)+("MR",-2)+("mrd",4)+("ms",-1)+("MSVC",2)+("mtl",1)+("mukai",1)+("mundo",-1)+("musasabi",16)+("mushy_pile_of_code",1)+("mux",3) ("mwc",-1)+("n+k",-1)+("name",1)+("nap",1) ("ncalexan",1)-("ndm",6)-("norpan",2)-("nothingmuch",0)+("ndm",16)+("negate",1)+("Nei",2)+("Nelson",1)+("neuronas-erg0t",-1)+("newsham",6)+("nick",2)+("nmessenger",2)+("nnunley",0)+("nocotigo",1)+("nomeata",2)+("nominolo",0)+("nornagon",5)+("norpan",0)+("nostromo",1)+("notebook",-3)+("nothingmuch",9)+("notsmack",2)+("nr",1)+("nscan",1)+("nub",1)+("nwc10",1) ("oasisbot",1)+("obfuscation",1)+("obra",4) ("ocaml",0)-("palomer",4)+("ocaml/c",1)+("oejan",-1)+("Oejet",1)+("oerjan",11)+("of",0)+("olas",3)+("Olathe",2)+("Ollydbg",1)+("olsner",3)+("omnId",9)+("omnIdiot",0)+("omniscientIdiot",0)+("OO",1)+("ookk",2)+("openoffice",-1)+("opensource",1)+("opera",-2)+("opqdonut",1)+("options",-1)+("osx",2)+("OUTPUT[-",-1)+("OUTPUT[fglock",2)+("overlay",-1)+("p",1)+("paj",1)+("palomer",5)+("paolin1",1) ("paolino",1)+("parsec",2)+("particle",2)+("pattern-matching",1)+("Patterner",2)+("patterns_in_list_comprehension",1)+("pbx",1)+("pc",2)+("pejo",2) ("perl",-1)-("petekaz",1)+("perl6",5)+("perlbot",-1)+("perlDreamer",3)+("pesimismo",1)+("petekaz",2)+("Philippa",4)+("Philippa_",2)+("php",-1) ("phys_rules",1)+("Piponi",1)+("pkhuong",2)+("pl",1)+("pmichaud",5)+("pmurias",128) ("poetix",3)+("pony",1)+("portability)",-1)+("positiveoutlook",1)+("postfix",-1)+("Prelude",1)+("Problems)",-1)+("Programming\"",1)+("prolog",-1)+("Pseudonym",15)+("pstickne",1)+("psychic",0)+("psykotic",5)+("ptolomy",1)+("pugs",1)+("Pupeno",3)+("putter",41)+("pwadler",1)+("python",-1)+("qc",-4)+("qemu",1)+("quickcheck",1)+("quicksilver",9)+("quiet",1)+("ral1",1)+("ramok",1)+("raxas",1)+("readline",1)+("recursion",2)+("referential_transparency",1)+("RemiTurk",1)+("renormalist",37) ("rep",1)+("repl",1)+("reports",-1)+("resources)",-1)+("rgs",3)+("rhr",5)+("ricky_clarkson",1) ("robdockins",3)+("rob|",3)+("roconnor",2)+("rodi",2)+("RogerTaylor",1) ("romildo",1)+("ross",1)+("rumble",-1) ("runhaskell",3)-("samB",0)+("runpugs",1)+("ruoso",117)+("RWS",-1)+("RyanT5000",1)+("Saizan",4)+("samb",0)+("SamB_XP",1)+("samreid",2)+("samurai7",1)+("Samus_",-3)+("sanctuary",1)+("sartak",16)+("Saulzar",1)+("scanl",1)+("scary",-1)+("scary_IO_monad",-1)+("scheme",-1)+("school",-1)+("sclv",1)+("scook0",2)+("scsibug",3)+("seano",1)+("search",1)+("sebazzz",-50)+("see",-1)+("segfault",-1)+("self.counter",1) ("sethk",4)-("shapr",17)-("sjanssen",9)+("sex",1)+("sh",-1)+("shadowfax",1)+("shapr",40)+("shay",1)+("shay|p6",1)+("shillelagh",3)+("shoffsta",1)+("SICP",1)+("sieni",4)+("sigfpe_",1)+("signatures-",-1)+("silvina",1)+("simonmar",1)+("sjanssen",51) ("sjanssen_",1)-("ski",4)+("skew",1)+("ski",10)+("slava",1)+("slavemaster",-1)+("sleepycat",-1)+("SmallCheck",1)+("smartlinks",2)+("smoke-",-1)+("socal",-1)+("softice",1)+("somebody",1)+("somenick++or",-1)+("sorear",25)+("soreman",-6)+("sorman",6)+("spaceinvader",0)+("spam",-1)+("Spark",1)+("Speck",1)+("spj",4)+("SPPN",1)+("sp\195\164tzle",1)+("ssh_forwarding",1)+("staff",1)+("static",0)+("static_typing",1) ("stefanw",1)-("stepcut",1)+("stepcut",3)+("streams",1)+("strong",1)+("Students;",-1)+("subbot",-1)+("subtract",1)+("suite>",1)+("sunnavy",12)+("SuSE",-2)+("svn",1)+("svnbot",1)+("sw17ch",1)+("sweden",1)+("swiert",8)+("SynapticPackageManager",1) ("syntaxfree",1)+("SyntaxNinja",11)+("Syzygy-",1)+("szabgab",9)+("tabs",-1)+("Tac-Tics2",1)+("tamarin",1)+("Taral",1)+("technology",1)+("Tene",0)+("test",3)+("testing)",1)+("th",-1)+("TheHunter",5)+("then",-1)+("theory",1)+("therp",1) ("the_evil_mangler",1) ("thighs",1)+("thinkpad",2)+("Thomas2_",1)+("ThreeQ",1)+("THUNK>-->-----",-1)+("tibbe",1)+("tikal",1)+("tilde/yakuake",1) ("timbod",1)+("time",-1)+("TimToady",8)+("tinyurl",3)+("tizoc",-102)+("tmoertel",3)+("TomPledger",2)+("tomshackell",1)+("ToRA",1)+("Toxaris",2)+("trabajo",-1)+("trac",1)+("TreyHarris",4)+("TSC",1)+("tumulus",3)+("tuomov",2)+("TuringTest",5)+("tuukkah",2)+("twanvl",7) ("twobitsprite",1)+("types",1)+("typesystem",1)+("U",1)+("u221e",2)+("uberpinguin",1) ("ulfdoz",1)-("unfoldr",3)+("uncons",1)+("undefined",1)+("unfoldr",7)+("unicode",1)+("university",1)+("unix",2)+("unpl",0)+("urgencyhook",1)+("use/mention",1)+("ValarQ",1)+("vascolet",12)+("vb",1)+("vb2hs",1)+("VC",6)+("vegai",2)+("ventonegro",2)+("viagra",1)+("views",1)+("vim",1) ("vim7",1)-("vincenz",4)-("wli",1)-("xerox",15)-("yhc",1)+("vimdiff",1)+("VImtermute",1)+("vincenz",19)+("vincenz/vincenz",1)+("virtualisation",1)+("visof",0)+("vista",-6)+("VisualJ",1)+("vital",1)+("vmware",1)+("vox",-1)+("wait",-1)+("walking",1)+("warmfuzzy",1)+("was",0)+("weekend",1)+("weitzman",-1)+("wget",1)+("whatsoever-",-1)+("whois",1)+("WholeWorld",1)+("wikipedia",0)+("windows",-4)+("wli",4)+("wnoise",1)+("wolverian",4)+("Writer",-1)+("WriterList",-1)+("WriterSequence",1)+("x",2)+("x3m",1)+("xDie",-2)+("xerox",28)+("xfce",3)+("xic",1)+("xinming",2)+("xkcd",3)+("xpdf",1)+("xs",1)+("xxx-x",0)+("y",0)+("Y-combinator",1)+("yaht",2)+("yaml",1)+("yaxu",4)+("yeah",-3)+("yhc",2)+("yiddel",1)+("yo",2)+("yodel",1)+("you!--More",-1) ("yozora",1)+("za",1)+("Zao",1)+("zeeeeeee",1) ("zellyn",0)+("zenpro",1)+("Ziggy6",3)+("zipWith",1)+("zonaforo",-4)+("zpg",1)+("ZU",-1)+("[()]",-1)+("[1]",1)+("[particle]",4)+("\\d",1)+("\\|-",-1)+("^",-1)+("^-",-1)+("_astrolabe",1)+("_foca",-2)+("_PB_",1)+("`",-5)+("|",-1)+("\150",-1)+("\226\144\164fglock",5)+("yi-gtk.cabal:",-1)
− State/lambda
@@ -1,262 +0,0 @@-100000-("Arrow"," \\t1 t2 v a q.a t1 t2")-("B"," \\f g x. f (g x)")-("Branch"," \\l k r lk bk.bk l k r")-("C"," \\f x y.f y x")-("Cons"," \\a l n c.c a l")-("False"," \\x y. y")-("Forall"," \\vs t v a q.q vs t")-("I"," \\x.x")-("Just"," \\x n j.j x")-("K"," \\x y.x")-("Leaf"," \\x l b.l x")-("Left"," \\x l r.l x")-("MonadError"," [flip (either Left),Right,Left,\\m h.either h Right m]")-("MonadLP"," [\\m f k.m (\\a.f a k),\\a k.k a]")-("MonadParser"," [\\m f s.either Left (pair (\\a s.f a s)) (m s),\\a s.Right (Pair a s),\\s.Right (Pair s s),\\s x.Right (Pair x s),\\e s.Left e,\\m1 m2 s.either (const (m2 s)) Right (m1 s)]")-("MonadReader"," [\\m f r.f (m r) r,\\a r.a,\\r.r,\\f e r.e (f r)]")-("MonadState"," [\\m f s.pair (\\a s.f a s) (m s),\\a s.Pair a s,\\s.Pair s s,\\x s.Pair s x]")-("MonadWriter"," MonadWriter_ [] (\\x y.x++y)")-("MonadWriter_"," \\mempty mappend.[\\m f.pair (\\a w.pair (\\b w2.Pair b (mappend w w2)) (f a)) m,\\a.Pair a mempty,\\w.Pair w w,\\m.pair (\\a w.Pair (Pair a w) w) m,\\m.pair (\\p w.pair (\\a f.Pair a (f w)) p) m]")-("Nil"," const")-("Nothing"," const")-("Pair"," \\x y k.k x y")-("Right"," \\x l r.r x")-("S"," \\f g x.f x (g x)")-("StateT"," \\m.[\\e f s.runMonad m (bind (e s) (pair (\\a s.f a s))),\\a s.runMonad m (return (Pair a s)),\\s.runMonad m (return (Pair s s)),\\s x.runMonad m (return (Pair x s))]")-("Succ"," \\n z s.s n")-("TVar"," \\s v a q.v s")-("Term"," \\a ts var term.term a ts")-("True"," \\x y. x")-("U"," \\f. f f")-("Var"," \\v var term.var v")-("X"," \\x.x K S K")-("Y"," \\f.U(\\g.f(U g))")-("Zero"," \\z s.z")-("a"," map (either bad fst . runMonad MonadParser parseRule) [\"lookup(cons(pair(K,V),T),K,V).\",\"lookup(cons(P,T),K,V) :- lookup(T,K,V).\"]")-("all"," \\p.and . map p")-("alt"," \\m1 m2 m.nth 5 m (m1 m) (m2 m)")-("ana"," unfoldr")-("and"," foldr (\\x y.x&&y) True")-("any"," \\p.or . map p")-("apo"," \\g n.maybe [] (\\p.fst p:either id (apo g) (snd p)) (g n)")-("app"," flip (foldr (\\x xs.x:xs))")-("append"," flip (fold Cons)")-("ask"," nth 2")-("between"," \\l r p.bind_ l $ bind_ spaces $ bind p $ \\res.bind_ r $ bind_ spaces (return res)")-("bind"," \\m1 f m.bind_internal m (m1 m) (\\a.f a m)")-("bind_"," \\m1 m2.bind m1 (const m2)")-("bind_internal"," nth 0")-("brp"," \\l.if null (tail l) then l else cat $ unzip $ brp $ group' l id")-("car"," list undefined const")-("cat"," pair (\\x y.x++y)")-("cata"," foldr")-("catchError"," \\e h m.nth 3 m (e m) (\\a.h a m)")-("cdr"," list undefined (K I)")-("chAnd"," \\x y . x y chFalse")-("chFalse"," \\x y. y")-("chIf"," I")-("chNot"," \\x y z . x z y")-("chOr"," \\x y . x chTrue y")-("chTrue"," \\x y. x")-("char"," \\c.sat (\\x.x==c)")-("charToDigit"," \\c.if c == '0' then 0 else if c == '1' then 1 else if c == '2' then 2 else if c == '3' then 3 else if c == '4' then 4 else if c == '5' then 5 else if c == '6' then 6 else if c == '7' then 7 else if c == '8' then 8 else if c == '9' then 9 else undefined")-("choice"," foldl alt (parseError \"parse error - choice\")")-("comma"," symbol \",\"")-("concat"," foldr (\\x y.x++y) []")-("concatMap"," \\f.concat . map f")-("cons"," \\h t n c. c h t")-("const"," \\x y.x")-("curry"," \\f x y.f (Pair x y)")-("cycle"," \\l.fix (\\x.l++x)")-("decay"," \\n.sum (factors n) - n")-("decaySequence"," \\n.n : unfoldr (\\n.if n == 0 then Nothing else (\\m.Just (Pair m m)) (decay n)) n")-("delete"," deleteBy (\\x y.x==y)")-("deleteBy"," \\eq x l.if null l then [] else if x `eq` head l then tail l else head l : deleteBy eq x (tail l)")-("deleteFirstsBy"," \\eq.foldl (flip (deleteBy eq))")-("diff"," foldl (flip delete)")-("digitToChar"," \\n.if n==0 then '0' else if n==1 then '1' else if n==2 then '2' else if n==3 then '3' else if n==4 then '4' else if n==5 then '5' else if n==6 then '6' else if n==7 then '7' else if n==8 then '8' else if n==9 then '9' else undefined")-("divides"," \\d.\\n.n `mod` d == 0")-("dot"," symbol \".\"")-("drop"," \\n l.if null l || n <= 0 then l else drop (n-1) (tail l)")-("dropWhile"," \\p l.if null l then [] else if p (head l) then dropWhile p (tail l) else l")-("either"," \\f g e. e f g")-("elem"," \\x.any (\\y.x==y)")-("enumFrom"," iterate (\\x.x+1)")-("enumFromThen"," \\m n.iterate (\\x.(n-m)+x) m")-("enumFromThenTo"," \\l r h.takeWhile (if r>=l then (\\x.x<=h) else (\\x.x>=h)) $ enumFromThen l r")-("enumFromTo"," \\l h.take (h-l+1) $ iterate (\\x.x+1) l")-("even"," \\x.x `mod` 2 == 0")-("fac"," product . fromTo 1")-("fact"," Y (\\fact. (\\n. if (n == 1) then 1 else (n * (fact (n - 1)))))")-("factors"," \\n.if n == 0 then from 0 else filter (\\d.d `divides` n) (fromTo 1 n)")-("factorsOLD"," \\n.if n == 0 then from 0 else filter (\\d.d `divides` n) (fromTo 1 n)")-("failed"," \\dict k.id")-("fibs"," 1:1:zipWith (\\x y.x+y) fibs (tail fibs)")-("filter"," \\p.foldr (\\x y.if p x then x:y else y) []")-("first"," head")-("fix"," \\f.f (fix f)")-("flip"," \\f x y.f y x")-("foldTerm"," \\var term.termCase var (\\a ts.term a (map (foldTerm var term) ts))")-("foldl"," \\c n l.if null l then n else foldl c (c n (head l)) (tail l)")-("foldl1"," \\f l.foldl f (head l) (tail l)")-("foldr"," \\c n l.if null l then n else c (head l) (foldr c n (tail l))")-("foldr1"," \\f l.if null (tail l) then head l else f (head l) (foldr1 f (tail l))")-("followLinks"," foldTerm (\\v.readLPRef v `bind` maybe (return (Var v)) followLinks) (\\a ts.sequence ts `bind` \\ts'.return (Term a ts'))")-("foo"," 3")-("free"," newLPRef Nothing `bind` \\ref. return (Var ref)")-("freevars"," type (\\x.[x]) (\\t1 t2.freevars t1 `union` freevars t2) (\\vs t.freevars t `diff` vs)")-("from"," enumFrom")-("fromList"," foldr Cons Nil")-("fromThen"," enumFromThen")-("fromThenTo"," enumFromThenTo")-("fromTo"," enumFromTo")-("fst"," \\p.p const")-("genCase"," \\n l d.if null l then d n else if fst (head l) == n then snd (head l) n else genCase n (tail l) d")-("get"," nth 2")-("getConstructor"," termCase error_getConstructor (\\a _.a)")-("group"," groupBy (\\x y.x==y)")-("group'"," \\l k.if null l then k [] else group' (tail (tail l)) (k . (\\x.Pair (head l) (head (tail l)) : x))")-("groupBy"," \\eq l.if null l then [] else pair (\\ys zs.(head l : ys) : groupBy eq zs) (span (eq (head l)) (tail l))")-("id"," \\x.x")-("identifier"," bind get $ \\s.bind (sat (\\c.isIdentifierLetter c && not (isDigit c) && (c/='-' || null (tail s) || not (isDigit (head (tail s)))))) $ \\c.bind (many (sat isIdentifierLetter)) $ \\cs.bind_ spaces $ return (c:cs)")-("init"," \\l.if null (tail l) then [] else head l : init (tail l)")-("internalListCase"," \\n c l.if null l then n else c (head l) (tail l)")-("interpretTerm"," foldTerm (\\v env.maybe (free `bind` \\v'.return (Pair v' (Pair v v':env))) (\\a.return (Pair a env)) (lookup v env)) (\\a ts env.foldl (\\m f.m `bind` \\p.f (snd p) `bind` pair (\\t env'.return (Pair (t:fst p) env'))) (return (Pair [] env)) ts `bind` pair (\\ts' env'.return (Pair (Term a (reverse ts')) env')))")-("intersperse"," \\sep l.if null l then [] else if null (tail l) then l else head l : sep : intersperse sep (tail l)")-("isDigit"," \\c.c >= '0' && c <= '9'")-("isIdentifierLetter"," \\c.notElem c \" []\\\"{}';(),\"")-("isPrime"," (\\n. all (\\x. x /= 0) (map (mod n) (enumFromTo 2 (sqrt n + 1))))")-("isSpace"," \\c.c==' '")-("isUpper"," \\c.elem c \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"")-("isVar"," termCase Just (\\_ _.Nothing)")-("iterate"," \\f x.x:iterate f (f x)")-("joy"," either id (flip joyEval [] . fst) . joyParse")-("joyBinOp"," \\op s.op (second s) (first s) : tail (tail s)")-("joyDefs"," [Pair \"+\" (joyBinOp (\\x y.x+y)),Pair \"-\" (joyBinOp (\\x y.x-y)),Pair \"/\" (joyBinOp (\\x y.x/y)),Pair \"*\" (joyBinOp (\\x y.x*y)),Pair \"=\" (joyBinOp (\\x y.x==y)),Pair \"dup\" \\s.first s : s,Pair \"i\" \\s.joyEval (first s) (tail s),Pair \"true\" \\s.True:s,Pair \"false\" \\s.False:s,Pair \"ifte\" joyIFTE,Pair \"x\" \\s.joyEval (first s) s,Pair \"pop\" tail,Pair \"dip\" \\s.second s:joyEval (first s) (tail (tail s))]")-("joyEval"," \\l.foldr (flip B) id (map (lookupDef joyDefs) l)")-("joyExpr"," many $ choice [bind (squares joyExpr) (return . Left),bind identifier (return . Right),bind_ (sat (\\c.c=='\\'')) $ bind next $ \\c.bind_ spaces $ return (Left c),bind parseNum $ \\n.bind_ spaces $ return (Left n)]")-("joyIFTE"," \\s.if head (joyEval (nth 2 s) (drop 3 s)) then joyEval (second s) (drop 3 s) else joyEval (first s) (drop 3 s)")-("joyParse"," runMonad MonadParser joyExpr")-("last"," \\l.if null (tail l) then (head l) else last (tail l)")-("lcFalse"," (C K)")-("lcIf"," I")-("lcTrue"," K")-("length"," foldl (\\x y.x+1) 0")-("lexeme"," \\p.p `bind` \\r.spaces `bind` \\_.return r")-("liftLP"," \\m dict k f s.pair (\\a s'.k a f s') (m s)")-("liftS"," \\e x s m.runMonad m (bind e (\\a.return (Pair a s)))")-("list"," \\c n l.l c n")-("listen"," \\e m.nth 3 m (e m)")-("local"," \\f e m.nth 3 m f (e m)")-("lookup"," \\k l.if null l then Nothing else if fst (head l) == k then Just (snd (head l)) else lookup k (tail l)")-("lookupDef"," \\d.either (\\a s.a:s) (\\k.maybe unbound_variable_error id (lookup k d))")-("lookupRef"," \\k l.if fst (head l) == k then snd (head l) else lookupRef k (tail l)")-("lookupTree"," \\i.tree id (\\l k r.if i < k then lookupTree i l else lookupTree i r)")-("makePerfect"," \\x.(\\y.y * (y + 1) / 2) (pow 2 x - 1)")-("many"," \\p.alt (many1 p) (return [])")-("many1"," \\p.bind p $ \\h.bind (many p) $ \\t.return (h:t)")-("map"," \\f.foldr (\\x y.f x:y) []")-("mapAccumL"," \\f s l.if null l then Pair s [] else pair (\\s' y.pair (\\s'' ys.Pair s'' (y:ys)) (mapAccumL f s' xs)) (f s (head l))")-("mapAccumR"," \\f s l.if null l then Pair s [] else pair (\\s' ys.pair (\\s'' y.Pair s'' (y:ys)) (f s' x)) (mapAccumR f s xs)")-("maybe"," \\f g m.m f g")-("mersenneExponents"," filter (\\x. isPrime (pow 2 x - 1)) (from 1)")-("mersennePrimes"," (filter isPrime (map (\\x. pow 2 x - 1) (enumFrom 1)))")-("mod"," \\n d.n-(n/d)*d")-("modifyTree"," \\i f.tree (\\x.Leaf (f x)) (\\l k r.if i < k then Branch (modifyTree i f l) k r else Branch l k (modifyTree i f r))")-("nat"," \\z s n.n z s")-("natuals"," \\x . (x : (naturals (x+1)))")-("naturals"," \\x . (x : (naturals (x+1)))")-("ndivby"," \\a b. (mod b a) /= 0")-("newLPRef"," \\x.liftLP (\\s.if null s then Pair 0 [Pair 0 x] else (\\r.Pair r ((Pair r x):s)) (fst (head s) + 1))")-("next"," bind get $ \\s.if null s then parseError \"end of input\" else bind_ (put (tail s)) $ return (head s)")-("nil"," \\n c. n")-("not"," \\x.if x then False else True")-("notElem"," \\c s.not (elem c s)")-("nth"," \\n l.if n == 0 then head l else nth (n-1) (tail l)")-("nub"," nubBy (\\x y.x==y)")-("nubBy"," \\eq l.if null l then [] else head l : nubBy eq (filter (\\x.not (x `eq` head l)) (tail l))")-("nullL"," list True (K (K False))")-("or"," foldr (\\x y.x||y) False")-("orLP"," \\m n dict k.m dict k . n dict k")-("pair"," \\k p.p k")-("para"," \\c n l.if null l then n else c (head l) (tail l) (para c n (tail l))")-("paraNat"," \\s z n.if n == 0 then z else s n $ paraNat s z (n-1)")-("parens"," between (char '(') (char ')')")-("parseError"," \\e m.nth 4 m e")-("parseNum"," bind (alt (bind_ (sat (\\c.c=='-')) $ return (\\x.0-x)) (return id)) $ \\op.bind (many1 (sat isDigit)) $ \\ns.return (op (foldl (\\x y.10*x+y) 0 (map charToDigit ns)))")-("parseRule"," parseTerm `bind` \\h.(symbol \":-\" `bind_` (parseTerm `sepBy1` comma) `bind` \\b.return (Pair h b)) `alt` (return (Pair h [])) `bind` \\r.dot `bind_` return r")-("parseTerm"," identifier `bind` \\h.parens ((parseTerm `sepBy1` comma) `bind` \\ts.if isUpper (head h) then parseError \"variable for constructor\" else return (Term h ts)) `alt` if isUpper (head h) then return (Var h) else return (Term h [])")-("pass"," \\e m.nth 4 m (e m)")-("piDigits"," piGen 1 0 1 1")-("piGen"," \\q r t k. (\\n.if (4*q+r)/t == n then n : piGen (10*q) (10*(r-n*t)) t k else piGen (q*k) (q*(4*k+2)+r*(2*k+1)) (t*(2*k+1)) (k+1)) ((3*q+r)/t)")-("pow"," \\b. \\n. if n == 0 then 1 else (if even n then (square (pow b (n / 2))) else (b * (pow b (n - 1))))")-("primes"," (sieve (naturals 2))")-("product"," foldl (\\x y.x*y) 1")-("prologFreevars"," nub . foldTerm (\\v.[v]) (\\_.concat)")-("prologMatch"," \\t db.(\\c.foldr orLP failed $ map (pair (\\h b.interpretTerm h [] `bind` pair (\\h' env.unify t h' `bind_` foldr (\\t' rest env'.interpretTerm t' env' `bind` pair (\\t'' env''.prologMatch t'' db `bind_` rest env'')) (const success) b env))) $ filter (\\r.getConstructor (fst r) == c) db) (getConstructor t)")-("put"," \\x m.nth 3 m x")-("rando"," \\s.(25173*s + 13849) `mod` 65536")-("random-list"," \\n. \\s. tail (take (n + 1) (iterate rando s))")-("randomList"," \\n. \\s. tail (take (n + 1) (iterate rando s))")-("readLPRef"," \\ref.liftLP (\\s.Pair (lookupRef ref s) s)")-("repeat"," iterate id")-("replicate"," \\n x.take n (iterate id x)")-("return"," \\a m.return_internal m a")-("return_internal"," nth 1")-("reverse"," foldl (\\x y.y:x) []")-("runLP"," \\m.runMonad MonadLP m (\\a f s.a:f s) (\\_.[]) []")-("runMonad"," \\m e.e m")-("sat"," \\p.bind next $ \\a.if p a then return a else get `bind` \\s.parseError (\"parse error at: \\\"\"++s++\"\\\"\")")-("scanl"," \\c n.reverse . foldl (\\x y.c (head x) y:x) [n]")-("scanr"," \\c n.foldr (\\x y.c x (head y):y) [n]")-("second"," head . tail")-("sepBy"," \\p sep.sepBy1 p sep `alt` return []")-("sepBy1"," \\p sep.p `bind` \\a.(sep `bind` \\_.sepBy p sep `bind` \\as.return (a:as)) `alt` return [a]")-("sequence"," \\l.if null l then return [] else head l `bind` (\\x.sequence (tail l) `bind` (\\xs.return (x:xs)))")-("sequence_"," foldr bind_ (return [])")-("showList"," \\se.(\\x.'[':(x++\"]\")) . concat . intersperse \", \" . map se")-("showMaybe"," \\showA.maybe \"Nothing\" (\\a.\"Just \"++showA a)")-("showNum"," \\n.(\\showNum.if n < 0 then '-':(reverse $ showNum (0-n)) else reverse $ showNum n) $ fix (\\showNum n.if n < 10 then [digitToChar n] else digitToChar (mod n 10) : showNum (n/10))")-("showPair"," \\sa sb.pair (\\a b.'(':sa a ++ ',':sb b++\")\")")-("showTerm"," showTerm' id (\\n.'_':showNum n)")-("showTerm'"," \\showAtom showVar.termCase showVar (\\a ts.if null ts then showAtom a else showAtom a++'(':concat (intersperse \",\" (map (showTerm' showAtom showVar) ts))++\")\")")-("showType"," type id (\\t1 t2.type id (\\t1 t2.'(':showType (Arrow t1 t2)++\")\") (\\vs t.'(':showType (Forall vs t)++\")\") t1 ++ \" -> \" ++ showType t2) (\\vs t.\"forall \"++concat (intersperse \" \" vs)++'.':showType t)")-("sieve"," \\l . (head l) : sieve (filter (ndivby (head l)) (tail l))")-("snd"," \\p.p (\\x y.y)")-("someMersennePrimeExponents"," [2,3,5,7,13,17,19,31,67,127,257]")-("somePerfectNumbers"," map makePerfect someMersennePrimeExponents")-("spaces"," get `bind` \\s.put (dropWhile isSpace s)")-("span"," \\p l.if null l then Pair [] [] else pair (\\ys zs.if p (head l) then Pair (head l : ys) zs else Pair [] l) (span p (tail l))")-("sqrt"," (\\x.fix (\\sqrt.\\a.if square a <= x && square (a+1) > x then a else sqrt ((a + x / a) / 2)) x)")-("square"," \\x.x*x")-("squares"," between (char '[') (char ']')")-("string"," \\s.sequence (map char s)")-("success"," return []")-("sum"," foldl (\\x y.x+y) 0")-("symbol"," lexeme . string")-("tails"," \\l.if null l then [[]] else l:tails (tail l)")-("take"," \\n l.if null l || n <= 0 then [] else head l : take (n-1) (tail l)")-("takeWhile"," \\p.unfoldr (\\s.if p (head s) then Just (Pair (head s) (tail s)) else Nothing)")-("tell"," \\w m.nth 2 m w")-("termCase"," \\var term t.t var term")-("test"," \"hello\"")-("throwError"," \\e m.nth 2 m e")-("toList"," \\l.if nullL l then [] else car l : toList (cdr l)")-("tree"," \\l b t.t l b")-("type"," \\v a q t.t v a q")-("uncurry"," \\f.pair (\\x y.f x y)")-("undefined"," undefined")-("unfoldr"," \\g n.maybe [] (pair (\\a s.a:unfoldr g s)) (g n)")-("unify"," \\a b.maybe (maybe (unifyTerm a b) (\\vb.unifyVar vb a) (isVar b)) (\\va.maybe (unifyVar va b) (\\vb.if va == vb then success else unifyVar va b) (isVar b)) (isVar a)")-("unifyTerm"," \\a b.termCase (\\_.failed) (\\aa ats.termCase (\\_.failed) (\\ba bts.if aa == ba then zipWithM_ unify ats bts else failed) b) a")-("unifyVar"," \\ref a.readLPRef ref `bind` maybe (writeLPRef ref (Just a)) (\\b.a `unify` b)")-("union"," unionBy (\\x y.x==y)")-("unionBy"," \\eq xs ys.xs ++ foldl (flip (deleteBy eq)) (nubBy eq ys) xs")-("unzip"," foldr (\\p ps.pair (\\l r.Pair (l:fst ps) (r:snd ps)) p) (Pair [] [])")-("updateRef"," \\k a l.if fst (head l) == k then Pair k a:tail l else head l:updateRef k a (tail l)")-("writeLPRef"," \\ref a dict k f s.k [] (f . updateRef ref (lookupRef ref s)) (updateRef ref a s)")-("zip"," zipWith Pair")-("zipWith"," \\f l r.if null l || null r then [] else f (head l) (head r) : zipWith f (tail l) (tail r)")-("zipWithM"," \\f xs ys.sequence (zipWith f xs ys)")-("zipWithM_"," \\f xs ys.sequence_ (zipWith f xs ys)")
− State/prelude.lam
@@ -1,153 +0,0 @@-# the church encoding for booleans-true    = \t f. t;-false   = \t f. f;-if      = \b x y. b x y;-not     = \x.   if x false true;-and     = \x y. if x y false;-or      = \x y. if x true y;-xor     = \x y. if x (not y) y;--# the church encoding for peano numbers-zero    = \f x. x;-succ    = \n f x. f (n f x);-pred    = \n f x. n (\g h. h (g f)) (\u. x) (\u. u);--# addition, subtraction and multiplication-plus    = \m n f x. m f (n f x);-sub     = \m n. (n pred) m;-mul     = \m n f. m (n f);--# some useful predicates on church numerals-even    = \n. n not true;-iszero  = \m. m (\x. false) true;-lte     = \m n. iszero (sub m n);-gte     = \m n. iszero (sub n m);-eq      = \m n. and (lte m n) (gte m n);-lt      = \m n. and (lte m n) (not (gte m n));-gt      = \m n. and (gte m n) (not (lte m n));--# aliases for the church numerals up to ten-one   = succ zero;-two   = succ one;-three = succ two;-four  = succ three;-five  = succ four;-six   = succ five;-seven = succ six;-eight = succ seven;-nine  = succ eight;-ten   = succ nine;--# Turner's combinators-I = \x .x;-K = \x y. x;-S = \f g x. (f x) (g x);-W = \f x. f x x;-B = \f g x. f (g x);--# the fixpoint combinator-Y = \f. (\x. f (x x)) \x. f (x x);--# a divergent labmda term-omega = (\x. x x) \x. x x;--# integer exponentation-pow = \m. Y (\powF n. n (\x. mul m x) one);--# factorial-fac = Y (\facF n. if (iszero n)-                     one -                     (mul n (facF (pred n))));--# the church encoding for pairs-pair = \x y f. f x y;-fst  = \p. p (\x y. x);-snd  = \p. p (\x y. y);--# now, encode ADTs-match = \x pats. x (\n f. f (fst ((n snd) pats)));--# the ADT representation of lists-nil  = \    w. w zero (\f. f);-cons = \h t w. w one  (\f. f h t);--# head and tail, by pattern matching-head = \l. match l (pair nil-                   (pair (\h t. h)-                    zero));--tail = \l. match l (pair nil-                   (pair (\h t. t)-                    zero));--# the ith element of a list-index = \n l. head (n tail l);--# right fold on a list-foldr = \f z. Y (\foldF l. match l (pair z-                                   (pair (\h t. f h (foldF t))-                                    zero)));--# left fold on a list-foldl = \f. Y (\foldF r l. match l (pair r-                                   (pair (\h t. foldF (f r h) t)-                                    zero)));--# the length of a list-len = foldl (\x h. succ x) zero;--# the mapping function on a list-map = \f. Y (\mapF l. match l (pair nil-                              (pair (\h t. cons (f h) (mapF t))-                               zero)));--# list generator-unfold = \g until. Y (\unfoldF x. if (until x)-                                       (cons x nil)-                                       (cons x (unfoldF (g x))));--# some other interesting list functions....--iterate = \g. unfold g (K false);-nats = iterate succ zero;--upTo = \n. unfold succ (\x. gte x n) zero;--zipWith = \f. Y (\zipF l1 l2. match l1-                     (pair nil-                     (pair (\h1 t1. match l2-                        (pair nil-                        (pair (\h2 t2.-                           cons (f h1 h2) (zipF t1 t2))-                         zero)))-                       zero)));--zip = zipWith pair;--take = \n l. zipWith K l (tail (upTo n));-drop = \n l. n tail l;--minAux = foldl (\x y. if (lt y x) y x);--min  = \l. match l-             (pair nil-             (pair minAux-              zero));--maxAux = foldl (\x y. if (gt y x) y x);--max  = \l. match l-             (pair nil-             (pair maxAux-              zero));--remove = \x. Y (\removeF l. match l-              (pair nil-              (pair (\h t.-                 if (eq h x) t (cons h (removeF t)))-               zero)));--insertSort = Y (\sortF l. match l-             (pair nil-             (pair (\h t. (\x. cons x (sortF (remove x l))) (minAux h t))-              zero)));
State/quote view

binary file changed (17024 → 40712 bytes)

+ State/source view

binary file changed (absent → 8658 bytes)

+ State/system view
@@ -0,0 +1,1 @@+((1194745261,822710000000),TimeDiff {tdYear = 0, tdMonth = 0, tdDay = 0, tdHour = 0, tdMin = 0, tdSec = 3368669, tdPicosec = 0})
State/todo view

binary file changed (1536 → 1215 bytes)

+ State/vixen view

binary file changed (absent → 96362 bytes)

State/where view

binary file changed (8288 → 6992 bytes)

− TODO
@@ -1,37 +0,0 @@-Dons:--  - count number of commands/plugins--  - a dynamic Config.hs module.-  - a scripting interface, expose module ops to a scripting module-  - look at pinging the server--  - things that should work:-        pl     . djinn-        type   . djinn $ xs == xs-        pretty . djinn-        pretty . pl-        djinn . hoogle--Todo:-    * Better error reporting when connections fail at startup-    * fsbot-style factoid parsing, -    * real hostmask matching-    * refactor utility functions out of the modules ex. gets(\s -> lookupFM ...)-    * @fact-to ircnick key for sending factoids via privmsg-    * multiple servers-    * factor out an IRC library-    * send alternate nickname?-    * automatically filter out blanks lines, ie. in dictionary output--Wishlist:--    * search ghc haddocks by function name and type name and ghc command line option searching ;-)-    * search Haskell 98 report-    * search citeseer-    * search local database of researching paper by keyword (swish++ ?)-    * channel statistics, record of pasted urls-    * unit tests, quickcheck tests, written tests... ok, maybe not written-    * Some support for bot clients to be able to do their own request/response stuff--* add your wishes here ...
build view
@@ -2,6 +2,14 @@  set -e -./Setup.hs build-./Setup.hs install-ghc -v0 -c -odir . -hidir . scripts/ShowQ.hs+ghc -O2 --make scripts/BotPP.hs -o BotPP+chmod +x Setup.hs configure+nice ./Setup.hs configure --bindir=`pwd` --libdir=`pwd`/lib+nice ./Setup.hs build+./Setup.hs copy+ghc -v0 -c -O2 -odir . -hidir . scripts/ShowQ.hs+ghc -v0 -c -O2 -odir . -hidir . scripts/ShowFun.hs+ghc -v0 -c -O2 -odir . -hidir . scripts/LargeWord.hs+ghc -v0 -c -O2 -funbox-strict-fields -odir . -hidir . scripts/SmallCheck.hs+ghc -v0 -c -O2 -odir . -hidir . scripts/SimpleReflect.hs+ghc -v0 -c -O2 -odir . -hidir . State/L.hs
configure view
@@ -272,7 +272,7 @@ PACKAGE_BUGREPORT=  ac_unique_file="Main.hs"-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS GHC_VERSION GHC_LIB_PATH PLATFORM CPU REPO_PATH PATCH_COUNT SYMS LIBOBJS LTLIBOBJS'+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS GHC_VERSION GHC_LIB_PATH PLATFORM CPU REPO_PATH PATCH_COUNT WithM4 SYMS LIBOBJS LTLIBOBJS' ac_subst_files=''  # Initialize some variables set by options.@@ -1248,13 +1248,98 @@ PATCH_COUNT=`darcs changes --xml-output 2> /dev/null | sed -n '/TAG/q;/^<\/patch/p' | wc -l | sed 's/ *//g'`  +# Use GNU m4, which is called gm4 on *BSD+if gm4 --version > /dev/null 2>&1 ; then+        # Extract the first word of "gm4", so it can be a program name with args.+set dummy gm4; ac_word=$2+echo "$as_me:$LINENO: checking for $ac_word" >&5+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6+if test "${ac_cv_path_WithM4+set}" = set; then+  echo $ECHO_N "(cached) $ECHO_C" >&6+else+  case $WithM4 in+  [\\/]* | ?:[\\/]*)+  ac_cv_path_WithM4="$WithM4" # Let the user override the test with a path.+  ;;+  *)+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR+for as_dir in $PATH+do+  IFS=$as_save_IFS+  test -z "$as_dir" && as_dir=.+  for ac_exec_ext in '' $ac_executable_extensions; do+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then+    ac_cv_path_WithM4="$as_dir/$ac_word$ac_exec_ext"+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5+    break 2+  fi+done+done++  ;;+esac+fi+WithM4=$ac_cv_path_WithM4++if test -n "$WithM4"; then+  echo "$as_me:$LINENO: result: $WithM4" >&5+echo "${ECHO_T}$WithM4" >&6+else+  echo "$as_me:$LINENO: result: no" >&5+echo "${ECHO_T}no" >&6+fi++else+        # Extract the first word of "m4", so it can be a program name with args.+set dummy m4; ac_word=$2+echo "$as_me:$LINENO: checking for $ac_word" >&5+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6+if test "${ac_cv_path_WithM4+set}" = set; then+  echo $ECHO_N "(cached) $ECHO_C" >&6+else+  case $WithM4 in+  [\\/]* | ?:[\\/]*)+  ac_cv_path_WithM4="$WithM4" # Let the user override the test with a path.+  ;;+  *)+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR+for as_dir in $PATH+do+  IFS=$as_save_IFS+  test -z "$as_dir" && as_dir=.+  for ac_exec_ext in '' $ac_executable_extensions; do+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then+    ac_cv_path_WithM4="$as_dir/$ac_word$ac_exec_ext"+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5+    break 2+  fi+done+done++  ;;+esac+fi+WithM4=$ac_cv_path_WithM4++if test -n "$WithM4"; then+  echo "$as_me:$LINENO: result: $WithM4" >&5+echo "${ECHO_T}$WithM4" >&6+else+  echo "$as_me:$LINENO: result: no" >&5+echo "${ECHO_T}no" >&6+fi++fi+ # need to recompile this if configure is rerun touch Plugin/Version.hs   -          ac_config_files="$ac_config_files config.h"+                    ac_config_files="$ac_config_files config.h testsuite/logpp" +          ac_config_commands="$ac_config_commands default"+ cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure@@ -1698,6 +1783,9 @@ Configuration files: $config_files +Configuration commands:+$config_commands+ Report bugs to <bug-autoconf@gnu.org>." _ACEOF @@ -1806,6 +1894,8 @@   case "$ac_config_target" in   # Handling of arguments.   "config.h" ) CONFIG_FILES="$CONFIG_FILES config.h" ;;+  "testsuite/logpp" ) CONFIG_FILES="$CONFIG_FILES testsuite/logpp" ;;+  "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;   *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}    { (exit 1); exit 1; }; };;@@ -1818,6 +1908,7 @@ # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files+  test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi  # Have a temporary directory for convenience.  Make it in the build tree@@ -1895,6 +1986,7 @@ s,@CPU@,$CPU,;t t s,@REPO_PATH@,$REPO_PATH,;t t s,@PATCH_COUNT@,$PATCH_COUNT,;t t+s,@WithM4@,$WithM4,;t t s,@SYMS@,$SYMS,;t t s,@LIBOBJS@,$LIBOBJS,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t@@ -2129,6 +2221,124 @@     rm -f $tmp/out   fi +done+_ACEOF+cat >>$CONFIG_STATUS <<\_ACEOF++#+# CONFIG_COMMANDS section.+#+for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue+  ac_dest=`echo "$ac_file" | sed 's,:.*,,'`+  ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`+  ac_dir=`(dirname "$ac_dest") 2>/dev/null ||+$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \+	 X"$ac_dest" : 'X\(//\)[^/]' \| \+	 X"$ac_dest" : 'X\(//\)$' \| \+	 X"$ac_dest" : 'X\(/\)' \| \+	 .     : '\(.\)' 2>/dev/null ||+echo X"$ac_dest" |+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }+  	  /^X\(\/\/\)$/{ s//\1/; q; }+  	  /^X\(\/\).*/{ s//\1/; q; }+  	  s/.*/./; q'`+  { if $as_mkdir_p; then+    mkdir -p "$ac_dir"+  else+    as_dir="$ac_dir"+    as_dirs=+    while test ! -d "$as_dir"; do+      as_dirs="$as_dir $as_dirs"+      as_dir=`(dirname "$as_dir") 2>/dev/null ||+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \+	 X"$as_dir" : 'X\(//\)[^/]' \| \+	 X"$as_dir" : 'X\(//\)$' \| \+	 X"$as_dir" : 'X\(/\)' \| \+	 .     : '\(.\)' 2>/dev/null ||+echo X"$as_dir" |+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }+  	  /^X\(\/\/\)$/{ s//\1/; q; }+  	  /^X\(\/\).*/{ s//\1/; q; }+  	  s/.*/./; q'`+    done+    test ! -n "$as_dirs" || mkdir $as_dirs+  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}+   { (exit 1); exit 1; }; }; }++  ac_builddir=.++if test "$ac_dir" != .; then+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`+  # A "../" for each directory in $ac_dir_suffix.+  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`+else+  ac_dir_suffix= ac_top_builddir=+fi++case $srcdir in+  .)  # No --srcdir option.  We are building in place.+    ac_srcdir=.+    if test -z "$ac_top_builddir"; then+       ac_top_srcdir=.+    else+       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`+    fi ;;+  [\\/]* | ?:[\\/]* )  # Absolute path.+    ac_srcdir=$srcdir$ac_dir_suffix;+    ac_top_srcdir=$srcdir ;;+  *) # Relative path.+    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix+    ac_top_srcdir=$ac_top_builddir$srcdir ;;+esac++# Do not use `cd foo && pwd` to compute absolute paths, because+# the directories may not exist.+case `pwd` in+.) ac_abs_builddir="$ac_dir";;+*)+  case "$ac_dir" in+  .) ac_abs_builddir=`pwd`;;+  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;+  *) ac_abs_builddir=`pwd`/"$ac_dir";;+  esac;;+esac+case $ac_abs_builddir in+.) ac_abs_top_builddir=${ac_top_builddir}.;;+*)+  case ${ac_top_builddir}. in+  .) ac_abs_top_builddir=$ac_abs_builddir;;+  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;+  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;+  esac;;+esac+case $ac_abs_builddir in+.) ac_abs_srcdir=$ac_srcdir;;+*)+  case $ac_srcdir in+  .) ac_abs_srcdir=$ac_abs_builddir;;+  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;+  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;+  esac;;+esac+case $ac_abs_builddir in+.) ac_abs_top_srcdir=$ac_top_srcdir;;+*)+  case $ac_top_srcdir in+  .) ac_abs_top_srcdir=$ac_abs_builddir;;+  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;+  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;+  esac;;+esac+++  { echo "$as_me:$LINENO: executing $ac_dest commands" >&5+echo "$as_me: executing $ac_dest commands" >&6;}+  case $ac_dest in+    default ) chmod 700 testsuite/logpp  ;;+  esac done _ACEOF 
configure.ac view
@@ -30,10 +30,18 @@ PATCH_COUNT=`darcs changes --xml-output 2> /dev/null | sed -n '/TAG/q;/^<\/patch/p' | wc -l | sed 's/ *//g'` AC_SUBST(PATCH_COUNT) +# Use GNU m4, which is called gm4 on *BSD+if gm4 --version > /dev/null 2>&1 ; then+        AC_PATH_PROG(WithM4,gm4)+else+        AC_PATH_PROG(WithM4,m4)+fi+ # need to recompile this if configure is rerun touch Plugin/Version.hs  AC_SUBST(SYMS) -AC_CONFIG_FILES([config.h])+AC_CONFIG_FILES([config.h testsuite/logpp])+AC_CONFIG_COMMANDS([default], [chmod 700 testsuite/logpp] ) AC_OUTPUT
ghci view
@@ -3,10 +3,7 @@ # Copyright (c) 2006 Don Stewart - http://www.cse.unsw.edu.au/~dons # GPL version 2 or later (see http://www.gnu.org/copyleft/gpl.html) -# preprocess the regex lib-if [ "Lib/Regex.hs" -ot "Lib/Regex.hsc" ] ; then-    hsc2hs -o Lib/Regex.hs Lib/Regex.hsc-fi+echo "Make sure you've done a full compiled build recently"  # build the preprocessor if [ -e "BotPP" ] ; then@@ -14,7 +11,7 @@ elif [ -e "dist/build/BotPP/BotPP" ] ; then 	BotPP=dist/build/BotPP/BotPP else-    ghc -o BotPP -package fps scripts/BotPP.hs+    ghc -O2 --make scripts/BotPP.hs -o BotPP     BotPP=BotPP fi @@ -26,4 +23,4 @@ fi  # run ghci with the right command line flags to launch lambdabot-ghci -Wall -Werror -fglasgow-exts -I. -pgmF ./BotPP -F -fno-warn-incomplete-patterns -fno-warn-missing-methods -fno-warn-orphans -DGHCi -hidir $Odir -odir $Odir $*+ghci -cpp -Wall -fglasgow-exts -I. -pgmF $BotPP -F -fno-warn-incomplete-patterns -fno-warn-missing-methods -fno-warn-orphans -DGHCi -hidir $Odir -odir $Odir $*
lambdabot.cabal view
@@ -5,20 +5,401 @@ -- enough for most people -- Name:                lambdabot-Version:             4.0+Version:             4.1 License:             GPL License-file:        LICENSE Author:              Don Stewart-Maintainer:          dons@cse.unsw.edu.au-Build-Depends:       base, unix, network, parsec, mtl, haskell-src, haskell98, readline, plugins>=1.0, fps>=0.7+Category:            Web+Synopsis:            A multi-talented IRC bot+Description:         Lambdabot is a Haskell development tool, written in Haskell.+                     It operates as a command line tool, embedded in an editor,+                     embedded in GHCi, via internet relay chat and on the web.+Homepage:            http://haskell.org/haskellwiki/Lambdabot+Maintainer:          dons@galois.com+Build-Depends:       base, unix, network, parsec, mtl, haskell-src,+                     readline, QuickCheck, arrows, containers,+                     regex-compat, regex-posix, zlib, binary>=0.2,+                     plugins>=1.0, oeis, bytestring, old-time,+                     random, process, directory, array, pretty+Build-Type:          Custom +extra-source-files: Lib/FixPrecedence.hs+                Lib/Serial.hs+                Lib/Error.hs+                Lib/Url.hs+                Lib/Process.hs+                Lib/Regex.hs+                Lib/MiniHTTP.hs+                Lib/AltTime.hs+                Lib/Pointful.hs+                Lib/Parser.hs+                Lib/OEIS.hs+                Lib/Signals.hs+                Lib/Util.hs+                DMain.hs+                Shared.hs+                LBState.hs+                Plugin/Version.hs+                Plugin/Filter.hs+                Plugin/OfflineRC.hs+                Plugin/Pl.hs+                Plugin/Localtime.hs+                Plugin/Code.hs+                Plugin/Instances.hs+                Plugin/Url.hs+                Plugin/Dict/DictLookup.hs+                Plugin/Unlambda.hs+                Plugin/Hello.hs+                Plugin/UnMtl.hs+                Plugin/State.hs+                Plugin/Where.hs+                Plugin/Elite.hs+                Plugin/Seen.hs+                Plugin/Small.hs+                Plugin/Search.hs+                Plugin/Karma.hs+                Plugin/Dummy.hs+                Plugin/Dynamic.hs+                Plugin/Djinn.hs+                Plugin/System.hs+                Plugin/Slap.hs+                Plugin/Spell.hs+                Plugin/Undo.hs+                Plugin/Check.hs+                Plugin/Free.hs+                Plugin/Quote.hs+                Plugin/Pointful.hs+                Plugin/Haddock.hs+                Plugin/Paste.hs+                Plugin/More.hs+                Plugin/Fresh.hs+                Plugin/Babel.hs+                Plugin/Log.hs+                Plugin/Quote/Fortune.hs+                Plugin/Quote/Text.hs+                Plugin/Dice.hs+                Plugin/Compose.hs+                Plugin/Vixen.hs+                Plugin/Fact.hs+                Plugin/Tell.hs+                Plugin/OEIS.hs+                Plugin/Help.hs+                Plugin/Base.hs+                Plugin/IRC.hs+                Plugin/Hoogle.hs+                Plugin/Dummy/DocAssocs.hs+                Plugin/BF.hs+                Plugin/DarcsPatchWatch.hs+                Plugin/Dict.hs+                Plugin/Free/Theorem.hs+                Plugin/Free/Test.hs+                Plugin/Free/Parse.hs+                Plugin/Free/Expr.hs+                Plugin/Free/FreeTheorem.hs+                Plugin/Free/Type.hs+                Plugin/Free/Util.hs+                Plugin/Eval.hs+                Plugin/Type.hs+                Plugin/Todo.hs+                Plugin/Activity.hs+                Plugin/Maya.hs+                Plugin/Topic.hs+                Plugin/FT.hs+                Plugin/Poll.hs+                Plugin/Figlet.hs+                Plugin/Pl/Optimize.hs+                Plugin/Pl/Rules.hs+                Plugin/Pl/Transform.hs+                Plugin/Pl/Test.hs+                Plugin/Pl/RuleLib.hs+                Plugin/Pl/Names.hs+                Plugin/Pl/Parser.hs+                Plugin/Pl/PrettyPrinter.hs+                Plugin/Pl/Common.hs+                Plugin/Pretty.hs+                Plugin/Source.hs+                Main.hs+                Modules.hs-boot+                Config.hs+                DynModules.hs+                IRCBase.hs+                Message.hs+                scripts/LargeWord.hs+                scripts/ShowFun.hs+                scripts/FT/FreeTheorems.hs+                scripts/FT/PPrint.hs+                scripts/FT/FreeTheorems/TypeParser.hs+                scripts/FT/FreeTheorems/Preparation.hs+                scripts/FT/FreeTheorems/PrettyPrint.hs+                scripts/FT/FreeTheorems/Types.hs+                scripts/FT/FreeTheorems/Unfolding.hs+                scripts/FT/FreeTheorems/Lifts.hs+                scripts/FT/FreeTheorems/Specialization.hs+                scripts/FT/FreeTheorems/TheoremData.hs+                scripts/FT/FreeTheorems/Reduction.hs+                scripts/FT/FreeTheorems/Simplification.hs+                scripts/FT/FreeTheorems/Delta.hs+                scripts/FT/FreeTheorems/Declarations.hs+                scripts/FT/FreeTheorems/Types/Relation.hs+                scripts/FT/FreeTheorems/Types/Theorem.hs+                scripts/FT/FreeTheorems/Types/LanguageModel.hs+                scripts/FT/FreeTheorems/Types/Type.hs+                scripts/FT/FreeTheorems/PrettyPrint/Document.hs+                scripts/FT/FreeTheorems/PrettyPrint/AsText.hs+                scripts/FT/FreeTheorems/PrettyPrint/Common.hs+                scripts/FT/FreeTheorems/Modification.hs+                scripts/FT/FTbase.hs+                scripts/FT/PredefinedTypes.hs+                scripts/QuickCheck.hs+                scripts/Unlambda.hs+                scripts/RunPlugs.hs+                scripts/RunSmallCheck.hs+                scripts/SimpleReflect.hs+                scripts/hoogle/src/Web/Main.hs+                scripts/hoogle/src/Web/Lambdabot.hs+                scripts/hoogle/src/Web/CGI.hs+                scripts/hoogle/src/Score.hs+                scripts/hoogle/src/CmdLine.hs+                scripts/hoogle/src/Doc/Main.hs+                scripts/hoogle/src/Doc.hs+                scripts/hoogle/src/Score/Main.hs+                scripts/hoogle/src/Hoogle/Match.hs+                scripts/hoogle/src/Hoogle/MatchName.hs+                scripts/hoogle/src/Hoogle/General.hs+                scripts/hoogle/src/Hoogle/MatchType.hs+                scripts/hoogle/src/Hoogle/Search.hs+                scripts/hoogle/src/Hoogle/Lexer.hs+                scripts/hoogle/src/Hoogle/MatchClass.hs+                scripts/hoogle/src/Hoogle/TypeAlias.hs+                scripts/hoogle/src/Hoogle/Parser.hs+                scripts/hoogle/src/Hoogle/Result.hs+                scripts/hoogle/src/Hoogle/Hoogle.hs+                scripts/hoogle/src/Hoogle/Database.hs+                scripts/hoogle/src/Hoogle/TypeSig.hs+                scripts/hoogle/src/Hoogle/TextUtil.hs+                scripts/hoogle/src/Web.hs+                scripts/hoogle/src/CmdLine/Main.hs+                scripts/hoogle/src/Test/Test.hs+                scripts/hoogle/data/hadhtml/Main.hs+                scripts/hoogle/data/hadhtml/Lexer.hs+                scripts/hoogle/data/hadhtml/TextUtil.hs+                scripts/hoogle/data/hadhoo/Main.hs+                scripts/hoogle/test/data/examples/Basic.hs+                scripts/hoogle/test/data/examples/ClassesEx.hs+                scripts/hoogle/test/data/examples/Operators.hs+                scripts/hoogle/test/data/examples/Data.hs+                scripts/hoogle/test/data/examples/GhcExts.hs+                scripts/hoogle/test/data/examples/Classes.hs+                scripts/hoogle/test/data/runtests.hs+                scripts/GenHaddock.hs+                scripts/BotPP.hs+                scripts/SmallCheck.hs+                scripts/BF.hs+                scripts/Djinn/Poly.hs+                scripts/Djinn/tests/Test.hs+                scripts/Djinn/Util/Digraph.hs+                scripts/Djinn/Util/Sort.hs+                scripts/Djinn/MJ.hs+                scripts/Djinn/Djinn.hs+                scripts/Djinn/LJTFormula.hs+                scripts/Djinn/MonadBFS.hs+                scripts/Djinn/REPL.hs+                scripts/Djinn/HTypes.hs+                scripts/Djinn/LJT.hs+                scripts/Djinn/Help.hs+                scripts/Djinn/MLJT.hs+                scripts/Djinn/LJTParse.hs+                scripts/Djinn/Util.hs+                scripts/Djinn/HCheck.hs+                scripts/ShowQ.hs+                State/L.hs+                State/Pristine.hs+                Boot.hs+                LMain.hs+                NickEq.hs+                Plugin.hs+                Lambdabot.hs+                Modules.hs+                testsuite/UnitTestsMain.hs+                testsuite/VariableExpansion.hs+                testsuite/TestFramework.hs+                testsuite/logpp.in+                testsuite/macros.m4+                testsuite/Tests.hs+                testsuite/logpp+                testsuite/Makefile++data-files: COMMENTARY+            README+            config.h.in+            Lib/README+            lambdabot.cabal+            configure+            Plugin/Pl/COPYING+            Plugin/Pl/Makefile+            ghci+            testsuite/README+            STYLE+            scripts/hoogle/docs/todo.txt+            scripts/hoogle/docs/file-format.txt+            scripts/hoogle/docs/builddocs.bat+            scripts/hoogle/docs/haddock.txt+            scripts/hoogle/src/Web/res/suffix.inc+            scripts/hoogle/src/Web/res/front_gtk.inc+            scripts/hoogle/src/Web/res/noresults.inc+            scripts/hoogle/src/Web/res/gtk.txt+            scripts/hoogle/src/Web/res/error.inc+            scripts/hoogle/src/Web/res/prefix.inc+            scripts/hoogle/src/Web/res/prefix_gtk.inc+            scripts/hoogle/src/Web/res/front.inc+            scripts/hoogle/src/Doc/res/documentation.txt+            scripts/hoogle/src/Score/examples.txt+            scripts/hoogle/src/Score/classes.txt+            scripts/hoogle/src/hoogle.txt+            scripts/hoogle/README.txt+            scripts/hoogle/data/hadhtml/haskell98.txt+            scripts/hoogle/data/hadhtml/exclude.txt+            scripts/hoogle/data/hihoo/hihoo.pl+            scripts/hoogle/web/favicon.png+            scripts/hoogle/web/developers.htm+            scripts/hoogle/web/download.htm+            scripts/hoogle/web/res/hoogle_small.png+            scripts/hoogle/web/res/hoogle_small_classic.png+            scripts/hoogle/web/res/quicksearch.js+            scripts/hoogle/web/res/hoogle_large.png+            scripts/hoogle/web/res/icons.png+            scripts/hoogle/web/res/hoogle.css+            scripts/hoogle/web/res/top_left.png+            scripts/hoogle/web/res/hoogle_large_classic.png+            scripts/hoogle/web/res/bot_left.png+            scripts/hoogle/web/res/bot_right.png+            scripts/hoogle/web/res/haskell_icon.png+            scripts/hoogle/web/res/hoogle.src+            scripts/hoogle/web/res/top_right.png+            scripts/hoogle/web/academics.htm+            scripts/hoogle/web/favicon.ico+            scripts/hoogle/web/about.htm+            scripts/hoogle/web/nodocs.htm+            scripts/hoogle/web/help.htm+            scripts/hoogle/test/data/gen-hihoo.bat+            scripts/hoogle/test/data/gen-hihoo.sh+            scripts/hoogle/test/data/build-hadhtml.bat+            scripts/hoogle/test/data/gen-hadhtml.bat+            scripts/hoogle/test/data/examples/Data.hoo+            scripts/hoogle/test/data/examples/ClassesEx.hoo+            scripts/hoogle/test/data/examples/GhcExts.hoo+            scripts/hoogle/test/data/examples/Classes.hoo+            scripts/hoogle/test/data/examples/Basic.hoo+            scripts/hoogle/test/data/examples/Operators.hoo+            scripts/hoogle/test/data/Makefile+            scripts/hoogle/misc/icons/icons.vsd+            scripts/hoogle/misc/logo/hoogle.xar+            scripts/hoogle/misc/logo/hoogle.ppt+            scripts/hoogle/wiki/LibraryDocumentation_2fPrelude.html+            scripts/hoogle/wiki/LibraryDocumentation.html+            scripts/hoogle/wiki/LibraryDocumentation_2fIx.html+            scripts/hoogle/wiki/Keywords.html+            scripts/hoogle/wiki/Hoogle.html+            scripts/hoogle/wiki/backup.bat+            scripts/hoogle/wiki/LibraryDocumentation_2fCPUTime.html+            scripts/hoogle/Makefile+            scripts/gnuplot.script+            scripts/vim/README+            scripts/vim/pl+            scripts/vim/bot+            scripts/vim/runwith+            scripts/vim/run+            scripts/vim/typeOf+            scripts/Djinn/NEWS+            scripts/Djinn/verbose-help+            scripts/Djinn/tests/testfiles.all+            scripts/Djinn/tests/ljt/sch_mult.002.ljt+            scripts/Djinn/tests/ljt/kk_p.006.ljt+            scripts/Djinn/tests/ljt/sch_implies.ljt+            scripts/Djinn/tests/ljt/con_p.002.ljt+            scripts/Djinn/tests/ljt/debruijn_n.010.ljt+            scripts/Djinn/tests/ljt/con_n.002.ljt+            scripts/Djinn/tests/ljt/kk_n.006.ljt+            scripts/Djinn/tests/ljt/sch_prop_n.002.ljt+            scripts/Djinn/tests/ljt/debruijn_n.002.ljt+            scripts/Djinn/tests/ljt/ph_n.002.ljt+            scripts/Djinn/tests/ljt/con_p.010.ljt+            scripts/Djinn/tests/ljt/ph_n.006.ljt+            scripts/Djinn/tests/ljt/sch_prop_n.001.ljt+            scripts/Djinn/tests/ljt/debruijn_n.006.ljt+            scripts/Djinn/tests/ljt/sch_prop_n.003.ljt+            scripts/Djinn/tests/ljt/sch_ax.ljt+            scripts/Djinn/tests/ljt/ph_p.006.ljt+            scripts/Djinn/tests/ljt/equiv_n.010.ljt+            scripts/Djinn/tests/ljt/sch_notnot.ljt+            scripts/Djinn/tests/ljt/equiv_n.002.ljt+            scripts/Djinn/tests/ljt/kk_n.010.ljt+            scripts/Djinn/tests/ljt/sch_notnot2.ljt+            scripts/Djinn/tests/ljt/sch_mult.004.ljt+            scripts/Djinn/tests/ljt/schwicht_p.006.ljt+            scripts/Djinn/tests/ljt/equiv_p.010.ljt+            scripts/Djinn/tests/ljt/sch_prop_n.004.ljt+            scripts/Djinn/tests/ljt/ph_n.010.ljt+            scripts/Djinn/tests/ljt/con_n.006.ljt+            scripts/Djinn/tests/ljt/con_n.010.ljt+            scripts/Djinn/tests/ljt/debruijn_p.002.ljt+            scripts/Djinn/tests/ljt/equiv_p.002.ljt+            scripts/Djinn/tests/ljt/debruijn_p.006.ljt+            scripts/Djinn/tests/ljt/debruijn_p.010.ljt+            scripts/Djinn/tests/ljt/kk_n.002.ljt+            scripts/Djinn/tests/ljt/con_p.006.ljt+            scripts/Djinn/tests/ljt/schwicht_n.006.ljt+            scripts/Djinn/tests/ljt/ph_p.010.ljt+            scripts/Djinn/tests/ljt/schwicht_p.010.ljt+            scripts/Djinn/tests/ljt/schwicht_n.010.ljt+            scripts/Djinn/tests/ljt/sch_mult.003.ljt+            scripts/Djinn/tests/ljt/kk_p.010.ljt+            scripts/Djinn/tests/ljt/equiv_p.006.ljt+            scripts/Djinn/tests/ljt/ph_p.002.ljt+            scripts/Djinn/tests/ljt/kk_p.002.ljt+            scripts/Djinn/tests/ljt/schwicht_n.002.ljt+            scripts/Djinn/tests/ljt/equiv_n.006.ljt+            scripts/Djinn/tests/ljt/schwicht_p.002.ljt+            scripts/Djinn/tests/ljt/sch_jens_prop.ljt+            scripts/Djinn/tests/Makefile+            scripts/Djinn/tests/testfiles.fast+            scripts/Djinn/LICENSE+            scripts/Djinn/ljt.p+            scripts/Djinn/TODO+            scripts/Djinn/examples+            scripts/Djinn/examples.out+            scripts/Djinn/Makefile+            scripts/Djinn/Setup.lhs+            scripts/Djinn/djinn.cabal+            scripts/timein+            COMMANDS+            State/djinn+            State/haddock+            State/source+            State/hoogle.txt+            State/quote+            State/todo+            State/vixen+            State/system+            State/where+            State/karma+            State/fact+            configure.ac+            AUTHORS+            online.rc+            build+            Makefile+            lambdabot.cabal.ghc-6.4+            online2.rc+            Modules.hs+ -- -- first build the preprocessor -- Executable:          BotPP hs-source-dirs:      scripts/ Main-is:             BotPP.hs-ghc-options:         -funbox-strict-fields -O+ghc-options:         -fasm -funbox-strict-fields -O  -- -- Lambdabot@@ -26,15 +407,15 @@ Executable:          lambdabot Main-is:             Main.hs extensions:          CPP-other-modules:       Lib.Regex-ghc-options:         -Wall -Werror -fglasgow-exts -pgmF dist/build/BotPP/BotPP -F -H64m -Onot -fasm -fno-warn-incomplete-patterns -fno-warn-missing-methods -fno-warn-orphans -I. -threaded+ghc-options:         -Wall -Werror -fglasgow-exts -pgmF dist/build/BotPP/BotPP -F -H64m -O -funbox-strict-fields -fasm -fno-warn-incomplete-patterns -fno-warn-missing-methods -fno-warn-orphans -I. -optl-Wl,-s -threaded --- For a fast lambdabot--- ghc-options:         -Wall -Werror -fglasgow-exts -pgmF dist/build/BotPP/BotPP -F -funbox-strict-fields -O -fasm -fno-warn-incomplete-patterns -fno-warn-missing-methods -fno-warn-orphans -I. -optl-Wl,-s -threaded+--+-- For a fast build use add -Onot+--  -- -- And a dynamically linked lambdabot--- +-- -- Not quite there yet. The problem is how to recompile Modules.hs with -- a list of statics and plugins, and then to recompile the rest of -- lambdabot's core@@ -50,6 +431,7 @@ -- Executable:          hoogle hs-source-dirs:      scripts/hoogle/src+ghc-options:         -funbox-strict-fields -O Main-is:             CmdLine.hs  --@@ -57,18 +439,63 @@ -- Executable:          djinn hs-source-dirs:      scripts/Djinn+ghc-options:         -O Main-is:             Djinn.hs  -- -- Unlambda ---Executable:          unlambda-hs-source-dirs:      scripts/-Main-is:             Unlambda.hs+--Executable:          unlambda+--hs-source-dirs:      scripts/+--ghc-options:         -O+--Main-is:             Unlambda.hs  -- -- runplugs --+-- Executable:          runplugs+-- hs-source-dirs:      scripts/+-- Main-is:             RunPlugs.hs++--+-- BF+--+--Executable:          bf+--hs-source-dirs:      scripts/+--Main-is:             BF.hs+--ghc-options:         -O2++--+-- FT+--+Executable:          ft+hs-source-dirs:      scripts/FT+Main-is:             FTbase.hs+ghc-options:         -O++------------------------------------------------------------------------+-- The following only work if plugins are enabled++--+-- runplugs+-- Executable:          runplugs hs-source-dirs:      scripts/+ghc-options:         -funbox-strict-fields -O Main-is:             RunPlugs.hs++--+-- check+--+Executable:          quickcheck+hs-source-dirs:      scripts/+ghc-options:         -funbox-strict-fields -O+Main-is:             QuickCheck.hs++--+-- check+--+Executable:          smallcheck+hs-source-dirs:      scripts/+ghc-options:         -funbox-strict-fields -O+Main-is:             RunSmallCheck.hs
+ lambdabot.cabal.ghc-6.4 view
@@ -0,0 +1,112 @@+--+-- Cabal build system for lambdabot+--+-- Currently only builds the static version of the bot, which should be+-- enough for most people+--+Name:                lambdabot+Version:             4.0+License:             GPL+License-file:        LICENSE+Author:              Don Stewart+Maintainer:          dons@cse.unsw.edu.au+Build-Depends:       base, unix, network, parsec, mtl, +                     haskell-src, readline, QuickCheck, template-haskell, +                     haskell98, fps>=0.7, plugins>=1.0++--+-- first build the preprocessor+--+Executable:          BotPP+hs-source-dirs:      scripts/+Main-is:             BotPP.hs+ghc-options:         -fasm -funbox-strict-fields -O++--+-- Lambdabot+--+Executable:          lambdabot+Main-is:             Main.hs+extensions:          CPP+ghc-options:         -Wall -Werror -fglasgow-exts -pgmF dist/build/BotPP/BotPP -F -H64m -O -funbox-strict-fields -fasm -fno-warn-incomplete-patterns -fno-warn-missing-methods -fno-warn-orphans -I. -threaded -optl-Wl,-s++--+-- And a dynamically linked lambdabot+-- +-- Not quite there yet. The problem is how to recompile Modules.hs with+-- a list of statics and plugins, and then to recompile the rest of+-- lambdabot's core+--+--Executable:         lambdabot-dynamic+--main-is:            Boot.hs+--extensions:         CPP+--ghc-options:        -main-is Boot.main -Wall -Werror -fglasgow-exts -H64m -Onot -fasm -I. -threaded+-- ghc-options:         -Wall -Werror -fglasgow-exts -funbox-strict-fields -O -fasm -I. -optl-Wl,-s -threaded++--+-- Hoogle+--+Executable:          hoogle+hs-source-dirs:      scripts/hoogle/src+ghc-options:         -funbox-strict-fields -O+Main-is:             CmdLine.hs++--+-- Djinn+--+Executable:          djinn+hs-source-dirs:      scripts/Djinn+ghc-options:         -O+Main-is:             Djinn.hs++--+-- Unlambda+--+Executable:          unlambda+hs-source-dirs:      scripts/+ghc-options:         -O+Main-is:             Unlambda.hs++--+-- BF+--+Executable:          bf+hs-source-dirs:      scripts/+Main-is:             BF.hs+ghc-options:         -O2++--+-- FT+--+Executable:          ft+hs-source-dirs:      scripts/FT+Main-is:             FTbase.hs+ghc-options:         -O++------------------------------------------------------------------------+-- The following only work if plugins are enabled++--+-- runplugs+--+Executable:          runplugs+hs-source-dirs:      scripts/+ghc-options:         -funbox-strict-fields -O+Main-is:             RunPlugs.hs++--+-- check+--+Executable:          quickcheck+hs-source-dirs:      scripts/+ghc-options:         -funbox-strict-fields -O+Main-is:             QuickCheck.hs++--+-- check+--+Executable:          smallcheck+hs-source-dirs:      scripts/+ghc-options:         -funbox-strict-fields -O+Main-is:             RunSmallCheck.hs+
+ online.rc view
@@ -0,0 +1,30 @@+irc-connect freenode chat.freenode.net 6667 lambdabot Lambda_Robots:_100%_Loyal+rc passwd.rc+admin + freenode:Pseudonym+admin + freenode:shapr+admin + freenode:vincenz+admin + freenode:Igloo+admin + freenode:Cale+admin + freenode:dons+admin + freenode:TheHunter+admin + freenode:musasabi+admin + freenode:Lemmih+admin + freenode:sjanssen+admin + freenode:sorear+admin + freenode:int-e+admin + freenode:igli+join freenode:#darcs+join freenode:#ghc+join freenode:#haskell+join freenode:#scala+join freenode:#haskell-blah+join freenode:#haskell-overflow+join freenode:#haskell-soc+join freenode:#jtiger+join freenode:#parrot+join freenode:#perl6+join freenode:#unicycling+join freenode:#xmonad+join freenode:##logic+join freenode:#gentoo-haskell+join freenode:#scannedinavian
+ online2.rc view
@@ -0,0 +1,32 @@+irc-connect freenode chat.freenode.net 6667 lambdabot2 Lambda_Robots:_100%_Loyal+rc passwd.rc+admin + freenode:Pseudonym+admin + freenode:shapr+admin + freenode:vincenz+admin + freenode:Igloo+admin + freenode:Cale+admin + freenode:dons+admin + freenode:TheHunter+admin + freenode:musasabi+admin + freenode:Lemmih+admin + freenode:sjanssen+admin + freenode:sorear+admin + freenode:int-e+join freenode:#haskell.se+join freenode:#haskell.ru+join freenode:#haskell.no+join freenode:#haskell.jp+join freenode:#haskell.it+join freenode:#haskell.hr+join freenode:#haskell.fr+join freenode:#haskell.fi+join freenode:#haskell.es+join freenode:#haskell.de+join freenode:#haskell.dut+join freenode:#haskell_ru+join freenode:#haskell-hac07+join freenode:#thunks+join freenode:#debian-es+join freenode:#dreamlinux-es+join freenode:#friendly-coders+join freenode:#gentoo-uy
+ scripts/BF.hs view
@@ -0,0 +1,414 @@+{-# OPTIONS -cpp #-}+-- This is an interpreter of the braif*ck language, written in+-- the pure, lazy, functional language Haskell.+-- +-- Copyright (C) 2006 by Jason Dagit <dagit@codersbase.com>+--                                                                           +-- This program is free software; you can redistribute it and/or modify+-- it under the terms of the GNU General Public License as published by+-- the Free Software Foundation; either version 2 of the License, or+-- (at your option) any later version.+--                                                                           +-- This program is distributed in the hope that it will be useful,+-- but WITHOUT ANY WARRANTY; without even the implied warranty of+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the+-- GNU General Public License for more details.+--                                                                           +-- You should have received a copy of the GNU General Public License+-- along with this program; if not, write to the Free Software+-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA+--++import Data.Array.IO+#if __GLASGOW_HASKELL__ >= 606+import Data.Array hiding (array)+#else+import Data.Array hiding (array,bounds)+#endif+import Data.Array.Base   (unsafeRead, unsafeWrite, array)+import Data.Word         ( Word8(..) )+import Data.Char         ( ord, chr )+import Data.List         ( find, findIndex, groupBy )+import Data.Maybe        ( catMaybes )+import Control.Monad     ( when )+import Control.Monad.State+import System.Posix.Resource++rlimit = ResourceLimit 3++main = setResourceLimit ResourceCPUTime (ResourceLimits rlimit rlimit) >> run++run = do+  prog <- getContents+  c    <- core+  let cmds = loadProgram prog+  when debug $ print cmds+  execute cmds (snd (bounds cmds)) (BF c 0 0)++{- | The complete BF language:++* \>    Increment the pointer.+* \<    Decrement the pointer.+* +     Increment the byte at the pointer.+* \-    Decrement the byte at the pointer.+* .     Output the byte at the pointer.+* ,     Input a byte and store it in the byte at the pointer.+* [     Jump forward past the matching ] if the byte at the pointer is zero.+* ]     Jump backward to the matching [ unless the byte at the pointer is zero.++-}++data Command = IncPtr+             | IncPtrBy !Int  -- ^ Increment pointer by set amount+             | DecPtr+             | IncByte+             | IncByteBy !Int -- ^ Increment by a set amount+             | DecByte+             | OutputByte+         --  | InputByte+             | JmpForward  !Int -- ^ nesting level+             | JmpBackward !Int -- ^ nesting level+             | SetIpTo !Int   -- ^ Sets the instruction ptr to a specific value+             | Halt+             | Ignored+             deriving (Show, Eq)++type Core = IOUArray Int Word8++type InstPtr = Int+type CorePtr = Int+data BF = BF !Core !CorePtr !InstPtr++instance Show BF where+    show (BF c cp ip) = "BF <core> CorePtr = " ++ show cp ++ " InstPtr = " ++ show ip++coreSize = 30000++core :: IO Core+core = newArray (0, coreSize - 1) (0::Word8)++decode :: Char -> State Int Command +decode '>' = return IncPtr+decode '<' = return DecPtr+decode '+' = return IncByte+decode '-' = return DecByte+decode '.' = return OutputByte+-- decode ',' = return InputByte+decode '[' = do n <- get+                put (n+1)+                return $ JmpForward n+decode ']' = do n <- get+                put (n-1)+                return $ JmpBackward (n-1)+decode '@' = return Halt+decode _   = return Ignored++debug = False++incIP :: InstPtr -> InstPtr+incIP = (+ 1)+{-# INLINE incIP #-}++incCP :: CorePtr -> CorePtr+incCP = (`mod` coreSize) . (1 +)+{-# inlinE incCP #-}++decCP :: CorePtr -> CorePtr+decCP = (`mod` coreSize) . subtract 1+{-# INLINE decCP #-}+ +doCommand :: Array Int Command -> BF -> IO BF+doCommand cmds bf@(BF _ _ ip) = doCommand' (cmds ! ip) cmds bf+  where+  doCommand' :: Command -> Array Int Command -> BF -> IO BF+  doCommand' Halt _ _ = undefined+  doCommand' Ignored _ (BF c cp ip) = {-# SCC "Ignored" #-} do+    when debug $ putStrLn $ "Ignored " ++ show bf+    return (BF c cp (incIP ip))+  doCommand' IncPtr _ bf@(BF c cp ip) = {-# SCC "IncPtr" #-} do+    when debug $ putStrLn $ "IncPtr " ++ show bf+    return (BF c (incCP cp) (incIP ip))+  doCommand' DecPtr _ bf@(BF c cp ip) = {-# SCC "DecPtr" #-} do+    when debug $ putStrLn $ "DecPtr " ++ show bf+    return (BF c (decCP cp) (incIP ip))+  doCommand' (IncPtrBy n) _ bf@(BF c cp ip) = {-# SCC "IncPtrBy" #-} do+    when debug $ putStrLn $ "IncPtrBy " ++ show n ++ " " ++ show bf+    return (BF c ((cp + n) `mod` coreSize) (incIP ip))+  doCommand' IncByte _ bf = {-# SCC "IncByte" #-} do+    when debug $ putStrLn $ "IncByte " ++ show bf+    updateByte bf (+1)+  doCommand' DecByte _ bf = {-# SCC "DecByte" #-} do+    when debug $ putStrLn $ "DecByte " ++ show bf+    updateByte bf (subtract 1)+  doCommand' (IncByteBy n) _ bf = {-# SCC "IncByteBy" #-} do+    when debug $ putStrLn $ "IncByteBy " ++ show n ++ " " ++ show bf+    updateByte bf (+ fromIntegral n)+  doCommand' OutputByte _ bf@(BF c cp ip) = {-# SCC "OutputByte" #-} do +    when debug $ putStrLn $ "OutputByte " ++ show bf+    c' <- unsafeRead c cp+    putChar (word8ToChr c')+    return (BF c cp (incIP ip))++{-+  doCommand' InputByte _ bf@(BF c cp ip) = {-# SCC "InputByte" #-} do+    when debug $ putStrLn $ "InputByte " ++ show bf+    c' <- getChar+    let newByte = chrToWord8 c'+    unsafeWrite c cp newByte+    return (BF c cp (incIP ip))+-}++  doCommand' (JmpForward n) cmds bf@(BF c cp ip) = {-# SCC "JmpForw" #-} do+    c' <- unsafeRead c cp+    case c' of +      0 -> {-# SCC "JmpForward1" #-} do +        when debug $ putStrLn $ "JmpForward1 " ++ show bf+        return (BF c cp newInstPtr)+      _ -> {-# SCC "JmpForward2" #-} do+        when debug $ putStrLn $ "JmpForward2 " ++ show bf+        let newBF = (BF c cp (incIP ip))+        when debug $ putStrLn $ "JmpForward3" ++ show newBF+        return newBF+    where+    -- we add one to go one past the next back jump+    newInstPtr = (nextJmp cmds ip (+1) (JmpBackward n)) + 1 +  doCommand' (JmpBackward n) cmds bf@(BF c cp ip) = {-# SCC "JmpBack" #-} do+    c' <- unsafeRead c cp+    if (c' /= 0) +      then do when debug $ putStrLn $ "JmpBackward1 " ++ show bf+              return (BF c cp newInstPtr)+      else do when debug $ putStrLn $ "JmpBackward2 " ++ show bf+              return (BF c cp (incIP ip))+    where+    newInstPtr = nextJmp cmds ip (subtract 1) (JmpForward n)+  doCommand' (SetIpTo i) _ bf@(BF c cp ip) = {-# SCC "SetIPTo" #-} do+    c' <- unsafeRead c cp+    when debug $ putStrLn $ "SetIpTo " ++ show i ++ " " +                          ++ show bf ++ " @" ++ show c'+    -- jmping behaves differently depending on jmp forward vs. backward+    -- we handle that with pos. vs. neg addresses+    -- Note: SetIpTo 0 is always a JmpBackward +    -- Because the first instruction cannot be SetIpTo 0+    if i > 0+      then if (c' == 0)+             then return $ BF c cp i+             else return $ BF c cp (incIP ip)+      else if (c' /= 0) +             then return $ BF c cp (-i)+             else return $ BF c cp (incIP ip)++nextJmp :: Array Int Command +        -> InstPtr +        -> (InstPtr -> InstPtr) -> Command -> InstPtr+nextJmp cmds ip f cmd = if cmds ! ip == cmd+                          then ip+                          else nextJmp cmds (f ip) f cmd++chrToWord8 :: Char -> Word8+chrToWord8 = fromIntegral . ord++word8ToChr :: Word8 -> Char+word8ToChr = chr . fromIntegral++updateByte (BF c cp ip) f = do+  e  <- unsafeRead c cp+  unsafeWrite c cp (f e)+  return (BF c cp (incIP ip))+{-# INLINE updateByte #-}++loadProgram :: String -> Array Int Command+loadProgram [] = array (0, 0) [(0, Halt)]++-- adding a halt on to the end fixes a bug when called from an irc session+loadProgram prog = optimize (cs++[Halt])+  where+  cs = fst $ runState (mapM decode prog) 0+  n  = length cs++optimize :: [Command] -> Array Int Command+optimize cmds = listArray (0, (length reduced)-1) reduced+  where+  reduced = phase3 . phase2 . phase1 $ cmds+  -- phase1 removes ignored things+  phase1 :: [Command] -> [Command]+  phase1 = filter (/=Ignored) +  -- in phase2 group inc/dec into special instructions+  phase2 :: [Command] -> [Command]+  phase2 cs = concat $ map reduce $ groupBy (==) cs+    where +    reduce :: [Command] -> [Command]+    reduce cs+      | all (==IncPtr)  cs = [IncPtrBy  (length cs)]+      | all (==DecPtr)  cs = [IncPtrBy  (-(length cs))]+      | all (==IncByte) cs = [IncByteBy (length cs)]+      | all (==DecByte) cs = [IncByteBy (-(length cs))]+      | otherwise          = cs+  -- now we can turn jumps into changes of the ip+  phase3 :: [Command] -> [Command]+  phase3 cmds = updates (updates cmds jmpBs) jmpFs+    where+    jmpBs = calcJmpBs (zip [0..] cmds)+    jmpFs = calcJmpFs (zip [0..] cmds)+    update :: [a] -> (Int, a) -> [a]+    update xs (i, a) = take i xs ++ [a] ++ drop (i+1) xs+    updates :: [a] -> [(Int, a)] -> [a]+    updates xs []     = xs+    updates xs (u:us) = updates (update xs u) us+    nested :: Command -> Int+    nested (JmpForward  n) = n+    nested (JmpBackward n) = n+    nested _               = undefined+    isJmp (JmpForward  _) = True+    isJmp (JmpBackward _) = False+    isJmpB (JmpBackward _) = True+    isJmpB _               = False+    isJmpF (JmpForward  _) = True+    isJmpF _               = False+    calcJmpBs :: [(Int, Command)] -> [(Int, Command)]+    calcJmpBs cmds = catMaybes $ map newCmd (filter (isJmpB . snd) cmds)+      where+      newCmd (i, c) = absJmpB (i, findPrevJmpF (map snd cmds) i (nested c))+    calcJmpFs :: [(Int, Command)] -> [(Int, Command)]+    calcJmpFs cmds = catMaybes $ map newCmd (filter (isJmpF . snd) cmds)+      where+      newCmd (i, c) = absJmpF (i, findNextJmpB (map snd cmds) i (nested c))+    absJmpB :: (Int, Maybe Int) -> Maybe (Int, Command)+    absJmpB (_, Nothing) = Nothing+    absJmpB (i, Just n)  = Just $ (i, SetIpTo (-n))+    absJmpF (_, Nothing) = Nothing+    absJmpF (i, Just n)  = Just $ (i, SetIpTo (n+1))+    findPrevJmpF :: [Command] +                 -> Int -- ^ index to start at+                 -> Int -- ^ nesting level to match+                 -> Maybe Int -- ^ index of next JmpF+    findPrevJmpF _    i _ | i < 0 = Nothing+    findPrevJmpF cmds i n = case (cmds !! i) of+                              (JmpForward l) | l == n -> Just i+                              _ -> findPrevJmpF cmds (i-1) n++    findNextJmpB :: [Command] +                 -> Int -- ^ index to start at+                 -> Int -- ^ nesting level to match+                 -> Maybe Int -- ^ index of next JmpF+    findNextJmpB cmds i _ | i >= length cmds = Nothing+    findNextJmpB cmds i    n = case (cmds !! i) of+                                 (JmpBackward l) | l == n -> Just i+                                 _ -> findNextJmpB cmds (i+1) n++execute :: Array Int Command -> Int -> BF -> IO ()+execute cmds n bf@(BF c cp ip) = do+  if ip >= n || cmds ! ip == Halt+    then halt+    else doCommand cmds bf >>= execute cmds n++halt = if debug +         then putStrLn "Machine Halted.\n"+         else putStrLn "\n"++-- Example Programs++helloWorld = +  ">+++++++++[<++++++++>-]<.>+++++++[<++++>-]<+.+++++++..+++.[-]>++++++++[<++++>-]"+++  "<.#>+++++++++++[<+++++>-]<.>++++++++[<+++>-]<.+++.------.--------.[-]>++++++++["+++  "<++++>-]<+.[-]++++++++++."+++-- works now, thanks to int-e for explaining the BF spec to me+bottles = +  "99 Bottles of Beer in Urban Mueller's BrainF*** (The actual"+++  "name is impolite)"+++  ""+++  "by Ben Olmstead"+++  ""+++  "ANSI C interpreter available on the internet; due to"+++  "constraints in comments the address below needs to have the"+++  "stuff in parenthesis replaced with the appropriate symbol:"+++  ""+++  "http://www(dot)cats(dash)eye(dot)com/cet/soft/lang/bf/"+++  ""+++  "Believe it or not this language is indeed Turing complete!"+++  "Combines the speed of BASIC with the ease of INTERCAL and"+++  "the readability of an IOCCC entry!"+++  ""+++  ">+++++++++[<+++++++++++>-]<[>[-]>[-]<<[>+>+<<-]>>[<<+>>-]>>>"+++  "[-]<<<+++++++++<[>>>+<<[>+>[-]<<-]>[<+>-]>[<<++++++++++>>>+<"+++  "-]<<-<-]+++++++++>[<->-]>>+>[<[-]<<+>>>-]>[-]+<<[>+>-<<-]<<<"+++  "[>>+>+<<<-]>>>[<<<+>>>-]>[<+>-]<<-[>[-]<[-]]>>+<[>[-]<-]<+++"+++  "+++++[<++++++<++++++>>-]>>>[>+>+<<-]>>[<<+>>-]<[<<<<<.>>>>>-"+++  "]<<<<<<.>>[-]>[-]++++[<++++++++>-]<.>++++[<++++++++>-]<++.>+"+++  "++++[<+++++++++>-]<.><+++++..--------.-------.>>[>>+>+<<<-]>"+++  ">>[<<<+>>>-]<[<<<<++++++++++++++.>>>>-]<<<<[-]>++++[<+++++++"+++  "+>-]<.>+++++++++[<+++++++++>-]<--.---------.>+++++++[<------"+++  "---->-]<.>++++++[<+++++++++++>-]<.+++..+++++++++++++.>++++++"+++  "++[<---------->-]<--.>+++++++++[<+++++++++>-]<--.-.>++++++++"+++  "[<---------->-]<++.>++++++++[<++++++++++>-]<++++.-----------"+++  "-.---.>+++++++[<---------->-]<+.>++++++++[<+++++++++++>-]<-."+++  ">++[<----------->-]<.+++++++++++..>+++++++++[<---------->-]<"+++  "-----.---.>>>[>+>+<<-]>>[<<+>>-]<[<<<<<.>>>>>-]<<<<<<.>>>+++"+++  "+[<++++++>-]<--.>++++[<++++++++>-]<++.>+++++[<+++++++++>-]<."+++  "><+++++..--------.-------.>>[>>+>+<<<-]>>>[<<<+>>>-]<[<<<<++"+++  "++++++++++++.>>>>-]<<<<[-]>++++[<++++++++>-]<.>+++++++++[<++"+++  "+++++++>-]<--.---------.>+++++++[<---------->-]<.>++++++[<++"+++  "+++++++++>-]<.+++..+++++++++++++.>++++++++++[<---------->-]<"+++  "-.---.>+++++++[<++++++++++>-]<++++.+++++++++++++.++++++++++."+++  "------.>+++++++[<---------->-]<+.>++++++++[<++++++++++>-]<-."+++  "-.---------.>+++++++[<---------->-]<+.>+++++++[<++++++++++>-"+++  "]<--.+++++++++++.++++++++.---------.>++++++++[<---------->-]"+++  "<++.>+++++[<+++++++++++++>-]<.+++++++++++++.----------.>++++"+++  "+++[<---------->-]<++.>++++++++[<++++++++++>-]<.>+++[<----->"+++  "-]<.>+++[<++++++>-]<..>+++++++++[<--------->-]<--.>+++++++[<"+++  "++++++++++>-]<+++.+++++++++++.>++++++++[<----------->-]<++++"+++  ".>+++++[<+++++++++++++>-]<.>+++[<++++++>-]<-.---.++++++.----"+++  "---.----------.>++++++++[<----------->-]<+.---.[-]<<<->[-]>["+++  "-]<<[>+>+<<-]>>[<<+>>-]>>>[-]<<<+++++++++<[>>>+<<[>+>[-]<<-]"+++  ">[<+>-]>[<<++++++++++>>>+<-]<<-<-]+++++++++>[<->-]>>+>[<[-]<"+++  "<+>>>-]>[-]+<<[>+>-<<-]<<<[>>+>+<<<-]>>>[<<<+>>>-]<>>[<+>-]<"+++  "<-[>[-]<[-]]>>+<[>[-]<-]<++++++++[<++++++<++++++>>-]>>>[>+>+"+++  "<<-]>>[<<+>>-]<[<<<<<.>>>>>-]<<<<<<.>>[-]>[-]++++[<++++++++>"+++  "-]<.>++++[<++++++++>-]<++.>+++++[<+++++++++>-]<.><+++++..---"+++  "-----.-------.>>[>>+>+<<<-]>>>[<<<+>>>-]<[<<<<++++++++++++++"+++  ".>>>>-]<<<<[-]>++++[<++++++++>-]<.>+++++++++[<+++++++++>-]<-"+++  "-.---------.>+++++++[<---------->-]<.>++++++[<+++++++++++>-]"+++  "<.+++..+++++++++++++.>++++++++[<---------->-]<--.>+++++++++["+++  "<+++++++++>-]<--.-.>++++++++[<---------->-]<++.>++++++++[<++"+++  "++++++++>-]<++++.------------.---.>+++++++[<---------->-]<+."+++  ">++++++++[<+++++++++++>-]<-.>++[<----------->-]<.+++++++++++"+++  "..>+++++++++[<---------->-]<-----.---.+++.---.[-]<<<]"+++  "@"++helloum =+  "++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.@"++-- can't figure this one out either...+sort =+  "Here is a Brainf*** program that bubblesorts its input and spits it out:"+++  ">>>>>,+[>>>,+]<<<[<<<"+++  "[>>>[-<<<-<+>[>]>>]<<<[<]>>"+++  "[>>>+<<<-]<[>+>>>+<<<<-]"+++  "<<]>>>[-.[-]]>>>[>>>]<<<]"++toupper =+  ",----------[----------------------.,----------]"++{-+Example optimized programs:++++++[>++++++++<-]>[.+]++[(0,IncByteBy 4),  (1,SetIpTo 7),     (2,IncPtrBy 1),+ (3,IncByteBy 8),  (4,IncPtrBy (-1)), (5,IncByteBy (-1)),+ (6,SetIpTo (-1)), (7,IncPtrBy 1),    (8,SetIpTo 12),+ (9,OutputByte),   (10,IncByteBy 1),  (11,SetIpTo (-8)),+ (12,Halt)+]++[[]]++[(0,SetIpTo 4), + (1,SetIpTo 3),+ (2,SetIpTo (-1)),+ (3,SetIpTo 0),+ (4,Halt)+]++-}
scripts/BotPP.hs view
@@ -21,27 +21,36 @@ import qualified Data.ByteString.Char8 as B -- crank it up, yeah!  main = do-    [_,i,o] <- getArgs-    B.readFile i >>= \l -> B.writeFile o $ expand (B.length l) 0 l+    -- putStr "BotPP called with args: ";  print =<< getArgs+    [orig,i,o] <- getArgs+    let basename = baseName orig+    -- putStr "basename = "; print basename+    B.readFile i >>= \l -> B.writeFile o $ expand (B.length l) 0 basename l +baseName :: FilePath -> FilePath+baseName s = base +    where+    rfile = takeWhile (not . (`elem` "/\\")) (reverse s)+    base  = takeWhile (/='.') (reverse rfile)+ -- -- tricksy non-copying implementation. ---expand :: Int -> Int -> ByteString -> ByteString-expand l n xs+expand :: Int -> Int -> String -> ByteString -> ByteString+expand l n basename xs     | n `seq` xs `seq` False               = undefined -- strict     | l == n                               = xs        -- not found     | pLUGIN  `B.isPrefixOf` (B.drop n xs) = B.concat $ pref : render  name  ++ [B.tail rest]-    | mODULES `B.isPrefixOf` (B.drop n xs) = B.concat $ pref : modules name' ++ [B.tail rest']-    | otherwise                            = expand l (n+1) xs+    | mODULES `B.isPrefixOf` (B.drop n xs) = B.concat $ pref : modules basename name' ++ [B.tail rest']+    | otherwise                            = expand l (n+1) basename xs      where pref         = B.take n xs    -- accumulating an offset            pLUGIN       = pack "PLUGIN "-          (name, rest) = B.breakChar '\n' (B.drop (n+B.length pLUGIN) xs)+          (name, rest) = B.break (=='\n') (B.drop (n+B.length pLUGIN) xs)            mODULES      = pack "MODULES "-          (name', rest') = B.breakChar '\n' (B.drop (n+B.length mODULES) xs)+          (name', rest') = B.break (=='\n') (B.drop (n+B.length mODULES) xs)  -- -- render the plugin boiler plate@@ -57,22 +66,41 @@ -- -- Collect all the plugin names, and generate the Modules.hs file ---modules :: ByteString -> [ByteString]-modules s =-    [pack "module Modules where\n"+modules :: String -> ByteString -> [ByteString]+modules basename s =+    [pack "module ", pack basename, pack " (modulesInfo) where\n"     ,pack "import Lambdabot\n"     ,pack "\n"]-    ++ (concatMap importify ms) ++-    [pack "loadStaticModules :: LB ()\n"+    ++ (concatMap importify statics) +++    [pack "modulesInfo :: (LB (), [String])\n"+    ,pack "modulesInfo = (loadStaticModules, plugins)\n"+    ,pack "loadStaticModules :: LB ()\n"     ,pack "loadStaticModules = do\n"]-    ++ (concatMap instalify ms) +++    ++ (concatMap instalify statics) ++     [pack "plugins :: [String]\n"-    ,pack "plugins = []\n"]+    ,pack "plugins = ["]+    ++ ((concat . (intersperse [pack ","]) . map pluginify) plugins) +++    [pack "]\n"] -    where ms  = sort $ B.split ' ' s+    where ms  = filter nonWhitespace $ B.split ' ' s++          statics = sort statics'+          plugins = sort plugins'++          (statics', rest) = break ((==)(pack ":")) ms+          plugins' = drop 1 rest+           importify x = [pack "import qualified Plugin.", x, B.singleton '\n']           instalify x = [pack "  ircInstallModule Plugin.",x                         ,pack ".theModule \""                         ,B.map toLower x                         , pack "\"\n"]+          pluginify x = [pack "\""+                        ,B.map toLower x+                        ,pack "\""]+                                +          nonWhitespace s +              | s == pack ""   = False+              | s == pack "\n" = False+              | otherwise      = True
scripts/Djinn/Djinn.hs view
@@ -3,13 +3,15 @@ -- See LICENSE for licensing details. -- module Main(main) where-import Char(isAlpha, isSpace)-import List(sortBy, nub)-import Ratio+import Data.Char(isAlpha, isSpace, isAlphaNum)+import Data.List(sortBy, nub, intersperse)+import Data.Ratio import Text.ParserCombinators.ReadP-import Monad(when)-import IO-import System+import Control.Monad(when)+import Control.Monad.Error()+import System.IO+import System.Environment+import System.Exit  import REPL import LJT@@ -21,23 +23,24 @@ main :: IO () main = do     args <- getArgs-    let	decodeOptions (('-':cs) : as) st = decodeOption cs >>= \f -> decodeOptions as (f False st)-	decodeOptions (('+':cs) : as) st = decodeOption cs >>= \f -> decodeOptions as (f True  st)-	decodeOptions as st = return (as, st)-	decodeOption cs = case [ set | (cmd, _, _, set) <- options, isPrefix cs cmd ] of-			  [] -> do usage; exitWith (ExitFailure 1)-			  set : _ -> return set+    let decodeOptions (('-':cs) : as) st = decodeOption cs >>= \f -> decodeOptions as (f False st)+        decodeOptions (('+':cs) : as) st = decodeOption cs >>= \f -> decodeOptions as (f True  st)+        decodeOptions as st = return (as, st)+        decodeOption cs = case [ set | (cmd, _, _, set) <- options, isPrefix cs cmd ] of+                          [] -> do usage; exitWith (ExitFailure 1)+                          set : _ -> return set     (args', state) <- decodeOptions args startState     case args' of-	[] -> repl (hsGenRepl state)-	_ -> loop state args'-	      where loop _ [] = return ()-		    loop s (a:as) = do-		        (q, s') <- loadFile s a-			if q then-			    return ()-			 else-			    loop s' as+        [] -> repl (hsGenRepl state)+        _ -> loop state args'+              where loop _ [] = return ()+                    loop s (a:as) = do+                        putStrLn $ "-- loading file " ++ a+                        (q, s') <- loadFile s a+                        if q then+                            return ()+                         else+                            loop s' as  usage :: IO () usage = putStrLn "Usage: djinn [option ...] [file ...]"@@ -52,6 +55,7 @@ data State = State {     synonyms :: [(HSymbol, ([HSymbol], HType, HKind))],     axioms :: [(HSymbol, HType)],+    classes :: [ClassDef],     multi :: Bool,     sorted :: Bool,     debug :: Bool,@@ -62,6 +66,7 @@ startState :: State startState = State {     synonyms = syns,+    classes = clss,     axioms = [],     multi = False,     sorted = True,@@ -69,16 +74,19 @@     cutOff = 100     }  where syns = either (const $ error "Bad initial environment") id $ htCheckEnv $ reverse [-	("()",     ([],        HTUnion [("()",[])],                                      undefined)),-	("Either", (["a","b"], HTUnion [("Left", [HTVar "a"]), ("Right", [HTVar "b"])],  undefined)),-	("Maybe",  (["a"],     HTUnion [("Nothing", []), ("Just", [HTVar "a"])],         undefined)),-	("Bool",   ([],        HTUnion [("False", []), ("True", [])],                    undefined)),-	("Void",   ([],        HTUnion [],                                               undefined)),-	("Not",    (["x"],     htNot "x",                                                undefined))-	]+        ("()",     ([],        HTUnion [("()",[])],                                      undefined)),+        ("Either", (["a","b"], HTUnion [("Left", [HTVar "a"]), ("Right", [HTVar "b"])],  undefined)),+        ("Maybe",  (["a"],     HTUnion [("Nothing", []), ("Just", [HTVar "a"])],         undefined)),+        ("Bool",   ([],        HTUnion [("False", []), ("True", [])],                    undefined)),+        ("Void",   ([],        HTUnion [],                                               undefined)),+        ("Not",    (["x"],     htNot "x",                                                undefined))+        ]+       clss = [("Eq", (["a"], [("==", a `HTArrow` (a `HTArrow` HTCon "Bool"))]))]+       a = HTVar "a" + version :: String-version = "version 2005-12-15"+version = "version 2007-04-20"  inIt :: State -> IO (String, State) inIt state = do@@ -90,8 +98,8 @@ eval s line =     case filter (null . snd) (readP_to_S pCmd line) of     [] -> do-		putStrLn $ "Cannot parse command"-		return (False, s)+                putStrLn $ "Cannot parse command"+                return (False, s)     (cmd, "") : _ -> runCmd s cmd     _ -> error "eval" @@ -100,14 +108,17 @@     putStrLn "Bye."     return () -data Cmd = Help Bool | Quit | Add HSymbol HType | Query HSymbol HType | Del HSymbol | Load HSymbol | Noop | Env |-	   Type (HSymbol, ([HSymbol], HType, HKind)) | Set (State -> State) | Clear+type Context = (HSymbol, [HType])+type ClassDef = (HSymbol, ([HSymbol], [Method])) +data Cmd = Help Bool | Quit | Add HSymbol HType | Query HSymbol [Context] HType | Del HSymbol | Load HSymbol | Noop | Env |+           Type (HSymbol, ([HSymbol], HType, HKind)) | Set (State -> State) | Clear | Class ClassDef+ pCmd :: ReadP Cmd pCmd = do     skipSpaces     let adds (':':s) p = do schar ':'; pPrefix (takeWhile (/= ' ') s); c <- p; skipSpaces; return c-	adds _ p = do c <- p; skipSpaces; return c+        adds _ p = do c <- p; skipSpaces; return c     cmd <- foldr1 (+++) [ adds s p | (s, _, p) <- commands ]     skipSpaces     return cmd@@ -118,9 +129,9 @@     cs <- look     let w = takeWhile isAlpha cs     if isPrefix w s then-	string w+        string w      else-	pfail+        pfail  isPrefix :: String -> String -> Bool isPrefix p s = not (null p) && length p <= length s && take (length p) s == p@@ -142,50 +153,56 @@     return (False, startState) runCmd s (Del i) =      return (False, s { axioms   = filter ((i /=) . fst) (axioms s)-                     , synonyms = filter ((i /=) . fst) (synonyms s) })+                     , synonyms = filter ((i /=) . fst) (synonyms s)+                     , classes = filter ((i /=) . fst) (classes s) }) runCmd s Env = do --    print s     let tname t = if isHTUnion t then "data" else "type"-	showd (HTUnion []) = ""-	showd t = " = " ++ show t+        showd (HTUnion []) = ""+        showd t = " = " ++ show t     mapM_ (\ (i, (vs, t, _)) -> putStrLn $ tname t ++ " " ++ unwords (i:vs) ++ showd t) (reverse $ synonyms s)     mapM_ (\ (i, t) -> putStrLn $ i ++ " :: " ++ show t) (reverse $ axioms s)+    mapM_ (putStrLn . showClass) (reverse $ classes s)     return (False, s) runCmd s (Type syn) = do     case htCheckEnv (syn : synonyms s) of-	Left msg -> do putStrLn $ "Error: " ++ msg; return (False, s)+        Left msg -> do putStrLn $ "Error: " ++ msg; return (False, s)         Right syns -> return (False, s { synonyms = syns }) runCmd s (Set f) =     return (False, f s)-runCmd s (Query i g) =-   case htCheckType (synonyms s) g of+runCmd s (Query i ctx g) =+   case htCheckType (synonyms s) g >> mapM (ctxLookup (classes s)) ctx of    Left msg -> do putStrLn $ "Error: " ++ msg; return (False, s)-   Right _ -> do+   Right mss -> do     let form = hTypeToFormula (synonyms s) g-	env = [ (Symbol v, hTypeToFormula (synonyms s) t) | (v, t) <- axioms s ]-	mpr = prove (multi s || sorted s) env form+        env = [ (Symbol v, hTypeToFormula (synonyms s) t) | (v, t) <- axioms s ] ++ ctxEnv+        ctxEnv = [ (Symbol v, hTypeToFormula (synonyms s) t) | ms <- mss, (v, t) <- ms ]+        mpr = prove (multi s || sorted s) env form     when (debug s) $ putStrLn ("*** " ++ show form)     case mpr of-	[] -> do-	    putStrLn $ "-- " ++ i ++ " cannot be realized."-	    return (False, s)-	ps -> do-	    let f p =-		   let c = termToHClause i p-		       bvs = getBinderVars c-		       r = if null bvs then (0, 0) else (length (filter (== "_") bvs) % length bvs, length bvs)-		   in  (r, c)-	        e:es = nub $ -		        if sorted s then-			    map snd $ sortBy (\ (x,_) (y,_) -> compare x y) $ map f $ take (cutOff s) ps-			else-			    map (termToHClause i) $ take (cutOff s) ps-	        pr = putStrLn . hPrClause-	    when (debug s) $ putStrLn ("+++ " ++ show (head ps))-	    putStrLn $ i ++ " :: " ++ show g-	    pr e-	    when (multi s) $ mapM_ (\ x -> putStrLn "-- or" >> pr x) es-	    return (False, s)+        [] -> do+            putStrLn $ "-- " ++ i ++ " cannot be realized."+            return (False, s)+        ps -> do+            let f p =+                   let c = termToHClause i p+                       bvs = getBinderVars c+                       r = if null bvs then (0, 0) else (length (filter (== "_") bvs) % length bvs, length bvs)+                   in  (r, c)+                e:es = nub $ +                        if sorted s then+                            map snd $ sortBy (\ (x,_) (y,_) -> compare x y) $ map f $ take (cutOff s) ps+                        else+                            map (termToHClause i) $ take (cutOff s) ps+                pr = putStrLn . hPrClause+                sctx = if null ctx then "" else showContexts ctx ++ " => "+            when (debug s) $ putStrLn ("+++ " ++ show (head ps))+            putStrLn $ i ++ " :: " ++ sctx ++ show g+            pr e+            when (multi s) $ mapM_ (\ x -> putStrLn "-- or" >> pr x) es+            return (False, s)+runCmd s (Class c) = do+    return (False, s { classes = c : classes s })  loadFile :: State -> String -> IO (Bool, State) loadFile s name = do@@ -196,43 +213,62 @@ stripComments "" = "" stripComments ('-':'-':cs) = skip cs   where skip "" = ""-	skip s@('\n':_) = stripComments s-	skip (_:s) = skip s+        skip s@('\n':_) = stripComments s+        skip (_:s) = skip s stripComments (c:cs) = c : stripComments cs +showClass :: ClassDef -> String+showClass (c, (as, ms)) = "class " ++ showContext (c, map HTVar as) ++ " where " ++ concat (intersperse "; " $ map sm ms)+  where sm (i, t) = pp i ++ " :: " ++ show t+        pp i@(ch:_) | not (isAlphaNum ch) = "(" ++ i ++ ")"+        pp i = i +showContext :: Context -> String+showContext (c, as) = show $ foldl HTApp (HTCon c) as++showContexts :: [Context] -> String+showContexts [] = ""+showContexts cs = "(" ++ concat (intersperse ", " $ map showContext cs) ++ ")"++ctxLookup :: [ClassDef] -> Context -> Either String [Method]+ctxLookup clss (c, as) =+    case lookup c clss of+    Nothing -> Left $ "Class not found: " ++ c+    Just (ps, ms) -> Right [(m, substHT (zip ps as) t) | (m, t) <- ms ]+ evalCmds :: State -> [String] -> IO (Bool, State) evalCmds state [] = return (False, state) evalCmds state (l:ls) = do     qs@(q, state') <- eval state l     if q then-	return qs+        return qs      else-	evalCmds state' ls+        evalCmds state' ls  commands :: [(String, String, ReadP Cmd)] commands = [-	(":clear",		"Clear the envirnment",		return Clear),-	(":delete <sym>",	"Delete from environment.",	pDel),-	(":environment",	"Show environment",		return Env),-	(":help",		"Print this message.",		return (Help False)),-	(":load <file>",	"Load a file",			pLoad),-	(":quit",		"Quit program.",		return Quit),-	(":set <option>",	"Set options",			pSet),-	(":verbose-help",	"Print verbose help.",		return (Help True)),-	("type <sym> <vars> = <type>", "Add a type synonym",	pType),-	("data <sym> <vars> = <datatype>", "Add a data type",	pData),-	("<sym> :: <type>",	"Add to environment",		pAdd),-	("<sym> ? <type>",	"Query",			pQuery),-	("",			"",				return Noop)-	]+        (":clear",              "Clear the envirnment",         return Clear),+        (":delete <sym>",       "Delete from environment.",     pDel),+        (":environment",        "Show environment",             return Env),+        (":help",               "Print this message.",          return (Help False)),+        (":load <file>",        "Load a file",                  pLoad),+        (":quit",               "Quit program.",                return Quit),+        (":set <option>",       "Set options",                  pSet),+        (":verbose-help",       "Print verbose help.",          return (Help True)),+        ("type <sym> <vars> = <type>", "Add a type synonym",    pType),+        ("data <sym> <vars> = <datatype>", "Add a data type",   pData),+        ("class <sym> <vars> where <method>...", "Add a class", pClass),+        ("<sym> :: <type>",     "Add to environment",           pAdd),+        ("<sym> ? <type>",      "Query",                        pQuery),+        ("",                    "",                             return Noop)+        ]  options :: [(String, String, State->Bool, Bool->State->State)] options = [-	  ("multi",		"print multiple solutions",	multi,	\ v s -> s { multi  = v }),-	  ("sorted",		"sort solutions",		sorted,	\ v s -> s { sorted = v }),-	  ("debug",		"debug mode",			debug,	\ v s -> s { debug  = v })-	  ]+          ("multi",             "print multiple solutions",     multi,  \ v s -> s { multi  = v }),+          ("sorted",            "sort solutions",               sorted, \ v s -> s { sorted = v }),+          ("debug",             "debug mode",                   debug,  \ v s -> s { debug  = v })+          ]  getHelp :: (String, String, a) -> String getHelp (cmd, help, _) = cmd ++ replicate (35 - length cmd) ' ' ++ help@@ -260,10 +296,20 @@ pQuery = do     i <- pHSymbol False     schar '?'+    c <- option [] pContext     t <- pHType     optional $ schar ';'-    return $ Query i t+    return $ Query i c t +pContext :: ReadP [Context]+pContext = do+    let pCtx = do c <- pHSymbol True; ts <- many pHTAtom; return (c, ts)+    schar '('+    ctx <- sepBy1 pCtx (schar ',')+    schar ')'+    sstring "=>"+    return ctx+ pType :: ReadP Cmd pType = do     sstring "type"@@ -280,6 +326,25 @@     args <- many (pHSymbol False)     (do schar '='; t <- pHDataType; return $ Type (syn, (args, t, undefined))) +++ (return $ Type (syn, (args, HTUnion [], undefined))) +pClass :: ReadP Cmd+pClass = do+    sstring "class"+    cls <- pHSymbol True+    args <- many (pHSymbol False)+    sstring "where"+    mets <- sepBy pMethod (schar ';')+    return $ Class (cls, (args, mets))++type Method = (HSymbol, HType)++pMethod :: ReadP Method+pMethod = do+    let pOpSym = satisfy (`elem` "~!#$%^&*-+=<>.:")+    i <- pHSymbol False +++ do schar '('; op <- many1 pOpSym; schar ')'; return op+    sstring "::"+    t <- pHType+    return (i, t)+ pSet :: ReadP Cmd pSet = do     val <- (do schar '+'; return True) +++ (do schar '-'; return False) @@ -308,7 +373,7 @@ \initial environment (do :e for a list).\n\ \\n\ \Caveat emptor: The expression will have the right type, but it\n\-\not be what you were looking for.\n\+\may not be what you were looking for.\n\ \\n\ \Send any comments and feedback to lennart@augustsson.net\n\ \\n\@@ -319,4 +384,4 @@ getSettings s = unlines $ [     "",     "Current settings" ] ++ [ "    " ++ (if gett s then "+" else "-") ++ name ++ replicate (10 - length name) ' ' ++ descr |-			      (name, descr, gett, _set) <- options ]+                              (name, descr, gett, _set) <- options ]
scripts/Djinn/HCheck.hs view
@@ -3,9 +3,9 @@ -- See LICENSE for licensing details. -- module HCheck(htCheckEnv, htCheckType) where-import List(union)+import Data.List(union) --import Control.Monad.Trans-import Control.Monad.Error+import Control.Monad.Error() import Control.Monad.State import Data.IntMap(IntMap, insert, (!), empty) @@ -33,8 +33,8 @@ getVar i = do     (_, m) <- get     case m!i of-	Just (KVar i') -> getVar i'-	mk -> return mk+        Just (KVar i') -> getVar i'+        mk -> return mk  addMap :: Int -> HKind -> M () addMap i k = do@@ -54,14 +54,14 @@ htCheckEnv :: [(HSymbol, ([HSymbol], HType, a))] -> Either String [(HSymbol, ([HSymbol], HType, HKind))] htCheckEnv its =     let graph = [ (n, i, getHTCons t) | n@(i, (_, t, _)) <- its ]-	order = stronglyConnComp graph+        order = stronglyConnComp graph     in  case [ c | CyclicSCC c <- order ] of-	c : _ -> Left $ "Recursive types are not allowed: " ++ unwords [ i | (i, _) <- c ]-	[] -> flip evalStateT initState $ addKinds-	    where addKinds = do-		        env <- inferHKinds [] $ map (\ (AcyclicSCC n) -> n) order-		  	let getK i = maybe (error $ "htCheck " ++ i) id $ lookup i env-			return [ (i, (vs, t, getK i)) | (i, (vs, t, _)) <- its ]+        c : _ -> Left $ "Recursive types are not allowed: " ++ unwords [ i | (i, _) <- c ]+        [] -> flip evalStateT initState $ addKinds+            where addKinds = do+                        env <- inferHKinds [] $ map (\ (AcyclicSCC n) -> n) order+                        let getK i = maybe (error $ "htCheck " ++ i) id $ lookup i env+                        return [ (i, (vs, t, getK i)) | (i, (vs, t, _)) <- its ]  inferHKinds :: KEnv -> [(HSymbol, ([HSymbol], HType, a))] -> M KEnv inferHKinds env [] = return env@@ -107,16 +107,16 @@ unifyK :: HKind -> HKind -> M () unifyK k1 k2 = do     let follow k@(KVar i) = getVar i >>= return . maybe k id -	follow k = return k-	unify KStar KStar = return ()-	unify (KArrow k11 k12) (KArrow k21 k22) = do unifyK k11 k21; unifyK k12 k22-	unify (KVar i1) (KVar i2) | i1 == i2 = return ()-	unify (KVar i) k = do occurs i k; addMap i k-	unify k (KVar i) = do occurs i k; addMap i k-	unify _ _ = lift $ Left "kind error"-	occurs _ KStar = return ()-	occurs i (KArrow f a) = do follow f >>= occurs i; follow a >>= occurs i-	occurs i (KVar i') = if i == i' then lift $ Left "cyclic kind" else return ()+        follow k = return k+        unify KStar KStar = return ()+        unify (KArrow k11 k12) (KArrow k21 k22) = do unifyK k11 k21; unifyK k12 k22+        unify (KVar i1) (KVar i2) | i1 == i2 = return ()+        unify (KVar i) k = do occurs i k; addMap i k+        unify k (KVar i) = do occurs i k; addMap i k+        unify _ _ = lift $ Left "kind error"+        occurs _ KStar = return ()+        occurs i (KArrow f a) = do follow f >>= occurs i; follow a >>= occurs i+        occurs i (KVar i') = if i == i' then lift $ Left "cyclic kind" else return ()     k1' <- follow k1     k2' <- follow k2     unify k1' k2'@@ -132,7 +132,7 @@ getConHKind env v =     case lookup v env of     Just k -> return k-    Nothing -> newKVar		-- allow uninterpreted type constructors+    Nothing -> newKVar          -- allow uninterpreted type constructors  ground :: HKind -> M HKind ground KStar = return KStar@@ -140,8 +140,8 @@ ground (KVar i) = do     mk <- getVar i     case mk of-	Just k -> return k-	Nothing -> return KStar+        Just k -> return k+        Nothing -> return KStar  getHTCons :: HType -> [HSymbol] getHTCons (HTApp f a) = getHTCons f `union` getHTCons a
scripts/Djinn/HTypes.hs view
@@ -2,13 +2,14 @@ -- Copyright (c) 2005 Lennart Augustsson -- See LICENSE for licensing details. ---module HTypes(HKind(..), HType(..), HSymbol, hTypeToFormula, pHSymbol, pHType, pHDataType, htNot, isHTUnion, getHTVars,-	HClause, HPat, HExpr, hPrClause, termToHExpr, termToHClause, getBinderVars) where+module HTypes(HKind(..), HType(..), HSymbol, hTypeToFormula, pHSymbol, pHType, pHDataType, pHTAtom,+        htNot, isHTUnion, getHTVars, substHT,+        HClause, HPat, HExpr(HEVar), hPrClause, termToHExpr, termToHClause, getBinderVars) where import Text.PrettyPrint.HughesPJ(Doc, renderStyle, style, text, (<>), parens, ($$), vcat, punctuate,-	 sep, fsep, nest, comma, (<+>))-import Char(isAlphaNum, isAlpha, isUpper)-import List(union, (\\))-import Monad(zipWithM)+         sep, fsep, nest, comma, (<+>))+import Data.Char(isAlphaNum, isAlpha, isUpper)+import Data.List(union, (\\))+import Control.Monad(zipWithM) import Text.ParserCombinators.ReadP import LJTFormula @@ -23,13 +24,13 @@     deriving (Eq, Show)  data HType-	= HTApp HType HType-	| HTVar HSymbol-	| HTCon HSymbol-	| HTTuple [HType]-	| HTArrow HType HType-	| HTUnion [(HSymbol, [HType])]		-- Only for data types; only at top level-	deriving (Eq)+        = HTApp HType HType+        | HTVar HSymbol+        | HTCon HSymbol+        | HTTuple [HType]+        | HTArrow HType HType+        | HTUnion [(HSymbol, [HType])]          -- Only for data types; only at top level+        deriving (Eq)  isHTUnion :: HType -> Bool isHTUnion (HTUnion _) = True@@ -44,15 +45,15 @@     showsPrec _ (HTVar s) = showString s     showsPrec _ (HTCon s) = showString s     showsPrec _ (HTTuple ss) = showParen True $ f ss-	where f [] = error "showsPrec HType"-	      f [t] = showsPrec 0 t-	      f (t:ts) = showsPrec 0 t . showString ", " . f ts+        where f [] = error "showsPrec HType"+              f [t] = showsPrec 0 t+              f (t:ts) = showsPrec 0 t . showString ", " . f ts     showsPrec p (HTArrow s t) = showParen (p > 0) $ showsPrec 1 s . showString " -> " . showsPrec 0 t     showsPrec _ (HTUnion cs) = f cs-	where f [] = id-	      f [cts] = scts cts-	      f (cts : ctss) = scts cts . showString " | " . f ctss-	      scts (c, ts) = foldl (\ s t -> s . showString " " . showsPrec 10 t) (showString c) ts+        where f [] = id+              f [cts] = scts cts+              f (cts : ctss) = scts cts . showString " | " . f ctss+              scts (c, ts) = foldl (\ s t -> s . showString " " . showsPrec 10 t) (showString c) ts  instance Read HType where     readsPrec _ = readP_to_S pHType'@@ -71,9 +72,9 @@ pHDataType :: ReadP HType pHDataType = do     let con = do-	    c <- pHSymbol True-	    ts <- many pHTAtom-	    return (c, ts)+            c <- pHSymbol True+            ts <- many pHTAtom+            return (c, ts)     cts <- sepBy con (schar '|')     return $ HTUnion cts @@ -180,7 +181,7 @@     deriving (Show, Eq)  data HExpr = HELam [HPat] HExpr | HEApply HExpr HExpr | HECon HSymbol | HEVar HSymbol | HETuple [HExpr] |-	HECase HExpr [(HPat, HExpr)]+        HECase HExpr [(HPat, HExpr)]     deriving (Show, Eq)  hPrClause :: HClause -> String@@ -188,7 +189,7 @@  ppClause :: Int -> HClause -> Doc ppClause _p (HClause f ps e) = text f <+> sep [sep (map (ppPat 10) ps) <+> text "=",-					       nest 2 $ ppExpr 0 e]+                                               nest 2 $ ppExpr 0 e]  ppPat :: Int -> HPat -> Doc ppPat _ (HPVar s) = text s@@ -199,13 +200,16 @@  ppExpr :: Int -> HExpr -> Doc ppExpr p (HELam ps e) = pparens (p > 0) $ sep [ text "\\" <+> sep (map (ppPat 10) ps) <+> text "->",-						ppExpr 0 e]-ppExpr p (HEApply f a) = pparens (p > 1) $ ppExpr 1 f <+> ppExpr 2 a+                                                ppExpr 0 e]+ppExpr p (HEApply (HEApply (HEVar f@(c:_)) a1) a2) | not (isAlphaNum c) =+     pparens (p > 4) $ ppExpr 5 a1 <+> text f <+> ppExpr 5 a2+ppExpr p (HEApply f a) = pparens (p > 11) $ ppExpr 11 f <+> ppExpr 12 a ppExpr _ (HECon s) = text s+ppExpr _ (HEVar s@(c:_)) | not (isAlphaNum c) = pparens True $ text s ppExpr _ (HEVar s) = text s ppExpr _ (HETuple es) = parens $ fsep $ punctuate comma (map (ppExpr 0) es) ppExpr p (HECase s alts) = pparens (p > 0) $ (text "case" <+> ppExpr 0 s <+> text "of") $$-			    vcat (map ppAlt alts)+                            vcat (map ppAlt alts)   where ppAlt (pp, e) = ppPat 0 pp <+> text "->" <+> ppExpr 0 e  @@ -222,75 +226,75 @@ termToHExpr :: Term -> HExpr termToHExpr term = niceNames $ etaReduce $ remUnusedVars $ fst $ conv [] term   where conv _vs (Var s) = (HEVar $ unSymbol s, [])-	conv vs (Lam s te) = -		let hs = unSymbol s-		    (te', ss) = conv (hs : vs) te-		in  (hELam [convV hs ss] te', ss)-	conv vs (Apply (Cinj (ConsDesc s n) _) a) = (f $ foldl HEApply (HECon s) as, ss)-		where (f, as) = unTuple n ha-		      (ha, ss) = conv vs a-	conv vs (Apply te1 te2) = convAp vs te1 [te2]-	conv _vs (Ctuple 0) = (HECon "()", [])-	conv _vs e = error $ "termToHExpr " ++ show e+        conv vs (Lam s te) = +                let hs = unSymbol s+                    (te', ss) = conv (hs : vs) te+                in  (hELam [convV hs ss] te', ss)+        conv vs (Apply (Cinj (ConsDesc s n) _) a) = (f $ foldl HEApply (HECon s) as, ss)+                where (f, as) = unTuple n ha+                      (ha, ss) = conv vs a+        conv vs (Apply te1 te2) = convAp vs te1 [te2]+        conv _vs (Ctuple 0) = (HECon "()", [])+        conv _vs e = error $ "termToHExpr " ++ show e -	unTuple 0 _ = (id, [])-	unTuple 1 a = (id, [a])-	unTuple n (HETuple as) | length as == n = (id, as)-	unTuple n e = error $ "unTuple: unimplemented " ++ show (n, e)+        unTuple 0 _ = (id, [])+        unTuple 1 a = (id, [a])+        unTuple n (HETuple as) | length as == n = (id, as)+        unTuple n e = error $ "unTuple: unimplemented " ++ show (n, e) -	unTupleP 0 _ = []---	unTupleP 1 p = [p]-	unTupleP n (HPTuple ps) | length ps == n = ps-	unTupleP n p = error $ "unTupleP: unimplemented " ++ show (n, p)+        unTupleP 0 _ = []+--      unTupleP 1 p = [p]+        unTupleP n (HPTuple ps) | length ps == n = ps+        unTupleP n p = error $ "unTupleP: unimplemented " ++ show (n, p) -	convAp vs (Apply te1 te2) as = convAp vs te1 (te2:as)-	convAp vs (Ctuple n) as | length as == n =-		let (es, sss) = unzip $ map (conv vs) as-		in  (hETuple es, concat sss)-	convAp vs (Ccases cds) (se : es) =-		let (alts, ass) = unzip $ zipWith cAlt es cds-		    cAlt (Lam v e) (ConsDesc c n) =-			let hv = unSymbol v-			    (he, ss) = conv (hv : vs) e-			    ps = case lookup hv ss of-				 Nothing -> replicate n (HPVar "_")-				 Just p -> unTupleP n p-			in  ((foldl HPApply (HPCon c) ps, he), ss)-		    cAlt e _ = error $ "cAlt " ++ show e-		    (e', ess) = conv vs se-		in  (hECase e' alts, ess ++ concat ass)-	convAp vs (Csplit n) (b : a : as) =-		let (hb, sb) = conv vs b-		    (a', sa) = conv vs a-		    (as', sss) = unzip $ map (conv vs) as-		    (ps, b') = unLam n hb-		    unLam 0 e = ([], e)-		    unLam k (HELam ps0 e) | length ps0 >= n = let (ps1, ps2) = splitAt k ps0 in (ps1, hELam ps2 e)-		    unLam k e = error $ "unLam: unimplemented" ++ show (k, e)-		in  case a' of-			HEVar v | v `elem` vs && null as -> (b', [(v, HPTuple ps)] ++ sb ++ sa)-			_ -> (foldr HEApply (hECase a' [(HPTuple ps, b')]) as',-			      sb ++ sa ++ concat sss)-		    -	convAp vs f as = -		let (es, sss) = unzip $ map (conv vs) (f:as)-		in  (foldl1 HEApply es, concat sss)+        convAp vs (Apply te1 te2) as = convAp vs te1 (te2:as)+        convAp vs (Ctuple n) as | length as == n =+                let (es, sss) = unzip $ map (conv vs) as+                in  (hETuple es, concat sss)+        convAp vs (Ccases cds) (se : es) =+                let (alts, ass) = unzip $ zipWith cAlt es cds+                    cAlt (Lam v e) (ConsDesc c n) =+                        let hv = unSymbol v+                            (he, ss) = conv (hv : vs) e+                            ps = case lookup hv ss of+                                 Nothing -> replicate n (HPVar "_")+                                 Just p -> unTupleP n p+                        in  ((foldl HPApply (HPCon c) ps, he), ss)+                    cAlt e _ = error $ "cAlt " ++ show e+                    (e', ess) = conv vs se+                in  (hECase e' alts, ess ++ concat ass)+        convAp vs (Csplit n) (b : a : as) =+                let (hb, sb) = conv vs b+                    (a', sa) = conv vs a+                    (as', sss) = unzip $ map (conv vs) as+                    (ps, b') = unLam n hb+                    unLam 0 e = ([], e)+                    unLam k (HELam ps0 e) | length ps0 >= n = let (ps1, ps2) = splitAt k ps0 in (ps1, hELam ps2 e)+                    unLam k e = error $ "unLam: unimplemented" ++ show (k, e)+                in  case a' of+                        HEVar v | v `elem` vs && null as -> (b', [(v, HPTuple ps)] ++ sb ++ sa)+                        _ -> (foldr HEApply (hECase a' [(HPTuple ps, b')]) as',+                              sb ++ sa ++ concat sss)+                    +        convAp vs f as = +                let (es, sss) = unzip $ map (conv vs) (f:as)+                in  (foldl1 HEApply es, concat sss) -	convV hs ss =-		case lookup hs ss of-		Nothing -> HPVar hs-		Just p -> HPAt hs p+        convV hs ss =+                case lookup hs ss of+                Nothing -> HPVar hs+                Just p -> HPAt hs p -	hETuple [e] = e-	hETuple es = HETuple es+        hETuple [e] = e+        hETuple es = HETuple es  niceNames :: HExpr -> HExpr niceNames e =     let bvars = filter (/= "_") $ getBinderVarsHE e-	nvars = [[c] | c <- ['a'..'z']] ++ [ "x" ++ show i | i <- [1::Integer ..]]-	freevars = getAllVars e \\ bvars-	vars = nvars \\ freevars-	sub = zip bvars vars+        nvars = [[c] | c <- ['a'..'z']] ++ [ "x" ++ show i | i <- [1::Integer ..]]+        freevars = getAllVars e \\ bvars+        vars = nvars \\ freevars+        sub = zip bvars vars     in  hESubst sub e  hELam :: [HPat] -> HExpr -> HExpr@@ -305,13 +309,13 @@ hECase e [(p, HELam ps b)] = HELam ps $ hECase e [(p, b)] hECase se alts@((_, HELam ops _):_) | m > 0 = HELam (take m ops) $ hECase se alts'   where m = minimum (map (numBind . snd) alts)-	numBind (HELam ps _) = length (takeWhile isPVar ps)-	numBind _ = 0-	isPVar (HPVar _) = True-	isPVar _ = False-	alts' = [ let (ps1, ps2) = splitAt m ps in (cps, hELam ps2 $ hESubst (zipWith (\ (HPVar v) n -> (v, n)) ps1 ns) e)-		  | (cps, HELam ps e) <- alts ]-	ns = [ n | HPVar n <- take m ops ]+        numBind (HELam ps _) = length (takeWhile isPVar ps)+        numBind _ = 0+        isPVar (HPVar _) = True+        isPVar _ = False+        alts' = [ let (ps1, ps2) = splitAt m ps in (cps, hELam ps2 $ hESubst (zipWith (\ (HPVar v) n -> (v, n)) ps1 ns) e)+                  | (cps, HELam ps e) <- alts ]+        ns = [ n | HPVar n <- take m ops ] -- if all arms are equal and there are at least two alternatives there can be no bound vars -- from the patterns hECase _ ((_,e):alts@(_:_)) | all (alphaEq e . snd) alts = e@@ -329,10 +333,10 @@ alphaEq (HELam ps1 e1) (HELam ps2 e2) =     Nothing /= do         s <- matchPat (HPTuple ps1) (HPTuple ps2)-	if alphaEq (hESubst s e1) e2 then-	    return ()-	 else-	    Nothing+        if alphaEq (hESubst s e1) e2 then+            return ()+         else+            Nothing alphaEq (HEApply f1 a1) (HEApply f2 a2) = alphaEq f1 f2 && alphaEq a1 a2 alphaEq (HECon s1) (HECon s2) = s1 == s2 alphaEq (HEVar s1) (HEVar s2) = s1 == s2@@ -381,30 +385,30 @@ remUnusedVars :: HExpr -> HExpr remUnusedVars expr = fst $ remE expr   where remE (HELam ps e) =-	    let (e', vs) = remE e-	    in  (HELam (map (remP vs) ps) e', vs)-	remE (HEApply f a) =-	    let (f', fs) = remE f-		(a', as) = remE a-	    in  (HEApply f' a', fs ++ as)-	remE (HETuple es) =-	    let (es', sss) = unzip (map remE es)-	    in  (HETuple es', concat sss)-	remE (HECase e alts) =-	    let (e', es) = remE e-		(alts', sss) = unzip [ let (ee', ss) = remE ee in ((remP ss p, ee'), ss) | (p, ee) <- alts ]-	    in  case alts' of-		[(HPVar "_", b)] -> (b, concat sss)-		_ -> (hECase e' alts', es ++ concat sss)-	remE e@(HECon _) = (e, [])-	remE e@(HEVar v) = (e, [v])-	remP vs p@(HPVar v) = if v `elem` vs then p else HPVar "_"-	remP _vs p@(HPCon _) = p-	remP vs (HPTuple ps) = hPTuple (map (remP vs) ps)-	remP vs (HPAt v p) = if v `elem` vs then HPAt v (remP vs p) else remP vs p-	remP vs (HPApply f a) = HPApply (remP vs f) (remP vs a)-	hPTuple ps | all (== HPVar "_") ps = HPVar "_"-	hPTuple ps = HPTuple ps+            let (e', vs) = remE e+            in  (HELam (map (remP vs) ps) e', vs)+        remE (HEApply f a) =+            let (f', fs) = remE f+                (a', as) = remE a+            in  (HEApply f' a', fs ++ as)+        remE (HETuple es) =+            let (es', sss) = unzip (map remE es)+            in  (HETuple es', concat sss)+        remE (HECase e alts) =+            let (e', es) = remE e+                (alts', sss) = unzip [ let (ee', ss) = remE ee in ((remP ss p, ee'), ss) | (p, ee) <- alts ]+            in  case alts' of+                [(HPVar "_", b)] -> (b, concat sss)+                _ -> (hECase e' alts', es ++ concat sss)+        remE e@(HECon _) = (e, [])+        remE e@(HEVar v) = (e, [v])+        remP vs p@(HPVar v) = if v `elem` vs then p else HPVar "_"+        remP _vs p@(HPCon _) = p+        remP vs (HPTuple ps) = hPTuple (map (remP vs) ps)+        remP vs (HPAt v p) = if v `elem` vs then HPAt v (remP vs p) else remP vs p+        remP vs (HPApply f a) = HPApply (remP vs f) (remP vs a)+        hPTuple ps | all (== HPVar "_") ps = HPVar "_"+        hPTuple ps = HPTuple ps  getBinderVars :: HClause -> [HSymbol] getBinderVars (HClause _ pats expr) = concatMap getBinderVarsHP pats ++ getBinderVarsHE expr@@ -412,37 +416,37 @@ getBinderVarsHE :: HExpr -> [HSymbol] getBinderVarsHE expr = gbExp expr   where gbExp (HELam ps e) = concatMap getBinderVarsHP ps ++ gbExp e-	gbExp (HEApply f a) = gbExp f ++ gbExp a-	gbExp (HETuple es) = concatMap gbExp es-	gbExp (HECase se alts) = gbExp se ++ concatMap (\ (p, e) -> getBinderVarsHP p ++ gbExp e) alts-	gbExp _ = []+        gbExp (HEApply f a) = gbExp f ++ gbExp a+        gbExp (HETuple es) = concatMap gbExp es+        gbExp (HECase se alts) = gbExp se ++ concatMap (\ (p, e) -> getBinderVarsHP p ++ gbExp e) alts+        gbExp _ = []  getBinderVarsHP :: HPat -> [HSymbol] getBinderVarsHP pat = gbPat pat-  where	gbPat (HPVar s) = [s]-	gbPat (HPCon _) = []-	gbPat (HPTuple ps) = concatMap gbPat ps-	gbPat (HPAt s p) = s : gbPat p-	gbPat (HPApply f a) = gbPat f ++ gbPat a+  where gbPat (HPVar s) = [s]+        gbPat (HPCon _) = []+        gbPat (HPTuple ps) = concatMap gbPat ps+        gbPat (HPAt s p) = s : gbPat p+        gbPat (HPApply f a) = gbPat f ++ gbPat a  getAllVars :: HExpr -> [HSymbol] getAllVars expr = gaExp expr   where gaExp (HELam _ps e) = gaExp e-	gaExp (HEApply f a) = gaExp f `union` gaExp a-	gaExp (HETuple es) = foldr union [] (map gaExp es)-	gaExp (HECase se alts) = foldr union (gaExp se) (map (\ (_p, e) -> gaExp e) alts)-	gaExp (HEVar s) = [s]-	gaExp _ = []+        gaExp (HEApply f a) = gaExp f `union` gaExp a+        gaExp (HETuple es) = foldr union [] (map gaExp es)+        gaExp (HECase se alts) = foldr union (gaExp se) (map (\ (_p, e) -> gaExp e) alts)+        gaExp (HEVar s) = [s]+        gaExp _ = []  etaReduce :: HExpr -> HExpr etaReduce expr = fst $ eta expr   where eta (HELam [HPVar v] (HEApply f (HEVar v'))) | v == v' && v `notElem` vs = (f', vs)-	    where (f', vs) = eta f-	eta (HELam ps e) = (HELam ps e', vs) where (e', vs) = eta e-	eta (HEApply f a) = (HEApply f' a', fvs++avs) where (f', fvs) = eta f; (a', avs) = eta a-	eta e@(HECon _) = (e, [])-	eta e@(HEVar s) = (e, [s])-	eta (HETuple es) = (HETuple es', concat vss) where (es', vss) = unzip $ map eta es-	eta (HECase e alts) = (HECase e' alts', vs ++ concat vss) where (e', vs) = eta e-									(alts', vss) = unzip $ [ let (a', ss) = eta a in ((p, a'), ss)-												 | (p, a) <- alts ]+            where (f', vs) = eta f+        eta (HELam ps e) = (HELam ps e', vs) where (e', vs) = eta e+        eta (HEApply f a) = (HEApply f' a', fvs++avs) where (f', fvs) = eta f; (a', avs) = eta a+        eta e@(HECon _) = (e, [])+        eta e@(HEVar s) = (e, [s])+        eta (HETuple es) = (HETuple es', concat vss) where (es', vss) = unzip $ map eta es+        eta (HECase e alts) = (HECase e' alts', vs ++ concat vss) where (e', vs) = eta e+                                                                        (alts', vss) = unzip $ [ let (a', ss) = eta a in ((p, a'), ss)+                                                                                                 | (p, a) <- alts ]
scripts/Djinn/Help.hs view
@@ -152,7 +152,7 @@ \Theory\n\ \======\n\ \  Djinn interprets a Haskell type as a logic formula using the\n\-\Curry-Howard isomorphism and then a decision procedure for\n\+\Curry-Howard isomorphism and then uses a decision procedure for\n\ \Intuitionistic Propositional Calculus.  This decision procedure is\n\ \based on Gentzen's LJ sequent calculus, but in a modified form, LJT,\n\ \that ensures termination.  This variation on LJ has a long history,\n\
scripts/Djinn/LJT.hs view
@@ -18,9 +18,9 @@ -- and I learnt a trick or two from Neil Tennant's "Autologic" book.  module LJT(module LJTFormula, provable,-	prove, Proof) where-import List(partition)-import Monad+        prove, Proof) where+import Data.List(partition)+import Control.Monad  import LJTFormula @@ -29,8 +29,8 @@ mtrace m x = if debug then trace m x else x wrap :: (Show a, Show b) => String -> a -> b -> b wrap fun args ret = mtrace (fun ++ ": " ++ show args) $-		    let o = show ret in seq o $ -		    mtrace (fun ++ " returns: " ++ o) ret+                    let o = show ret in seq o $ +                    mtrace (fun ++ " returns: " ++ o) ret wrapM :: (Show a, Show b, Monad m) => String -> a -> m b -> m b wrapM fun args mret = do     () <- mtrace (fun ++ ": " ++ show args) $ return ()@@ -61,9 +61,9 @@ subst :: Term -> Symbol -> Term -> P Term subst b x term = sub term   where sub t@(Var s') = if x == s' then copy [] b else return t-	sub (Lam s t) = liftM (Lam s) (sub t)-	sub (Apply t1 t2) = liftM2 Apply (sub t1) (sub t2)-	sub t = return t+        sub (Lam s t) = liftM (Lam s) (sub t)+        sub (Apply t1 t2) = liftM2 Apply (sub t1) (sub t2)+        sub t = return t  copy :: [(Symbol, Symbol)] -> Term -> P Term copy r (Var s) = return $ Var $ maybe s id $ lookup s r@@ -92,7 +92,7 @@ applyImp :: Term -> Term -> Term applyImp p q = Apply p (Apply q (Lam y $ Apply p (Lam x (Var y))))   where x = Symbol "x"-	y = Symbol "y"+        y = Symbol "y"  -- ((c->d)->false) -> ((c->false)->false, d->false) -- p : (c->d)->false)@@ -100,11 +100,11 @@ cImpDImpFalse :: Symbol -> Symbol -> Term -> Term -> P Term cImpDImpFalse p1 p2 cdf gp = do     let p1b = Lam cf $ Apply cdf $ Lam x $ Apply (Ccases []) $ Apply (Var cf) (Var x)-	p2b = Lam d $ Apply cdf $ Lam c $ Var d-	cf = Symbol "cf"-	x = Symbol "x"-	d = Symbol "d"-	c = Symbol "c"+        p2b = Lam d $ Apply cdf $ Lam c $ Var d+        cf = Symbol "cf"+        x = Symbol "x"+        d = Symbol "d"+        c = Symbol "c"     subst p1b p1 gp >>= subst p2b p2  ------------------------------@@ -117,17 +117,17 @@ nf :: Term -> P Term nf ee = spine ee []   where spine (Apply f a) as = do a' <- nf a; spine f (a' : as)-	spine (Lam s e) [] = liftM (Lam s) (nf e)-	spine (Lam s e) (a : as) = do e' <- subst a s e; spine e' as-	spine (Csplit n) (b : tup : args) | istup && n <= length xs = spine (applys b xs) args-	  where (istup, xs) = getTup tup-		getTup (Ctuple _) = (True, [])-		getTup (Apply f a) = let (tf, as) = getTup f in (tf, a:as)-		getTup _ = (False, [])-	spine (Ccases []) (e@(Apply (Ccases []) _) : as) = spine e as-	spine (Ccases cds) (Apply (Cinj _ i) x : as) | length as >= n = spine (Apply (as!!i) x) (drop n as)-		where n = length cds-	spine f as = return $ applys f as+        spine (Lam s e) [] = liftM (Lam s) (nf e)+        spine (Lam s e) (a : as) = do e' <- subst a s e; spine e' as+        spine (Csplit n) (b : tup : args) | istup && n <= length xs = spine (applys b xs) args+          where (istup, xs) = getTup tup+                getTup (Ctuple _) = (True, [])+                getTup (Apply f a) = let (tf, as) = getTup f in (tf, a:as)+                getTup _ = (False, [])+        spine (Ccases []) (e@(Apply (Ccases []) _) : as) = spine e as+        spine (Ccases cds) (Apply (Cinj _ i) x : as) | length as >= n = spine (Apply (as!!i) x) (drop n as)+                where n = length cds+        spine f as = return $ applys f as   ------------------------------@@ -140,11 +140,11 @@ instance Monad P where     return x = P $ \ s -> [(s, x)]     P m >>= f = P $ \ s ->-	[ y | (s',x) <- m s, y <- unP (f x) s' ]+        [ y | (s',x) <- m s, y <- unP (f x) s' ]  instance Functor P where     fmap f (P m) = P $ \ s ->-	[ (s', f x) | (s', x) <- m s ]+        [ (s', f x) | (s', x) <- m s ]  instance MonadPlus P where     mzero = P $ \ _s -> []@@ -234,18 +234,18 @@ order :: NestImps -> Formula -> AtomImps -> NestImps order nestImps g atomImps =     if heuristics then-	nestImps+        nestImps     else-	let -	    good_for (NestImp _ _ _ (Disj [])) = True-	    good_for (NestImp _ _ _ g') = g == g'-	    nice_for (NestImp _ _ _ (PVar s)) =-	        case extract atomImps s of-	        (bs', _) -> let bs = [ b | A _ b <- bs'] in g `elem` bs || false `elem` bs-	    nice_for _ = False-	    (good, ok) = partition good_for nestImps-	    (nice, bad) = partition nice_for ok-	in  good ++ nice ++ bad+        let +            good_for (NestImp _ _ _ (Disj [])) = True+            good_for (NestImp _ _ _ g') = g == g'+            nice_for (NestImp _ _ _ (PVar s)) =+                case extract atomImps s of+                (bs', _) -> let bs = [ b | A _ b <- bs'] in g `elem` bs || false `elem` bs+            nice_for _ = False+            (good, ok) = partition good_for nestImps+            (nice, bad) = partition nice_for ok+        in  good ++ nice ++ bad  ------------------------------ ----- Generate a new unique variable@@ -259,8 +259,8 @@ select :: [a] -> P (a, [a]) select zs = many [ del n zs | n <- [0 .. length zs - 1] ]   where del 0 (x:xs) = (x, xs)-	del n (x:xs) = let (y,ys) = del (n-1) xs in (y, x:ys)-	del _ _ = error "select"+        del n (x:xs) = let (y,ys) = del (n-1) xs in (y, x:ys)+        del _ _ = error "select"  ------------------------------ ----- @@ -294,89 +294,89 @@     [] -> redsucc goal     a:l -> redant1 a l goal   where redant0 l g = redant more l atomImps nestImps atoms g-	redant1 :: Antecedent -> Antecedents -> Goal -> P Proof-	redant1 a@(A p f) l g = -	    wrapM "redant1" ((a, l), atomImps, nestImps, atoms, g) $-	    if f == g then-	        -- The goal is the antecedent, we're done.-	        -- XXX But we might want more?-	        if more then-		    return p `mplus` redant1' a l g-		else-		    return p-	    else-	        redant1' a l g+        redant1 :: Antecedent -> Antecedents -> Goal -> P Proof+        redant1 a@(A p f) l g = +            wrapM "redant1" ((a, l), atomImps, nestImps, atoms, g) $+            if f == g then+                -- The goal is the antecedent, we're done.+                -- XXX But we might want more?+                if more then+                    return p `mplus` redant1' a l g+                else+                    return p+            else+                redant1' a l g -	-- Reduce the first antecedent-	redant1' :: Antecedent -> Antecedents -> Goal -> P Proof-	redant1' (A p (PVar s)) l g =-	   let af = AtomF p s-	       (bs, restAtomImps) = extract atomImps s-	   in  redant more ([A (Apply f p) b | A f b <- bs] ++ l) restAtomImps nestImps (addAtom af atoms) g-	redant1' (A p (Conj bs)) l g = do-	   vs <- mapM (const (newSym "v")) bs-	   gp <- redant0 (zipWith (\ v a -> A (Var v) a) vs bs ++ l) g-	   return $ applys (Csplit (length bs)) [foldr Lam gp vs, p]-	redant1' (A p (Disj ds)) l g = do-	   vs <- mapM (const (newSym "d")) ds-	   ps <- mapM (\ (v, (_, d)) -> redant1 (A (Var v) d) l g) (zip vs ds)-	   if null ds && g == Disj [] then-	       -- We are about to construct `void p : Void', so we shortcut-	       -- it with just `p'.-	       return p-	    else-	       return $ applys (Ccases (map fst ds)) (p : zipWith Lam vs ps)-	redant1' (A p (a :-> b)) l g = redantimp p a b l g+        -- Reduce the first antecedent+        redant1' :: Antecedent -> Antecedents -> Goal -> P Proof+        redant1' (A p (PVar s)) l g =+           let af = AtomF p s+               (bs, restAtomImps) = extract atomImps s+           in  redant more ([A (Apply f p) b | A f b <- bs] ++ l) restAtomImps nestImps (addAtom af atoms) g+        redant1' (A p (Conj bs)) l g = do+           vs <- mapM (const (newSym "v")) bs+           gp <- redant0 (zipWith (\ v a -> A (Var v) a) vs bs ++ l) g+           return $ applys (Csplit (length bs)) [foldr Lam gp vs, p]+        redant1' (A p (Disj ds)) l g = do+           vs <- mapM (const (newSym "d")) ds+           ps <- mapM (\ (v, (_, d)) -> redant1 (A (Var v) d) l g) (zip vs ds)+           if null ds && g == Disj [] then+               -- We are about to construct `void p : Void', so we shortcut+               -- it with just `p'.+               return p+            else+               return $ applys (Ccases (map fst ds)) (p : zipWith Lam vs ps)+        redant1' (A p (a :-> b)) l g = redantimp p a b l g -	redantimp :: Term -> Formula -> Formula -> Antecedents -> Goal -> P Proof-	redantimp t c d a g =-	    wrapM "redantimp" (c,d,a,g) $-	    redantimp' t c d a g+        redantimp :: Term -> Formula -> Formula -> Antecedents -> Goal -> P Proof+        redantimp t c d a g =+            wrapM "redantimp" (c,d,a,g) $+            redantimp' t c d a g -	-- Reduce an implication antecedent-	redantimp' :: Term -> Formula -> Formula -> Antecedents -> Goal -> P Proof-	-- p : PVar s -> b-	redantimp' p (PVar s) b l g = redantimpatom p s b l g-	-- p : (c & d) -> b-	redantimp' p (Conj cs) b l g = do-	    x <- newSym "x"-	    let imp = foldr (:->) b cs-	    gp <- redant1 (A (Var x) imp) l g-	    subst (curryt (length cs) p) x gp-	-- p : (c | d) -> b-	redantimp' p (Disj ds) b l g = do-	    vs <- mapM (const (newSym "d")) ds-	    gp <- redant0 (zipWith (\ v (_, d) -> A (Var v) (d :-> b)) vs ds ++ l) g-	    foldM (\ r (i, v, (cd, _)) -> subst (inj cd i p) v r) gp (zip3 [0..] vs ds)-	-- p : (c -> d) -> b-	redantimp' p (c :-> d) b l g = redantimpimp p c d b l g+        -- Reduce an implication antecedent+        redantimp' :: Term -> Formula -> Formula -> Antecedents -> Goal -> P Proof+        -- p : PVar s -> b+        redantimp' p (PVar s) b l g = redantimpatom p s b l g+        -- p : (c & d) -> b+        redantimp' p (Conj cs) b l g = do+            x <- newSym "x"+            let imp = foldr (:->) b cs+            gp <- redant1 (A (Var x) imp) l g+            subst (curryt (length cs) p) x gp+        -- p : (c | d) -> b+        redantimp' p (Disj ds) b l g = do+            vs <- mapM (const (newSym "d")) ds+            gp <- redant0 (zipWith (\ v (_, d) -> A (Var v) (d :-> b)) vs ds ++ l) g+            foldM (\ r (i, v, (cd, _)) -> subst (inj cd i p) v r) gp (zip3 [0..] vs ds)+        -- p : (c -> d) -> b+        redantimp' p (c :-> d) b l g = redantimpimp p c d b l g -	redantimpimp :: Term -> Formula -> Formula -> Formula -> Antecedents -> Goal -> P Proof-	redantimpimp f b c d a g =-	    wrapM "redantimpimp" (b,c,d,a,g) $-	    redantimpimp' f b c d a g+        redantimpimp :: Term -> Formula -> Formula -> Formula -> Antecedents -> Goal -> P Proof+        redantimpimp f b c d a g =+            wrapM "redantimpimp" (b,c,d,a,g) $+            redantimpimp' f b c d a g -	-- Reduce a double implication antecedent-	redantimpimp' :: Term -> Formula -> Formula -> Formula -> Antecedents -> Goal -> P Proof-	-- next clause exploits ~(C->D) <=> (~~C & ~D)-	-- which isn't helpful when D = false-	redantimpimp' p c d (Disj []) l g | d /= false = do-	    x <- newSym "x"-	    y <- newSym "y"-	    gp <- redantimpimp (Var x) c false false (A (Var y) (d :-> false) : l) g-	    cImpDImpFalse x y p gp-	-- p : (c -> d) -> b-	redantimpimp' p c d b l g = redant more l atomImps (addNestImp (NestImp p c d b) nestImps) atoms g+        -- Reduce a double implication antecedent+        redantimpimp' :: Term -> Formula -> Formula -> Formula -> Antecedents -> Goal -> P Proof+        -- next clause exploits ~(C->D) <=> (~~C & ~D)+        -- which isn't helpful when D = false+        redantimpimp' p c d (Disj []) l g | d /= false = do+            x <- newSym "x"+            y <- newSym "y"+            gp <- redantimpimp (Var x) c false false (A (Var y) (d :-> false) : l) g+            cImpDImpFalse x y p gp+        -- p : (c -> d) -> b+        redantimpimp' p c d b l g = redant more l atomImps (addNestImp (NestImp p c d b) nestImps) atoms g -	-- Reduce an atomic implication-	redantimpatom :: Term -> Symbol -> Formula -> Antecedents -> Goal -> P Proof-	redantimpatom p s b l g =-	    wrapM "redantimpatom" (s,b,l,g) $-	    redantimpatom' p s b l g+        -- Reduce an atomic implication+        redantimpatom :: Term -> Symbol -> Formula -> Antecedents -> Goal -> P Proof+        redantimpatom p s b l g =+            wrapM "redantimpatom" (s,b,l,g) $+            redantimpatom' p s b l g -	redantimpatom' :: Term -> Symbol -> Formula -> Antecedents -> Goal -> P Proof-	redantimpatom' p s b l g = -	  do+        redantimpatom' :: Term -> Symbol -> Formula -> Antecedents -> Goal -> P Proof+        redantimpatom' p s b l g = +          do             a <- cutSearch more $ many (findAtoms s atoms)             x <- newSym "x"             gp <- redant1 (A (Var x) b) l g@@ -386,65 +386,65 @@             (mtrace "redantimpatom: RRR" $              redant more l (insert atomImps (AtomImp s [A p b])) nestImps atoms g) {--	    let ps = wrap "redantimpatom findAtoms" atoms $ findAtoms s atoms-	    in  if not (null ps) then do-		    a <- cutSearch more $ many ps-		    x <- newSym "x"-		    gp <- redant1 (A (Var x) b) l g-		    mtrace "redantimpatom: LLL" $-		     subst (applyAtom p a) x gp-		else-		    mtrace "redantimpatom: RRR" $-		     redant more l (insert atomImps (AtomImp s [A p b])) nestImps atoms g+            let ps = wrap "redantimpatom findAtoms" atoms $ findAtoms s atoms+            in  if not (null ps) then do+                    a <- cutSearch more $ many ps+                    x <- newSym "x"+                    gp <- redant1 (A (Var x) b) l g+                    mtrace "redantimpatom: LLL" $+                     subst (applyAtom p a) x gp+                else+                    mtrace "redantimpatom: RRR" $+                     redant more l (insert atomImps (AtomImp s [A p b])) nestImps atoms g -}-	-- Reduce the goal, with all antecedents already being classified-	redsucc :: Goal -> P Proof-	redsucc g =-	    wrapM "redsucc" (g, atomImps, nestImps, atoms) $-	    redsucc' g+        -- Reduce the goal, with all antecedents already being classified+        redsucc :: Goal -> P Proof+        redsucc g =+            wrapM "redsucc" (g, atomImps, nestImps, atoms) $+            redsucc' g -	redsucc' :: Goal -> P Proof-	redsucc' a@(PVar s) =-	    (cutSearch more $ many (findAtoms s atoms))-	  `mplus`-	    -- The posin check is an optimization.  It gets a little slower without the test.-	    (if posin s atomImps nestImps then-	        redsucc_choice a-	    else-		none)-	redsucc' (Conj cs) = do-	    ps <- mapM redsucc cs-	    return $ applys (Ctuple (length cs)) ps-	-- next clause deals with succedent (A v B) by pushing the-	-- non-determinism into the treatment of implication on the left-	redsucc' (Disj ds) = do-	    s1 <- newSym "_"-	    let v = PVar s1-	    redant0 [ A (Cinj cd i) $ d :-> v | (i, (cd, d)) <- zip [0..] ds ] v-	redsucc' (a :-> b) = do-	    s <- newSym "x"-	    p <- redant1 (A (Var s) a) [] b-	    return $ Lam s p+        redsucc' :: Goal -> P Proof+        redsucc' a@(PVar s) =+            (cutSearch more $ many (findAtoms s atoms))+          `mplus`+            -- The posin check is an optimization.  It gets a little slower without the test.+            (if posin s atomImps nestImps then+                redsucc_choice a+            else+                none)+        redsucc' (Conj cs) = do+            ps <- mapM redsucc cs+            return $ applys (Ctuple (length cs)) ps+        -- next clause deals with succedent (A v B) by pushing the+        -- non-determinism into the treatment of implication on the left+        redsucc' (Disj ds) = do+            s1 <- newSym "_"+            let v = PVar s1+            redant0 [ A (Cinj cd i) $ d :-> v | (i, (cd, d)) <- zip [0..] ds ] v+        redsucc' (a :-> b) = do+            s <- newSym "x"+            p <- redant1 (A (Var s) a) [] b+            return $ Lam s p -	-- Now we have the hard part; maybe lots of formulae -	-- of form (C->D)->B  in nestImps to choose from!-	-- Which one to take first? We user the order heuristic.-	redsucc_choice :: Goal -> P Proof-	redsucc_choice g =-	    wrapM "redsucc_choice" g $-	    redsucc_choice' g+        -- Now we have the hard part; maybe lots of formulae +        -- of form (C->D)->B  in nestImps to choose from!+        -- Which one to take first? We user the order heuristic.+        redsucc_choice :: Goal -> P Proof+        redsucc_choice g =+            wrapM "redsucc_choice" g $+            redsucc_choice' g -	redsucc_choice' :: Goal -> P Proof-	redsucc_choice' g = do-	    let ordImps = order nestImps g atomImps-	    (NestImp p c d b, restImps) <- -		mtrace ("redsucc_choice: order=" ++ show ordImps) $-		select ordImps-	    x <- newSym "x"-	    z <- newSym "z"-	    qz <- redant more [A (Var z) $ d :-> b] atomImps restImps atoms (c :-> d)-	    gp <- redant more [A (Var x) b] atomImps restImps atoms g-	    subst (applyImp p (Lam z qz)) x gp+        redsucc_choice' :: Goal -> P Proof+        redsucc_choice' g = do+            let ordImps = order nestImps g atomImps+            (NestImp p c d b, restImps) <- +                mtrace ("redsucc_choice: order=" ++ show ordImps) $+                select ordImps+            x <- newSym "x"+            z <- newSym "z"+            qz <- redant more [A (Var z) $ d :-> b] atomImps restImps atoms (c :-> d)+            gp <- redant more [A (Var x) b] atomImps restImps atoms g+            subst (applyImp p (Lam z qz)) x gp  posin :: Symbol -> AtomImps -> NestImps -> Bool posin g atomImps nestImps = posin1 g atomImps || posin2 g [ (a :-> b) :-> c | NestImp _ a b c <- nestImps ]
scripts/Djinn/LJTFormula.hs view
@@ -3,10 +3,10 @@ -- See LICENSE for licensing details. -- module LJTFormula(Symbol(..), Formula(..), (<->), (&), (|:), fnot, false, true,-	ConsDesc(..),-	Term(..), applys, freeVars-	) where-import List(union, (\\))+        ConsDesc(..),+        Term(..), applys, freeVars+        ) where+import Data.List(union, (\\))  infixr 2 :-> infix  2 <->@@ -19,14 +19,14 @@ instance Show Symbol where     show (Symbol s) = s -data ConsDesc = ConsDesc String Int	-- name and arity+data ConsDesc = ConsDesc String Int     -- name and arity      deriving (Eq, Ord, Show)  data Formula-	= Conj [Formula]-	| Disj [(ConsDesc, Formula)]-	| Formula :-> Formula-	| PVar Symbol+        = Conj [Formula]+        | Disj [(ConsDesc, Formula)]+        | Formula :-> Formula+        | PVar Symbol      deriving (Eq, Ord)  (<->) :: Formula -> Formula -> Formula@@ -52,34 +52,34 @@     showsPrec _ (Conj []) = showString "true"     showsPrec _ (Conj [c]) = showParen True $ showString "&" . showsPrec 0 c     showsPrec p (Conj cs) =-	showParen (p>40) $ loop cs-	  where loop [f] = showsPrec 41 f-		loop (f : fs) = showsPrec 41 f . showString " & " . loop fs-		loop [] = error "showsPrec Conj"+        showParen (p>40) $ loop cs+          where loop [f] = showsPrec 41 f+                loop (f : fs) = showsPrec 41 f . showString " & " . loop fs+                loop [] = error "showsPrec Conj"     showsPrec _ (Disj []) = showString "false"     showsPrec _ (Disj [(_,c)]) = showParen True $ showString "|" . showsPrec 0 c     showsPrec p (Disj ds) =-	showParen (p>30) $ loop ds-	  where loop [(_,f)] = showsPrec 31 f-		loop ((_,f) : fs) = showsPrec 31 f . showString " v " . loop fs-		loop [] = error "showsPrec Disj"+        showParen (p>30) $ loop ds+          where loop [(_,f)] = showsPrec 31 f+                loop ((_,f) : fs) = showsPrec 31 f . showString " v " . loop fs+                loop [] = error "showsPrec Disj"     showsPrec _ (f1 :-> Disj []) =-	showString "~" . showsPrec 100 f1+        showString "~" . showsPrec 100 f1     showsPrec p (f1 :-> f2) =-	showParen (p>20) $ showsPrec 21 f1 . showString " -> " . showsPrec 20 f2+        showParen (p>20) $ showsPrec 21 f1 . showString " -> " . showsPrec 20 f2     showsPrec p (PVar s) = showsPrec p s  ------------------------------  data Term-	= Var Symbol-	| Lam Symbol Term-	| Apply Term Term-	| Ctuple Int-	| Csplit Int-	| Cinj ConsDesc Int-	| Ccases [ConsDesc]-	| Xsel Int Int Term		--- XXX just temporary by MJ+        = Var Symbol+        | Lam Symbol Term+        | Apply Term Term+        | Ctuple Int+        | Csplit Int+        | Cinj ConsDesc Int+        | Ccases [ConsDesc]+        | Xsel Int Int Term             --- XXX just temporary by MJ     deriving (Eq, Ord)  instance Show Term where
scripts/Djinn/LJTParse.hs view
@@ -3,7 +3,7 @@ -- See LICENSE for licensing details. -- module LJTParse(parseFormula, parseLJT) where-import Char(isAlphaNum)+import Data.Char(isAlphaNum) import Text.ParserCombinators.ReadP(ReadP, (+++), char, sepBy1, readP_to_S, skipSpaces, munch1, many) import LJTFormula @@ -24,8 +24,8 @@ removeComments "" = "" removeComments ('%':cs) = skip cs   where skip "" = ""-	skip s@('\n':_) = removeComments s-	skip (_:s) = skip s+        skip s@('\n':_) = removeComments s+        skip (_:s) = skip s removeComments (c:cs) = c : removeComments cs  pTop :: ReadP Formula@@ -79,9 +79,9 @@     skipSpaces     cs <- munch1 isAlphaNum     case cs of-	"false" -> return false-	"true" -> return true-	_ -> return $ PVar $ Symbol cs+        "false" -> return false+        "true" -> return true+        _ -> return $ PVar $ Symbol cs  pParen :: ReadP a -> ReadP a pParen p = do
scripts/Djinn/MJ.hs view
@@ -1,7 +1,7 @@ module MJ(module LJTFormula, provable, prove, buildGraph) where --import Monad import Control.Monad.State-import List((\\), partition, nubBy, sort)+import Data.List((\\), partition, nubBy, sort) import qualified Data.Set as S import qualified Data.Map as M import Data.Map(Map, (!), empty, insert, member, assocs, filterWithKey)@@ -47,10 +47,10 @@ --runForest :: Forest a -> [a] runForest' fr = run [fr]   where run [] = []-	run (Forest xs : q) =-	    mtrace ("Q " ++ show q) $-	    [x | Tip x <- xs] ++ -	    run (q ++ [ f | Fork f <- xs])+        run (Forest xs : q) =+            mtrace ("Q " ++ show q) $+            [x | Tip x <- xs] ++ +            run (q ++ [ f | Fork f <- xs]) -} ------------------------------ ----- Generate a new unique variable@@ -99,14 +99,14 @@ proveP :: Bool -> [(Symbol, Formula)] -> Formula -> P Term proveP _ env f = do     let s = initialSequent (map snd env) f-	g = buildGraph s-	vcs = countSequents g s-	g' = pruneGraph g vcs+        g = buildGraph s+        vcs = countSequents g s+        g' = pruneGraph g vcs     () <- mtrace (unlines ("---------" : show f : show (size g) : map show (toList g))) $ return () --    () <- trace (unlines (show f : show (size g) : map show vcs)) $ return ()     () <- mtrace (unlines ("---------" : show f : show (lookup (SVar s) vcs) : show (size g') : map show (toList g'))) $ return ()     if size g' == 0 then-	none+        none      else do         m <- unfold (recGraph s g') (mapFst V env)         let t = theta m@@ -120,31 +120,31 @@  insertSplit :: Term -> P Term insertSplit t = do-    let	sels = nubBy (\ (Xsel _ _ e) (Xsel _ _ e') -> e == e') $ collectSels t-	selTbl = [ (e, n, freeVars e) | Xsel _ n e <- sels ]-	ins :: [(Term, Int, [Symbol])] -> Map Term [Term] -> Term -> P Term-	ins  tbl  stbl (Lam s b) = do-		let tbl' = [ (e, n, fv \\ [s]) | (e, n, fv) <- tbl ]-		    (spls, tbl'') = partition (\ (_,_,fv) -> null fv) tbl'-		    mkSplit (f, sps) (e, n, _) = do-		        vars <- mapM (const (newSym "s")) [1..n]-			let sps' = insert e (map Var vars) sps-			e' <- ins tbl'' sps' e-			let fun oe = Apply (Apply (Csplit n) (foldr Lam oe vars)) e'-			return (f . fun, sps')-	        (trfun, stbl') <- foldM mkSplit (id, stbl) spls-		e' <- ins tbl'' stbl' b-		return $ Lam s (trfun e')-	ins  tbl  stbl (Apply f a) = liftM2 Apply (ins tbl stbl f) (ins tbl stbl a)-	ins _tbl  stbl (Xsel i _ e) = --trace ("Xsel " ++ show (_tbl, stbl, i, e)) $-	        return $ (stbl ! e) !! i-	ins _tbl _stbl e = return e+    let sels = nubBy (\ (Xsel _ _ e) (Xsel _ _ e') -> e == e') $ collectSels t+        selTbl = [ (e, n, freeVars e) | Xsel _ n e <- sels ]+        ins :: [(Term, Int, [Symbol])] -> Map Term [Term] -> Term -> P Term+        ins  tbl  stbl (Lam s b) = do+                let tbl' = [ (e, n, fv \\ [s]) | (e, n, fv) <- tbl ]+                    (spls, tbl'') = partition (\ (_,_,fv) -> null fv) tbl'+                    mkSplit (f, sps) (e, n, _) = do+                        vars <- mapM (const (newSym "s")) [1..n]+                        let sps' = insert e (map Var vars) sps+                        e' <- ins tbl'' sps' e+                        let fun oe = Apply (Apply (Csplit n) (foldr Lam oe vars)) e'+                        return (f . fun, sps')+                (trfun, stbl') <- foldM mkSplit (id, stbl) spls+                e' <- ins tbl'' stbl' b+                return $ Lam s (trfun e')+        ins  tbl  stbl (Apply f a) = liftM2 Apply (ins tbl stbl f) (ins tbl stbl a)+        ins _tbl  stbl (Xsel i _ e) = --trace ("Xsel " ++ show (_tbl, stbl, i, e)) $+                return $ (stbl ! e) !! i+        ins _tbl _stbl e = return e --    () <- trace ("insertSplit " ++ show (t, selTbl)) $ return ()     t' <- ins selTbl empty t     if t == t' then         return t      else---	trace ("insertSplit recurses") $+--      trace ("insertSplit recurses") $         insertSplit t'  @@ -187,7 +187,7 @@ initialSequent g f = S (Gamma $ S.fromList g) Nothing f  data Rule = OrL [(ConsDesc, Formula)] | OrR ConsDesc Int | AndL Int Int -	  | AndR | ImpL | ImpR Formula | Ax | Cont Formula+          | AndR | ImpL | ImpR Formula | Ax | Cont Formula     deriving (Show, Eq, Ord)  data VP a = VP Rule [a]@@ -203,36 +203,36 @@     case deQueue q of     Nothing -> g     Just (sq, q') ->-	let vps = getVPs sq ++ getVpCont sq-	    g' = insert sq vps g-	    (q'', g'') = foldr addSeq (q', g') [ s | VP _ ss <- vps, s <- ss ]-	in  buildG q'' g''+        let vps = getVPs sq ++ getVpCont sq+            g' = insert sq vps g+            (q'', g'') = foldr addSeq (q', g') [ s | VP _ ss <- vps, s <- ss ]+        in  buildG q'' g''   where addSeq s o@(oq, og) = if member s og then o else (addToQueue oq s, insert s [] og) -	getVPs (S env (Just (Disj ds)) c) =-	    [ VP (OrL ds) [ S (addEnv a env) Nothing c | (_, a) <- ds ] ]-	getVPs (S env (Just (Conj as)) b) =-	    [ VP (AndL i (length as)) [S env (Just a) b] | (a, i) <- zip as [0..] ]-	getVPs (S env (Just (a :-> b)) c) =-	    [ VP ImpL [S env Nothing a, S env (Just b) c] ]-	getVPs (S _env (Just x) x') | x == x' =-	    [ VP Ax [] ]+        getVPs (S env (Just (Disj ds)) c) =+            [ VP (OrL ds) [ S (addEnv a env) Nothing c | (_, a) <- ds ] ]+        getVPs (S env (Just (Conj as)) b) =+            [ VP (AndL i (length as)) [S env (Just a) b] | (a, i) <- zip as [0..] ]+        getVPs (S env (Just (a :-> b)) c) =+            [ VP ImpL [S env Nothing a, S env (Just b) c] ]+        getVPs (S _env (Just x) x') | x == x' =+            [ VP Ax [] ] -	getVPs (S env Nothing (Disj ds)) =-	    [ VP (OrR (fst (ds!!i)) i) [S env Nothing a] | ((_,a), i) <- zip ds [0..] ]-	getVPs (S env Nothing (Conj as)) =-	    [ VP AndR [ S env Nothing a | a <- as ] ]-	getVPs (S env Nothing (a :-> b)) =-	    [ VP (ImpR a) [ S (addEnv a env) Nothing b ] ]+        getVPs (S env Nothing (Disj ds)) =+            [ VP (OrR (fst (ds!!i)) i) [S env Nothing a] | ((_,a), i) <- zip ds [0..] ]+        getVPs (S env Nothing (Conj as)) =+            [ VP AndR [ S env Nothing a | a <- as ] ]+        getVPs (S env Nothing (a :-> b)) =+            [ VP (ImpR a) [ S (addEnv a env) Nothing b ] ] -	getVPs (S _ _ _) =-	    [ ]+        getVPs (S _ _ _) =+            [ ] -	getVpCont (S env Nothing b) =-	    [ VP (Cont a) [S env (Just a) b] | a <- envList env ]-	getVpCont (S _ _ _) =-	    [ ]-		+        getVpCont (S env Nothing b) =+            [ VP (Cont a) [S env (Just a) b] | a <- envList env ]+        getVpCont (S _ _ _) =+            [ ]+                  buildGraph :: Sequent -> Graph buildGraph s = buildG (addToQueue emptyQueue s) empty@@ -250,37 +250,37 @@ --countSequents g s = solveEqnSystem $ buildEqns g (const Nothing) s countSequents g s =     let eqns = buildEqns g (const Nothing) s-	subst = [(v, TV i) | ((v, _), i) <- zip eqns [0..]] -	eqns' = zip (map snd subst) (map (substPolyVars subst . snd) eqns)-	sol = solveEqnSystem eqns'+        subst = [(v, TV i) | ((v, _), i) <- zip eqns [0..]] +        eqns' = zip (map snd subst) (map (substPolyVars subst . snd) eqns)+        sol = solveEqnSystem eqns'     in  zip (map fst eqns) (map snd (sort sol))  buildEqns :: Graph -> (Sequent -> Maybe Ninf) -> Sequent -> EqnSystem SVar buildEqns graph oracle seqnt = assocs $ build seqnt empty   where build :: Sequent -> Map SVar (Poly SVar) -> Map SVar (Poly SVar)-	build s r =-	    let sv = SVar s in-	    if sv `member` r then-		r-	    else case oracle s of-		 Just n -> insert sv (constp n) r-		 Nothing ->-		    let v = sum [ product [ var (SVar n) | n <- ns ] | VP _ ns <- graph!s ]-		        r' = insert sv v r-		        l = [ n | VP _ ns <- graph!s, n <- ns ]-		    in  foldr build r' l+        build s r =+            let sv = SVar s in+            if sv `member` r then+                r+            else case oracle s of+                 Just n -> insert sv (constp n) r+                 Nothing ->+                    let v = sum [ product [ var (SVar n) | n <- ns ] | VP _ ns <- graph!s ]+                        r' = insert sv v r+                        l = [ n | VP _ ns <- graph!s, n <- ns ]+                    in  foldr build r' l  pruneGraph :: Graph -> [(SVar, Ninf)] -> Graph pruneGraph g vcs =     let zset = S.fromList [ s | (SVar s, 0) <- vcs ]-	g' = filterWithKey (\ k _ -> not (S.member k zset)) g-	g'' = M.map (\ vps -> filter (\ (VP _ ns) -> not (any (`S.member` zset) ns)) vps) g'+        g' = filterWithKey (\ k _ -> not (S.member k zset)) g+        g'' = M.map (\ vps -> filter (\ (VP _ ns) -> not (any (`S.member` zset) ns)) vps) g'     in  g''  recGraph :: Sequent -> Graph -> GraphRec recGraph s g =     let m :: M.Map Sequent GraphRec-	m = M.map (\ vps -> Next $ map (\ (VP r ss) -> VP r (map (m M.!) ss)) vps) g+        m = M.map (\ vps -> Next $ map (\ (VP r ss) -> VP r (map (m M.!) ss)) vps) g     in  m M.! s  ------------------------------@@ -288,39 +288,39 @@ unfold :: GraphRec -> Context -> P M unfold graph context = unfoldM context graph   where unfoldM  ctx s = wrap $ msum $ map (unfoldVPM  ctx) (unNext s)-	unfoldMs ctx s = wrap $ msum $ map (unfoldVPMs ctx) (unNext s)+        unfoldMs ctx s = wrap $ msum $ map (unfoldVPMs ctx) (unNext s) -	unfoldVPMs ctx (VP (OrL cfs) ns) = do-	    vms <- zipWithM (\ n (_, a) -> do-		     x <- liftM V $ newSym "c"-		     m <- unfoldM (addCtx x a ctx) n-		     return (x, m)-		) ns cfs-	    return $ When (map fst cfs) vms-	unfoldVPMs ctx (VP (AndL i n) [s]) = do-	    m <- unfoldMs ctx s-	    return $ Sel i n m-	unfoldVPMs ctx (VP ImpL [sa, sc]) = do-	    u <- unfoldM ctx sa-	    l <- unfoldMs ctx sc-	    return $ u ::: l-	unfoldVPMs _ctx (VP Ax []) =-	    return Nil-	unfoldVPMs _ctx _vp = error $ "unfoldVPMs " -- ++ show vp+        unfoldVPMs ctx (VP (OrL cfs) ns) = do+            vms <- zipWithM (\ n (_, a) -> do+                     x <- liftM V $ newSym "c"+                     m <- unfoldM (addCtx x a ctx) n+                     return (x, m)+                ) ns cfs+            return $ When (map fst cfs) vms+        unfoldVPMs ctx (VP (AndL i n) [s]) = do+            m <- unfoldMs ctx s+            return $ Sel i n m+        unfoldVPMs ctx (VP ImpL [sa, sc]) = do+            u <- unfoldM ctx sa+            l <- unfoldMs ctx sc+            return $ u ::: l+        unfoldVPMs _ctx (VP Ax []) =+            return Nil+        unfoldVPMs _ctx _vp = error $ "unfoldVPMs " -- ++ show vp -	unfoldVPM ctx (VP (OrR c i) [s]) = do-	    u <- unfoldM ctx s-	    return $ In c i u-	unfoldVPM ctx (VP AndR ns) = do-	    ts <- mapM (unfoldM ctx) ns-	    return $ Tuple ts-	unfoldVPM ctx (VP (ImpR a) [s]) = do-	    x <- liftM V $ newSym "i"-	    u <- unfoldM (addCtx x a ctx) s-	    return $ VLam x u-	unfoldVPM ctx (VP (Cont ca) [s]) = do-	    (x, _a) <- many $ filter ((== ca) . snd) ctx-	    l <- unfoldMs ctx s-	    return $ Semi x l-	-	unfoldVPM _ctx _vp = error $ "unfoldVPM " -- ++ show vp+        unfoldVPM ctx (VP (OrR c i) [s]) = do+            u <- unfoldM ctx s+            return $ In c i u+        unfoldVPM ctx (VP AndR ns) = do+            ts <- mapM (unfoldM ctx) ns+            return $ Tuple ts+        unfoldVPM ctx (VP (ImpR a) [s]) = do+            x <- liftM V $ newSym "i"+            u <- unfoldM (addCtx x a ctx) s+            return $ VLam x u+        unfoldVPM ctx (VP (Cont ca) [s]) = do+            (x, _a) <- many $ filter ((== ca) . snd) ctx+            l <- unfoldMs ctx s+            return $ Semi x l+        +        unfoldVPM _ctx _vp = error $ "unfoldVPM " -- ++ show vp
scripts/Djinn/MLJT.hs view
@@ -2,8 +2,7 @@ -- Copyright (c) 2005 Lennart Augustsson -- See LICENSE for licensing details. ---import IO-import System+import System.IO import LJTParse import MJ @@ -13,19 +12,19 @@     hSetBuffering stderr NoBuffering     args <- getArgs     file <--	    case args of-		[a] -> readFile a-		_ -> hGetContents stdin+            case args of+                [a] -> readFile a+                _ -> hGetContents stdin     let form = parseLJT file---	pr = provable form---	cpr = provable (fnot (fnot form))-	mpr = take 25 $ prove False [] form+--      pr = provable form+--      cpr = provable (fnot (fnot form))+        mpr = take 25 $ prove False [] form     print form --    putStrLn $ "Classical " ++ show cpr --    putStrLn $ "Intuitionistic " ++ show pr --    putStrLn $ show mpr     case mpr of-	[] -> return ()-	terms -> do-	    putStrLn $ "proof : " ++ show form-	    putStrLn $ unlines (map (("proof = " ++) . show) terms)+        [] -> return ()+        terms -> do+            putStrLn $ "proof : " ++ show form+            putStrLn $ unlines (map (("proof = " ++) . show) terms)
scripts/Djinn/Makefile view
@@ -1,6 +1,6 @@ BINDIR = /usr/local/bin #-GHC = ghc+GHC = /usr/local/bin/ghc GHCFLAGS = -Wall #GHCFLAGS = -Wall -prof -auto-all -O2 @@ -44,5 +44,5 @@  .PHONY: clean clean:-	rm -f djinn MLJT a.out *.o *.hi *.old out */*.o */*.hi+	rm -f djinn MLJT a.out *.o *.hi *.old out */*.o 	cd tests; ${MAKE} clean
scripts/Djinn/MonadBFS.hs view
@@ -1,5 +1,5 @@ module MonadBFS(MonadBFS(..), BFS, runBFS) where-import Monad+import Control.Monad  class MonadPlus m => MonadBFS m where     mwrap :: m a -> m a@@ -21,7 +21,7 @@ fjoin :: BFS (BFS a) -> BFS a fjoin = BFS . concatMap tjoin . unBFS   where tjoin (Tip x) = unBFS x-	tjoin (Fork x) = [Fork $ fjoin x]+        tjoin (Fork x) = [Fork $ fjoin x]  instance MonadPlus BFS where     mzero = BFS []@@ -45,8 +45,8 @@ runBFS :: BFS a -> [a] runBFS fr = run (enq [fr] mtq)   where run aq =-	    case deq aq of-	    Nothing -> []-	    Just (BFS xs, q) ->-	        [x | Tip x <- xs] ++ -	        run (enq [ f | Fork f <- xs] q)+            case deq aq of+            Nothing -> []+            Just (BFS xs, q) ->+                [x | Tip x <- xs] ++ +                run (enq [ f | Fork f <- xs] q)
scripts/Djinn/Poly.hs view
@@ -1,6 +1,6 @@ module Poly(Ninf, inf, ninfToN,-	    Poly, var, constp, coeffsOf, mustBeConst, substPolyVars,-	    EqnSystem, solveEqnSystem) where+            Poly, var, constp, coeffsOf, mustBeConst, substPolyVars,+            EqnSystem, solveEqnSystem) where import List(partition, sort) import Util.Digraph(stronglyConnComp, SCC(..)) import Util(mapSnd, insert, makeSet)@@ -23,7 +23,7 @@  instance Eq Ninf where     I i == I j  =  i == j-    Inf == Inf  =  error "Ninf: Inf == Inf" --True	 -- XXX?+    Inf == Inf  =  error "Ninf: Inf == Inf" --True       -- XXX?     _   == _    = False  instance Ord Ninf where@@ -42,30 +42,30 @@     abs _   = error "Ninf: abs"     signum _   = error "Ninf: signum"     fromInteger i | i < 0 = error "Ninf: fromInteger"-		  | otherwise = I i+                  | otherwise = I i   --------------------------------------- ----- Polynomials over Ninf -- Parametrized over the variable type -data Poly a = P ![Summand a]		-- summands, sorted+data Poly a = P ![Summand a]            -- summands, sorted     deriving (Eq, Ord) -data Summand a = S ![(a, Integer)] !Ninf	-- variables with their exponents and scalar factor, sorted+data Summand a = S ![(a, Integer)] !Ninf        -- variables with their exponents and scalar factor, sorted     deriving (Eq, Ord)  instance (Show a) => Show (Poly a) where     showsPrec _ (P []) = showString "0"     showsPrec _ (P ss) = mix (map showS ss) " + "         where mix [] _ = error "Poly.mix"-	      mix [x] _ = x-	      mix (x:xs) m = x . showString m . mix xs m-	      showS (S [] i) = showsPrec 0 i-	      showS (S vs 1) = mix (map showV vs) "*"-	      showS (S vs n) = mix (showsPrec 0 n : map showV vs) "*"-	      showV (v, 1) = showsPrec 0 v-	      showV (v, n) = showsPrec 0 v . showString "^" . showsPrec 0 n+              mix [x] _ = x+              mix (x:xs) m = x . showString m . mix xs m+              showS (S [] i) = showsPrec 0 i+              showS (S vs 1) = mix (map showV vs) "*"+              showS (S vs n) = mix (showsPrec 0 n : map showV vs) "*"+              showV (v, 1) = showsPrec 0 v+              showV (v, n) = showsPrec 0 v . showString "^" . showsPrec 0 n  mkS :: [(a, Integer)] -> Ninf -> Summand a mkS ves Inf = S [(v,1) | (v,_) <- ves] Inf@@ -91,8 +91,8 @@     abs _   = error "Poly: abs"     signum _   = error "Poly: signum"     fromInteger i | i < 0 = error "Poly: fromInteger"-		  | i == 0 = P []-		  | otherwise = P [S [] (fromInteger i)]+                  | i == 0 = P []+                  | otherwise = P [S [] (fromInteger i)]  add :: (Ord a) => [Summand a] -> [Summand a] -> [Summand a] add [] ss = ss@@ -106,12 +106,12 @@ muls :: (Ord a) => Summand a -> Summand a -> Summand a muls (S vs1 k1) (S vs2 k2) = mkS (merge vs1 vs2) (k1 * k2)   where merge [] ys = ys-	merge xs [] = xs-	merge (x@(v1, e1):xs) (y@(v2, e2):ys) =-	    case compare v1 v2 of-	    LT -> x : merge xs (y:ys)-	    EQ -> (v1, e1+e2) : merge xs ys-	    GT -> y : merge (x:xs) ys+        merge xs [] = xs+        merge (x@(v1, e1):xs) (y@(v2, e2):ys) =+            case compare v1 v2 of+            LT -> x : merge xs (y:ys)+            EQ -> (v1, e1+e2) : merge xs ys+            GT -> y : merge (x:xs) ys  ----- -- Return all the coefficints for a certain variable of@@ -120,12 +120,12 @@ coeffsOf :: (Show a, Ord a) => a -> Poly a -> [(Integer, Poly a)] coeffsOf x (P ss) = sort $ foldr coeff [] ss   where coeff s@(S vs k) cs =-	    case partition (\ (v, _) -> v == x) vs of-	    ([(_, a)], vs') -> addCoeff a (P [S vs' k]) cs-	    _ -> addCoeff 0 (P [s]) cs-	addCoeff a c [] = [(a, c)]-	addCoeff a c ((a', c'):cs) | a == a' = (a, c + c') : cs-	addCoeff a c (k:cs) = k : addCoeff a c cs+            case partition (\ (v, _) -> v == x) vs of+            ([(_, a)], vs') -> addCoeff a (P [S vs' k]) cs+            _ -> addCoeff 0 (P [s]) cs+        addCoeff a c [] = [(a, c)]+        addCoeff a c ((a', c'):cs) | a == a' = (a, c + c') : cs+        addCoeff a c (k:cs) = k : addCoeff a c cs  mustBeConst :: (Show a) => Poly a -> Ninf mustBeConst (P []) = 0@@ -159,24 +159,24 @@     -- The definition could be  mapSnd mustBeConst $ solve eqns     -- but this can be very slow.     let groups = map flatten $ stronglyConnComp [ (eqn, v, getPolyVars rhs) | eqn@(v, rhs) <- eqns ]-		  where	flatten (CyclicSCC es) = es-			flatten (AcyclicSCC e) = [e]-	solveGroup :: (Ord var, Show var) => [(var, Ninf)] -> EqnSystem var -> [(var, Ninf)]-	solveGroup sols es =-	    let newsols = mapSnd mustBeConst $ solve (mapSnd (evalPolyConst sols) es)-	    in  foldr insert sols newsols+                  where flatten (CyclicSCC es) = es+                        flatten (AcyclicSCC e) = [e]+        solveGroup :: (Ord var, Show var) => [(var, Ninf)] -> EqnSystem var -> [(var, Ninf)]+        solveGroup sols es =+            let newsols = mapSnd mustBeConst $ solve (mapSnd (evalPolyConst sols) es)+            in  foldr insert sols newsols     in  foldl solveGroup [] groups  solve :: (Ord var, Show var) => EqnSystem var -> [(var, Poly var)] solve [] = [] solve ((v,f):xfs) =     let cs = coeffsOf v f-	a0 = getCoeff 0 cs-	a = sum [ ai | (i, ai) <- cs, i /= 0 ]+        a0 = getCoeff 0 cs+        a = sum [ ai | (i, ai) <- cs, i /= 0 ]         g = a0 + a0 * a * constp inf-	xfs' = [ (y, evalPoly [(v, g)] p) | (y, p) <- xfs ]-	sol = solve xfs'-	x = evalPoly sol g+        xfs' = [ (y, evalPoly [(v, g)] p) | (y, p) <- xfs ]+        sol = solve xfs'+        x = evalPoly sol g     in  (v, x) : sol  evalPoly :: (Ord var, Show var) => [(var, Poly var)] -> Poly var -> Poly var@@ -191,13 +191,13 @@ -- Assume vps is sorted in the same order as vs. evalPolyConst vcs (P ss) = P (concatMap evalS ss)   where evalS (S ves k) = loop vcs ves [] k-	loop [] ves rves k = [mkS (reverse rves ++ ves) k]-	loop _  []  rves k = [mkS (reverse rves) k]-	loop ovps@((v,c) : vps) oves@(ve@(v',e) : ves) rves k =-	    case v `compare` v' of-	    LT -> loop vps oves rves k-	    EQ -> if c == 0 then [] else loop vps ves rves (k * c^e)-	    GT -> loop ovps ves (ve:rves) k+        loop [] ves rves k = [mkS (reverse rves ++ ves) k]+        loop _  []  rves k = [mkS (reverse rves) k]+        loop ovps@((v,c) : vps) oves@(ve@(v',e) : ves) rves k =+            case v `compare` v' of+            LT -> loop vps oves rves k+            EQ -> if c == 0 then [] else loop vps ves rves (k * c^e)+            GT -> loop ovps ves (ve:rves) k  getCoeff :: (Ord a, Show a) => Integer -> [(Integer, Poly a)] -> Poly a getCoeff i ips = maybe 0 id $ lookup i ips
scripts/Djinn/REPL.hs view
@@ -7,8 +7,8 @@ import System.Console.Readline(readline, addHistory)  data REPL s = REPL {-    repl_init :: IO (String, s),		-- prompt and initial state-    repl_eval :: s -> String -> IO (Bool, s),		-- quit flag and new state+    repl_init :: IO (String, s),                -- prompt and initial state+    repl_eval :: s -> String -> IO (Bool, s),           -- quit flag and new state     repl_exit :: s -> IO ()     } @@ -16,19 +16,19 @@ repl p = do     (prompt, state) <- repl_init p     let loop s = (do-	    mline <- readline prompt-	    case mline of-		Nothing -> loop s-		Just line -> do-		    (quit, s') <- repl_eval p s line-		    if quit then-			repl_exit p s'-		     else do-			addHistory line-			loop s'-	    ) `Control.Exception.catch` ( \ exc ->-		do-		    putStrLn $ "\nInterrupted (" ++ show exc ++ ")"-		    loop s-	    )+            mline <- readline prompt+            case mline of+                Nothing -> loop s+                Just line -> do+                    (quit, s') <- repl_eval p s line+                    if quit then+                        repl_exit p s'+                     else do+                        addHistory line+                        loop s'+            ) `Control.Exception.catch` ( \ exc ->+                do+                    putStrLn $ "\nInterrupted (" ++ show exc ++ ")"+                    loop s+            )     loop state
scripts/Djinn/Util.hs view
@@ -1,5 +1,5 @@ module Util(mapFst, mapSnd, insert, makeSet) where-import List(sort)+import Data.List(sort)  mapFst :: (a->b) -> [(a,c)] -> [(b, c)] mapFst f xys = [ (f x, y) | (x, y) <- xys ]@@ -15,6 +15,6 @@ makeSet :: (Ord a) => [a] -> [a] makeSet = remDup . sort   where remDup [] = []-	remDup [x] = [x]-	remDup (x : xs@(x' : _)) | x == x' = remDup xs-	remDup (x : xs) = x : remDup xs+        remDup [x] = [x]+        remDup (x : xs@(x' : _)) | x == x' = remDup xs+        remDup (x : xs) = x : remDup xs
scripts/Djinn/verbose-help view
@@ -149,7 +149,7 @@ Theory ======   Djinn interprets a Haskell type as a logic formula using the-Curry-Howard isomorphism and then a decision procedure for+Curry-Howard isomorphism and then uses a decision procedure for Intuitionistic Propositional Calculus.  This decision procedure is based on Gentzen's LJ sequent calculus, but in a modified form, LJT, that ensures termination.  This variation on LJ has a long history,
+ scripts/FT/FTbase.hs view
@@ -0,0 +1,267 @@+-- Copyright 2006, Sascha Boehme.+++++-- Main module of the application.++module Main (main) where++++import FreeTheorems+import PredefinedTypes++import Control.Monad+import Data.List+import System.Environment+import System.Console.GetOpt+import System.IO+import Text.ParserCombinators.Parsec (ParseError)++computeResult' :: String -> String+computeResult' t =+    let model = FixModel+        omitIns = True+    in+      case parseTypeString t of+        Left error -> "There was an error in the type: "++show error+        Right nt   ->+          let (th, td) = generateTheorem model nt+              (th2, td2) = foldl instantiateRelation (th, td)+                                 (extractRelationVariables th)+              tm2 = if omitIns then omitInstantiations th2 else th2+              ls2 = extractLiftRelations (th2, td2) omitIns+          in  (printAsText tm2)+              ++ (concatMap (\l -> "\n\n"++(printAsText l)) ls2)++main = putStr . computeResult' =<< getLine+++-- Entry point for the application.+-- The function parses the command line arguments. Then, it starts the+-- computation with the given values.++{-+main :: IO ()+main = do+  arguments <- getArgs+  case getOpt Permute options arguments of+    (opts, _, [])  -> let (info, os) = checkOpt opts+                      in  if info+                            then putStrLn showInfo+                            else case os of+                                   Left errors   -> showErrors errors+                                   Right (t,m,o) -> putStrLn+                                                    $ computeResult t m o+    (_, _, errors) -> showErrors errors++  where+    showErrors errors = do+      mapM (\s -> hPutStr stderr ("Error: " ++ s)) errors+      hPutStr stderr (usageInfo "Usage: ftbase [OPTIONS]" options)++    showInfo =+        xmlTag "info" [] (concat+          [ concatMap (\(n,i) -> xmlData n i) getSupportedAlgebraicDatatypes+          , concatMap (\(n,i) -> xmlType n i) getSupportedTypeSynonyms+          , concatMap (\(n,t) -> xmlPred n t) predefinedTypes+          ])+      where+        xmlData n i = xmlEmptyTag "data" [("name", n), ("arity", show i)]+        xmlType n i = xmlEmptyTag "type" [("name", n), ("arity", show i)]+        xmlPred n t = xmlTag "predefined" [("name", n)] t++-}++++--------------------------------------------------------------------------------+--+-- Parsing of command line arguments.+--++++-- Abstract description of command line options.++data Flag = Type String+          | Model LanguageModel+          | Info+          | OmitInstantiations+          deriving (Eq, Show)++++-- The command line options.++options :: [OptDescr Flag]+options =+  [ Option ['t'] ["type"]+           (ReqArg Type "TYPE")+           "the type from which to generate a theorem"++  , Option ['b'] ["basic-model"]+           (NoArg (Model BasicModel))+           "use the basic model"++  , Option ['f'] ["fix-model"]+           (NoArg (Model FixModel))+           "use the fix model"++  , Option ['o'] ["omit-instantiations"]+           (NoArg OmitInstantiations)+           "omit instantiations in the generated theorem"++  , Option ['i'] ["info"]+           (NoArg Info)+           "show available constructors and predefined types"+  ]++++-- Checks if the detected command line options are correct, i.e. if flags of+-- each kind are occurring only once. If so, the corresponding values are+-- returned.++checkOpt :: [Flag] -> (Bool, Either [String] (LanguageModel, String, Bool))+checkOpt flags =+  let om = foldr (checkModel) (Left "missing model\n") flags+      ot = case foldr (checkType) (Left "missing type\n") flags of+             Left e  -> Left e+             Right t -> if length (words t) > 0+                          then Right t+                          else Left "missing type\n"+      oi = any (\f -> f == Info) flags+      oo = any (\f -> f == OmitInstantiations) flags++      extractError = either (\e -> [e]) (\_ -> [])+      errors = extractError om ++ extractError ot++  in  case (om,ot) of+        (Right m, Right t) -> (oi, Right (m, t, oo))+        otherwise          -> (oi, Left errors)++  where+    checkModel (Model m) (Left _)  = Right m+    checkModel (Model _) (Right _) = Left "only one model can be given\n"+    checkModel _         x         = x++    checkType (Type t) (Left _)  = Right t+    checkType (Type _) (Right _) = Left "only one type can be given\n"+    checkType _        x         = x++++++--------------------------------------------------------------------------------+--+-- Computation of output+--++++-- Parses the given string and creates either an error message or valid output.++computeResult :: LanguageModel -> String -> Bool -> String+computeResult model t omitIns =+  case parseTypeString t of+    Left error -> xmlTag "error" [("type", t)] (xmlClean (show error))+    Right nt   ->+      let (th, td) = generateTheorem model nt+          tm = if omitIns then omitInstantiations th else th+          ls = extractLiftRelations (th, td) omitIns++          (th2, td2) = foldl instantiateRelation (th, td)+                             (extractRelationVariables th)+          tm2 = if omitIns then omitInstantiations th2 else th2+          ls2 = extractLiftRelations (th2, td2) omitIns++      in  xmlTag "model" [] (show model)+          ++ xmlTag "type" [] (xmlClean (printAsText nt))+          ++ xmlTag "fundamental" [] (concat+               [ xmlTag "theorem"  [] (xmlClean (printAsText tm))+               , concatMap (\l -> xmlTag "lift"  [] (xmlClean (printAsText l))) ls+               ])+          ++ xmlTag "reduced" [] (concat+               [ xmlTag "theorem"  [] (xmlClean (printAsText tm2))+               , concatMap (\l -> xmlTag "lift"  [] (xmlClean (printAsText l))) ls2+               ])++++-- Parses a type string and returns the named type obtained from parsing or an+-- error if no type was found. The function works as follows:+--+--   * If the input contains "::", then it is parsed as a named type.+--+--   * If the input is only one word, the function tries to find a type with+--     that name in the list of predefined types. If it can be found, that type+--     is parsed as a named type.+--+--   * Otherwise the input is parsed as a type without name, while a new name is+--     generated.++parseTypeString :: String -> Either ParseError NamedType+parseTypeString string =+  let wlist = words string+  in if (containsTwoColons string)+       then parseNamedType string+       else let (w:ws) = wlist+            in  if (ws == [])+                  then case lookup w predefinedTypes of+                         Nothing -> parseType acceptName string+                         Just t  -> parseNamedType (w ++ " :: " ++ t)+                  else parseType acceptName string+  where+    containsTwoColons str =+      case str of+        ':' : ':' : cs -> True+        _   :  c  : cs -> containsTwoColons (c:cs)+        otherwise     -> False++    acceptName name =+      let (predefinedNames, _) = unzip predefinedTypes+      in  name `notElem` predefinedNames++++++--------------------------------------------------------------------------------+--+-- XML functions+--++++-- Creates an XML tag.++xmlTag :: String -> [(String, String)] -> String -> String+xmlTag n as c =+  "<" ++ n+  ++ foldl (\s (k,v) -> s ++ " " ++ k ++ "=\"" ++ xmlClean v ++ "\"") "" as+  ++ ">" ++ c ++ "</" ++ n ++ ">"++++-- Creates an empty XML tag.++xmlEmptyTag :: String -> [(String, String)] -> String+xmlEmptyTag n as =+  "<" ++ n+  ++ foldl (\s (k,v) -> s ++ " " ++ k ++ "=\"" ++ xmlClean v ++ "\"") "" as+  ++ "/>"++++-- Replaces XML special characters.++xmlClean :: String -> String+xmlClean = concatMap replaceSymbol+  where+    replaceSymbol '&' = "&amp;"+    replaceSymbol '>' = "&gt;"+    replaceSymbol '<' = "&lt;"+    replaceSymbol c   = [c]
+ scripts/FT/FreeTheorems.hs view
@@ -0,0 +1,86 @@+-- Copyright 2006, Sascha Boehme.+++++-- | This module is the interface to the FreeTheorems library. It exposes all+--   types and functions needed to parse types, generate theorems for them and+--   pretty-print types and theorems.+--+--   Although every type below is an instance of the class 'Show', the provided+--   pretty-printing classes should be used to display them. The standard 'show'+--   function is only available for debugging purposes.++module FreeTheorems (++-- * Types and theorems+    LanguageModel(..),+    NamedType(..),+    TermVariable,+    Type,+    Theorem,+    RelationVariable,+    UnfoldedRelation,+    TheoremData,++-- * Parsing of types+    parseNamedType,+    parseType,+    getSupportedAlgebraicDatatypes,+    getSupportedTypeSynonyms,++-- * Generation and deduction of theorems+    generateTheorem,+    extractLiftRelations,+    Specialization.extractRelationVariables,+    instantiateRelation,+    omitInstantiations,++-- * Pretty-printing+    PrettyPrintAsText(..)+) where++++import FreeTheorems.Declarations+import FreeTheorems.Delta+import qualified FreeTheorems.Lifts as Lifts+import FreeTheorems.Modification+import FreeTheorems.PrettyPrint+import qualified FreeTheorems.Specialization as Specialization+import FreeTheorems.TheoremData+import FreeTheorems.TypeParser+import FreeTheorems.Types+import FreeTheorems.Unfolding++++-- | Generates a theorem for a named type using a certain language model.++generateTheorem :: LanguageModel -> NamedType -> (Theorem, TheoremData)+generateTheorem model (NamedType tv t) =+  execute tv (applyDelta model t >>= unfold tv)++++-- | Creates a list of all lifted relations occurring in the given theorem.+--   Lifted relations are @lift@ relations as well as functional relations and+--   relational abstractions.+--   The lifted relations are returned together with their unfolded description.++extractLiftRelations :: (Theorem, TheoremData) -> Bool -> [UnfoldedRelation]+extractLiftRelations (theorem, tdata) omitIns =+  fst $ executeWith tdata (Lifts.extractLiftRelations theorem omitIns)++++-- | Instantiates a relation variable found by+--   'Specialization.extractRelationVariables' in the given theorem.+--   A new function symbol is created to replace the relation variable.++instantiateRelation :: (Theorem, TheoremData)+                       -> RelationVariable+                       -> (Theorem, TheoremData)++instantiateRelation (theorem, tdata) rv =+  executeWith tdata (Specialization.replaceRelationVariable theorem rv)
+ scripts/FT/FreeTheorems/Declarations.hs view
@@ -0,0 +1,298 @@+-- Copyright 2006, Sascha Boehme.+++++-- | This module defines the accepted user-defined types.+--   It covers only algebraic datatypes and type synonyms.++module FreeTheorems.Declarations (++    -- * Haskell type declarations+    DataDeclaration(..),+    DataConstructorDeclaration(..),+    Type(..),+    TypeDeclaration(..),+    TypeConstructor,+    Arity,++    -- * Type information+    isDefined,+    getDataDecl,+    getTypeDecl,+    getSupportedAlgebraicDatatypes,+    getSupportedTypeSynonyms,++    -- testing interface+    testDeclarations+) where++++import FreeTheorems.Types++++-- | Gives a notation for the declaration of an algebraic datatype.+--   The right-hand side is defined as a function type to replace type variables+--   easily by arbitrary types. The argument list of this function should be+--   exactly as long as the arity of the type constructor.+--   The types of the right-hand side should not contain any type synonym+--   because right-hand sides will not be prepared the same way as types+--   inputted by the user.++data DataDeclaration = DataDecl TypeConstructor Arity+                                ([Type] -> [DataConstructorDeclaration])++++-- | Denotes the declaration of a data constructor as it occurs in definitions+--   of algebraic datatypes.++data DataConstructorDeclaration = DataConDecl DataConstructor [Type]++++-- | Represents the declaration of a type synonym.+--   The right-hand side is defined as a function type to replace type variables+--   easily by arbitrary types. The argument list of this function should be+--   exactly as long as the arity of the type constructor.++data TypeDeclaration = TypeDecl TypeConstructor Arity ([Type] -> Type)++++-- | Used to describe the rank or arity of type constructors.++type Arity = Int++++-- | Stores valid user-defined types.+--   It contains algebraic datatypes and type synonyms along with their+--   right-hand side.++data UserDefinedTypes = UserDefinedTypes {+  dataDecls :: [DataDeclaration],   -- ^ A list of valid algebraic data types+                                    --   each of them with their right-hand+                                    --   side.++  typeDecls :: [TypeDeclaration]    -- ^ A list of valid type synonymes each of+                                    --   them with their right-hand side.+}++++-- | Checks if a type constructor occurs in the list of accepted user-defined+--   types.++isDefined :: TypeConstructor -> Bool+isDefined t =+     any (\(DataDecl t' _ _) -> (t == t')) (dataDecls userDefinedTypes)+  || any (\(TypeDecl t' _ _) -> (t == t')) (typeDecls userDefinedTypes)++++-- | Returns the declaration of an algebraic datatype, if it occurs in the list+--   of accepted algebraic datatypes.++getDataDecl :: TypeConstructor -> Maybe DataDeclaration+getDataDecl t =+  case (filter (\(DataDecl t' _ _)-> (t == t')) (dataDecls userDefinedTypes)) of+    []    -> Nothing+    (d:_) -> Just d++++-- | Returns the declaration of a type synonym, if it occurs in the list of+--   accepted type synonyms.++getTypeDecl :: TypeConstructor -> Maybe TypeDeclaration+getTypeDecl t =+  case (filter (\(TypeDecl t' _ _)-> (t == t')) (typeDecls userDefinedTypes)) of+    []    -> Nothing+    (d:_) -> Just d++++-- | Returns the list of algebraic datatypes being supported by the FreeTheorems+--   library. For each algebraic datatype, its name and arity are returned.++getSupportedAlgebraicDatatypes :: [(String, Int)]+getSupportedAlgebraicDatatypes = map (\(DataDecl n i _) -> (n,i))+                                     (dataDecls userDefinedTypes)++++-- | Returns the list of type synonyms being supported by the FreeTheorems+--   library. For each type synonym, its name and arity are returned.++getSupportedTypeSynonyms :: [(String, Int)]+getSupportedTypeSynonyms = map (\(TypeDecl n i _) -> (n,i))+                               (typeDecls userDefinedTypes)++++-- | Defines the set of valid user-defined types.+--   This sets defines all types which may occur in type terms from which+--   theorems can be generated. Except of predefined types, no more types are+--   allowed in type terms.++userDefinedTypes :: UserDefinedTypes+userDefinedTypes = UserDefinedTypes {++-- Note that the types of the right-hand side should not contain any type+-- synonym because it will not be replaced.+  dataDecls = [+    DataDecl "Bool" 0 (\[] ->+             [DataConDecl "False" []+             ,DataConDecl "True" []+             ]),+    DataDecl "Maybe" 1 (\[a] ->+             [DataConDecl "Nothing" []+             ,DataConDecl "Just" [a]+             ]),+    DataDecl "Either" 2 (\[a, b] ->+             [DataConDecl "Left" [a]+             ,DataConDecl "Right" [b]+             ]),+    DataDecl "Ordering" 0 (\[] ->+             [DataConDecl "LT" []+             ,DataConDecl "EQ" []+             ,DataConDecl "GT" []+             ]),+    DataDecl "IOMode" 0 (\[] ->+             [DataConDecl "ReadMode" []+             ,DataConDecl "WriteMode" []+             ,DataConDecl "AppendMode" []+             ,DataConDecl "ReadWriteMode" []+             ]),+    DataDecl "BufferMode" 0 (\[] ->+             [DataConDecl "NoBuffering" []+             ,DataConDecl "LineBuffering" []+             ,DataConDecl "BlockBuffering" [TypeCon "Maybe" [TypeBasic Int]]+             ]),+    DataDecl "SeekMode" 0 (\[] ->+             [DataConDecl "AbsoluteSeek" []+             ,DataConDecl "RelativeSeek" []+             ,DataConDecl "SeekFromEnd" []+             ]),+    DataDecl "Permissions" 0 (\[] ->+             [DataConDecl "Permissions" [TypeCon "Bool" []  -- readable+                                        ,TypeCon "Bool" []  -- writable+                                        ,TypeCon "Bool" []  -- executable+                                        ,TypeCon "Bool" []  -- searchable+                                        ]]),+    DataDecl "ExitCode" 0 (\[] ->+             [DataConDecl "ExitSuccess" []+             ,DataConDecl "ExitFailure" [TypeBasic Int]+             ]),+    DataDecl "Month" 0 (\[] ->+             [DataConDecl "January" []+             ,DataConDecl "February" []+             ,DataConDecl "March" []+             ,DataConDecl "April" []+             ,DataConDecl "May" []+             ,DataConDecl "June" []+             ,DataConDecl "July" []+             ,DataConDecl "August" []+             ,DataConDecl "September" []+             ,DataConDecl "October" []+             ,DataConDecl "November" []+             ,DataConDecl "December" []+             ]),+    DataDecl "Day" 0 (\[] ->+             [DataConDecl "Sunday" []+             ,DataConDecl "Monday" []+             ,DataConDecl "Tuesday" []+             ,DataConDecl "Wednesday" []+             ,DataConDecl "Thursday" []+             ,DataConDecl "Friday" []+             ,DataConDecl "Saturday" []+             ]),+    DataDecl "CalenderTime" 0 (\[] ->+             [DataConDecl "CalenderTime" [TypeBasic Int     -- ctYear+                                         ,TypeCon "Month" []    -- ctMonth+                                         ,TypeBasic Int     -- ctDay+                                         ,TypeBasic Int     -- ctHour+                                         ,TypeBasic Int     -- ctMin+                                         ,TypeBasic Int     -- ctSec+                                         ,TypeBasic Integer -- ctPicosec+                                         ,TypeCon "Day" []  -- ctWDay+                                         ,TypeBasic Int     -- ctYDay+                                         ,TypeList (TypeBasic Char)  -- ctTZName+                                         ,TypeBasic Int     -- ctTZ+                                         ,TypeCon "Bool" [] -- ctIsDST+                                         ]]),+    DataDecl "TimeDiff" 0 (\[] ->+             [DataConDecl "TimeDiff" [TypeBasic Int     -- tdYear+                                     ,TypeBasic Int     -- tdMonth+                                     ,TypeBasic Int     -- tdDay+                                     ,TypeBasic Int     -- tdHour+                                     ,TypeBasic Int     -- tdMin+                                     ,TypeBasic Int     -- tdSec+                                     ,TypeBasic Integer -- tdPicosec+                                     ]]),+    DataDecl "TimeLocale" 0 (\[] ->+             [DataConDecl "TimeLocale"+                [TypeList (TypeTuple [TypeList (TypeBasic Char)+                                     ,TypeList (TypeBasic Char)]) -- wDays+                ,TypeList (TypeTuple [TypeList (TypeBasic Char)+                                     ,TypeList (TypeBasic Char)]) -- months+                ,TypeTuple [TypeList (TypeBasic Char)+                           ,TypeList (TypeBasic Char)]            -- amPm+                ,TypeList (TypeBasic Char)        -- dateTimeFmt+                ,TypeList (TypeBasic Char)        -- dateFmt+                ,TypeList (TypeBasic Char)        -- timeFmt+                ,TypeList (TypeBasic Char)        -- time12Fmt+                ]])+  ],++  typeDecls = [+    TypeDecl "String" 0+             (\[] -> TypeList (TypeBasic Char)),+    TypeDecl "ReadS" 1+             (\[a] -> TypeFun (TypeCon "String" [])+                              (TypeList (TypeTuple [a, TypeCon "String" []]))),+    TypeDecl "ShowS" 0+             (\[] -> TypeFun (TypeCon "String" []) (TypeCon "String" [])),+    TypeDecl "FilePath" 0+             (\[] -> TypeCon "String" [])+  ]+}++++--------------------------------------------------------------------------------++++-- A list of tests for this module.++testDeclarations = do+  putStr "declarations contain no function and forall ... "+  putStrLn (if test_no_fun_forall then "OK" else "FALSE")++++-- Check that data declarations contain no functions and type abstractions in+-- its right-hand sides.++test_no_fun_forall = and $ map hasNoFunForall (dataDecls userDefinedTypes)++hasNoFunForall (DataDecl _ n f) =+  let vs = map (\i -> TypeVar ("a" ++ show i)) [1..n]+      ts = concatMap (\(DataConDecl _ ts) -> ts) (f vs)+  in  and $ map noFunForall ts++noFunForall t =+  case t of+    TypeBasic _    -> True+    TypeVar _      -> True+    TypeTermVar _  -> True+    TypeCon _ ts   -> and $ map noFunForall ts+    TypeList t'    -> noFunForall t'+    TypeUnit       -> True+    TypeTuple ts   -> and $ map noFunForall ts+    TypeFun _ _    -> False+    TypeForall _ _ -> False
+ scripts/FT/FreeTheorems/Delta.hs view
@@ -0,0 +1,289 @@+-- Copyright 2006, Sascha Boehme.+++++-- | This module contains the delta algorithm which transforms a type into a+--   relation.++module FreeTheorems.Delta (+    applyDelta,+    applyDeltaWith,+    Environment,++    -- testing interface+    -- testDelta+) where++++import Prelude hiding (lookup)++import FreeTheorems.Preparation+import FreeTheorems.Reduction+import FreeTheorems.TheoremData+import FreeTheorems.Types+import qualified Data.Map as Map (Map, empty, insert, lookup)++-- import FreeTheorems.Test.ArbitraryTypes+import Data.List (nub, delete)+-- import Test.QuickCheck (quickCheck)++++++-- | Applies the delta algorithm to a type to transform it into a corresponding+--   relation. In the generated relation, subrelations are simplified as much as+--   possible.+--+--   According to the language model used, the correct delta algorithm is+--   chosen. The delta algorithm is essentially a term rewriting, i.e. type+--   terms are transformed in corresponding relations while obeying certain+--   rules of the language subset in use.++applyDelta :: LanguageModel -> Type -> TheoremState Relation+applyDelta model = applyDeltaWith model empty++++-- | Applies the delta algorithm to a type to transform it into a corresponding+--   relation. In the generated relation, subrelations are simplified as much as+--   possible.+--+--   According to the language model used, the correct delta algorithm is+--   chosen. The delta algorithm is essentially a term rewriting, i.e. type+--   terms are transformed in corresponding relations while obeying certain+--   rules of the language subset in use.+--+--   This function is a variant of 'applyDelta' where an initial environment can+--   be provided.++applyDeltaWith :: LanguageModel -> Environment -> Type -> TheoremState Relation+applyDeltaWith model env t = do+  rel <- case model of+           BasicModel -> deltaBasic env t+           FixModel   -> deltaFix env t+  return $ reduceRelation rel+++++-- | Declares the type for environments which are mappings of type variables to+--   relation variables.++type Environment = Map.Map TypeVariable Relation++++-- | Creates an empty environment.++empty :: Environment+empty = Map.empty++++-- | Updates an environment.++update :: Environment -> TypeVariable -> RelationVariable -> Environment+update env v rv = Map.insert v (RelVar rv) env++++-- | Returns the relation variable which is mapped to a type variable.++lookup :: Environment -> TypeVariable -> Relation+lookup env v =+  case Map.lookup v env of+    Just rel -> rel+    -- 'Nothing' can not occur because every types processed in 'delta' is+    -- closed and a 'lookup' may only occur after the corresponding 'update'+    -- (due to the structure of types).++++++-- | The delta algorithm for the basic model.++deltaBasic :: Environment -> Type -> TheoremState Relation+deltaBasic env t =+  case t of+    TypeBasic b     -> return (RelTerm (TermIns (TermVar (PV "id")) t) (t,t))++    TypeVar v       -> return (lookup env v)++    TypeCon c ts    -> do rels <- mapM (deltaBasic env) ts+                          return (RelLift BasicModel c rels)++    TypeList t1     -> do rel <- deltaBasic env t1+                          return (RelLiftList BasicModel rel)++    TypeUnit        -> return (RelTerm (TermIns (TermVar (PV "id")) t) (t, t))++    TypeTuple ts    -> do rels <- mapM (deltaBasic env) ts+                          return (RelLiftTuple BasicModel rels)++    TypeFun t1 t2   -> do rel1 <- deltaBasic env t1+                          rel2 <- deltaBasic env t2+                          return (RelFun BasicModel rel1 rel2)++    TypeForall v t1 -> do rv  <- newRelationVariable v+                          rel <- deltaBasic (update env v rv) t1+                          return (RelForall BasicModel rv rel)++++-- | The delta algorithm for the fix model.++deltaFix :: Environment -> Type -> TheoremState Relation+deltaFix env t =+  case t of+    TypeBasic b     -> return (RelTerm (TermIns (TermVar (PV "id")) t) (t,t))++    TypeVar v       -> return (lookup env v)++    TypeCon c ts    -> do rels <- mapM (deltaFix env) ts+                          return (RelLift FixModel c rels)++    TypeList t1     -> do rel <- deltaFix env t1+                          return (RelLiftList FixModel rel)++    TypeUnit        -> return (RelTerm (TermIns (TermVar (PV "id")) t) (t,t))++    TypeTuple ts    -> do rels <- mapM (deltaFix env) ts+                          return (RelLiftTuple FixModel rels)++    TypeFun t1 t2   -> do rel1 <- deltaFix env t1+                          rel2 <- deltaFix env t2+                          return (RelFun FixModel rel1 rel2)++    TypeForall v t1 -> do rv  <- newRelationVariable v+                          rel <- deltaFix (update env v rv) t1+                          return (RelForall FixModel rv rel)++++--------------------------------------------------------------------------------++++-- A list of tests for this module.++{-+testDelta = do+  putStr "delta preserves the structure ... "+  quickCheck prop_delta_preserves_structure+  putStr "every relation variable occurs only once ... "+  quickCheck prop_every_rv_only_once+  putStr "every relation variable is bound ... "+  quickCheck prop_every_rv_is_bound+  putStr "relation uses only one model ... "+  quickCheck prop_only_one_model+  putStr "delta reduces the generated relation ... "+  quickCheck prop_delta_reduces_relation+-}++++-- Check that delta preserves the structure, i.e. the type is just reflected+-- into a representation by relations.++prop_delta_preserves_structure model t =+   let t' = prepare t+       rel = fst $ execute (PV "t") $ applyDelta model t'+   in  compareTypeAndRelation (rel, t')++compareTypeAndRelation :: (Relation, Type) -> Bool+compareTypeAndRelation pair =+  case pair of+    (RelVar rv, TypeVar v)               -> let R _ v' _ = rv+                                            in  v == v'++    (RelTerm _ _, t')                    -> True++    (RelLift _ c rels, TypeCon c' ts)    -> (c == c')+                                            && and (map compareTR $ zip rels ts)++    (RelLiftList _ rel, TypeList t)      -> compareTR (rel, t)++    (RelLiftTuple _ rels, TypeTuple ts)  -> and (map compareTR $ zip rels ts)++    (RelFun _ rel1 rel2, TypeFun t1 t2)  -> compareTR (rel1, t1) &&+                                            compareTR (rel2, t2)++    (RelForall _ rv rel, TypeForall v t) -> let R _ v' _ = rv+                                            in  v' == v && compareTR (rel, t)++    otherwise      -> False++  where+    compareTR = compareTypeAndRelation++++-- Check that every relation variable is bound only once in a quantification,+-- i.e. every relation variable is unique.++prop_every_rv_only_once model t =+  let rel = fst $ execute (PV "t") $ applyDelta model $ prepare t+      rvs = getBoundRelVars rel+  in  rvs == nub rvs++getBoundRelVars rel =+  case rel of+    RelTerm _ _         -> []+    RelVar _            -> []+    RelLift _ _ rels    -> concatMap getBoundRelVars rels+    RelLiftList _ rel'  -> getBoundRelVars rel'+    RelLiftTuple _ rels -> concatMap getBoundRelVars rels+    RelFun _ rel1 rel2  -> getBoundRelVars rel1 ++ getBoundRelVars rel2+    RelForall _ rv rel' -> rv : (getBoundRelVars rel')++++-- Check that all relation variables are quantified.++prop_every_rv_is_bound model t =+  let rel = fst $ execute (PV "t") $ applyDelta model $ prepare t+  in  checkRelVars rel == []++checkRelVars rel =+  case rel of+    RelTerm _ _         -> []+    RelVar rv           -> [rv]+    RelLift _ _ rels    -> nub $ concatMap checkRelVars rels+    RelLiftList _ rel'  -> nub $ checkRelVars rel'+    RelLiftTuple _ rels -> nub $ concatMap checkRelVars rels+    RelFun _ rel1 rel2  -> nub $ checkRelVars rel1 ++ checkRelVars rel2+    RelForall _ rv rel' -> delete rv (checkRelVars rel')++++-- Check that delta creates relations having only one model.++prop_only_one_model model t =+  let rel = fst $ execute (PV "t") $ applyDelta model $ prepare t+  in  usesModel model rel++usesModel model rel =+  case rel of+    RelTerm _ _         -> True+    RelVar rv           -> True+    RelLift m _ rels    -> m == model && and (map (usesModel model) rels)+    RelLiftList m rel'  -> m == model && usesModel model rel'+    RelLiftTuple m rels -> m == model && and (map (usesModel model) rels)+    RelFun m rel1 rel2  -> m == model && usesModel model rel1+                                      && usesModel model rel2+    RelForall m rv rel' -> m == model && usesModel model rel'++++-- Check that delta simplifies its generated relations.++prop_delta_reduces_relation model t =+   let rel = fst $ execute (PV "t") $ applyDelta model $ prepare t+   in  rel == reduceRelation rel+++
+ scripts/FT/FreeTheorems/Lifts.hs view
@@ -0,0 +1,220 @@+-- Copyright 2006, Sascha Boehme.+++++-- | This module defines a function to extract and unfold lifted relations+--   occurring in theorems.++module FreeTheorems.Lifts (+    extractLiftRelations+) where++++import FreeTheorems.Declarations+import FreeTheorems.Delta+import FreeTheorems.Modification+import FreeTheorems.TheoremData+import FreeTheorems.Types+import FreeTheorems.Unfolding+import Control.Monad (liftM, liftM2)+import Control.Monad.State (evalState)+import Data.List (nub)+import qualified Data.Map as Map (fromAscList)+import Data.Maybe (catMaybes)++++++-- | Creates a list of all lifted relations occurring in the given theorem.+--   Lifted relations are @lift@ relations as well as functional relations and+--   relational abstractions.+--   The lifted relations are returned together with their unfolded description.+--   If the second argument is 'True', all instantiations in the terms of the+--   returned unfolded relations are omitted.++extractLiftRelations :: Theorem -> Bool -> TheoremState [UnfoldedRelation]+extractLiftRelations theorem omitIns = do+  rels <- extractLifts theorem+  lifts <- mapM unfoldLiftRelation $ nub rels+  if omitIns+    then return (map omitInstantiationsInUnfoldedRelation lifts)+    else return lifts++++--------------------------------------------------------------------------------++++-- | Extracts all lifted relations from a theorem. This is a helper function for+--   'extractLiftRelations'.++extractLifts :: Theorem -> TheoremState [Relation]+extractLifts theorem =+  case theorem of+    IsElementOf _ rel       -> collectLifts rel+    ForallPairs _ rel t     -> liftM2 (++) (collectLifts rel) (extractLifts t)+    ForallRelations _ _ t   -> extractLifts t+    ForallFunctions _ _ _ t -> extractLifts t+    ForallElements _ _ t    -> extractLifts t+    Conjunction t1 t2       -> liftM2 (++) (extractLifts t1) (extractLifts t2)+    Implication t1 t2       -> liftM2 (++) (extractLifts t1) (extractLifts t2)++++-- | Returns all lift relations occurring in a relation.++collectLifts :: Relation -> TheoremState [Relation]+collectLifts rel =+  case rel of+    RelTerm _ _         -> return []+    RelVar _            -> return []++    RelLift m con rels  -> do subLifts <- subLifts m con rels+                              lifts <- liftM concat $ mapM collectLifts rels+                              return $ rel : lifts ++ subLifts++    RelLiftList _ rel'  -> do lifts <- collectLifts rel'+                              return $ rel : lifts++    RelLiftTuple _ rels -> do lifts <- liftM concat $ mapM collectLifts rels+                              return $ rel : lifts++    RelFun _ rel1 rel2  -> do lifts1 <- collectLifts rel1+                              lifts2 <- collectLifts rel2+                              return $ rel : lifts1 ++ lifts2++    RelForall _ _ rel'  -> do lifts <- collectLifts rel'+                              return $ rel : lifts++++-- | Returns all sublifts occurring in the right-hand side definition of a+--   type constructor. For example, the following datatype has a sublift:+--+-- > data Foo = Bar [Int]+--+--   Here, the function will return the relation for @[Int]@ as the only sublift+--   of @Foo@.+--+--   However, only general type constructors, tuples and lists may occur as+--   sublifts. Functions and type abstractions are forbidden, because their+--   behaviour is not yet defined.++-- The function relies on the fact, that functions and type abstractions may not+-- occur on the right-hand side of data declarations. That way, it can safely+-- use 'delta' (which is also defined for functions and type abstractions) to+-- create relations of types.++subLifts :: LanguageModel+            -> TypeConstructor+            -> [Relation]+            -> TheoremState [Relation]++subLifts model con rels = do+  let Just (DataDecl _ n f) = getDataDecl con+  let vs = map (\i -> "a" ++ show i) [1..n]+  let decls = f (map (\v -> TypeVar v) vs)+  let types = concatMap (\(DataConDecl _ ts) -> ts) decls+  let env = Map.fromAscList $ zip vs rels+  relations <- mapM (applyDeltaWith model env) types+  liftM concat (mapM collectLifts relations)++++--------------------------------------------------------------------------------++++-- | Unfolds a lift relation. This is a helper function for+--   'extractLiftRelations'.++unfoldLiftRelation :: Relation -> TheoremState UnfoldedRelation+unfoldLiftRelation rel =+  case rel of++-- the following two cases will never occur, see 'collectLifts'+--    RelTerm _ _+--    RelVar _++    RelLift model con rels  -> liftM (pack model) (unfoldLift model con rels)+    RelLiftList model rel'  -> return $ pack model (unfoldLiftList model rel')+    RelLiftTuple model rels -> return $ pack model (unfoldLiftTuple model rels)++    RelFun model rel1 rel2  -> do (f, g) <- newVariablesFor rel+                                  let pair = (TermVar f, TermVar g)+                                  theorem <- unfoldFunction model rel1 rel2 pair+                                  return $ pack model+                                         $ UnfoldedFunction (f,g) theorem++    RelForall model rv rel' -> do (x, y) <- newVariablesFor rel+                                  let pair = (TermVar x, TermVar y)+                                  theorem <- unfoldForall model rv rel' pair+                                  return $ pack model+                                         $ UnfoldedForall (x,y) theorem+  where+    pack = UnfoldedRelation rel++++-- | Unfolds a lifted relation of an algebraic datatype. It uses 'delta' on the+--   types occurring on the right-hand side of the according type constructor's+--   definition to generate relations.++unfoldLift :: LanguageModel+              -> TypeConstructor+              -> [Relation]+              -> TheoremState UnfoldedSet++unfoldLift model con rels = do+  let Just (DataDecl _ n f) = getDataDecl con+      vs = map (\i -> "a" ++ show i) [1..n]+      decls = f (map (\v -> TypeVar v) vs)+      env = Map.fromAscList $ zip vs rels++  liftM UnfoldedLift (mapM (unfoldDecl env) decls)++  where+    unfoldDecl env (DataConDecl con types) = do+      let n = length types+          xs = map (TV "x") [1..n]+          ys = map (TV "y") [1..n]+      if n == 0+        then return (con, [], [], Nothing)+        else liftM (\t -> (con, xs, ys, Just t)) (buildTheorem env xs ys types)++    buildTheorem env xs ys types = do+      rels <- mapM (applyDeltaWith model env) types+      let mkTheorem (x,y,r) = IsElementOf (TermVar x, TermVar y) r+          theorems = map mkTheorem (zip3 xs ys rels)+      return $ foldr1 Conjunction theorems++++-- | Unfolds a lifted list relation.++unfoldLiftList :: LanguageModel -> Relation -> UnfoldedSet+unfoldLiftList model rel =+  let (x, xs) = (PV "x", PV "xs")+      (y, ys) = (PV "y", PV "ys")+      lift    = RelLiftList model rel+      theorem = Conjunction (IsElementOf (TermVar x, TermVar y) rel)+                            (IsElementOf (TermVar xs, TermVar ys) lift)+  in  UnfoldedLiftList ((x, xs), (y, ys)) theorem++++-- | Unfolds a lifted tuple relation.++unfoldLiftTuple :: LanguageModel -> [Relation] -> UnfoldedSet+unfoldLiftTuple model rels =+  let n = length rels+      xs = map (TV "x") [1..n]+      ys = map (TV "y") [1..n]+      mkTheorem (x,y,r) = IsElementOf (TermVar x, TermVar y) r+      theorem = foldr1 Conjunction (map mkTheorem (zip3 xs ys rels))+  in  UnfoldedLiftTuple (xs, ys) theorem+
+ scripts/FT/FreeTheorems/Modification.hs view
@@ -0,0 +1,87 @@+-- Copyright 2006, Sascha Boehme.+++++-- | This module defines a function to modify theorems by omitting+--   instantiations in terms.++module FreeTheorems.Modification (+    omitInstantiations,+    omitInstantiationsInUnfoldedRelation+) where++++import FreeTheorems.Types++++-- | Omits all instantiations in the terms of the given theorem.++omitInstantiations :: Theorem -> Theorem+omitInstantiations theorem =+  case theorem of+    IsElementOf (t1,t2) r   -> IsElementOf (omitIns t1, omitIns t2)+                                           (omitInsRel r)+    ForallPairs p r t       -> ForallPairs p (omitInsRel r)+                                             (omitInstantiations t)+    ForallRelations rv r t  -> ForallRelations rv r (omitInstantiations t)+    ForallFunctions f p r t -> ForallFunctions f p r (omitInstantiations t)+    ForallElements x ty t   -> ForallElements x ty (omitInstantiations t)+    Conjunction t1 t2       -> Conjunction (omitInstantiations t1)+                                           (omitInstantiations t2)+    Implication t1 t2       -> Implication (omitInstantiations t1)+                                           (omitInstantiations t2)++++-- | Omits all instantiations in unfolded relations.++omitInstantiationsInUnfoldedRelation :: UnfoldedRelation -> UnfoldedRelation+omitInstantiationsInUnfoldedRelation (UnfoldedRelation rel model set) =+  UnfoldedRelation (omitInsRel rel) model (omitInsSet set)++++-- | Omit instantiations in relations.++omitInsRel :: Relation -> Relation+omitInsRel rel =+  case rel of+    RelTerm t types     -> RelTerm (omitIns t) types+    RelVar _            -> rel+    RelLift m c rels    -> RelLift m c (map omitInsRel rels)+    RelLiftList m rel'  -> RelLiftList m (omitInsRel rel')+    RelLiftTuple m rels -> RelLiftTuple m (map omitInsRel rels)+    RelFun m rel1 rel2  -> RelFun m (omitInsRel rel1) (omitInsRel rel2)+    RelForall m rv rel' -> RelForall m rv (omitInsRel rel')++++-- | Omits instantiations in unfolded sets.++omitInsSet :: UnfoldedSet -> UnfoldedSet+omitInsSet set =+  case set of+    UnfoldedLift list     -> UnfoldedLift (map omit list)+    UnfoldedLiftList p t  -> UnfoldedLiftList p (omitInstantiations t)+    UnfoldedLiftTuple p t -> UnfoldedLiftTuple p (omitInstantiations t)+    UnfoldedFunction p t  -> UnfoldedFunction p (omitInstantiations t)+    UnfoldedForall p t    -> UnfoldedForall p (omitInstantiations t)+  where+    omit (con, xs, ys, mt) =+      case mt of+        Nothing -> (con, xs, ys, mt)+        Just t  -> (con, xs, ys, Just (omitInstantiations t))++++-- | Omits all instantiations in a term.++omitIns :: Term -> Term+omitIns t =+  case t of+    TermVar tv    -> TermVar tv+    TermApp t1 t2 -> TermApp (omitIns t1) (omitIns t2)+    TermIns t _   -> omitIns t
+ scripts/FT/FreeTheorems/Preparation.hs view
@@ -0,0 +1,156 @@+-- Copyright 2006, Sascha Boehme.+++++-- | This module contains functions to process types before a theorem can be+--   generated out of them.++module FreeTheorems.Preparation (+    prepare,++    -- testing interface+    -- testPreparation+) where++++import FreeTheorems.Declarations (TypeDeclaration(..), getTypeDecl)+import FreeTheorems.Types+import Data.List (nub, delete)++-- import FreeTheorems.Test.ArbitraryTypes+-- import Test.QuickCheck (quickCheck)++++++-- | Prepares a type before a theorem can be generated out of it.++prepare :: Type -> Type+prepare = replaceTypeSynonyms . closure++++++-- | Computes the closure for a named type term. The returned type term contains+--   no free type variables anymore.++closure :: Type -> Type+closure t = foldr (\v t -> TypeForall v t) t (freeVariables t)++++-- | Computes the free type variables for a type term.+--   This is a helper function for 'closure'.++freeVariables :: Type -> [TypeVariable]+freeVariables t =+  case t of+    TypeBasic _     -> []+    TypeVar v       -> [v]+    TypeTermVar _   -> []+    TypeCon _ ts    -> nub $ concat $ map freeVariables ts+    TypeList t1     -> freeVariables t1+    TypeUnit        -> []+    TypeTuple ts    -> nub $ concat $ map freeVariables ts+    TypeFun t1 t2   -> nub $ concat $ map freeVariables [t1, t2]+    TypeForall v t1 -> delete v (freeVariables t1)++++++-- | Replaces all type synonyms by its declaration's right-hand side.+--   Only type synonyms occurring in the set of user-defined types are replaced.+--   However, there may be no other type synonyms in the type term, anyway.++replaceTypeSynonyms :: Type -> Type+replaceTypeSynonyms t =+  let replaceTS = replaceTypeSynonyms+  in  case t of+        TypeBasic _     -> t+        TypeVar _       -> t+        TypeTermVar _   -> t+        TypeCon c ts    -> replaceByDecl c ts+        TypeList t1     -> TypeList (replaceTS t1)+        TypeUnit        -> t+        TypeTuple ts    -> TypeTuple (map replaceTS ts)+        TypeFun t1 t2   -> TypeFun (replaceTS t1) (replaceTS t2)+        TypeForall v t1 -> TypeForall v (replaceTS t1)+++++-- | Replaces a type constructor by its declaration's right-hand side, if the+--   type constructor belongs to a type synonym. Otherwise calls+--   'replaceTypeSynonyms' on the subtypes.++replaceByDecl :: TypeConstructor -> [Type] -> Type+replaceByDecl con ts =+  case getTypeDecl con of+    Nothing   -> TypeCon con (map replaceTypeSynonyms ts)+    Just decl -> let TypeDecl _ _ rhs = decl+                 in  replaceTypeSynonyms (rhs ts)++++--------------------------------------------------------------------------------++++-- A list of tests for this module.++{-+testPreparation = do+  putStr "closure of types works ... "+  quickCheck prop_closure+  putStr "type synonyms are replaced correctly ... "+  quickCheck prop_replaceTypeSynonyms+  putStr "preparation of types works ... "+  quickCheck prop_prepare++-}+++-- A closed type term does not contain any free variable.++prop_closure t =+     (freeVariables (closure t) == [])+  && (closure t == closure (closure t))++++-- Check that there are no type synonyms anymore and that further applications+-- of 'replaceTypeSynonyms' don't change the type anymore.++prop_replaceTypeSynonyms t =+     (hasNoTypeSynonyms $ replaceTypeSynonyms t)+  && (replaceTypeSynonyms t == replaceTypeSynonyms (replaceTypeSynonyms t))++hasNoTypeSynonyms t =+  case t of+    TypeBasic _     -> True+    TypeVar _       -> True+    TypeCon c ts    -> case getTypeDecl c of+                         Nothing -> and (map hasNoTypeSynonyms ts)+                         Just _  -> False+    TypeList t1     -> hasNoTypeSynonyms t1+    TypeUnit        -> True+    TypeTuple ts    -> and (map hasNoTypeSynonyms ts)+    TypeFun t1 t2   -> hasNoTypeSynonyms t1 && hasNoTypeSynonyms t2+    TypeForall v t1 -> hasNoTypeSynonyms t1+    otherwise       -> False++++-- Check that prepare does everything it is supposed to do, in any way.++prop_prepare t =+  (prepare t == (replaceTypeSynonyms $ closure t))+  && (prepare t == (closure $ replaceTypeSynonyms t))+++
+ scripts/FT/FreeTheorems/PrettyPrint.hs view
@@ -0,0 +1,68 @@+-- Copyright 2006, Sascha Boehme.+++++-- | This module contains classes to pretty-print types and theorems in+--   different formats.++module FreeTheorems.PrettyPrint where++++-- This module is just an interface for all pretty-print modules. The intention+-- is that this module hides the implementation of several output formats by a+-- simple interface. For each output format, there should be one module in the+-- 'PrettyPrint' subdirectory (according to the 'AsText' module) and also one+-- class similar to 'PrettyPrintAsText'.++++import FreeTheorems.Types+import qualified FreeTheorems.PrettyPrint.AsText as Text++++++-- | Conversion of values to 'String's.+--   Derived instances of 'PrettyPrintAsText' show their values using+--   'printAsText'. The pretty-printed text is optimized consoles or text files+--   having a line length of at least 75 characters.++class PrettyPrintAsText a where+  -- | Pretty-prints a value as plain text with a maximum line length of 75+  --   characters.+  printAsText :: a -> String++++instance PrettyPrintAsText LanguageModel where+  printAsText = Text.printLanguageModel++++instance PrettyPrintAsText NamedType where+  printAsText = Text.printNamedType++++instance PrettyPrintAsText Theorem where+  printAsText = Text.printTheorem++++instance PrettyPrintAsText UnfoldedRelation where+  printAsText = Text.printUnfoldedRelation++++instance PrettyPrintAsText TermVariable where+  printAsText = Text.printTermVariable++++instance PrettyPrintAsText RelationVariable where+  printAsText = Text.printRelationVariable++
+ scripts/FT/FreeTheorems/PrettyPrint/AsText.hs view
@@ -0,0 +1,264 @@+-- Copyright 2006, Sascha Boehme.+++++-- | This module defines functions to pretty-print types and theorems as text.++module FreeTheorems.PrettyPrint.AsText (+    printLanguageModel,+    printNamedType,+    printTheorem,+    printUnfoldedRelation,+    printTermVariable,+    printRelationVariable+) where++++import FreeTheorems.Types+import FreeTheorems.PrettyPrint.Common+import FreeTheorems.PrettyPrint.Document+import qualified PPrint as P++++++-- | Renders a document. This helper function is used both to render type+--   documents and theorem documents.+--+--   The parameters to renderPretty influence the output by setting the ribbon+--   factor and the line length.++renderDoc :: PDoc -> String+renderDoc (P doc) = P.displayS (P.renderPretty 1.0 75 doc) ""++++--------------------------------------------------------------------------------++++-- | Pretty-prints a language model.++printLanguageModel :: LanguageModel -> String+printLanguageModel BasicModel = "BasicModel"+printLanguageModel FixModel   = "FixModel"++++-- | Pretty-prints a named type.++printNamedType :: NamedType -> String+printNamedType = renderDoc . docNamedType++++-- | Pretty-prints a theorem.++printTheorem :: Theorem -> String+printTheorem = renderDoc . docTheorem++++-- | Pretty-prints a term variable.++printTermVariable :: TermVariable -> String+printTermVariable = renderDoc . docTermVariable++++-- | Pretty-prints a relation variable.++printRelationVariable :: RelationVariable -> String+printRelationVariable = renderDoc . docRelationVariable++++-- | Pretty-prints an expanded relation.++printUnfoldedRelation :: UnfoldedRelation -> String+printUnfoldedRelation = renderDoc . docUnfoldedRelation++++--------------------------------------------------------------------------------++++-- | Defines text documents as liftings of the document type used in the PPrint+--   library.++newtype PDoc = P P.Doc+++-- Define some lift operators for the PDoc type, so that the following code is+-- then better readable.++lift d1 = P d1++lift1 op (P d1) = P (op d1)++lift2 op (P d1) (P d2) = P (op d1 d2)++liftL op pds = P (op (map (\(P d) -> d) pds))++text = P . P.text++++-- The instance declaration which specifies for every class method, how it+-- should work when pretty-printing objects as plain text. The following+-- definitions lift mainly some of the PPrint functions.++instance Document PDoc where++  -- The empty document.+  empty = lift P.empty++  -- Concatenates two documents horizontally without putting space between+  -- them.+  (<>) = lift2 (P.<>)++  -- Concatenates two documents horizontally and puts a soft space between+  -- them. A soft space may differ from the underlying document structure. If+  -- it puts spaces automatically between objects, than a soft space should be+  -- an empty document, otherwise it should be a space character.+  --+  -- If the two documents do not fit on the same line, a linebreak is used+  -- instead of the soft space.+  (<.>) = lift2 (P.</>)++  -- Concatenates two documents horizontally and puts a space between them.+  --+  -- If the two documents do not fit on the same line, a linebreak is used+  -- instead of the soft space.+  (<+>) = lift2 (P.</>)++  -- Concatenates two documents vertically.+  (<$>) = lift2 (P.<$>)++  -- Concatenates a list of documents either horizontally, if it fits on the+  -- page, or vertically otherwise.+  -- When concatenating the documents horizontally, a soft space is inserted+  -- between each document.+  catSoft = liftL P.sep++  -- Creates a document where all lines start at least from the current+  -- column.+  align = lift1 P.align++  -- Indents the document. The amount of indentation is left to the+  -- implementation.+  indent = lift1 (P.indent 2)+++++  -- Puts '(' and ')' around the document.+  parens = lift1 P.parens++  -- Puts '[' and ']' around the document.+  brackets = lift1 P.brackets++  -- Puts '{' and '}' around the document.+  braces = lift1 P.braces++  -- Writes an instantiation of a document by another document.+  instant d1 d2 = d1 <> (text "_") <> braces d2+++++  -- The comma @,@.+  docComma = text ","++  -- The dot @.@ as used to terminate quantifications.+  docDot = text "."++  -- The colon @:@ used as data constructor for lists or as double colon in+  -- type notations.+  docColon = text ":"++  -- The arrow @->@.+  docArrow = text "->"++  -- The universal quantifier.+  docForall = text "forall"++  -- The universal quantifier in the FixModel.+  docForallFix = text "forall-fix"++  -- The equals sign @=@.+  docEqual = text "="++  -- The is-element-of sign.+  docIn = text "in"++  -- The conjunction sign.+  docConjunction = text "/\\"++  -- The implication sign.+  docImplication = text "==>"++  -- The union sign used when building the union of two sets.+  docUnion = text "u"++  -- The bottom @_|_@.+  docBottom = text "_|_"++  -- The bar @|@ used to separate elements from their restrictions in sets.+  docBar = text "|"++  -- The mathematical symbol for the set of closed types.+  docTypes = text "TYPES"++  -- The mathematical symbol for the set of relations over closed types.+  docRel = text "REL"++  -- The identity relation @id@.+  docId = text "id"++  -- The lift relation @lift@.+  docLift = text "lift"++  -- The pointed lift relation.+  docLiftPointed = text "lift-pointed"++  -- The text \"strict\".+  docStrict = text "strict"++  -- The text \"strict and continuous\".+  docStrictAndContinuous = fillSep [text "strict", text "and",+                                    text "continuous"]+++++  -- Creates a document from a basic type.+  docBasicType b = text (show b)++  -- Creates a document from a type constructor.+  docTypeConstructor = text++  -- Creates a document from a data constructor.+  docDataConstructor = text++  -- Creates a document from a type variable.+  docTypeVariable = text++  -- Creates a document from a type term variable.+  docTypeTermVariable (T i) = text "T" <> docInt i++  -- Creates a document from a term variable.+  docTermVariable (PV tv)   = text tv+  docTermVariable (TV tv i) = text tv <> docInt i++  -- Creates a document from a relation variable.+  docRelationVariable (R i _ _)  = text "R" <> docInt i++  -- Creates a document from an integer value.+  docInt i = text (show i)++
+ scripts/FT/FreeTheorems/PrettyPrint/Common.hs view
@@ -0,0 +1,395 @@+-- Copyright 2006, Sascha Boehme.+++++-- | This module gives common pretty-printing functions shared by various output+--   formats. It is heavily based 'Document' to let the output look uniformly+--   for different output formats and pretty printers.++module FreeTheorems.PrettyPrint.Common (+    docNamedType,+    docType,+    docTheorem,+    docUnfoldedRelation+) where++++import FreeTheorems.Types+import FreeTheorems.PrettyPrint.Document+import Control.Monad (liftM)+import Data.Maybe (maybeToList)++++++-- | Creates a document from a named type.++docNamedType :: Document a => NamedType -> a+docNamedType (NamedType tv t) =+  docTermVariable tv <+> docColon <> docColon <+> align (docType False t)++++-- | Creates a document from a type. The second parareter is used to switch+--   between a compact notation ('True') and a better readable notation+--   ('False').++docType :: Document a => Bool -> Type -> a+docType = docTypeP id++++-- | Creates a document from a type. This is just a helper function for+--   'docTypeP'.+--+--   The first argument should either be 'id' or 'parens'. It is+--   used to put parentheses around certain parts of types depending on their+--   position. It effects only functions and type abstractions.+--+--   The second argument is used to switch between a compact notation ('True')+--   and a better readable notation ('False'). If turned off with False, it+--   breaks long functions into several lines.++docTypeP :: Document a => (a -> a) -> Bool -> Type -> a+docTypeP useParens compact t =+  case t of+    TypeBasic b    -> docBasicType b++    TypeVar v      -> docTypeVariable v++    TypeTermVar tv -> docTypeTermVariable tv++    TypeCon c ts   -> let docts = map (docTypeP parens compact) ts+                          doc   = fillSep (docTypeConstructor c : docts)+                      in  if ts == []+                            then doc+                            else parens doc++    TypeList t'    -> brackets (docTypeP id compact t')++    TypeUnit       -> parens empty++    TypeTuple ts   -> tupled (map (docTypeP id compact) ts)++    TypeFun t1 t2  -> let ts = collectFun t2+                          t2d = (\t -> docArrow <.> docTypeP parens compact t)+                          docts = map t2d ts+                          docts' = (docTypeP parens compact t1) : docts+                      in  if compact+                            then useParens (fillSoft docts')+                            else useParens (catSoft docts')++    TypeForall _ _ -> let (vs,t') = collectForall t+                          docvs = fillSoft (map docTypeVariable vs)+                          doct' = docTypeP id compact t'+                          doc   = docForall <.> docvs <> docDot <.> align doct'+                      in  useParens doc++  where+    -- Collects all types being part of a function.+    collectFun t =+      case t of+        TypeFun t1 t2 -> t1 : (collectFun t2)+        otherwise     -> [t]++    -- Collects variables of consecutive type abstractions.+    collectForall t =+      case t of+        TypeForall v t1 -> (v:vs, t2) where (vs,t2) = (collectForall t1)+        otherwise       -> ([], t)++++--------------------------------------------------------------------------------++++-- | Creates a document from a theorem.+--   To make theorems better readable, every quantification indents its+--   subtheorem a bit. Otherwise, the parts of a theorem are written on a line,+--   possibly continuing in the next line.++docTheorem :: Document a => Theorem -> a+++docTheorem (IsElementOf (t1,t2) rel) =+  let doct1  = docTerm t1+      doct2  = docTerm t2+  in  case rel of+        RelTerm (TermVar (PV "id")) _ -> fillSoft [doct1, docEqual, doct2]++        RelTerm (TermIns (TermVar (PV "id")) _) _ -> fillSoft [doct1, docEqual,+                                                               doct2]++        RelTerm t _ -> fillSoft [docTerm (TermApp t t1), docEqual, doct2]++        otherwise -> let docrel = case rel of+                                    RelForall _ _ _ -> parens $ docRelation rel+                                    RelFun _ _ _    -> parens $ docRelation rel+                                    otherwise       -> docRelation rel+                     in  fillSoft [tupled [doct1, doct2], docIn, docrel]+++docTheorem (ForallPairs (tv1,tv2) rel theorem) =+  let doctv1 = docTermVariable tv1+      doctv2 = docTermVariable tv2+      docrel = docRelation rel+  in  fillSoft [docForall, tupled [doctv1, doctv2], docIn, docrel <> docDot]+      <$> indent (docTheorem theorem)+++docTheorem (ForallRelations rv res theorem) =+  let R _ _ (ttv1, ttv2) = rv+      docttvs = docTypeTermVariable ttv1 <> docComma <> docTypeTermVariable ttv2+      docrv   = docRelationVariable rv+      docres  = case res of+                  []        -> docDot+                  otherwise -> let drs = map docRestriction res+                                   i = map (\dr -> dr <> docComma) (init drs)+                                   l = last drs <> docDot+                               in  fillSep ([docComma] ++ i ++ [l])+  in  fillSoft [docForall, docttvs, docIn, docTypes <> docDot,+                docForall, docrv, docIn, docRel <> parens docttvs <> docres]+      <$> indent (docTheorem theorem)+++docTheorem (ForallFunctions f (ttv1, ttv2) res theorem) =+  let docttvs = docTypeTermVariable ttv1 <> docComma <> docTypeTermVariable ttv2+      doct    = docType True (TypeFun (TypeTermVar ttv1) (TypeTermVar ttv2))+      docf    = docTermVariable f+      docres  = case res of+                  []        -> docDot+                  otherwise -> let drs = map docRestriction res+                                   i = map (\dr -> dr <> docComma) (init drs)+                                   l = last drs <> docDot+                               in  fillSep ([docComma] ++ i ++ [l])+  in  fillSoft [docForall, docttvs, docIn, docTypes <> docDot,+                docForall, docf, docColon <> docColon, doct <> docres]+      <$> indent (docTheorem theorem)+++docTheorem (ForallElements tv t theorem) =+  let doctv   = docTermVariable tv+      doct    = case t of+                  TypeForall _ _ -> parens (docType True t)+                  otherwise      -> docType True t+  in  fillSoft [docForall, doctv, docColon <> docColon, doct <> docDot]+      <$> indent (docTheorem theorem)+++docTheorem (Conjunction theorem1 theorem2) =+  let collect t = case t of+                    Conjunction t1 t2 -> t1 : collect t2+                    otherwise         -> [t]+      docts = map (\t -> align $ docTheorem t) (collect theorem2)+  in  foldl (<$>) (parens $ align $ docTheorem theorem1)+                  (map (\d -> docConjunction <+> parens d) docts)+++docTheorem (Implication theorem1 theorem2) =+  (parens $ align $ docTheorem theorem1)+  <$> (docImplication <+> (align $ docTheorem theorem2))++++++-- | Creates a document from a term.++docTerm :: Document a => Term -> a+docTerm term =+  case term of+    TermVar tv    -> docTermVariable tv++    TermApp t1 t2 -> case t2 of+                       TermApp _ _ -> fillSep [docTerm t1, parens (docTerm t2)]+                       otherwise   -> fillSep [docTerm t1, docTerm t2]++    TermIns t ty  -> let docty = docType True ty+                     in  case t of+                           TermApp _ _ -> instant (parens (docTerm t)) docty+                           otherwise   -> instant (docTerm t) docty++++++-- | Creates a document from a restriction.++docRestriction :: Document a => Restriction -> a+docRestriction res =+  case res of+    IsStrict tv              -> fillSep [docTermVariable tv, docStrict]+    IsStrictAndContinuous rv -> fillSep [docRelationVariable rv,+                                         docStrictAndContinuous]++++++-- | Creates a document from a relation.++docRelation :: Document a => Relation -> a+docRelation rel =+  case rel of+    RelTerm t _             -> docTerm t++    RelVar rv               -> docRelationVariable rv++    RelLift model con rels  -> let doccon = docTypeConstructor con+                               in  docLiftRelation model doccon rels++    RelLiftList model rel'  -> docLiftRelation model (brackets empty) [rel']++    RelLiftTuple model rels -> let doccon = parens (docInt (length rels))+                               in  docLiftRelation model doccon rels++    RelFun model rel1 rel2  -> fillSoft [docRelation rel1,+                                         docArrow,+                                         docRelation rel2]++    RelForall model rv rel' -> let quant = case model of+                                             BasicModel -> docForall+                                             FixModel   -> docForallFix+                               in  fillSoft [quant,+                                             docRelationVariable rv <> docDot,+                                             docRelation rel']++++-- | Creates a document from a lift relation.++docLiftRelation :: Document a => LanguageModel -> a -> [Relation] -> a+docLiftRelation model doccon rels =+  let doclift = case model of+                  BasicModel -> docLift+                  FixModel   -> docLiftPointed+      docrels =  map docRelation rels+  in  (instant doclift doccon) <> (tupled docrels)++++--------------------------------------------------------------------------------++++-- | Creates a document from an unfolded relation.++docUnfoldedRelation :: Document a => UnfoldedRelation -> a+docUnfoldedRelation (UnfoldedRelation rel model unfolded) =+  let docsets = case unfolded of+                  UnfoldedLift cs        -> docUnfoldedLift model cs+                  UnfoldedLiftList vs t  -> docUnfoldedListLift model vs t+                  UnfoldedLiftTuple vs t -> docUnfoldedTupleLift model vs t+                  UnfoldedFunction vs t  -> [docUnfoldedFunction model vs t]+                  UnfoldedForall vs t    -> [docUnfoldedForall model vs t]+      docrel = docRelation rel+      h = docEqual <+> head docsets+      t = map (\d -> docUnion <+> d) (tail docsets)+  in  foldr1 (<$>) (docrel : h : t)++++-- | Creates a document from a tuple and a corresponding theorem.++docUnfoldedSet :: Document a => (a, a) -> Maybe a -> a+docUnfoldedSet (x, y) maybeTheorem =+  case maybeTheorem of+    Nothing      -> braces (tupled [x, y])+    Just theorem -> braces ((tupled [x, y]) <+> docBar <+> align theorem)++++-- | Creates a document showing a set containing only a pair of bottoms.++docBottomSet :: Document a => LanguageModel -> Maybe a+docBottomSet model =+  case model of+    BasicModel -> Nothing+    FixModel   -> Just (docUnfoldedSet (docBottom, docBottom) Nothing)++++-- | Creates a document for an unfolded lifted relation.++docUnfoldedLift :: Document a => LanguageModel+                                   -> [( DataConstructor+                                       , [TermVariable], [TermVariable]+                                       , Maybe Theorem)]+                                   -> [a]++docUnfoldedLift model list =+  maybeToList (docBottomSet model) ++ map makeSet list+  where+    makeSet (con, xs, ys, maybeTheorem) =+      let doccon = docDataConstructor con+          docxs = doccon <+> fillSep (map docTermVariable xs)+          docys = doccon <+> fillSep (map docTermVariable ys)+          doctheorem = liftM docTheorem maybeTheorem+      in  docUnfoldedSet (docxs, docys) doctheorem++++-- | Creates a document for an unfolded lifted list relation.++docUnfoldedListLift :: Document a => LanguageModel+                                     -> ( (TermVariable, TermVariable)+                                        , (TermVariable, TermVariable))+                                     -> Theorem+                                     -> [a]++docUnfoldedListLift model ((x,xs),(y,ys)) theorem =+  let docx  = docTermVariable x+      docy  = docTermVariable y+      docxs = docTermVariable xs+      docys = docTermVariable ys+      doctuple   = (docx <.> docColon <.> docxs, docy <.> docColon <.> docys)+      docempty   = docUnfoldedSet (brackets empty, brackets empty) Nothing+      doctheorem = Just $ docTheorem theorem+  in  maybeToList (docBottomSet model)+      ++ [docempty] ++ [docUnfoldedSet doctuple doctheorem]++++-- | Creates a document for an unfolded lifted tuple relation.++docUnfoldedTupleLift :: Document a => LanguageModel+                                      -> ([TermVariable], [TermVariable])+                                      -> Theorem+                                      -> [a]++docUnfoldedTupleLift model (xs, ys) theorem =+  let docxs    = tupled (map docTermVariable xs)+      docys    = tupled (map docTermVariable ys)+      doctuple = (docxs, docys)+      doctheorem = Just $ docTheorem theorem+  in  maybeToList (docBottomSet model) ++ [docUnfoldedSet doctuple doctheorem]++++-- | Creates a document for an unfolded functional relation.++docUnfoldedFunction :: Document a => LanguageModel+                                     -> (TermVariable, TermVariable)+                                     -> Theorem+                                     -> a++docUnfoldedFunction model (f,g) theorem =+  docUnfoldedSet (docTermVariable f, docTermVariable g)+                 (Just $ docTheorem theorem)++++-- | Creates a document for an unfolded relational abstraction.++docUnfoldedForall :: Document a => LanguageModel+                                   -> (TermVariable, TermVariable)+                                   -> Theorem+                                   -> a++docUnfoldedForall model (x,y) theorem =+  docUnfoldedSet (docTermVariable x, docTermVariable y)+                 (Just $ docTheorem theorem)
+ scripts/FT/FreeTheorems/PrettyPrint/Document.hs view
@@ -0,0 +1,212 @@+-- Copyright 2006, Sascha Boehme.+++++-- | This module contains a class used as an abstraction of various+--   pretty-printing libraries. It is used as a foundation to pretty-print+--   types, relations and theorems in any format.++module FreeTheorems.PrettyPrint.Document where++++import FreeTheorems.Types++++-- | An abstract document for a certain type.+--   Every document type has to implement the member functions which are used as+--   combinators to pretty-print types and theorems.++class Document a where+  -- | The empty document.+  empty :: a++  -- | Concatenates two documents horizontally without putting space between+  --   them.+  (<>) :: a -> a -> a++  -- | Concatenates two documents horizontally and puts a soft space between+  --   them. A soft space may differ from the underlying document structure. If+  --   it puts spaces automatically between objects, than a soft space should be+  --   an empty document, otherwise it should be a space character.+  --+  --   If the two documents do not fit on the same line, a linebreak is used+  --   instead of the soft space.+  (<.>) :: a -> a -> a++  -- | Concatenates two documents horizontally and puts a space between them.+  --+  --   If the two documents do not fit on the same line, a linebreak is used+  --   instead of the space.+  (<+>) :: a -> a -> a++  -- | Concatenates two documents vertically.+  (<$>) :: a -> a -> a+++  infixr 6 <>, <.>, <+>+  infixr 5 <$>++  -- | Concatenates a list of documents and uses soft spaces to separate the+  --   documents.+  --+  --   If the concatenated document exceeds the line length, a line break is+  --   inserted at the correct position instead of a soft space.+  --+  --   An implementation is already provided.+  fillSoft :: [a] -> a+  fillSoft ds =+    case ds of+      []        -> empty+      [d]       -> d+      otherwise -> foldr1 (<.>) ds++  -- | Concatenates a list of documents with a soft space between every+  --   document.+  --+  --   If the concatenated document exceeds the line length, a line break is+  --   inserted at the correct position instead of a space.+  --+  --   An implementation is already provided.+  fillSep :: [a] -> a+  fillSep ds =+    case ds of+      []        -> empty+      [d]       -> d+      otherwise -> foldr1 (<+>) ds++  -- | Concatenates a list of documents either horizontally, if it fits on the+  --   page, or vertically otherwise.+  --   When concatenating the documents horizontally, a soft space is inserted+  --   between each document.+  catSoft :: [a] -> a++  -- | Creates a document where all lines start at least from the current+  --   column.+  align :: a -> a++  -- | Indents the document. The amount of indentation is left to the+  --   implementation.+  indent :: a -> a++++++  -- | Puts '(' and ')' around the document.+  parens :: a -> a++  -- | Puts '[' and ']' around the document.+  brackets :: a -> a++  -- | Puts '{' and '}' around the document.+  braces :: a -> a++  -- | Writes the list of documents as a tuple (d1,d2,...,dn).+  --+  --   An implementation is already provided.+  tupled :: [a] -> a+  tupled ds = let i = map (\d -> d <> docComma) (init ds)+              in  parens (fillSoft (i ++ [last ds]))++  -- | Writes an instantiation of a document by another document.+  instant :: a -> a -> a++++++  -- | The comma @,@.+  docComma :: a++  -- | The dot @.@ as used to terminate quantifications.+  docDot :: a++  -- | The colon @:@ used as data constructor for lists or as double colon in+  --   type notations.+  docColon :: a++  -- | The arrow @->@.+  docArrow :: a++  -- | The universal quantifier.+  docForall :: a++  -- | The universal quantifier in the FixModel.+  docForallFix :: a++  -- | The equals sign @=@.+  docEqual :: a++  -- | The is-element-of sign.+  docIn :: a++  -- | The conjunction sign.+  docConjunction :: a++  -- | The implication sign.+  docImplication :: a++  -- | The union sign used when building the union of two sets.+  docUnion :: a++  -- | The bottom @_|_@.+  docBottom :: a++  -- | The bar @|@ used to separate elements from their restrictions in sets.+  docBar :: a++  -- | The mathematical symbol for the set of closed types.+  docTypes :: a++  -- | The mathematical symbol for the set of relations over closed types.+  docRel :: a++  -- | The identity relation @id@.+  docId :: a++  -- | The lift relation @lift@.+  docLift :: a++  -- | The pointed lift relation.+  docLiftPointed :: a++  -- | The text \"strict\".+  docStrict :: a++  -- | The text \"strict and continuous\".+  docStrictAndContinuous :: a++++++  -- | Creates a document from a basic type.+  docBasicType :: BasicType -> a++  -- | Creates a document from a type constructor.+  docTypeConstructor :: TypeConstructor -> a++  -- | Creates a document from a data constructor.+  docDataConstructor :: TypeConstructor -> a++  -- | Creates a document from a type variable.+  docTypeVariable :: TypeVariable -> a++  -- | Creates a document from a type term variable.+  docTypeTermVariable :: TypeTermVariable -> a++  -- | Creates a document from a term variable.+  docTermVariable :: TermVariable -> a++  -- | Creates a document from a relation variable.+  docRelationVariable :: RelationVariable -> a++  -- | Creates a document from an integer value.+  docInt :: Int -> a++++
+ scripts/FT/FreeTheorems/Reduction.hs view
@@ -0,0 +1,141 @@+-- Copyright 2006, Sascha Boehme.+++++-- | This module contains a function to reduce automatically generated+--   relations.++module FreeTheorems.Reduction (+    reduceRelation,++    -- testing interface+    -- testReduction+) where++++import FreeTheorems.Types++-- import FreeTheorems.Test.ArbitraryTypes+-- import Test.QuickCheck (quickCheck)++++-- | Simplifies relations by replacing lifted relations by identity relations+--   if possible. A lifted relation can be reduced to an identity relation, if+--   all relations it is based on are identity relations. The same is true for+--   functional relations.++reduceRelation :: Relation -> Relation+reduceRelation rel = either id toIdentityRelation $ reduceToId rel++++-- | Reduces relations to identity relations. This is a helper function for+--   'reduceRelation'.+--+--   If a lifted relation is only based on identity relations, it can be+--   replaced by a identity relation itself. The same is true for functional+--   relations.+--+--   This functions walks other a given relation and decides on this mechanism+--   if a lifted function should be reduced. It returns @Right t@ if the+--   relation @r@ was reduced to an identity over type @t@. Otherwise,+--   @Left r'@ is returned, where @r'@ is the relation @r@ with possible changes+--   in its subrelations.++reduceToId :: Relation -> Either Relation Type+reduceToId rel =+  case rel of+    RelTerm term typepair   -> processTerm term typepair+    RelVar rv               -> Left rel+    RelLift model con rels  -> either (Left . RelLift model con)+                                      (Right . TypeCon con)+                                      (foldReduceToId rels)++    RelLiftList model rel'  -> either (Left . RelLiftList model)+                                      (Right . TypeList)+                                      (reduceToId rel')++    RelLiftTuple model rels -> either (Left . RelLiftTuple model)+                                      (Right . TypeTuple)+                                      (foldReduceToId rels)++    RelFun model rel1 rel2  -> either (\[r1,r2] -> Left $ RelFun model r1 r2)+                                      (\[t1,t2] -> Right $ TypeFun t1 t2)+                                      (foldReduceToId [rel1, rel2])++    RelForall model rv rel' -> either (Left . RelForall model rv)+                                      (Left . RelForall model rv+                                       . toIdentityRelation)+                                      (reduceToId rel')++  where+    processTerm term typepair =+      case term of+        TermIns (TermVar (PV "id")) ty -> Right ty+        otherwise                      -> Left (RelTerm term typepair)++    foldReduceToId = foldr (\r x -> combine (reduceToId r) x) (Right [])++    combine (Left x) (Left es)   = Left (x : es)+    combine (Left x) (Right es)  = Left (x : (map toIdentityRelation es))+    combine (Right x) (Left es)  = Left ((toIdentityRelation x) : es)+    combine (Right x) (Right es) = Right (x : es)++++-- | Returns the identity relation for a given type.++toIdentityRelation :: Type -> Relation+toIdentityRelation t = RelTerm (TermIns (TermVar (PV "id")) t) (t,t)++++--------------------------------------------------------------------------------++++-- A list of tests for this module.++{-+testReduction = do+  putStr "reduction of relation works ... "+  quickCheck prop_reduceRelation++++-- Check that 'simplifyRelationsToId' doesn't change anything when applied+-- twice and that it preserves the structure.++prop_reduceRelation rel =+  (reduceRelation (reduceRelation rel) == reduceRelation rel)+  && compareRelAndRel ((reduceRelation rel), rel)++compareRelAndRel pair =+  case pair of+    (RelTerm t1 _, RelTerm t2 _) -> t1 == t2+    (RelTerm t1 _, _)            -> True++    (RelVar rv1, RelVar rv2) -> rv1 == rv2++    (RelLift m1 c1 rels1, RelLift m2 c2 rels2) ->+        (m1 == m2) && (c1 == c2) && and (map compareRelAndRel $ zip rels1 rels2)++    (RelLiftList m1 rel1, RelLiftList m2 rel2) ->+        (m1 == m2) && compareRelAndRel (rel1, rel2)++    (RelLiftTuple m1 rels1, RelLiftTuple m2 rels2) ->+        (m1 == m2) && and (map compareRelAndRel $ zip rels1 rels2)++    (RelFun m1 rel1 rel1', RelFun m2 rel2 rel2') ->+        (m1 == m2) && compareRelAndRel (rel1, rel2)+                   && compareRelAndRel (rel1', rel2')++    (RelForall m1 rv1 rel1, RelForall m2 rv2 rel2) ->+        (m1 == m2) && (rv1 == rv2) && compareRelAndRel (rel1, rel2)++    otherwise -> False++-}
+ scripts/FT/FreeTheorems/Simplification.hs view
@@ -0,0 +1,96 @@+-- Copyright 2006, Sascha Boehme.+++++-- | This module defines a function to simplify theorems by trivial+--   transformations.++module FreeTheorems.Simplification (+    simplifyTheorem+) where++++import FreeTheorems.Types++++-- | Simplifies a theorem. It essentially replaces parts like+--+-- >   forall x :: T1.+-- >     forall y :: T2.+-- >       (f x = y)+-- >       ==> theorem+--+--   by+--+-- >   forall x :: T1.+-- >     theorem'+--+--   where @f@ is any function and @theorem'@ is obtained from @theorem@ by+--   replacing each occurrence of @y1@ by @f x1@.++simplifyTheorem :: Theorem -> Theorem+simplifyTheorem theorem =+  case theorem of+    IsElementOf _ _            -> theorem+    ForallPairs p r t          -> ForallPairs p r (simplifyTheorem t)+    ForallRelations rv res t   -> ForallRelations rv res (simplifyTheorem t)+    ForallFunctions f ts res t -> ForallFunctions f ts res (simplifyTheorem t)+    ForallElements x ty t      -> ForallElements x ty (tryToSimplify t)+    Conjunction t1 t2          -> Conjunction (simplifyTheorem t1)+                                              (simplifyTheorem t2)+    Implication t1 t2          -> Implication (simplifyTheorem t1)+                                              (simplifyTheorem t2)++++-- | Tries to apply the simplification on the given theorem. This is a helper+--   function for 'simplifyTheorem'.++tryToSimplify :: Theorem -> Theorem+tryToSimplify theorem =+  case theorem of+    ForallElements y _ (Implication (IsElementOf (t1, TermVar tv)+                                                 (RelTerm term _)) t) ->+        if y == tv+          then let term' = case term of+                             TermIns (TermVar (PV "id")) _ -> t1+                             otherwise                     -> TermApp term t1+               in  simplifyTheorem (replaceInTheorem tv term' t)+          else simplifyTheorem theorem+    otherwise -> simplifyTheorem theorem++++-- | Replaces every occurrence of a term variable in the given theorem by a+--   term.++replaceInTheorem :: TermVariable -> Term -> Theorem -> Theorem+replaceInTheorem tv term theorem =+  case theorem of+    IsElementOf (t1, t2) rel -> IsElementOf ((replaceInTerm tv term t1)+                                            ,(replaceInTerm tv term t2)) rel+    ForallPairs p r t        -> ForallPairs p r (replaceInTheorem tv term t)+    ForallRelations rv res t -> ForallRelations rv res+                                                (replaceInTheorem tv term t)+    ForallFunctions f ts res t -> ForallFunctions f ts res+                                                (replaceInTheorem tv term t)+    ForallElements x ty t    -> ForallElements x ty (replaceInTheorem tv term t)+    Conjunction t1 t2        -> Conjunction (replaceInTheorem tv term t1)+                                            (replaceInTheorem tv term t2)+    Implication t1 t2        -> Implication (replaceInTheorem tv term t1)+                                            (replaceInTheorem tv term t2)++++-- | Replaces every occurrence of a term variable in the given term by a term.++replaceInTerm :: TermVariable -> Term -> Term -> Term+replaceInTerm tv term t =+  case t of+    TermVar tv'   -> if tv' == tv then term else TermVar tv'+    TermApp t1 t2 -> TermApp (replaceInTerm tv term t1)+                             (replaceInTerm tv term t2)+    TermIns t' ty -> TermIns (replaceInTerm tv term t') ty
+ scripts/FT/FreeTheorems/Specialization.hs view
@@ -0,0 +1,180 @@+-- Copyright 2006, Sascha Boehme.+++++-- | This module defines function which are used in specializing relations to+--   functions.++module FreeTheorems.Specialization (+    extractRelationVariables,+    replaceRelationVariable+) where++++import FreeTheorems.Simplification+import FreeTheorems.TheoremData+import FreeTheorems.Types+import FreeTheorems.Unfolding+import Control.Monad (liftM)++++-- | Returns all relation variables of a theorem which can be specialized to a+--   function.+--   Relation variables being quantified on the left-hand side of an implication+--   can not be specialized. However, relation variables being quantified like+--+-- >   ((forall R. theorem) ==> theorem1) ==> theorem2+--+--   can be specialized. Thus, the position relative to implications decides+--   whether a relation variable is returned by this function.++extractRelationVariables :: Theorem -> [RelationVariable]+extractRelationVariables theorem = extractRelVars True theorem++++-- | Returns all relation variables of a theorem which can be specialized to a+--   function. This is a helper function for 'extractRelationVariables' and uses+--   its first argument to decide if a relation variable can be specialized to a+--   function.++extractRelVars :: Bool -> Theorem -> [RelationVariable]+extractRelVars takeRVs theorem =+  case theorem of+    IsElementOf _ _         -> []+    ForallPairs _ _ t       -> extractRelVars takeRVs t+    ForallRelations rv _ t  -> if takeRVs+                                 then rv : (extractRelVars takeRVs t)+                                 else extractRelVars takeRVs t+    ForallFunctions _ _ _ t -> extractRelVars takeRVs t+    ForallElements _ _ t    -> extractRelVars takeRVs t+    Conjunction t1 t2       -> extractRelVars takeRVs t1+                               ++ extractRelVars takeRVs t2+    Implication t1 t2       -> extractRelVars (not takeRVs) t1+                               ++ extractRelVars takeRVs t2++++--------------------------------------------------------------------------------++++-- | Replaces a relation variable found by 'extractRelationVariables' in the+--   given theorem. A new function symbol is created to replace the relation+--   variable. The returned theorem is simplified by 'simplifyTheorem'.++replaceRelationVariable :: Theorem -> RelationVariable -> TheoremState Theorem+replaceRelationVariable theorem rv = do+  f <- newRelationAsFunctionVariable+  return $ simplifyTheorem (replaceRelVar rv f theorem)++++-- | Replaces every occurrence of a relation variable by the given term+--   variable. This is a helper function for 'replaceRelationVariable'.++replaceRelVar :: RelationVariable -> TermVariable -> Theorem -> Theorem+replaceRelVar rv f theorem =+  case theorem of+    IsElementOf p r       -> IsElementOf p (replaceInRel rv f [] r)++    ForallPairs p r t     -> let r' = replaceInRel rv f [] r+                                 t' = replaceRelVar rv f t+                             in  adjustForallPairs p r' t'++    ForallRelations rv' res t -> let t'   = replaceRelVar rv f t+                                     res' = map (updateRestriction f) res+                                     R _ _ types = rv+                                 in  if rv == rv'+                                       then ForallFunctions f types res' t'+                                       else ForallRelations rv'     res  t'++    ForallFunctions f' types res t -> ForallFunctions f' types res+                                                      (replaceRelVar rv f t)++    ForallElements x ty t -> ForallElements x ty (replaceRelVar rv f t)++    Conjunction t1 t2     -> Conjunction (replaceRelVar rv f t1)+                                         (replaceRelVar rv f t2)++    Implication t1 t2     -> Implication (replaceRelVar rv f t1)+                                         (replaceRelVar rv f t2)++++-- | Takes a restriction for a relation variable and transforms it into a+--   restriction for the given term variable.++updateRestriction :: TermVariable -> Restriction -> Restriction+updateRestriction f res =+  case res of+    IsStrictAndContinuous _ -> IsStrict f+    otherwise               -> res++++-- | Replaces every occurrence of the given relation variable by the given term+--   variable in a relation.+--   The third argument gives a list of relation variables bound in the current+--   environment.++replaceInRel :: RelationVariable+                -> TermVariable+                -> [RelationVariable]+                -> Relation+                -> Relation++replaceInRel rv f rvs rel =+  case rel of+    RelTerm _ _          -> rel+    RelVar rv'           -> if (rv' `elem` rvs) || (rv' /= rv)+                              then RelVar rv'+                              else let R _ _ (ttv1, ttv2) = rv+                                       types = ( TypeTermVar ttv1+                                               , TypeTermVar ttv2)+                                   in  RelTerm (TermVar f) types+    RelLift m c rels     -> RelLift m c (map (replaceInRel rv f rvs) rels)+    RelLiftList m rel'   -> adjustLiftList m (replaceInRel rv f rvs rel')+    RelLiftTuple m rels  -> RelLiftTuple m (map (replaceInRel rv f rvs) rels)+    RelFun m rel1 rel2   -> RelFun m (replaceInRel rv f rvs rel1)+                                     (replaceInRel rv f rvs rel2)+    RelForall m rv' rel' -> RelForall m rv' (replaceInRel rv f (rv':rvs) rel')++++-- | Creates a proper notation of a lifted list relation. If the argument+--   relation is a function, the list relation is replaced by @map@.++adjustLiftList :: LanguageModel -> Relation -> Relation+adjustLiftList model rel =+  case rel of+    RelTerm t (ty1, ty2) -> let tmap  = TermVar (PV "map")+                                tmap' = (TermIns (TermIns tmap ty1) ty2)+                            in  RelTerm (TermApp tmap' t)+                                        (TypeList ty1, TypeList ty2)+    otherwise            -> RelLiftList model rel++++-- | Creates a proper notation for abstractions over term variables. If the+--   corresponding relation is a function, then the term variables abstraction+--   uses a different notation.++adjustForallPairs :: (TermVariable, TermVariable)+                     -> Relation+                     -> Theorem+                     -> Theorem++adjustForallPairs (tv1, tv2) rel theorem =+  case rel of+    RelTerm _ _ -> let (ty1, ty2)  = getTypesOf rel+                   in  ForallElements tv1 ty1+                       $ ForallElements tv2 ty2+                       $ Implication+                           (IsElementOf (TermVar tv1, TermVar tv2) rel)+                           theorem+    otherwise   -> ForallPairs (tv1, tv2) rel theorem+
+ scripts/FT/FreeTheorems/TheoremData.hs view
@@ -0,0 +1,200 @@+-- Copyright 2006, Sascha Boehme.+++++-- | This module provides a state object used in various stages of the theorem+--   generation process. It serves to create unique indices.++module FreeTheorems.TheoremData (+    TheoremData,+    TheoremState,+    newTheoremData,+    execute,+    executeWith,+    newRelationVariable,+    newVariablesFor,+    newRelationAsFunctionVariable+) where++++import FreeTheorems.Declarations (isDefined)+import FreeTheorems.Types+import Control.Monad (liftM2)+import Control.Monad.State (State, get, modify, runState)++++-- | A type synonym for the state used when modifying 'TheoremData'.++type TheoremState a = State TheoremData a++++-- | Stores information used to create unique indices. It is used while+--   generating theorems for types.++data TheoremData = TheoremData {+                    forbiddenVariable :: TermVariable,+                        -- ^ The name of the type, from which the theorem is+                        --   generated. Used to avoid name clashes.++                    nextRelVarIndex :: Int,+                        -- ^ The next index when creating a new relation+                        --   variable.++                    nextTypeTermVarIndex :: Int,+                        -- ^ The next index when creating a new type term+                        --   variable.++                    nextTermVarIndex  :: Int,+                        -- ^ Next index when creating a new term variable.++                    nextFunVarIndex   :: Int,+                        -- ^ Next index when creating a new term variable+                        --   representing a function.++                    nextRelFunVarIndex   :: Int+                        -- ^ Next index when creating a new term variable+                        --   representing a function specialized from a+                        --   relation.+                  }++++-- | Creates new theorem data based on the name of the type from which the+--   theorem is generated and the relation variable mapping of 'applyDelta'.++newTheoremData :: TermVariable -> TheoremData+newTheoremData tv = TheoremData {+                      forbiddenVariable = tv,+                      nextRelVarIndex = 1,+                      nextTypeTermVarIndex = 1,+                      nextTermVarIndex = 1,+                      nextFunVarIndex = 1,+                      nextRelFunVarIndex = 1+                    }++++-- | Executes a 'TheoremState' action and returns the result of it along with+--   the last data. The latter may be used to execute consecutive actions.++execute :: TermVariable -> TheoremState a -> (a, TheoremData)+execute tv action = executeWith (newTheoremData tv) action+++-- | Executes a 'TheoremState' action using previously generated data. Returns+--   the action's result and updated data.++executeWith :: TheoremData -> TheoremState a -> (a, TheoremData)+executeWith tdata action = runState action tdata++++-- | Creates a new relation variable.++newRelationVariable :: TypeVariable -> TheoremState RelationVariable+newRelationVariable v = do+  ttv1 <- newTypeTermVariable+  ttv2 <- newTypeTermVariable++  tdata <- get+  let index  = nextRelVarIndex tdata+  let rv = R index v (ttv1, ttv2)+  modify (\tdata -> tdata { nextRelVarIndex = index + 1 })+  return rv++++-- | Creates a new type term variable.++newTypeTermVariable :: TheoremState TypeTermVariable+newTypeTermVariable = do+  tdata <- get+  let index = nextTypeTermVarIndex tdata+  modify (\tdata -> tdata { nextTypeTermVarIndex = index + 1 })++  -- check if the name of the new type term variable collides with an already+  -- existing type constructor name+  if isDefined ("T" ++ show index)+    then newTypeTermVariable+    else return (T index)++++-- Generates a term variable for a non-function term or generates a function+-- variable for a function, even if it is hidden by abstractions.++newVariablesFor :: Relation -> TheoremState (TermVariable, TermVariable)+newVariablesFor rel =+  case rel of+    RelFun _ _ _    -> newFunctionVariables+    RelForall _ _ r -> newVariablesFor r+    otherwise       -> newTermVariables++++-- | Creates a new pair of term variables (@x_i@ and @y_i@).+--   The created variables are checked against the name of the type from which+--   the theorem is generated to ensure that the variables are unique.++newTermVariables :: TheoremState (TermVariable, TermVariable)+newTermVariables = do+  tdata <- get+  let index = nextTermVarIndex tdata+  modify (\tdata -> tdata { nextTermVarIndex = index + 1 })+  let x = (TV "x" index)+  let y = (TV "y" index)+  areInUse <- liftM2 (||) (isAlreadyInUse x) (isAlreadyInUse y)+  if areInUse+    then newTermVariables+    else return (x, y)++++-- | Creates a new pair of function term variables (@f_i@ and @g_i@).+--   The created variables are checked against the name of the type from which+--   the theorem is generated to ensure that the variables are unique.++newFunctionVariables :: TheoremState (TermVariable, TermVariable)+newFunctionVariables = do+  tdata <- get+  let index = nextFunVarIndex tdata+  modify (\tdata -> tdata { nextFunVarIndex = index + 1 })+  let f = (TV "f" index)+  let g = (TV "g" index)+  areInUse <- liftM2 (&&) (isAlreadyInUse f) (isAlreadyInUse g)+  if areInUse+    then newFunctionVariables+    else return (f, g)++++-- | Creates a new function variable @h_i@ which is used to replace or+--   specialize a relation variable.+--   The created variable is checked against the name of the type from which+--   the theorem is generated to ensure that the variable is unique.++newRelationAsFunctionVariable :: TheoremState TermVariable+newRelationAsFunctionVariable = do+  tdata <- get+  let index = nextRelFunVarIndex tdata+  modify (\tdata -> tdata { nextRelFunVarIndex = index + 1 })+  let h = TV "h" index+  isInUse <- isAlreadyInUse h+  if isInUse+    then newRelationAsFunctionVariable+    else return h++++-- | Checks if a generated variable is unique. Returns 'True' if the same name+--   is already in use.++isAlreadyInUse :: TermVariable -> TheoremState Bool+isAlreadyInUse var = do+  tdata <- get+  return (var == forbiddenVariable tdata)+
+ scripts/FT/FreeTheorems/TypeParser.hs view
@@ -0,0 +1,502 @@+-- Copyright 2006, Sascha Boehme.+++++-- | This module defines a parser to create a 'NamedType' out of a string.+--   The parser itself is based on Parsec.++module FreeTheorems.TypeParser (+    parseNamedType,+    parseType,++    -- testing interface+--  testTypeParser+) where++++import FreeTheorems.Declarations+import FreeTheorems.Preparation+import FreeTheorems.PrettyPrint+import FreeTheorems.Types+import Data.Char (isLower, isUpper, isAlphaNum, isSpace, isDigit)+import Text.ParserCombinators.Parsec++-- import FreeTheorems.Test.ArbitraryTypes+-- import Test.QuickCheck (quickCheck)++++++-- | Parses a Haskell type string and creates a named type.+--+--   The content of the string argument has to be conforming to the following+--   EBNF syntax:+--+-- > NamedType ::= Name :: TypeTerm+--+--   where @Name@ is a token starting with a lower letter or @_@, and+--   consisting of alphanumeric letters and the characters @_@ and @'@ from the+--   second character onwards. A @Name@ starting with @_@ has to be at least two+--   characters long, because @_@ is a reserved identifier in Haskell.+--+--   Alternatively, a @Name@ can also be an operator which has to be enclosed in+--   parentheses. Allowed characters of operators are+--+-- > ! | # | $ | % | & | * | + | . | / | < | = | > | ? | @ | \ | ^ | | | - | ~+--+--   and the colon @:@ from the second although character onwards.+--   Note that the following operators are restricted keywords in Haskell and+--   can not be used as names of types:+--+-- > .. | : | :: | = | \ | | | <- | -> | @ | ~ | =>+--+--   For the syntax of a @TypeTerm@ see 'parseType'.++parseNamedType :: String                            -- ^ The string to be+                                                    --   parsed.+                  -> Either ParseError NamedType    -- ^ Returns the parsed+                                                    --   named type or a parser+                                                    --   error.+parseNamedType string =+  case runParser namedType () "" string of+    Left error             -> Left error+    Right (NamedType tv t) -> Right (NamedType tv (prepare t))++++-- | Parses a Haskell type string and creates a named type.+--+--   A type string has to be conforming to the following EBNF syntax:+--+-- > TypeTerm ::= SimpleTypeTerm+-- >            | SimpleTypeTerm "->" TypeTerm+-- >            | "forall" TypeVariableList "." TypeTerm+--+-- > SimpleTypeTerm ::= ATypeTerm+-- >                  | TypeConstructor ATypeTermList+-- >                  | "[]" ATypeTerm+-- >                  | "(,)" ATypeTerm ATypeTerm+-- >                  | "(,,)" ATypeTerm ATypeTerm ATypeTerm+-- >                  | ...+-- >                  | {- tuple in prefix notation of arity 15 -}+-- >                  | "(->)" ATypeTerm ATypeTerm+--+-- > ATypeTerm ::= "Char" | "Int" | "Integer" | "Float" | "Double"+-- >             | TypeVariable+-- >             | "()"+-- >             | "[" TypeTerm "]"+-- >             | "(" TypeTerm "," TypeTerm ")"+-- >             | "(" TypeTerm "," TypeTerm "," TypeTerm ")"+-- >             | ...+-- >             | {- tuple of arity 15 -}+-- >             | "(" TypeTerm ")"+--+-- > ATypeTermList ::= ATypeTerm+-- >                 | ATypeTermList ATypeTerm+--+-- > TypeVariableList ::= TypeVariable+-- >                    | TypeVariableList TypeVariable+--+--   where @TypeVariable@ is a token starting with a lower letter or @_@, while+--   @TypeConstructor@ starts with a capital letter. Every of these two tokens+--   may consist of alphanumeric letters and the characters @_@ and @'@ from the+--   second character onwards.+--   A @TypeVariable@ starting with @_@ has to be at least two characters long,+--   because @_@ is a reserved identifier in Haskell.+--   Type constructors can not be formed from symbols.+--+--   Although tuples are restricted to an arity of 15, tuples in the usual+--   non-prefixed way can be arbitrary large. However, applications should not+--   rely on this possibility.+--+--   An additional rule limits the valid type terms: The number of type+--   arguments for a type constructor must match the type constructors arity.++parseType :: (String -> Bool)       -- ^ When 'parseType' is trying to+                                    --   automatically create a name for the+                                    --   type, this function is asked if a name+                                    --   is acceptable.++             -> String              -- ^ The string to be parsed.++             -> Either ParseError NamedType+                                    -- ^ Returns the parsed named type with+                                    --   the generated name or an parser+                                    --   error.+parseType accept string =+  case runParser onlyType () "" string of+    Left error -> Left error+    Right t    -> Right (NamedType (newName (TV "t" 1) accept) (prepare t))+  where+    newName v@(TV t i) accept = if accept (printAsText v)+                                  then v+                                  else newName (TV t (i+1)) accept++++--------------------------------------------------------------------------------++++-- Parser for the above syntax.++++-- | The parser type used throughout this module.+--   This type was just defined to make the type following annotations shorter.++type CLParser a = GenParser Char () a++++-- | Parses a named type.+--   This is a top-level parser, i.e. it requests end of input when finished.++namedType :: CLParser NamedType+namedType = do+  skipSpace+  n <- (typeName <?> "name of a type")+  symbol "::"+  t <- typeTerm+  eof++  -- separate the parsed name in name and index, if possible+  let (rd, rn) = span isDigit $ reverse n+  let (n', digits) = (reverse rn, reverse rd)+  let tv = if (digits == [])+             then PV n'+             else TV n' (read digits)++  return (NamedType tv t)++++-- | Parses a type only.+--   This is a top-level parser, i.e. it requests end of input when finished.++onlyType :: CLParser Type+onlyType = do+  skipSpace+  t <- typeTerm+  eof+  return t++++-- | Parses a type term consisting of functions or type abstractions,+--   both of which are based on simple type terms.++typeTerm :: CLParser Type+typeTerm =++  -- parse type abstractions+  -- This is different to the above EBNF definition to allow for finding+  -- the keyword "forall" before any type variables. Thus, the parser gets+  -- a bit simpler.+      do try (keyword "forall")+         vs <- many1 typeVariable+         symbol "."+         t <- typeTerm+         return (foldr (\v t -> TypeForall v t) t vs)++  -- parse a simple type term possibly being part of a function type+  <|> simpleTypeTerm `chainr1` function++++-- | Parses the function symbol and returns a function to create a function+--   type term out of two type terms.++function :: CLParser (Type -> Type -> Type)+function = do+  symbol "->"+  return (\t1 t2 -> TypeFun t1 t2)++++-- | Parses a simple type term.++--   The cases are ordered so that first predefined type constructors in prefix+--   notatation are checked, then basic type terms, and finally type+--   constructors are parsed.++simpleTypeTerm :: CLParser Type+simpleTypeTerm =+      do try (symbol "[]" <?> "prefixed list constructor")+         t <- aTypeTerm+         return (TypeList t)++  <|> do n <- (tupleConstructor <?> "prefixed tuple constructor")+         ts <- count n aTypeTerm+         return (TypeTuple ts)++  <|> do try (symbol "(->)" <?> "prefixed function constructor")+         t1 <- aTypeTerm+         t2 <- aTypeTerm+         return (TypeFun t1 t2)++  <|> aTypeTerm++  <|> do (c, n) <- (typeConstructor <?> "type constructor")+         ts <- count n aTypeTerm+         return (TypeCon c ts)++  <?> "a simple type term"++++-- | Parses a basic type term.++aTypeTerm :: CLParser Type+aTypeTerm =+      do try (keyword "Char")+         return (TypeBasic Char)+  <|> do try (keyword "Int")+         return (TypeBasic Int)+  <|> do try (keyword "Integer")+         return (TypeBasic Integer)+  <|> do try (keyword "Float")+         return (TypeBasic Float)+  <|> do try (keyword "Double")+         return (TypeBasic Double)++  <|> do v <- (typeVariable <?> "type variable")+         return (TypeVar v)++  <|> do t <- between (symbol "[") (symbol "]") typeTerm+         return (TypeList t)++  <|> do l <- between (symbol "(") (symbol ")") (typeTerm `sepBy` (symbol ","))+         return $ case l of+                    []        -> TypeUnit+                    [t]       -> t+                    otherwise -> (TypeTuple l)++  <?> ("a basic type, a type variable or a list or tuple type term "+       ++ "like [a] or (a,b)")+++--------------------------------------------------------------------------------++++-- The lexer for the above parser's tokens.+-- After every token, spaces are skipped.+++-- | Parses a name (of an identifier).++name :: CLParser String+name =+      do c  <- char '_'+         cs <- (many1 hsID <?> "at least one more character after \"_\"")+         skipSpace+         return (c:cs)++  <|> do c  <- hsSmall+         cs <- many hsID+         skipSpace+         return (c:cs)++++-- | Parses a name of a type which can be either an identifier or an operator.++typeName :: CLParser String+typeName =+     name+ <|> do char '('+        op1 <- hsOperator1+        ops <- many hsOperator+        let op = op1 : ops+        if any (== op) reservedOps+          then unexpected ("reserved operator \"" ++ op ++ "\"")+          else do char ')'+                  skipSpace+                  return ("(" ++ op ++ ")")+  where+    reservedOps =+      [ "..", ":", "::", "=", "\\", "|", "<-", "->", "@", "~", "=>" ]++++-- | Parses a type variable. Note that there can not be a type variable called+--   "forall".++typeVariable :: CLParser TypeVariable+typeVariable = do+  n <- name+  if (n == "forall")+    then unexpected "reserved word \"forall\"" <?> "type variable"+    else return n++++-- | Parses a type constructor.+--   This function checks, if the parsed type constructor is accepted in the+--   given language subset. If so, it returns also the arity of the type+--   constructor.+--   If the parsed type constructor is not valid, an error message is created.++typeConstructor :: CLParser (TypeConstructor, Int)+typeConstructor = do+  c  <- hsLarge+  cs <- many hsID+  let con = c:cs+  if (not $ isDefined con)+    then unexpected ("type constructor '" ++ con ++ "' " +++                     "(this type constructor is not declared)")+    else do+      let Just n = getArity con+      skipSpace+      return (con, n)++++-- | Parses a tuple type constructor as @(,)@ or @(,,)@.+--   Returns the arity of the parsed tuple type constructor.++tupleConstructor :: CLParser Int+tupleConstructor = do+  try (string "(,")+  cs <- many (char ',')+  char ')'+  skipSpace+  return (length cs + 2)++++-- | Checks if a symbol (consisting of operator characters) is at the current+--   position of the input.++symbol :: String -> CLParser ()+symbol s = do+  string s+  skipSpace+  return ()++++-- | Checks if a keyword (consisting of alphanumeric characters) is at the+--   current position of the input. Assures also, that after this keyword no+--   other alphanumeric character is following.++keyword :: String -> CLParser ()+keyword s = do+  string s+  notFollowedBy hsID+  skipSpace+  return ()++++-- | Skips zero or more space characters.++skipSpace :: CLParser ()+skipSpace = skipMany hsSpace++++-- | Returns a lower letter character (see 'name').++hsSmall :: CLParser Char+hsSmall = satisfy $ \c -> isLower c++++-- | Returns a capital letter character (see 'typeConstructor').++hsLarge :: CLParser Char+hsLarge = satisfy $ \c -> isUpper c++++-- | Returns an alphanumeric character of which keywords and identifiers can be+--   formed.++hsID :: CLParser Char+hsID = satisfy $ \c -> isAlphaNum c || (c == '_') || (c == '\'')++++-- | Returns a symbol which can be the first character of an operator function.++hsOperator1 :: CLParser Char+hsOperator1 = satisfy $ \c -> any (== c) "!#$%&*+./<=>?@\\^|-~"++++-- | Returns a symbol of which operators can be formed.++hsOperator :: CLParser Char+hsOperator = satisfy $ \c -> any (== c) "!#$%&*+./<=>?@\\^|-~:"++++-- | Returns a space character.++hsSpace :: CLParser Char+hsSpace = satisfy $ \c -> isSpace c++++--------------------------------------------------------------------------------++++-- Helper function++++-- | Returns the arity of a type constructor or @Nothing@ if the type+--   constructor is not accepted in the given language subset.++getArity :: TypeConstructor -> Maybe Int+getArity con =+  case (getDataDecl con) of+    Just (DataDecl _ len _) -> Just len+    Nothing                 ->+      case (getTypeDecl con) of+        Just (TypeDecl _ len _) -> Just len+        Nothing                 -> Nothing++++--------------------------------------------------------------------------------++++-- A list of tests for this module.++{-+testTypeParser = do+  putStr "parser for named types works ... "+  quickCheck prop_parser_NamedType+  putStr "parser for types works ... "+  quickCheck prop_parser_Type+-}++++-- Checks the type parser for named types.++prop_parser_NamedType nt =+  case parseNamedType (printAsText nt) of+    Left _    -> False+    Right nt' -> let NamedType tv t = nt+                 in  NamedType tv (prepare t) == nt'++++-- Checks the type parser for types only.++prop_parser_Type t =+  let nt   = NamedType (PV "t") t+      text = drop 4 (printAsText nt)+  in  case parseType (\_ -> True) text of+        Left _                 -> False+        Right (NamedType _ t') -> prepare t == t'+
+ scripts/FT/FreeTheorems/Types.hs view
@@ -0,0 +1,39 @@+-- Copyright 2006, Sascha Boehme.+++++-- | This module contains declarations for all major types used in the+--   Free Theorems library. It includes the following types:+--+--       * 'LanguageModel' which gives means to restrict the covered language+--         subset of Haskell when generating theorems,+--+--       * 'NamedType', 'Type' and related types to describe the structure of+--         Haskell types,+--+--       * 'Theorem', 'Relation' and connected types to formulate theorems which+--         are generated from Haskell types.++module FreeTheorems.Types (+    -- * Language model+    module FreeTheorems.Types.LanguageModel,++    -- * Haskell types+    module FreeTheorems.Types.Type,++    -- * Relations+    module FreeTheorems.Types.Relation,++    -- * Theorems+    module FreeTheorems.Types.Theorem+) where++++import FreeTheorems.Types.LanguageModel+import FreeTheorems.Types.Type+import FreeTheorems.Types.Relation+import FreeTheorems.Types.Theorem++
+ scripts/FT/FreeTheorems/Types/LanguageModel.hs view
@@ -0,0 +1,21 @@+-- Copyright 2006, Sascha Boehme.+++++-- | This module declares 'LanguageModel' which gives means to restrict the+--   covered language subset of Haskell when generating theorems,+--+module FreeTheorems.Types.LanguageModel where++++-- | Specifies the Haskell language model used in generating theorems.++data LanguageModel+  = BasicModel      -- ^ Most restrictive language model which does not allow+                    --   any of the relaxations the other models are providing.++  | FixModel        -- ^ Allows fixpoints and _|_ in the used Haskell subset.++  deriving (Eq, Show)
+ scripts/FT/FreeTheorems/Types/Relation.hs view
@@ -0,0 +1,74 @@+-- Copyright 2006, Sascha Boehme.+++++-- | This module declares 'Relation' and connected types to formulate relations+--   which are occurring in theorems.++module FreeTheorems.Types.Relation where++++import FreeTheorems.Types.LanguageModel+import FreeTheorems.Types.Type++++-- | A structure to describe relations occurring in free theorems.++data Relation+  = RelTerm Term (Type, Type)+        -- ^ A function as a special case of a relation.+        --   The additional pair stores the type of the function, i.e. if+        --   the function has type T1 -> T2, then the pair is (T1, T2).++  | RelVar RelationVariable+        -- ^ A relation variable.++  | RelLift LanguageModel TypeConstructor [Relation]+        -- ^ A lift relation for a certain type constructor.++  | RelLiftList LanguageModel Relation+        -- ^ A lift relation for lists over a given relation.++  | RelLiftTuple LanguageModel [Relation]+        -- ^ A lift relation for tuples of relations.++  | RelFun LanguageModel Relation Relation+        -- ^ A functional relation between two relations.++  | RelForall LanguageModel RelationVariable Relation+        -- ^ A relational abstraction.++  deriving (Eq, Show)++++-- | Specifies relation variable or function variables as a special case of a+--   relation.++--   This definition is close to the mathematical notation @R_i@ in LaTeX.+--   To every relation variable a number is assigned which is unique among+--   relation variables.++data RelationVariable = R Int TypeVariable (TypeTermVariable, TypeTermVariable)+                            -- ^ A relation variable with a unique index.+                        deriving (Eq, Show)++++-- | Specifies terms which could occur in pairs of free theorems. Terms can+--   either be just variables, applications of variables to terms or+--   instantiations of terms.++data Term+  = TermVar TermVariable    -- ^ A variable.++  | TermApp Term Term       -- ^ An application of a term to a term.++  | TermIns Term Type       -- ^ An instantiation of a term by a closed type.+  deriving (Eq, Show)+++
+ scripts/FT/FreeTheorems/Types/Theorem.hs view
@@ -0,0 +1,137 @@+-- Copyright 2006, Sascha Boehme.+++++-- | This module 'Theorem' and connected types to formulate theorems which are+--   generated from Haskell types.++module FreeTheorems.Types.Theorem where++++import FreeTheorems.Types.LanguageModel+import FreeTheorems.Types.Type+import FreeTheorems.Types.Relation++++-- | Defines a structure to describe free theorems.++--   The structure of the theorem type is essentially tree-like. Leaves+--   consists of pairs of terms being elements of relations, and nodes are+--   different universal quantifiers as well as conjunctions and implications.++data Theorem+  = IsElementOf (Term, Term) Relation+        -- ^ Models, that a pair of terms is an element of a relation.++  | ForallPairs (TermVariable,TermVariable) Relation Theorem+        -- ^ Models a universal quantification over pairs of a relation.++  | ForallRelations RelationVariable [Restriction] Theorem+        -- ^ Models a universal quantification over pairs of closed type terms+        --   and relations over these pairs where the relation respects the+        --   given list of restrictions.++  | ForallFunctions TermVariable (TypeTermVariable, TypeTermVariable)+                    [Restriction] Theorem+        -- ^ Models a universal quantification over pairs of closed type terms+        --   and functions over these pairs where the function respects the+        --   given list of restrictions.++  | ForallElements TermVariable Type Theorem+        -- ^ Models a universal quantification over elements from a certain+        --   type.++  | Conjunction Theorem Theorem+        -- ^ Models a conjunction between two theorems.++  | Implication Theorem Theorem+        -- ^ Models an implication between two theorems.++  deriving Show++++-- | Gives certain restrictions occurring in theorems.++data Restriction+  = IsStrict TermVariable+        -- ^ Requests that a function denoted by a term variable must be strict.++  | IsStrictAndContinuous RelationVariable+        -- ^ Requests that a relation denoted by a relation variable must be+        --   strict and continous.++  deriving Show++++++-- | Gives a means to describe unfolded relations, i.e. relations and+--   corresponding sets which specify explicitely the members of that relation.++data UnfoldedRelation = UnfoldedRelation Relation LanguageModel UnfoldedSet++++-- | The sets of an unfolded lift relation.++data UnfoldedSet++        -- | The sets of a general unfolded lift relation. Each set consists of+        --   the elements to create a notation like:+        --+        -- > { (D x1 ... xn, D y1 ... yn) | (xi,yi) in Ri }+        --+        --   where the theorem may be omitted in the case of nullary data+        --   constructors.+  = UnfoldedLift+      [(DataConstructor, [TermVariable], [TermVariable], Maybe Theorem)]++        -- | The set of an unfolded list relation. It corresponds to the+        --   notation:+        --+        -- > { (x:xs, y:ys) | (x,y) in R and (xs,ys) in lift_[](R) }+  | UnfoldedLiftList+      ((TermVariable, TermVariable), (TermVariable, TermVariable))+      Theorem++        -- | The set of an unfolded tuple relation. It corresponds to the+        --   notation:+        --+        -- > { ((x1, ..., xn), (y1, ..., yn)) | (xi,yi) in Ri }+  | UnfoldedLiftTuple+      ([TermVariable], [TermVariable])+      Theorem++        -- | The set of an unfolded functional relation. It corresponds to the+        --   notation:+        --+        -- > { (f, g) | forall (x,y) in R1. (f x, g y) in R2 }+  | UnfoldedFunction+      (TermVariable, TermVariable)+      Theorem++        -- | The set of an unfolded relational abstraction. It corresponds to+        --   the notation:+        --+        -- > { (x, y) | forall T1,T2 in TYPES. forall R in Rel(T1,T2).+        -- >            (x_T1, y_T2) in F(R) }+  | UnfoldedForall+      (TermVariable, TermVariable)+      Theorem++++++-- | A Haskell data constructor.++type DataConstructor = String++++
+ scripts/FT/FreeTheorems/Types/Type.hs view
@@ -0,0 +1,93 @@+-- Copyright 2006, Sascha Boehme.+++++-- | This module declares 'NamedType', 'Type' and related types to describe the+--   structure of Haskell types.++module FreeTheorems.Types.Type where++++++-- | A Haskell type with an associated name.++data NamedType = NamedType TermVariable Type+                 deriving (Eq, Show)+++-- | Describes Haskell types.+--   This algebraic datatype is powerful enough to not only model Haskell98+--   types, but also higher-rank function types.++data Type+  = TypeBasic BasicType         -- ^ A basic type.++  | TypeVar TypeVariable        -- ^ A type variable.++  | TypeTermVar TypeTermVariable    -- ^ A type term variable representing an+                                    --   abstract type term.++  | TypeCon TypeConstructor [Type]+                                -- ^ An algebraic datatype with type arguments.++  | TypeList Type               -- ^ The list type.++  | TypeUnit                    -- ^ The unit type @()@.++  | TypeTuple [Type]            -- ^ Tuple types. Although this construct allows+                                --   arbitrary typle sizes, tuples are generally+                                --   restricted to a size between 2 and 15.++  | TypeFun Type Type           -- ^ A function type of the two argument types.++  | TypeForall TypeVariable Type+                                -- ^ A @forall@ type abstraction.++  deriving (Eq, Show)++++-- | Defines the basic types of Haskell. The data constructors use the same+--   names as the corresponding Haskell types.++data BasicType = Char | Int | Integer | Float | Double+                 deriving (Eq, Show)++++-- | Defines a type to represent type constructors.++type TypeConstructor = String++++-- | Describes Haskell type variables.++type TypeVariable = String++++-- | Describes a variable occurring in terms.++data TermVariable+  = TV String Int   -- ^ An automatically generated term variable where the+                    --   string is a prefix (like @x@) and the integer is an+                    --   index.++  | PV String       -- ^ A parsed term variable, usually the name of a type.++  deriving (Eq, Show)++++-- | Defines a type term variable.++--   This definition is close to the mathematical notation @T_i@ in LaTeX.+--   To every relation variable a number is assigned which is unique among+--   relation variables.++newtype TypeTermVariable = T Int    -- ^ A type term variable with an index.+                           deriving (Eq, Show)
+ scripts/FT/FreeTheorems/Unfolding.hs view
@@ -0,0 +1,309 @@+-- Copyright 2006, Sascha Boehme.+++++-- | This module defines a function to unfold relations generated from types to+--   theorems.++module FreeTheorems.Unfolding (+    unfold,+    unfoldFunction,+    unfoldForall,+    getTypesOf,++    -- testing interface+    -- testUnfolding+) where++++import FreeTheorems.Simplification+import FreeTheorems.TheoremData+import FreeTheorems.Types+import Control.Monad (liftM)++import FreeTheorems.Delta+import FreeTheorems.Preparation+-- import FreeTheorems.Test.ArbitraryTypes+-- import Test.QuickCheck (quickCheck)++++++-- | Unfolds a relation to a theorem.+--   It replaces all functional relations and relation abstractions by logical+--   statements and conditions while the other relations are transformed in+--   is-element-of predicates using relations on their right-hand side.+--+--   The returned theorem is simplified using 'simplifyTheorem'.++unfold :: TermVariable+                -- ^ The name of the type from which the theorem is to be+                --   generated.+          -> Relation+                -- ^ Relation which was generated from the type.+          -> TheoremState Theorem+                -- ^ Returns the generated theorem in the corresponding theorem+                --   state.++unfold tv rel =+  liftM simplifyTheorem (unfoldRelation rel (TermVar tv, TermVar tv))++++++-- | Unfolds the given relation to a theorem. This is a helper function for+--   'unfold'.+--+--   Basic relations are transformed into is-element-of predicates while+--   functional relations and relation abstractions are replaced by logical+--   expressions. See also 'unfoldFunction' and 'unfoldForall'.++unfoldRelation :: Relation -> (Term, Term) -> TheoremState Theorem+unfoldRelation rel (t1, t2) =+  case rel of+    RelTerm _ _             -> return $ IsElementOf (t1,t2) rel+    RelVar _                -> return $ IsElementOf (t1,t2) rel+    RelLift _ _ _           -> return $ IsElementOf (t1,t2) rel+    RelLiftList _ _         -> return $ IsElementOf (t1,t2) rel+    RelLiftTuple _ _        -> return $ IsElementOf (t1,t2) rel+    RelFun model rel1 rel2  -> unfoldFunction model rel1 rel2 (t1,t2)+    RelForall model rv rel1 -> unfoldForall model rv rel1 (t1,t2)++++-- | Unfolds a functional relation to a logical expression.++unfoldFunction :: LanguageModel+                  -> Relation+                  -> Relation+                  -> (Term, Term)+                  -> TheoremState Theorem++unfoldFunction model rel1 rel2 (t1,t2) = do+  (x,y) <- newVariablesFor rel1+  let (tx,ty) = (TermVar x, TermVar y)+  theorem <- unfoldRelation rel2 (TermApp t1 tx, TermApp t2 ty)+  case rel1 of+    RelTerm t (t1,t2) -> return $ ForallElements x t1+                                $ ForallElements y t2+                                $ Implication (IsElementOf (tx,ty) rel1) theorem++    RelVar _          -> return $ ForallPairs (x,y) rel1 theorem+    RelLift _ _ _     -> return $ ForallPairs (x,y) rel1 theorem+    RelLiftList _ _   -> return $ ForallPairs (x,y) rel1 theorem+    RelLiftTuple _ _  -> return $ ForallPairs (x,y) rel1 theorem++    RelFun _ rel3 rel4  -> do let (t1, t2) = getTypesOf rel3+                              let (t3, t4) = getTypesOf rel4+                              theorem1 <- unfoldFunction model rel3 rel4 (tx,ty)+                              return $ ForallElements x (TypeFun t1 t3)+                                     $ ForallElements y (TypeFun t2 t4)+                                     $ Implication theorem1 theorem++    RelForall _ rv rel3 -> do let (t1, t2) = getTypesOf rel1+                              theorem1 <- unfoldForall model rv rel3 (tx,ty)+                              return $ ForallElements x t1+                                     $ ForallElements y t2+                                     $ Implication theorem1 theorem++++-- | Unfolds a relation abstraction to a logical expression.+--   Depending on the language model used, the expression may contain certain+--   restriction annotations.++unfoldForall :: LanguageModel+                -> RelationVariable+                -> Relation+                -> (Term, Term)+                -> TheoremState Theorem++unfoldForall model rv rel (t1,t2) = do+  let R _ _ (ttv1, ttv2) = rv+  let pair = (TermIns t1 (TypeTermVar ttv1), TermIns t2 (TypeTermVar ttv2))++  let res = case model of+              BasicModel -> []+              FixModel   -> [IsStrictAndContinuous rv]++  liftM (ForallRelations rv res) (unfoldRelation rel pair)++++--------------------------------------------------------------------------------++++-- | Every relation is defined over a pair of closed types. This function+--   returns exactly that pair of types for an arbitrary relation. Thus, it acts+--   like an inverse delta function, although this is not fully true.++getTypesOf :: Relation -> (Type, Type)+getTypesOf rel = getTypes [] rel++++-- | Computes the pair of types for a relation. This function is a helper+--   function for 'getTypesOf'.+--+--   The second argument contains a list of relation variables which should+--   be replaced by corresponding type variables (used to process abstractions).+--   Otherwise, relation variables are replaced by the according type term+--   variables.++getTypes :: [RelationVariable] -> Relation -> (Type, Type)+getTypes rvs rel =+  case rel of+    RelTerm _ typepair      -> typepair++    RelVar rv               -> let R _ v (ttv1, ttv2) = rv+                               in  if rv `elem` rvs+                                     then (TypeVar v, TypeVar v)+                                     else (TypeTermVar ttv1, TypeTermVar ttv2)++    RelLift model c rels    -> let (ts1, ts2) = unzip $ map (getTypes rvs) rels+                               in  (TypeCon c ts1, TypeCon c ts2)++    RelLiftList model rel'  -> let (t1, t2) = getTypes rvs rel'+                               in  (TypeList t1, TypeList t2)++    RelLiftTuple model rels -> let (ts1, ts2) = unzip $ map (getTypes rvs) rels+                               in  (TypeTuple ts1, TypeTuple ts2)++    RelFun model rel1 rel2  -> let (t1, t2) = getTypes rvs rel1+                                   (t3, t4) = getTypes rvs rel2+                               in  (TypeFun t1 t3, TypeFun t2 t4)++    RelForall model rv rel' -> let (t1, t2) = getTypes (rv:rvs) rel'+                                   R _ v _ = rv+                               in  (TypeForall v t1, TypeForall v t2)++++--------------------------------------------------------------------------------++++-- A list of tests for this module.++{-+testUnfolding = do+  putStr "unfold replaces functions and abstractions ... "+  quickCheck prop_unfold+  putStr "every variable is quantified ... "+  quickCheck prop_variables_are_quantified+-}++++-- Check that after expansion, there are no function type relations and+-- type abstraction relations anymore.++prop_unfold model t =+  let tv = PV "t"+      theorem = fst $ execute tv (applyDelta model (prepare t) >>= unfold tv)+  in  hasNoFunAndForall theorem+++hasNoFunAndForall theorem =+  case theorem of+    IsElementOf _ rel     -> isNotFunOrForall rel+    ForallPairs _ rel t   -> isNotFunOrForall rel && hasNoFunAndForall t+    ForallRelations _ _ t -> hasNoFunAndForall t+    ForallElements _ _ t  -> hasNoFunAndForall t+    Conjunction t1 t2     -> hasNoFunAndForall t1 && hasNoFunAndForall t2+    Implication t1 t2     -> hasNoFunAndForall t1 && hasNoFunAndForall t2++isNotFunOrForall rel =+  case rel of+    RelTerm _ _      -> True+    RelVar _         -> True+    RelLift _ _ _    -> True+    RelLiftList _ _  -> True+    RelLiftTuple _ _ -> True+    RelFun _ _ _     -> False+    RelForall _ _ _  -> False++++-- Check that every variable is quantified after expansion.++prop_variables_are_quantified model t =+  let tv = PV "t"+      theorem = fst $ execute tv (applyDelta model (prepare t) >>= unfold tv)+  in  cqTheorem [PV "t", PV "id"] [] [] theorem+++cqTheorem tvs ttvs rvs theorem =+  case theorem of+    IsElementOf (t1,t2) rel     -> cqTerm tvs ttvs t1 && cqTerm tvs ttvs t2+                                   && cqRelation tvs ttvs rvs rel++    ForallPairs (tv1,tv2) rel t -> cqRelation tvs ttvs rvs rel+                                   && cqTheorem (tv1:tv2:tvs) ttvs rvs t++    ForallRelations rv res t    -> let R _ _ (ttv1,ttv2) = rv+                                       ttvs' = ttv1:ttv2:ttvs+                                   in cqRestriction tvs (rv:rvs) res+                                      && cqTheorem tvs ttvs' (rv:rvs) t++    ForallElements tv ty t      -> cqType [] ttvs ty+                                   && cqTheorem (tv:tvs) ttvs rvs t++    Conjunction t1 t2           -> cqTheorem tvs ttvs rvs t1+                                   && cqTheorem tvs ttvs rvs t2++    Implication t1 t2           -> cqTheorem tvs ttvs rvs t1+                                   && cqTheorem tvs ttvs rvs t2+++cqRestriction tvs rvs [] = True+cqRestriction tvs rvs (res:ress) = cqRestriction tvs rvs ress &&+  case res of+    IsStrict tv              -> tv `elem` tvs+    IsStrictAndContinuous rv -> rv `elem` rvs+++cqTerm tvs ttvs t =+  case t of+    TermVar tv    -> tv `elem` tvs+    TermApp t1 t2 -> cqTerm tvs ttvs t1 && cqTerm tvs ttvs t2+    TermIns t' ty -> cqTerm tvs ttvs t' && cqType [] ttvs ty++cqRelation tvs ttvs rvs rel =+  case rel of+    RelTerm t (ty1, ty2) -> cqTerm tvs ttvs t+                            && cqType [] ttvs ty1 && cqType [] ttvs ty2+    RelVar rv            -> rv `elem` rvs+    RelLift _ _ rels     -> and $ map (cqRelation tvs ttvs rvs) rels+    RelLiftList _ rel'   -> cqRelation tvs ttvs rvs rel'+    RelLiftTuple _ rels  -> and $ map (cqRelation tvs ttvs rvs) rels+    RelFun _ rel1 rel2   -> cqRelation tvs ttvs rvs rel1+                            && cqRelation tvs ttvs rvs rel2+    RelForall _ rv rel'  -> cqRelation tvs ttvs (rv:rvs) rel'++cqType vs ttvs t =+  case t of+    TypeBasic _     -> True+    TypeVar v       -> v `elem` vs+    TypeTermVar ttv -> ttv `elem` ttvs+    TypeCon _ ts    -> and $ map (cqType vs ttvs) ts+    TypeList t'     -> cqType vs ttvs t'+    TypeUnit        -> True+    TypeTuple ts    -> and $ map (cqType vs ttvs) ts+    TypeFun t1 t2   -> cqType vs ttvs t1 && cqType vs ttvs t2+    TypeForall v t' -> cqType (v:vs) ttvs t'++++++zz = TypeForall "a" (TypeFun (TypeBasic Char) (TypeTuple [TypeBasic Float,TypeVar "b"+  ,TypeBasic Char,TypeCon "String" [],TypeCon "String" [],TypeVar "b",TypeBasic+  Double,TypeVar "c",TypeVar "b",TypeCon "String" [],TypeBasic Int]))++zzz = fst $ execute (PV "t") (applyDelta BasicModel (prepare zz) >>= unfold (PV "t"))
+ scripts/FT/PPrint.hs view
@@ -0,0 +1,409 @@+-----------------------------------------------------------+-- Daan Leijen (c) 2000, http://www.cs.uu.nl/~daan+--+-- $version: $+--+-- Pretty print module based on Philip Wadlers "prettier printer"+--      "A prettier printer"+--      Draft paper, April 1997, revised March 1998.+--      http://cm.bell-labs.com/cm/cs/who/wadler/papers/prettier/prettier.ps+--+-- Haskell98 compatible+-----------------------------------------------------------+module PPrint+        ( Doc+        , Pretty, pretty++        , show, putDoc, hPutDoc++        , (<>)+        , (<+>)+        , (</>), (<//>)+        , (<$>), (<$$>)++        , sep, fillSep, hsep, vsep+        , cat, fillCat, hcat, vcat+        , punctuate++        , align, hang, indent+        , fill, fillBreak++        , list, tupled, semiBraces, encloseSep+        , angles, langle, rangle+        , parens, lparen, rparen+        , braces, lbrace, rbrace+        , brackets, lbracket, rbracket+        , dquotes, dquote, squotes, squote++        , comma, space, dot, backslash+        , semi, colon, equals++        , string, bool, int, integer, float, double, rational++        , softline, softbreak+        , empty, char, text, line, linebreak, nest, group+        , column, nesting, width++        , SimpleDoc(..)+        , renderPretty, renderCompact+        , displayS, displayIO+        ) where++import System.IO      (Handle,hPutStr,hPutChar,stdout)++infixr 5 </>,<//>,<$>,<$$>+infixr 6 <>,<+>+++-----------------------------------------------------------+-- list, tupled and semiBraces pretty print a list of+-- documents either horizontally or vertically aligned.+-----------------------------------------------------------+list            = encloseSep lbracket rbracket comma+tupled          = encloseSep lparen   rparen  comma+semiBraces      = encloseSep lbrace   rbrace  semi++encloseSep left right sep ds+    = case ds of+        []  -> left <> right+        [d] -> left <> d <> right+        _   -> align (cat (zipWith (<>) (left : repeat sep) ds) <> right)+++-----------------------------------------------------------+-- punctuate p [d1,d2,...,dn] => [d1 <> p,d2 <> p, ... ,dn]+-----------------------------------------------------------+punctuate p []      = []+punctuate p [d]     = [d]+punctuate p (d:ds)  = (d <> p) : punctuate p ds+++-----------------------------------------------------------+-- high-level combinators+-----------------------------------------------------------+sep             = group . vsep+fillSep         = fold (</>)+hsep            = fold (<+>)+vsep            = fold (<$>)++cat             = group . vcat+fillCat         = fold (<//>)+hcat            = fold (<>)+vcat            = fold (<$$>)++fold f []       = empty+fold f ds       = foldr1 f ds++x <> y          = x `beside` y+x <+> y         = x <> space <> y+x </> y         = x <> softline <> y+x <//> y        = x <> softbreak <> y+x <$> y         = x <> line <> y+x <$$> y        = x <> linebreak <> y++softline        = group line+softbreak       = group linebreak++squotes         = enclose squote squote+dquotes         = enclose dquote dquote+braces          = enclose lbrace rbrace+parens          = enclose lparen rparen+angles          = enclose langle rangle+brackets        = enclose lbracket rbracket+enclose l r x   = l <> x <> r++lparen          = char '('+rparen          = char ')'+langle          = char '<'+rangle          = char '>'+lbrace          = char '{'+rbrace          = char '}'+lbracket        = char '['+rbracket        = char ']'++squote          = char '\''+dquote          = char '"'+semi            = char ';'+colon           = char ':'+comma           = char ','+space           = char ' '+dot             = char '.'+backslash       = char '\\'+equals          = char '='+++-----------------------------------------------------------+-- Combinators for prelude types+-----------------------------------------------------------++-- string is like "text" but replaces '\n' by "line"+string ""       = empty+string ('\n':s) = line <> string s+string s        = case (span (/='\n') s) of+                    (xs,ys) -> text xs <> string ys++bool :: Bool -> Doc+bool b          = text (show b)++int :: Int -> Doc+int i           = text (show i)++integer :: Integer -> Doc+integer i       = text (show i)++float :: Float -> Doc+float f         = text (show f)++double :: Double -> Doc+double d        = text (show d)++rational :: Rational -> Doc+rational r      = text (show r)+++-----------------------------------------------------------+-- overloading "pretty"+-----------------------------------------------------------+class Pretty a where+  pretty        :: a -> Doc+  prettyList    :: [a] -> Doc+  prettyList    = list . map pretty++instance Pretty a => Pretty [a] where+  pretty        = prettyList++instance Pretty Doc where+  pretty        = id++instance Pretty () where+  pretty ()     = text "()"++instance Pretty Bool where+  pretty b      = bool b++instance Pretty Char where+  pretty c      = char c+  prettyList s  = string s++instance Pretty Int where+  pretty i      = int i++instance Pretty Integer where+  pretty i      = integer i++instance Pretty Float where+  pretty f      = float f++instance Pretty Double where+  pretty d      = double d+++--instance Pretty Rational where+--  pretty r      = rational r++instance (Pretty a,Pretty b) => Pretty (a,b) where+  pretty (x,y)  = tupled [pretty x, pretty y]++instance (Pretty a,Pretty b,Pretty c) => Pretty (a,b,c) where+  pretty (x,y,z)= tupled [pretty x, pretty y, pretty z]++instance Pretty a => Pretty (Maybe a) where+  pretty Nothing        = empty+  pretty (Just x)       = pretty x++++-----------------------------------------------------------+-- semi primitive: fill and fillBreak+-----------------------------------------------------------+fillBreak f x   = width x (\w ->+                  if (w > f) then nest f linebreak+                             else text (spaces (f - w)))++fill f d        = width d (\w ->+                  if (w >= f) then empty+                              else text (spaces (f - w)))++width d f       = column (\k1 -> d <> column (\k2 -> f (k2 - k1)))+++-----------------------------------------------------------+-- semi primitive: Alignment and indentation+-----------------------------------------------------------+indent i d      = hang i (text (spaces i) <> d)++hang i d        = align (nest i d)++align d         = column (\k ->+                  nesting (\i -> nest (k - i) d))   --nesting might be negative :-)++++-----------------------------------------------------------+-- Primitives+-----------------------------------------------------------+data Doc        = Empty+                | Char Char             -- invariant: char is not '\n'+                | Text !Int String      -- invariant: text doesn't contain '\n'+                | Line !Bool            -- True <=> when undone by group, do not insert a space+                | Cat Doc Doc+                | Nest !Int Doc+                | Union Doc Doc         -- invariant: first lines of first doc longer than the first lines of the second doc+                | Column  (Int -> Doc)+                | Nesting (Int -> Doc)++data SimpleDoc  = SEmpty+                | SChar Char SimpleDoc+                | SText !Int String SimpleDoc+                | SLine !Int SimpleDoc+++empty           = Empty++char '\n'       = line+char c          = Char c++text ""         = Empty+text s          = Text (length s) s++line            = Line False+linebreak       = Line True++beside x y      = Cat x y+nest i x        = Nest i x+column f        = Column f+nesting f       = Nesting f+group x         = Union (flatten x) x++flatten :: Doc -> Doc+flatten (Cat x y)       = Cat (flatten x) (flatten y)+flatten (Nest i x)      = Nest i (flatten x)+flatten (Line break)    = if break then Empty else Text 1 " "+flatten (Union x y)     = flatten x+flatten (Column f)      = Column (flatten . f)+flatten (Nesting f)     = Nesting (flatten . f)+flatten other           = other                     --Empty,Char,Text++++-----------------------------------------------------------+-- Renderers+-----------------------------------------------------------++-----------------------------------------------------------+-- renderPretty: the default pretty printing algorithm+-----------------------------------------------------------++-- list of indentation/document pairs; saves an indirection over [(Int,Doc)]+data Docs   = Nil+            | Cons !Int Doc Docs++renderPretty :: Float -> Int -> Doc -> SimpleDoc+renderPretty rfrac w x+    = best 0 0 (Cons 0 x Nil)+    where+      -- r :: the ribbon width in characters+      r  = max 0 (min w (round (fromIntegral w * rfrac)))++      -- best :: n = indentation of current line+      --         k = current column+      --        (ie. (k >= n) && (k - n == count of inserted characters)+      best n k Nil      = SEmpty+      best n k (Cons i d ds)+        = case d of+            Empty       -> best n k ds+            Char c      -> let k' = k+1 in seq k' (SChar c (best n k' ds))+            Text l s    -> let k' = k+l in seq k' (SText l s (best n k' ds))+            Line _      -> SLine i (best i i ds)+            Cat x y     -> best n k (Cons i x (Cons i y ds))+            Nest j x    -> let i' = i+j in seq i' (best n k (Cons i' x ds))+            Union x y   -> nicest n k (best n k (Cons i x ds))+                                      (best n k (Cons i y ds))++            Column f    -> best n k (Cons i (f k) ds)+            Nesting f   -> best n k (Cons i (f i) ds)++      --nicest :: r = ribbon width, w = page width,+      --          n = indentation of current line, k = current column+      --          x and y, the (simple) documents to chose from.+      --          precondition: first lines of x are longer than the first lines of y.+      nicest n k x y    | fits width x  = x+                        | otherwise     = y+                        where+                          width = min (w - k) (r - k + n)+++fits w x        | w < 0         = False+fits w SEmpty                   = True+fits w (SChar c x)              = fits (w - 1) x+fits w (SText l s x)            = fits (w - l) x+fits w (SLine i x)              = True+++-----------------------------------------------------------+-- renderCompact: renders documents without indentation+--  fast and fewer characters output, good for machines+-----------------------------------------------------------+renderCompact :: Doc -> SimpleDoc+renderCompact x+    = scan 0 [x]+    where+      scan k []     = SEmpty+      scan k (d:ds) = case d of+                        Empty       -> scan k ds+                        Char c      -> let k' = k+1 in seq k' (SChar c (scan k' ds))+                        Text l s    -> let k' = k+l in seq k' (SText l s (scan k' ds))+                        Line _      -> SLine 0 (scan 0 ds)+                        Cat x y     -> scan k (x:y:ds)+                        Nest j x    -> scan k (x:ds)+                        Union x y   -> scan k (y:ds)+                        Column f    -> scan k (f k:ds)+                        Nesting f   -> scan k (f 0:ds)++++-----------------------------------------------------------+-- Displayers:  displayS and displayIO+-----------------------------------------------------------+displayS :: SimpleDoc -> ShowS+displayS SEmpty             = id+displayS (SChar c x)        = showChar c . displayS x+displayS (SText l s x)      = showString s . displayS x+displayS (SLine i x)        = showString ('\n':indentation i) . displayS x++displayIO :: Handle -> SimpleDoc -> IO ()+displayIO handle simpleDoc+    = display simpleDoc+    where+      display SEmpty        = return ()+      display (SChar c x)   = do{ hPutChar handle c; display x}+      display (SText l s x) = do{ hPutStr handle s; display x}+      display (SLine i x)   = do{ hPutStr handle ('\n':indentation i); display x}+++-----------------------------------------------------------+-- default pretty printers: show, putDoc and hPutDoc+-----------------------------------------------------------+instance Show Doc where+  showsPrec d doc       = displayS (renderPretty 0.4 80 doc)++putDoc :: Doc -> IO ()+putDoc doc              = hPutDoc stdout doc++hPutDoc :: Handle -> Doc -> IO ()+hPutDoc handle doc      = displayIO handle (renderPretty 0.4 80 doc)++++-----------------------------------------------------------+-- insert spaces+-- "indentation" used to insert tabs but tabs seem to cause+-- more trouble than they solve :-)+-----------------------------------------------------------+spaces n        | n <= 0    = ""+                | otherwise = replicate n ' '++indentation n   = spaces n++--indentation n   | n >= 8    = '\t' : indentation (n-8)+--                | otherwise = spaces n
+ scripts/FT/PredefinedTypes.hs view
@@ -0,0 +1,81 @@+-- Copyright 2006, Sascha Boehme.+++++-- List types of functions which are defined in Haskell libraries.++module PredefinedTypes where++++-- Lists types of functions defined in Haskell libraries.++predefinedTypes :: [(String, String)]+predefinedTypes = preludeTypes++++-- Lists the types of all polymorphic functions from the Haskell prelude.++preludeTypes :: [(String, String)]+preludeTypes =+  [ ("maybe", "forall a b. b -> (a -> b) -> Maybe a -> b")+  , ("either", "forall a b c. (a -> c) -> (b -> c) -> Either a b -> c")+  , ("fst", "forall a b. (a, b) -> a")+  , ("snd", "forall a b. (a, b) -> b")+  , ("curry", "forall a b c. ((a, b) -> c) -> a -> b -> c")+  , ("uncurry", "forall a b c. (a -> b -> c) -> (a, b) -> c")+  , ("id", "forall a. a -> a")+  , ("const", "forall a b. a -> b -> a")+  , ("(.)", "forall a b c. (b -> c) -> (a -> b) -> a -> c")+  , ("flip", "forall a b c. (a -> b -> c) -> b -> a -> c")+  , ("($)", "forall a b. (a -> b) -> a -> b")+  , ("until", "forall a. (a -> Bool) -> (a -> a) -> a -> a")+  , ("asTypeOf", "forall a. a -> a -> a")+  , ("error", "forall a. String -> a")+  , ("undefined", "forall a. a")+  , ("seq", "forall a b. a -> b -> b")+  , ("($!)", "forall a b. (a -> b) -> a -> b")+  , ("map", "forall a b. (a -> b) -> [a] -> [b]")+  , ("(++)", "forall a. [a] -> [a] -> [a]")+  , ("filter", "forall a. (a -> Bool) -> [a] -> [a]")+  , ("head", "forall a. [a] -> a")+  , ("last", "forall a. [a] -> a")+  , ("tail", "forall a. [a] -> [a]")+  , ("init", "forall a. [a] -> [a]")+  , ("null", "forall a. [a] -> Bool")+  , ("length", "forall a. [a] -> Int")+  , ("(!!)", "forall a. [a] -> Int -> a")+  , ("reverse", "forall a. [a] -> [a]")+  , ("foldl", "forall a b. (a -> b -> a) -> a -> [b] -> a")+  , ("foldl1", "forall a b. (a -> a -> a) -> [a] -> a")+  , ("foldr", "forall a b. (a -> b -> b) -> b -> [a] -> b")+  , ("foldr1", "forall a. (a -> a -> a) -> [a] -> a")+  , ("any", "forall a. (a -> Bool) -> [a] -> Bool")+  , ("all", "forall a. (a -> Bool) -> [a] -> Bool")+  , ("concat", "forall a. [[a]] -> [a]")+  , ("concatMap", "forall a b. (a -> [b]) -> [a] -> [b]")+  , ("scanl", "forall a b. (a -> b -> a) -> a -> [b] -> [a]")+  , ("scanl1", "forall a. (a -> a -> a) -> [a] -> [a]")+  , ("scanr", "forall a b. (a -> b -> b) -> b -> [a] -> [b]")+  , ("scanr1", "forall a. (a -> a -> a) -> [a] -> [a]")+  , ("iterate", "forall a. (a -> a) -> a -> [a]")+  , ("repeat", "forall a. a -> [a]")+  , ("replicate", "forall a. Int -> a -> [a]")+  , ("cycle", "forall a. [a] -> [a]")+  , ("take", "forall a. Int -> [a] -> [a]")+  , ("drop", "forall a. Int -> [a] -> [a]")+  , ("splitAt", "forall a. Int -> [a] -> ([a], [a])")+  , ("takeWhile", "forall a. (a -> Bool) -> [a] -> [a]")+  , ("dropWhile", "forall a. (a -> Bool) -> [a] -> [a]")+  , ("span", "forall a. (a -> Bool) -> [a] -> ([a], [a])")+  , ("break", "forall a. (a -> Bool) -> [a] -> ([a], [a])")+  , ("zip", "forall a b. [a] -> [b] -> [(a, b)]")+  , ("zip3", "forall a b c. [a] -> [b] -> [c] -> [(a, b, c)]")+  , ("zipWith", "forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]")+  , ("zipWith3", "forall a b c d. (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]")+  , ("unzip", "forall a b. [(a, b)] -> ([a], [b])")+  , ("unzip3", "forall a b c. [(a, b, c)] -> ([a], [b], [c])")+  , ("readParen", "forall a. Bool -> ReadS a -> ReadS a")+  ]
+ scripts/LargeWord.hs view
@@ -0,0 +1,139 @@+{-# OPTIONS -w #-}+-----------------------------------------------------------------------------+-- |+-- Module      :  Data.LargeWord+-- Copyright   :  (c) Dominic Steinitz 2004+-- License     :  BSD-style (see the file ReadMe.tex)+-- +-- Maintainer  :  dominic.steinitz@blueyonder.co.uk+-- Stability   :  experimental+-- Portability :  portable+--+-- Provides Word128, Word192 and Word256 and a way of producing other+-- large words if required.+--+-----------------------------------------------------------------------------++module LargeWord (LargeWord(..),Word128,Word192,Word256,Word1024,Word512,Word2048,Word4096) where++import Data.Word+import Data.Bits+import Numeric+import Data.Char++-- Keys have certain capabilities.++class LargeWord a where+   largeWordToInteger   :: a -> Integer+   integerToLargeWord   :: Integer -> a+   largeWordPlus        :: a -> a -> a+   largeWordAnd         :: a -> a -> a+   largeWordOr          :: a -> a -> a+   largeWordShift       :: a -> Int -> a+   largeWordXor         :: a -> a -> a+   largeBitSize         :: a -> Int++-- Word64 is a key in the obvious way.++instance LargeWord Word64 where+   largeWordToInteger   = toInteger+   integerToLargeWord   = fromInteger+   largeWordPlus        = (+)+   largeWordAnd         = (.&.)+   largeWordOr          = (.|.)+   largeWordShift       = shift+   largeWordXor         = xor+   largeBitSize         = bitSize++-- Define larger keys from smaller ones.++data LargeKey a b = LargeKey !a !b+   deriving (Eq, Ord)++instance (Ord a, Bits a, LargeWord a, Bits b, LargeWord b) =>+   LargeWord (LargeKey a b) where+      largeWordToInteger (LargeKey lo hi) =+         largeWordToInteger lo + (2^(bitSize lo)) * largeWordToInteger hi+      integerToLargeWord x =+         let (h,l) =  x `quotRem` (2^(bitSize lo))+             (lo,hi) = (integerToLargeWord l, integerToLargeWord h) in+                LargeKey lo hi+      largeWordPlus (LargeKey alo ahi) (LargeKey blo bhi) =+         LargeKey lo' hi' where+            lo' = alo + blo+            hi' = ahi + bhi + if lo' < alo then 1 else 0+      largeWordAnd (LargeKey alo ahi) (LargeKey blo bhi) =+         LargeKey lo' hi' where+            lo' = alo .&. blo+            hi' = ahi .&. bhi+      largeWordOr (LargeKey alo ahi) (LargeKey blo bhi) =+         LargeKey lo' hi' where+            lo' = alo .|. blo+            hi' = ahi .|. bhi+      largeWordXor (LargeKey alo ahi) (LargeKey blo bhi) =+         LargeKey lo' hi' where+            lo' = alo `xor` blo+            hi' = ahi `xor` bhi+      largeWordShift w 0 = w+      largeWordShift (LargeKey lo hi) x =+         if bitSize lo < bitSize hi+            then LargeKey (shift lo x) +                          (shift hi x .|. (shift (conv lo) (x - (bitSize lo))))+            else LargeKey (shift lo x)+                          (shift hi x .|. (conv $ shift lo (x - (bitSize lo))))+         where conv = integerToLargeWord . largeWordToInteger+      largeBitSize ~(LargeKey lo hi) = largeBitSize lo + largeBitSize hi++instance (Ord a, Bits a, LargeWord a, Bits b, LargeWord b) => Show (LargeKey a b) where+   showsPrec p = showInt . largeWordToInteger++instance (Ord a, Bits a, LargeWord a, Bits b, LargeWord b) => +   Num (LargeKey a b) where+      (+) = largeWordPlus+      fromInteger = integerToLargeWord ++-- Larger keys are instances of Bits provided their constituents are keys.++instance (Ord a, Bits a, LargeWord a, Bits b, LargeWord b) => +   Bits (LargeKey a b) where+      (.&.) = largeWordAnd+      (.|.) = largeWordOr+      xor = largeWordXor+      shift = largeWordShift+      bitSize = largeBitSize++instance (Ord a, Bits a, Bounded a, Integral a, LargeWord a, +                 Bits b, Bounded b, Integral b, LargeWord b) => +   Bounded (LargeKey a b) where+      minBound = 0+      maxBound =+         result where+            result =+               fromIntegral $+               (1 + fromIntegral (maxBound `asTypeOf` (boflk result)))*+                  (1 + fromIntegral (maxBound `asTypeOf` (aoflk result))) - 1++aoflk :: (LargeKey a b) -> a+aoflk = undefined+boflk :: (LargeKey a b) -> b+boflk = undefined++instance (Ord a, Bits a, LargeWord a, Ord b, Bits b, LargeWord b) =>+   Integral (LargeKey a b) where+      toInteger = largeWordToInteger++instance (Ord a, Bits a, LargeWord a, Ord b, Bits b, LargeWord b) =>+   Real (LargeKey a b)++instance Enum (LargeKey a b)++type Word96   = LargeKey Word32 Word64+type Word128  = LargeKey Word64 Word64+type Word160  = LargeKey Word32 Word128+type Word192  = LargeKey Word64 Word128+type Word224  = LargeKey Word32 Word192+type Word256  = LargeKey Word64 Word192+type Word512  = LargeKey Word256 Word256+type Word1024 = LargeKey Word512 Word512+type Word2048 = LargeKey Word1024 Word1024+type Word4096 = LargeKey Word1024 Word1024
+ scripts/QuickCheck.hs view
@@ -0,0 +1,70 @@+--+-- Copyright (c) 2004 Don Stewart - http://www.cse.unsw.edu.au/~dons+-- GPL version 2 or later (see http://www.gnu.org/copyleft/gpl.html)+--++--+-- | QuickCheck. use hs-plugins to run a Haskell expression under+-- controlled conditions.+--+import System.Eval.Haskell      (unsafeEval_)++import Data.Char                (chr)+import Data.Maybe               (isJust, fromJust)+import Control.Monad++import System.Random+import System.Exit              (exitWith, ExitCode(ExitSuccess))+import System.IO                (getContents, putStrLn)+import System.Posix.Resource    (setResourceLimit,+                                 Resource(ResourceCPUTime),+                                 ResourceLimits(ResourceLimits),+                                 ResourceLimit(ResourceLimit))+import Test.QuickCheck++import qualified Control.Exception++rlimit = ResourceLimit 5++context = prelude ++ prehier ++ datas ++ qualifieds ++ controls ++ other ++ extras++prelude = ["qualified Prelude as P", "Prelude"]++other = ["Text.Printf"]++prehier = ["Char", "List", "Maybe", "Numeric", "Random" ]++qualifieds = ["qualified Data.Map as M"+             ,"qualified Data.Set as S"+             ,"qualified Data.Generics as G"+             ,"qualified Data.IntSet as I"]++datas   = map ("Data." ++) [+                "Array", "Complex",+                "Bits", "Bool", "Char", "Dynamic", "Either", +                "Graph", "Int", "Ix", "List",+                "Maybe", "Ratio", "Tree", "Tuple", "Typeable", "Word" +              ]++controls = map ("Control." ++) ["Monad", "Monad.Cont", "Monad.State", "Monad.Writer", "Monad.Reader", "Monad.Fix", "Arrow"]++extras   = ["ShowQ","ShowFun","Test.QuickCheck","L","LargeWord"] -- a show instance for (Q a)++main = do+    setResourceLimit ResourceCPUTime (ResourceLimits rlimit rlimit)+    s <- getLine+    when (not . null $ s) $ do+        x <- sequence (take 3 (repeat $ getStdRandom (randomR (97,122)) >>= return . chr))+        s <- unsafeEval_ ("let { "++x+++                         " = \n# 1 \"<irc>\"\n"++s+++                         "\n} in (myquickcheck "++x+++                         ")") (context) [] [] []+        case s of+            Left  e -> mapM_ putStrLn e+            Right a -> Control.Exception.catch+                (a >>= putStr . take 512)+                (\e -> Control.Exception.handle (const $ putStrLn "Exception") $ do+                            e' <- Control.Exception.evaluate e+                            putStrLn $ "Exception: " ++ take 128 (show e'))+    exitWith ExitSuccess+
scripts/RunPlugs.hs view
@@ -25,35 +25,105 @@  rlimit = ResourceLimit 3 -context = prelude ++ prehier ++ datas ++ qualifieds ++ controls ++ other ++ template ++ extras+context = prelude ++ prehier ++ datas ++ qualifieds ++ controls ++ other+       ++ template ++ extras ++ numbers -prelude = ["qualified Prelude as P", "Prelude"]+prelude =+    ["qualified Prelude as P", "Prelude"] -other = ["Text.Printf"]+other   =+    ["Text.Printf"+    ,"Text.PrettyPrint.HughesPJ hiding (empty)"+    ,"Math.OEIS"] -prehier = ["Char", "List", "Maybe", "Numeric", "Random" ]+prehier =+    ["Numeric"] -qualifieds = ["qualified Data.Map as M"-             ,"qualified Data.Set as S"-             ,"qualified Data.IntSet as I"]+qualifieds =+    ["qualified Data.Map                    as M"+    ,"qualified Data.IntMap                 as I"+    ,"qualified Data.ByteString             as S"+    ,"qualified Data.ByteString.Char8       as SC"+    ,"qualified Data.ByteString.Lazy        as L"+    ,"qualified Data.ByteString.Lazy.Char8  as LC"+    ,"qualified Data.Set"+    ,"qualified Data.Generics"+    ,"qualified Data.IntSet"+    ,"qualified Data.Foldable"+    ,"qualified Data.Sequence"+    ,"qualified Data.Traversable"+    ,"qualified Control.Monad.Writer"+    ] -datas   = map ("Data." ++) [-                "Array", "Complex",-                "Bits", "Bool", "Char", "Dynamic", "Either", -                "Graph", "Int", "Ix", "List",-                "Maybe", "Ratio", "Tree", "Tuple", "Typeable", "Word" -              ]+datas   = map ("Data." ++)+    ["Array"+    ,"Bits"+    ,"Bool"+    ,"Char"+    ,"Complex"+    ,"Dynamic"+    ,"Either"+    ,"Eq"+    ,"Fixed"+--  ,"Foldable"+--  ,"Function"+--  ,"Generics"+    ,"Graph"+    ,"Int"+--  ,"IntMap"+--  ,"IntSet"+    ,"Ix"+    ,"List"+--  ,"Map"+    ,"Maybe"+    ,"Monoid"+    ,"Ord"+    ,"Ratio"+--  ,"Set"+    ,"Tree"+    ,"Tuple"+    ,"Typeable"+    ,"Word"+    ] -controls = map ("Control." ++) ["Monad", "Monad.Cont", "Monad.State", "Monad.Reader", "Monad.Fix", "Arrow"]+numbers = map ("Data.Number." ++)+    ["Symbolic"+    ,"Dif"+    ,"CReal"+    ,"Fixed"+    ,"Interval"+    ,"BigFloat"+    ,"Natural"] +controls = map ("Control." ++)+    ["Monad"+    ,"Monad.Cont"+    ,"Monad.Error"+    ,"Monad.Identity"+    ,"Monad.List"+    ,"Monad.RWS"+    ,"Monad.Reader"+    ,"Monad.State"+    ,"Monad.Trans"+    ,"Monad.Fix"+    ,"Monad.Instances"+    ,"Applicative"+    ,"Arrow hiding (pure)"+--  ,"Arrow.Transformer"+--  ,"Arrow.Transformer.All"+--  ,"Arrow.Operations"+    ,"Parallel"+    ,"Parallel.Strategies"+    ]+ -- -- See if TH is safe with runIO and friends hidden. -- -- Be very careful here. The semantics of what is safe and unsafe is a -- bit blurry. It depends on what GHC allows. ---template = ["Language.Haskell.TH hiding (runIO,reify)"]-extras   = ["ShowQ"] -- a show instance for (Q a)+template = [] -- ["Language.Haskell.TH hiding (runIO,reify)"]+extras   = ["ShowQ","ShowFun","L","LargeWord","SimpleReflect hiding (var)"]  main = do     setResourceLimit ResourceCPUTime (ResourceLimits rlimit rlimit)@@ -63,13 +133,13 @@         s <- unsafeEval_ ("let { "++x++                          " = \n# 1 \"<irc>\"\n"++s++                          "\n} in P.take 2048 (P.show "++x++-                         ")") context ["-fth"] [] []+                         ")") context ["-O","-fasm","-fextended-default-rules","-package oeis"] [] []         case s of             Left  e -> mapM_ putStrLn e             Right v -> Control.Exception.catch                 (putStrLn v)                 (\e -> Control.Exception.handle (const $ putStrLn "Exception") $ do                             e' <- Control.Exception.evaluate e-                            putStrLn $ "Exception: " ++ show e')+                            putStrLn $ "Exception: " ++ take 1024 (show e'))     exitWith ExitSuccess 
+ scripts/RunSmallCheck.hs view
@@ -0,0 +1,70 @@+--+-- Copyright (c) 2004 Don Stewart - http://www.cse.unsw.edu.au/~dons+-- GPL version 2 or later (see http://www.gnu.org/copyleft/gpl.html)+--++--+-- | QuickCheck. use hs-plugins to run a Haskell expression under+-- controlled conditions.+--+import System.Eval.Haskell      (unsafeEval_)++import Data.Char                (chr)+import Data.Maybe               (isJust, fromJust)+import Control.Monad++import System.Random+import System.Exit              (exitWith, ExitCode(ExitSuccess))+import System.IO                (getContents, putStrLn)+import System.Posix.Resource    (setResourceLimit,+                                 Resource(ResourceCPUTime),+                                 ResourceLimits(ResourceLimits),+                                 ResourceLimit(ResourceLimit))+import SmallCheck++import qualified Control.Exception++rlimit = ResourceLimit 5++context = prelude ++ prehier ++ datas ++ qualifieds ++ controls ++ other ++ extras++prelude = ["qualified Prelude as P", "Prelude"]++other = ["Text.Printf"]++prehier = ["Char", "List", "Maybe", "Numeric", "Random" ]++qualifieds = ["qualified Data.Map as M"+             ,"qualified Data.Set as S"+             ,"qualified Data.Generics as G"+             ,"qualified Data.IntSet as I"]++datas   = map ("Data." ++) [+                "Array", "Complex", +                "Bits", "Bool", "Char", "Dynamic", "Either", +                "Graph", "Int", "Ix", "List",+                "Maybe", "Ratio", "Tree", "Tuple", "Typeable", "Word" +              ]++controls = map ("Control." ++) ["Monad", "Monad.Cont", "Monad.State", "Monad.Writer", "Monad.Reader", "Monad.Fix", "Arrow"]++extras   = ["ShowQ","SmallCheck","L","LargeWord"] -- a show instance for (Q a)++main = do+    setResourceLimit ResourceCPUTime (ResourceLimits rlimit rlimit)+    s <- getLine+    when (not . null $ s) $ do+        x <- sequence (take 3 (repeat $ getStdRandom (randomR (97,122)) >>= return . chr))+        s <- unsafeEval_ ("let { "++x+++                         " = \n# 1 \"<irc>\"\n"++s+++                         "\n} in (smallCheck 6 "++x+++                         ")") (context) [] [] []+        case s of+            Left  e -> mapM_ putStrLn e+            Right a -> Control.Exception.catch+                (a >>= putStr . take 512)+                (\e -> Control.Exception.handle (const $ putStrLn "Exception") $ do+                            e' <- Control.Exception.evaluate e+                            putStrLn $ "Exception: " ++ take 128 (show e'))+    exitWith ExitSuccess+
+ scripts/ShowFun.hs view
@@ -0,0 +1,13 @@+--+-- Helper code for runplugs that doesn't agree with SmallCheck+--++module ShowFun where++import Data.Typeable++instance (Typeable a, Typeable b) => Show (a -> b) where+    show e = '<' : (show . typeOf) e ++ ">"++instance Typeable a => Show (IO a) where+    show e = '<' : (show . typeOf) e ++ ">"
scripts/ShowQ.hs view
@@ -6,12 +6,108 @@ -- module ShowQ where -import Language.Haskell.TH+-- import Language.Haskell.TH import System.IO.Unsafe import Data.Dynamic+import Data.Ratio -instance (Typeable a, Typeable b) => Show (a -> b) where-    show e = '<' : (show . typeOf) e ++ ">"+import Test.QuickCheck.Batch+import Test.QuickCheck+import Data.Char+import Data.List+import Data.Word+import Data.Int+import System.Random -instance Ppr a => Show (Q a) where-    show e = unsafePerformIO $ runQ e >>= return . pprint+type T = [Int]+type I = Int++-- instance Ppr a => Show (Q a) where+--     show e = unsafePerformIO $ runQ e >>= return . pprint++instance Arbitrary Char where+    arbitrary     = choose (minBound, maxBound)+    coarbitrary c = variant (ord c `rem` 4)++instance Arbitrary Word8 where+    arbitrary = choose (minBound, maxBound)+    coarbitrary c = variant (fromIntegral ((fromIntegral c) `rem` 4))++instance Arbitrary Ordering where+    arbitrary     = elements [LT,EQ,GT]+    coarbitrary LT = variant 1+    coarbitrary EQ = variant 2+    coarbitrary GT = variant 0++instance Arbitrary Int64 where+  arbitrary     = sized $ \n -> choose (-fromIntegral n,fromIntegral n)+  coarbitrary n = variant (fromIntegral (if n >= 0 then 2*n else 2*(-n) + 1))++instance (Integral a, Arbitrary a) => Arbitrary (Ratio a) where+  arbitrary    = do a <- arbitrary+                    b <- arbitrary+                    return $ if b == 0+                         then if a == 0+                            then (1 % 1)+                            else (b % a)+                         else (a % b)++  coarbitrary m = variant (fromIntegral $ if n >= 0 then 2*n else 2*(-n) + 1)+    where n = numerator m++instance Random Word8 where+  randomR = integralRandomR+  random = randomR (minBound,maxBound)++instance Random Int64 where+  randomR = integralRandomR+  random  = randomR (minBound,maxBound)++integralRandomR :: (Integral a, RandomGen g) => (a,a) -> g -> (a,g)+integralRandomR  (a,b) g = case randomR (fromIntegral a :: Integer,+                                         fromIntegral b :: Integer) g of+                            (x,g) -> (fromIntegral x, g)++myquickcheck :: Testable a => a -> IO String+myquickcheck a = do+    rnd <- newStdGen+    tests (evaluate a) rnd 0 0 []++tests :: Gen Result -> StdGen -> Int -> Int -> [[String]] -> IO String+tests gen rnd0 ntest nfail stamps+  | ntest == 500  = done "OK, passed" ntest stamps+  | nfail == 1000 = done "Arguments exhausted after" ntest stamps+  | otherwise = case ok result of+       Nothing    -> tests gen rnd1 ntest (nfail+1) stamps+       Just True  -> tests gen rnd1 (ntest+1) nfail (stamp result:stamps)+       Just False -> return $ "Falsifiable, after "+                               ++ show ntest+                               ++ " tests:\n"+                               ++ unlines (arguments result)+   where+      result      = generate (((+ 3) . (`div` 2)) ntest) rnd2 gen+      (rnd1,rnd2) = split rnd0++done :: String -> Int -> [[String]] -> IO String+done mesg ntest stamps = return $ mesg ++ " " ++ show ntest ++ " tests" ++ table+ where+  table = display+        . map entry+        . reverse+        . sort+        . map pairLength+        . group+        . sort+        . filter (not . null)+        $ stamps++  display []  = ".\n"+  display [x] = " (" ++ x ++ ").\n"+  display xs  = ".\n" ++ unlines (map (++ ".") xs)++  pairLength xss@(xs:_) = (length xss, xs)+  entry (n, xs)         = percentage n ntest+                       ++ " "+                       ++ concat (intersperse ", " xs)++  percentage n m        = show ((100 * n) `div` m) ++ "%"
+ scripts/SimpleReflect.hs view
@@ -0,0 +1,212 @@+-----------------------------------------------------------------------------+-- |+-- Module      :  SimpleReflect+-- Copyright   :  (c) 2008 Twan van Laarhoven+-- License     :  BSD-style+-- +-- Maintainer  :  twanvl@gmail.com+-- Stability   :  experimental+-- Portability :  portable+--+-- Simple reflection of haskell expressions containing variables.+--+-----------------------------------------------------------------------------+module SimpleReflect+    ( Expr+    , var, fun, expr, reduce+    , a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z+    ) where++import Data.List+import Control.Applicative++------------------------------------------------------------------------------+-- Data type+------------------------------------------------------------------------------++data Expr = Expr+   { showExpr   :: Int -> ShowS+   , intExpr    :: Maybe Integer+   , doubleExpr :: Maybe Double+   , reduced    :: Maybe Expr+   }++instance Show Expr where+    showsPrec p r = showExpr r p++-- Default expression+emptyExpr :: Expr+emptyExpr = Expr { showExpr   = \_ -> showString ""+                 , intExpr    = Nothing+                 , doubleExpr = Nothing+                 , reduced    = Nothing+                 }++------------------------------------------------------------------------------+-- Lifting and combining expressions+------------------------------------------------------------------------------++-- | A variable+var :: String -> Expr+var s = emptyExpr { showExpr = \_ -> showString s }++lift :: Show a => a -> Expr+lift x = emptyExpr { showExpr = \p -> showsPrec p x }++data Fixity = L | R deriving Eq++-- | A operator as expression+op :: Fixity -> Int -> String -> Expr -> Expr -> Expr+op fix prec op a b = emptyExpr { showExpr = showFun }+ where showFun p = showParen (p > prec)+                     $ showExpr a (if fix == L then prec else prec + 1)+                     . showString op+                     . showExpr b (if fix == R then prec else prec + 1)++------------------------------------------------------------------------------+-- Adding numeric results+------------------------------------------------------------------------------++iOp  r f a   = (r a  ) { intExpr    = f <$> intExpr    a }+iOp2 r f a b = (r a b) { intExpr    = f <$> intExpr    a <*> intExpr    b }+dOp  r f a   = (r a  ) { doubleExpr = f <$> doubleExpr a }+dOp2 r f a b = (r a b) { doubleExpr = f <$> doubleExpr a <*> doubleExpr b }++withReduce r a    = let rr = r a in+                    rr { reduced = withReduce r <$> reduced a+                               <|> fromInteger <$> intExpr    rr+                               <|> fromDouble  <$> doubleExpr rr+                       }+withReduce2 r a b = let rr = r a b in+                    rr { reduced = (\a' -> withReduce2 r a' b) <$> reduced a+                               <|> (\b' -> withReduce2 r a b') <$> reduced b+                               <|> fromInteger <$> intExpr    rr+                               <|> fromDouble  <$> doubleExpr rr+                       }++------------------------------------------------------------------------------+-- Function types+------------------------------------------------------------------------------++class FromExpr a where+    fromExpr :: Expr -> a++instance FromExpr Expr where+    fromExpr = id++instance (Show a, FromExpr b) => FromExpr (a -> b) where+    fromExpr f a = fromExpr $ op L 10 " " f (lift a)++fun :: FromExpr a => String -> a+fun = fromExpr . var++------------------------------------------------------------------------------+-- Variables!+------------------------------------------------------------------------------++a,b,c,d,e,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z :: Expr+[a,b,c,d,e,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z]+   = [var [x] | x <- ['a'..'e']++['i'..'z']]++f,g,h :: FromExpr a => a+f = fun "f"+g = fun "g"+h = fun "h"++------------------------------------------------------------------------------+-- Forcing conversion & evaluation+------------------------------------------------------------------------------++-- | Force something to be an expression+expr :: Expr -> Expr+expr = id++-- | Reduce (evaluate) an expression once+--   for example 1 + 2 + 3 + 4 ==> 3 + 3 + 4+reduce :: Expr -> Expr+reduce e = maybe e id (reduced e)++reduction :: Expr -> [Expr]+reduction e = e : unfoldr (\e -> do e' <- reduced e; return (e',e')) e++------------------------------------------------------------------------------+-- Numeric classes+------------------------------------------------------------------------------++instance Eq Expr where+    Expr{ intExpr    = Just a } == Expr{ intExpr    = Just b }  =  a == b+    Expr{ doubleExpr = Just a } == Expr{ doubleExpr = Just b }  =  a == b+    a                           == b                            =  show a == show b++instance Ord Expr where+    compare Expr{ intExpr    = Just a } Expr{ intExpr    = Just b }  =  compare a b+    compare Expr{ doubleExpr = Just a } Expr{ doubleExpr = Just b }  =  compare a b+    compare a                           b                            =  compare (show a) (show b)+    min = fun "min" `iOp2` min `dOp2` min+    max = fun "max" `iOp2` max `dOp2` max++instance Num Expr where+    (+)    = withReduce2 $ op L 6 " + " `iOp2` (+)   `dOp2` (+)+    (-)    = withReduce2 $ op L 6 " - " `iOp2` (-)   `dOp2` (-)+    (*)    = withReduce2 $ op L 7 " * " `iOp2` (*)   `dOp2` (*)+    negate = withReduce  $ fun "negate" `iOp` negate `dOp` negate+    abs    = withReduce  $ fun "abs"    `iOp` abs    `dOp` abs+    signum = withReduce  $ fun "signum" `iOp` signum `dOp` signum+    fromInteger i = (lift i)+                     { intExpr    = Just i+                     , doubleExpr = Just $ fromInteger i }++instance Real Expr where+    toRational expr = case (doubleExpr expr, intExpr expr) of+          (Just d,_) -> toRational d+          (_,Just i) -> toRational i+          _          -> error "not a number"++instance Integral Expr where+    quotRem a b = (quot a b, rem a b)+    divMod  a b = (div  a b, mod a b)+    quot = withReduce2 $ op L 7 " `quot` " `iOp2` quot+    rem  = withReduce2 $ op L 7 " `rem` "  `iOp2` rem+    div  = withReduce2 $ op L 7 " `div` "  `iOp2` div+    mod  = withReduce2 $ op L 7 " `mod` "  `iOp2` mod+    toInteger expr = case intExpr expr of+          Just i -> i+          _      -> error "not a number"++instance Fractional Expr where+    (/)   = withReduce2 $ op L 7 " / " `dOp2` (/)+    recip = withReduce  $ fun "recip"  `dOp` recip+    fromRational r = fromDouble (fromRational r)++fromDouble d = (lift d) { doubleExpr = Just d }++instance Floating Expr where+    pi    = (var "pi") { doubleExpr = Just pi }+    exp   = withReduce  $ fun "exp"   `dOp` exp+    sqrt  = withReduce  $ fun "sqrt"  `dOp` sqrt+    log   = withReduce  $ fun "log"   `dOp` log+    (**)  = withReduce2 $ op R 8 "**" `dOp2` (**)+    sin   = withReduce  $ fun "sin"   `dOp` sin+    cos   = withReduce  $ fun "cos"   `dOp` cos+    sinh  = withReduce  $ fun "sinh"  `dOp` sinh+    cosh  = withReduce  $ fun "cosh"  `dOp` cosh+    asin  = withReduce  $ fun "asin"  `dOp` asin+    acos  = withReduce  $ fun "acos"  `dOp` acos+    atan  = withReduce  $ fun "atan"  `dOp` atan+    asinh = withReduce  $ fun "asinh" `dOp` asinh+    acosh = withReduce  $ fun "acosh" `dOp` acosh+    atanh = withReduce  $ fun "atanh" `dOp` atanh++instance Enum Expr where+    succ   = withReduce  $ fun "succ" `iOp` succ `dOp` succ+    pred   = withReduce  $ fun "pred" `iOp` pred `dOp` pred+    toEnum = fun "toEnum"+    fromEnum = fromEnum . toInteger+    enumFrom       a     = map fromInteger $ enumFrom       (toInteger a)+    enumFromThen   a b   = map fromInteger $ enumFromThen   (toInteger a) (toInteger b)+    enumFromTo     a   c = map fromInteger $ enumFromTo     (toInteger a)               (toInteger c)+    enumFromThenTo a b c = map fromInteger $ enumFromThenTo (toInteger a) (toInteger b) (toInteger c)++instance Bounded Expr where+    minBound = var "minBound"+    maxBound = var "maxBound"
+ scripts/SmallCheck.hs view
@@ -0,0 +1,378 @@+---------------------------------------------------------------------+-- SmallCheck: another lightweight testing library.+-- Colin Runciman, August 2006+-- Version 0.2 (November 2006)+--+-- After QuickCheck, by Koen Claessen and John Hughes (2000-2004).+---------------------------------------------------------------------++module SmallCheck (+  smallCheck, depthCheck,+  Property, Testable,+  forAll, forAllElem,+  exists, existsDeeperBy, thereExists, thereExistsElem,+  (==>),+  Series, Serial(..),+  (\/), (><), two, three, four,+  cons0, cons1, cons2, cons3, cons4,+  alts0, alts1, alts2, alts3, alts4,+  N(..), Nat, Natural,+  depth, inc, dec+  ) where++import Data.List (intersperse)+import Control.Monad (when)+import System.IO (stdout, hFlush)++------------------ <Series of depth-bounded values> -----------------++-- Series arguments should be interpreted as a depth bound (>=0)+-- Series results should have finite length++type Series a = Int -> [a]++-- sum+infixr 7 \/+(\/) :: Series a -> Series a -> Series a+s1 \/ s2 = \d -> s1 d ++ s2 d++-- product+infixr 8 ><+(><) :: Series a -> Series b -> Series (a,b)+s1 >< s2 = \d -> [(x,y) | x <- s1 d, y <- s2 d]++------------------- <methods for type enumeration> ------------------++-- enumerated data values should be finite and fully defined+-- enumerated functional values should be total and strict++-- bounds:+-- for data values, the depth of nested constructor applications+-- for functional values, both the depth of nested case analysis+-- and the depth of results+ +class Serial a where+  series   :: Series a+  coseries :: Serial b => Series (a->b)++instance Serial () where+  series   _ = [()]+  coseries d = [ \() -> b+               | b <- series d ]++instance Serial Int where+  series   d = [(-d)..d]+  coseries d = [ \i -> if i > 0 then f (N (i - 1))+                       else if i < 0 then g (N (abs i - 1))+                       else z+               | z <- alts0 d, f <- alts1 d, g <- alts1 d ]++instance Serial Integer where+  series   d = [ toInteger (i :: Int)+               | i <- series d ]+  coseries d = [ f . (fromInteger :: Integer->Int)+               | f <- series d ]++newtype N a = N a++instance Show a => Show (N a) where+  show (N i) = show i++instance (Integral a, Serial a) => Serial (N a) where+  series   d = map N [0..d']+               where+               d' = fromInteger (toInteger d)+  coseries d = [ \(N i) -> if i > 0 then f (N (i - 1))+                           else z+               | z <- alts0 d, f <- alts1 d ]++type Nat = N Int+type Natural = N Integer++instance Serial Float where+  series d   = [ encodeFloat sig exp+               | (sig,exp) <- series d,+                 odd sig || sig==0 && exp==0 ]+  coseries d = [ f . decodeFloat+               | f <- series d ]+             +instance Serial Double where+  series   d = [ frac (x :: Float)+               | x <- series d ]+  coseries d = [ f . (frac :: Double->Float)+               | f <- series d ]++frac :: (Real a, Fractional a, Real b, Fractional b) => a -> b+frac = fromRational . toRational++instance Serial Char where+  series d   = take (d+1) ['a'..'z']+  coseries d = [ \c -> f (N (fromEnum c - fromEnum 'a'))+               | f <- series d ]++instance (Serial a, Serial b) =>+         Serial (a,b) where+  series   = series >< series+  coseries = map uncurry . coseries++instance (Serial a, Serial b, Serial c) =>+         Serial (a,b,c) where+  series   = \d -> [(a,b,c) | (a,(b,c)) <- series d]+  coseries = map uncurry3 . coseries++instance (Serial a, Serial b, Serial c, Serial d) =>+         Serial (a,b,c,d) where+  series   = \d -> [(a,b,c,d) | (a,(b,(c,d))) <- series d]+  coseries = map uncurry4 . coseries++uncurry3 :: (a->b->c->d) -> ((a,b,c)->d)+uncurry3 f (x,y,z) = f x y z++uncurry4 :: (a->b->c->d->e) -> ((a,b,c,d)->e)+uncurry4 f (w,x,y,z) = f w x y z++two   :: Series a -> Series (a,a)+two   s = s >< s++three :: Series a -> Series (a,a,a)+three s = \d -> [(x,y,z) | (x,(y,z)) <- (s >< s >< s) d]++four  :: Series a -> Series (a,a,a,a)+four  s = \d -> [(w,x,y,z) | (w,(x,(y,z))) <- (s >< s >< s >< s) d]++cons0 :: +         a -> Series a+cons0 c _ = [c]++cons1 :: Serial a =>+         (a->b) -> Series b+cons1 c d = [c z | d > 0, z <- series (d-1)]++cons2 :: (Serial a, Serial b) =>+         (a->b->c) -> Series c+cons2 c d = [c y z | d > 0, (y,z) <- series (d-1)]++cons3 :: (Serial a, Serial b, Serial c) =>+         (a->b->c->d) -> Series d+cons3 c d = [c x y z | d > 0, (x,y,z) <- series (d-1)]++cons4 :: (Serial a, Serial b, Serial c, Serial d) =>+         (a->b->c->d->e) -> Series e+cons4 c d = [c w x y z | d > 0, (w,x,y,z) <- series (d-1)]++alts0 ::  Serial a =>+            Series a+alts0 d = series d++alts1 ::  (Serial a, Serial b) =>+            Series (a->b)+alts1 d = if d > 0 then series (dec d)+          else [\_ -> x | x <- series d]++alts2 ::  (Serial a, Serial b, Serial c) =>+            Series (a->b->c)+alts2 d = if d > 0 then series (dec d)+          else [\_ _ -> x | x <- series d]++alts3 ::  (Serial a, Serial b, Serial c, Serial d) =>+            Series (a->b->c->d)+alts3 d = if d > 0 then series (dec d)+          else [\_ _ _ -> x | x <- series d]++alts4 ::  (Serial a, Serial b, Serial c, Serial d, Serial e) =>+            Series (a->b->c->d->e)+alts4 d = if d > 0 then series (dec d)+          else [\_ _ _ _ -> x | x <- series d]++instance Serial Bool where+  series     = cons0 True \/ cons0 False+  coseries d = [ \x -> if x then b1 else b2+               | (b1,b2) <- series d ]++instance Serial a => Serial (Maybe a) where+  series     = cons0 Nothing \/ cons1 Just+  coseries d = [ \m -> case m of+                       Nothing -> z+                       Just x  -> f x+               |  z <- alts0 d ,+                  f <- alts1 d ]++instance (Serial a, Serial b) => Serial (Either a b) where+  series     = cons1 Left \/ cons1 Right+  coseries d = [ \e -> case e of+                       Left x  -> f x+                       Right y -> g y+               |  f <- alts1 d ,+                  g <- alts1 d ]++instance Serial a => Serial [a] where+  series     = cons0 [] \/ cons2 (:)+  coseries d = [ \xs -> case xs of+                        []      -> y+                        (x:xs') -> f x xs'+               |   y <- alts0 d ,+                   f <- alts2 d ]++-- Warning: the coseries instance here may generate duplicates.+instance (Serial a, Serial b) => Serial (a->b) where+  series = coseries+  coseries d = [ \f -> g [f x | x <- series d]+               | g <- series d ]              ++-- For customising the depth measure.  Use with care!++depth :: Int -> Int -> Int+depth d d' | d >= 0    = d'+1-d+           | otherwise = error "SmallCheck.depth: argument < 0"++dec :: Int -> Int+dec d | d > 0     = d-1+      | otherwise = error "SmallCheck.dec: argument <= 0"++inc :: Int -> Int+inc d = d+1++-- show the extension of a function (in part, bounded both by+-- the number and depth of arguments)+instance (Serial a, Show a, Show b) => Show (a->b) where+  show f = +    if maxarheight == 1+    && sumarwidth + length ars * length "->;" < widthLimit then+      "{"++(+      concat $ intersperse ";" $ [a++"->"++r | (a,r) <- ars]+      )++"}"+    else+      concat $ [a++"->\n"++indent r | (a,r) <- ars]+    where+    ars = take lengthLimit [ (show x, show (f x))+                           | x <- series depthLimit ]+    maxarheight = maximum  [ max (height a) (height r)+                           | (a,r) <- ars ]+    sumarwidth = sum       [ length a + length r +                           | (a,r) <- ars]+    indent = unlines . map ("  "++) . lines+    height = length . lines+    (widthLimit,lengthLimit,depthLimit) = (80,20,3)::(Int,Int,Int)++---------------- <properties and their evaluation> ------------------++-- adapted from QuickCheck originals: here results come in lists,+-- properties have depth arguments, stamps (for classifying random+-- tests) are omitted, existentials are introduced++newtype PR = Prop [Result]++data Result = Result {ok :: Maybe Bool, arguments :: [String]}++nothing :: Result+nothing = Result {ok = Nothing, arguments = []}++result :: Result -> PR+result res = Prop [res]++newtype Property = Property (Int -> PR)++class Testable a where+  property :: a -> Int -> PR++instance Testable Bool where+  property b _ = Prop [Result (Just b) []]++instance Testable PR where+  property prop _ = prop++instance (Serial a, Show a, Testable b) => Testable (a->b) where+  property f = f' where Property f' = forAll series f++instance Testable Property where+  property (Property f) d = f d++evaluate :: Testable a => a -> Series Result+evaluate x d = rs where Prop rs = property x d++forAll :: (Show a, Testable b) => Series a -> (a->b) -> Property+forAll xs f = Property $ \d -> Prop $+  [ r{arguments = show x : arguments r}+  | x <- xs d, r <- evaluate (f x) d ]++forAllElem :: (Show a, Testable b) => [a] -> (a->b) -> Property+forAllElem xs = forAll (const xs)++thereExists :: Testable b => Series a -> (a->b) -> Property+thereExists xs f = Property $ \d -> Prop $+  [ Result+      ( Just $ or [ all pass (evaluate (f x) d)+                  | x <- xs d ] )+      [] ] +  where+  pass (Result Nothing _)  = True+  pass (Result (Just b) _) = b++thereExistsElem :: Testable b => [a] -> (a->b) -> Property+thereExistsElem xs = thereExists (const xs)++exists :: (Serial a, Testable b) =>+            (a->b) -> Property+exists = thereExists series++existsDeeperBy :: (Serial a, Testable b) =>+                    (Int->Int) -> (a->b) -> Property+existsDeeperBy f = thereExists (series . f)+ +infixr 0 ==>++(==>) :: Testable a => Bool -> a -> Property+True ==>  x = Property (property x)+False ==> x = Property (const (result nothing))++--------------------- <top-level test drivers> ----------------------++-- similar in spirit to QuickCheck but with iterative deepening++-- test for values of depths 0..d stopping when a property+-- fails or when it has been checked for all these values+smallCheck :: Testable a => Int -> a -> IO String+smallCheck d = iterCheck 0 (Just d)++depthCheck :: Testable a => Int -> a -> IO String+depthCheck d = iterCheck d (Just d)++iterCheck :: Testable a => Int -> Maybe Int -> a -> IO String+iterCheck dFrom mdTo t = iter dFrom+  where+  iter :: Int -> IO String+  iter d = do+    let Prop results = property t d+    (ok,s) <- check (mdTo==Nothing) 0 0 True results+    maybe (iter (d+1))+          (\dTo -> if ok && d < dTo+                        then iter (d+1)+                        else return s)+          mdTo++check :: Bool -> Int -> Int -> Bool -> [Result] -> IO (Bool, String)+check i n x ok rs | null rs = do+  let s = "  Completed "++show n++" test(s)"+      y = if i then "." else " without failure."+      z | x > 0     = "  But "++show x++" did not meet ==> condition."+        | otherwise = ""+  return (ok, s ++ y ++ z)++check i n x ok (Result Nothing _ : rs) = do+  progressReport i n x+  check i (n+1) (x+1) ok rs++check i n x f (Result (Just True) _ : rs) = do+  progressReport i n x+  check i (n+1) x f rs++check i n x f (Result (Just False) args : rs) = do+  let s = "  Failed test no. "++show (n+1)++". Test values follow."+      s' = s ++ ": " ++ concat (intersperse ", " args)+  if i then+      check i (n+1) x False rs+    else+      return (False, s')++progressReport :: Bool -> Int -> Int -> IO ()+progressReport _ _ _ = return ()
+ scripts/gnuplot.script view
@@ -0,0 +1,11 @@+set border 3+set xtics nomirror rotate ( "Don Stewart" 0, "Thomas Jaeger" 1, "J Louis" 2, "Samuel Bronson" 3, "Jason Dagit" 4, "Spencer Janssen" 5, "Bertram Felgenhauer" 6, "Pete Kazmier" 7, "Paolo Martini" 8, "Stefan Wehr" 9, "Dmitry Astapov" 10, "David House" 11, "Derek Elkins" 12, "David" 13, "Kevin Reid" 14, "smith" 15, "Simon Winwood" 16, "Shapr" 17, "Mark Wotton" 18, "Ketil Malde" 19, "tatd2" 20, "softpro" 21, "Ganesh" 22, "Duncan Coutts" 23, "Davidf" 24, "Andres" 25, "rizzix" 26, "mux" 27, "l.mai" 28, "Vesa Kaihlavirta" 29, "Vaclav Haisman" 30, "Peter Davis" 31, "Lemmih" 32, "Kenneth hoste" 33, "Josef Svenningsson" 34, "Joel Koerwer" 35, "Joachim breitner" 36, "Echo Nolan" 37 )+set border 3+set boxwidth 0.7 relative+set xrange [-1:*]+set yrange [1:*]+set logscale y+set ticscale 0+set terminal png font Vera 9+set output "lambdabot-commiters.png"+plot "authors" ti "Commiters" with boxes 
scripts/hoogle/Makefile view
@@ -30,6 +30,7 @@ 	cp -r web/* deploy 	cp src/hoogle.txt deploy/res/hoogle.txt 	cp src/Web/res/* deploy/res+	cp src/Doc/res/* deploy/res 	haddock --html --title=Hoogle --odir=deploy/haddock --prologue=docs/haddock.txt src/*.hs src/*/*.hs  
scripts/hoogle/README.txt view
@@ -11,32 +11,16 @@ Web Version
 -----------
 
-A web version is available at http://www.cs.york.ac.uk/~ndm/hoogle/
-
-
-Source Code License
--------------------
-
-This file is part of Hoogle, (c) Neil Mitchell 2004-2005
-http://www.cs.york.ac.uk/~ndm/hoogle/
-
-This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License.
-To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/2.0/
-or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
+A web version is available at http://www.haskell.org/hoogle
 
-Code contributions received from
-    Thomas "Bob" Davie (http://www.cs.kent.ac.uk/people/rpg/tatd2/)
-    Donald Bruce Stewart (http://www.cse.unsw.edu.au/~dons/)
-    Thomas Jäger
-    Gaal Yahas (http://gaal.livejournal.com/)
-    Mike Dodds (http://www-users.cs.york.ac.uk/~miked/)
+All the appropriate documentation/credits/reference material is on the Haskell wiki at
+http://www.haskell.org/haskellwiki/Hoogle
 
 
 Building
 --------
 
-To build the source type "hmake hoogle", you will need hmake, happy and ghc/nhc/hugs
-
+To build the source type "ghc --make" on the files.
 
 Folders
 -------
+ scripts/hoogle/data/hadhoo/Main.hs view
@@ -0,0 +1,36 @@++module Main where++import System.Environment+import System.Cmd+import Control.Monad+import Data.List+++helpMsg = "help msg for hadhoo\nhadhoo directory -output.hoo"++main :: IO ()+main = do args <- getArgs+          if null args then putStrLn helpMsg else do+            let (outfiles,infiles) = partition ("-" `isPrefixOf`) args+                outfile = last ("hoogle.txt":map tail outfiles)+            allfiles <- liftM concat $ mapM pickFiles infiles+            if null allfiles+              then putStrLn "No in files specified, nothing to do"+              else execute allfiles outfile+++pickFiles :: FilePath -> IO [FilePath]+pickFiles file = return [file]+++execute :: [FilePath] -> FilePath -> IO ()+execute srcfiles outfile = mapM_ (executeOne outfile) srcfiles++executeOne :: FilePath -> FilePath -> IO ()+executeOne outfile file = do+    system $ "haddock -hoogle " ++ file ++ " > temp.txt"+    src <- readFile "temp.txt"+    appendFile outfile src++
− scripts/hoogle/src/CmdLine/GetOpt.hs
@@ -1,317 +0,0 @@------------------------------------------------------------------------------
--- |
--- Module      :  System.Console.GetOpt
--- Copyright   :  (c) Sven Panne 2002-2005
--- License     :  BSD-style (see the file libraries/base/LICENSE)
--- 
--- Maintainer  :  libraries@haskell.org
--- Stability   :  experimental
--- Portability :  portable
---
--- This library provides facilities for parsing the command-line options
--- in a standalone program.  It is essentially a Haskell port of the GNU 
--- @getopt@ library.
---
------------------------------------------------------------------------------
-
-{-
-Sven Panne <Sven.Panne@informatik.uni-muenchen.de> Oct. 1996 (small
-changes Dec. 1997)
-
-Two rather obscure features are missing: The Bash 2.0 non-option hack
-(if you don't already know it, you probably don't want to hear about
-it...) and the recognition of long options with a single dash
-(e.g. '-help' is recognised as '--help', as long as there is no short
-option 'h').
-
-Other differences between GNU's getopt and this implementation:
-
-* To enforce a coherent description of options and arguments, there
-  are explanation fields in the option/argument descriptor.
-
-* Error messages are now more informative, but no longer POSIX
-  compliant... :-(
-
-And a final Haskell advertisement: The GNU C implementation uses well
-over 1100 lines, we need only 195 here, including a 46 line example! 
-:-)
--}
-
-module CmdLine.GetOpt (
-   -- * GetOpt
-   getOpt, getOpt',
-   usageInfo,
-   ArgOrder(..),
-   OptDescr(..),
-   ArgDescr(..),
-
-   -- * Example
-
-   -- $example
-) where
-
-import Prelude -- necessary to get dependencies right
-
-import List ( isPrefixOf )
-
--- |What to do with options following non-options
-data ArgOrder a
-  = RequireOrder                -- ^ no option processing after first non-option
-  | Permute                     -- ^ freely intersperse options and non-options
-  | ReturnInOrder (String -> a) -- ^ wrap non-options into options
-
-{-|
-Each 'OptDescr' describes a single option.
-
-The arguments to 'Option' are:
-
-* list of short option characters
-
-* list of long option strings (without \"--\")
-
-* argument descriptor
-
-* explanation of option for user
--}
-data OptDescr a =              -- description of a single options:
-   Option [Char]                --    list of short option characters
-          [String]              --    list of long option strings (without "--")
-          (ArgDescr a)          --    argument descriptor
-          String                --    explanation of option for user
-
--- |Describes whether an option takes an argument or not, and if so
--- how the argument is injected into a value of type @a@.
-data ArgDescr a
-   = NoArg                   a         -- ^   no argument expected
-   | ReqArg (String       -> a) String -- ^   option requires argument
-   | OptArg (Maybe String -> a) String -- ^   optional argument
-
-data OptKind a                -- kind of cmd line arg (internal use only):
-   = Opt       a                --    an option
-   | UnreqOpt  String           --    an un-recognized option
-   | NonOpt    String           --    a non-option
-   | EndOfOpts                  --    end-of-options marker (i.e. "--")
-   | OptErr    String           --    something went wrong...
-
--- | Return a string describing the usage of a command, derived from
--- the header (first argument) and the options described by the 
--- second argument.
-usageInfo :: String                    -- header
-          -> [OptDescr a]              -- option descriptors
-          -> String                    -- nicely formatted decription of options
-usageInfo header optDescr = unlines (header:table)
-   where (ss,ls,ds)     = (unzip3 . concatMap fmtOpt) optDescr
-         table          = zipWith3 paste (sameLen ss) (sameLen ls) ds
-         paste x y z    = "  " ++ x ++ "  " ++ y ++ "  " ++ z
-         sameLen xs     = flushLeft ((maximum . map length) xs) xs
-         flushLeft n xs = [ take n (x ++ repeat ' ') | x <- xs ]
-
-fmtOpt :: OptDescr a -> [(String,String,String)]
-fmtOpt (Option sos los ad descr) =
-   case lines descr of
-     []     -> [(sosFmt,losFmt,"")]
-     (d:ds) ->  (sosFmt,losFmt,d) : [ ("","",d') | d' <- ds ]
-   where sepBy _  []     = ""
-         sepBy _  [x]    = x
-         sepBy ch (x:xs) = x ++ ch:' ':sepBy ch xs
-         sosFmt = sepBy ',' (map (fmtShort ad) sos)
-         losFmt = sepBy ',' (map (fmtLong  ad) los)
-
-fmtShort :: ArgDescr a -> Char -> String
-fmtShort (NoArg  _   ) so = "-" ++ [so]
-fmtShort (ReqArg _ ad) so = "-" ++ [so] ++ " " ++ ad
-fmtShort (OptArg _ ad) so = "-" ++ [so] ++ "[" ++ ad ++ "]"
-
-fmtLong :: ArgDescr a -> String -> String
-fmtLong (NoArg  _   ) lo = "--" ++ lo
-fmtLong (ReqArg _ ad) lo = "--" ++ lo ++ "=" ++ ad
-fmtLong (OptArg _ ad) lo = "--" ++ lo ++ "[=" ++ ad ++ "]"
-
-{-|
-Process the command-line, and return the list of values that matched
-(and those that didn\'t). The arguments are:
-
-* The order requirements (see 'ArgOrder')
-
-* The option descriptions (see 'OptDescr')
-
-* The actual command line arguments (presumably got from 
-  'System.Environment.getArgs').
-
-'getOpt' returns a triple consisting of the option arguments, a list
-of non-options, and a list of error messages.
--}
-getOpt :: ArgOrder a                   -- non-option handling
-       -> [OptDescr a]                 -- option descriptors
-       -> [String]                     -- the command-line arguments
-       -> ([a],[String],[String])      -- (options,non-options,error messages)
-getOpt ordering optDescr args = (os,xs,es ++ map errUnrec us)
-   where (os,xs,us,es) = getOpt' ordering optDescr args
-
-{-|
-This is almost the same as 'getOpt', but returns a quadruple
-consisting of the option arguments, a list of non-options, a list of
-unrecognized options, and a list of error messages.
--}
-getOpt' :: ArgOrder a                         -- non-option handling
-        -> [OptDescr a]                       -- option descriptors
-        -> [String]                           -- the command-line arguments
-        -> ([a],[String], [String] ,[String]) -- (options,non-options,unrecognized,error messages)
-getOpt' _        _        []         =  ([],[],[],[])
-getOpt' ordering optDescr (arg:args) = procNextOpt opt ordering
-   where procNextOpt (Opt o)      _                 = (o:os,xs,us,es)
-         procNextOpt (UnreqOpt u) _                 = (os,xs,u:us,es)
-         procNextOpt (NonOpt x)   RequireOrder      = ([],x:rest,us,[])
-         procNextOpt (NonOpt x)   Permute           = (os,x:xs,us,es)
-         procNextOpt (NonOpt x)   (ReturnInOrder f) = (f x :os, xs,us,es)
-         procNextOpt EndOfOpts    RequireOrder      = ([],rest,us,[])
-         procNextOpt EndOfOpts    Permute           = ([],rest,us,[])
-         procNextOpt EndOfOpts    (ReturnInOrder f) = (map f rest,[],us,[])
-         procNextOpt (OptErr e)   _                 = (os,xs,us,e:es)
-
-         (opt,rest) = getNext arg args optDescr
-         (os,xs,us,es) = getOpt' ordering optDescr rest
-
--- take a look at the next cmd line arg and decide what to do with it
-getNext :: String -> [String] -> [OptDescr a] -> (OptKind a,[String])
-getNext ('-':'-':[]) rest _        = (EndOfOpts,rest)
-getNext ('-':'-':xs) rest optDescr = longOpt xs rest optDescr
-getNext ('-': x :xs) rest optDescr = shortOpt x xs rest optDescr
-getNext a            rest _        = (NonOpt a,rest)
-
--- handle long option
-longOpt :: String -> [String] -> [OptDescr a] -> (OptKind a,[String])
-longOpt ls rs optDescr = long ads arg rs
-   where (opt,arg) = break (=='=') ls
-         getWith p = [ o  | o@(Option _ xs _ _) <- optDescr, x <- xs, opt `p` x ]
-         exact     = getWith (==)
-         options   = if null exact then getWith isPrefixOf else exact
-         ads       = [ ad | Option _ _ ad _ <- options ]
-         optStr    = ("--"++opt)
-
-         long (_:_:_)      _        rest     = (errAmbig options optStr,rest)
-         long [NoArg  a  ] []       rest     = (Opt a,rest)
-         long [NoArg  _  ] ('=':_)  rest     = (errNoArg optStr,rest)
-         long [ReqArg _ d] []       []       = (errReq d optStr,[])
-         long [ReqArg f _] []       (r:rest) = (Opt (f r),rest)
-         long [ReqArg f _] ('=':xs) rest     = (Opt (f xs),rest)
-         long [OptArg f _] []       rest     = (Opt (f Nothing),rest)
-         long [OptArg f _] ('=':xs) rest     = (Opt (f (Just xs)),rest)
-         long _            _        rest     = (UnreqOpt optStr,rest)
-
--- handle short option
-shortOpt :: Char -> String -> [String] -> [OptDescr a] -> (OptKind a,[String])
-shortOpt y ys rs optDescr = short ads ys rs
-  where options = [ o  | o@(Option ss _ _ _) <- optDescr, s <- ss, y == s ]
-        ads     = [ ad | Option _ _ ad _ <- options ]
-        optStr  = '-':[y]
-
-        short (_:_:_)        _  rest     = (errAmbig options optStr,rest)
-        short (NoArg  a  :_) [] rest     = (Opt a,rest)
-        short (NoArg  a  :_) xs rest     = (Opt a,('-':xs):rest)
-        short (ReqArg _ d:_) [] []       = (errReq d optStr,[])
-        short (ReqArg f _:_) [] (r:rest) = (Opt (f r),rest)
-        short (ReqArg f _:_) xs rest     = (Opt (f xs),rest)
-        short (OptArg f _:_) [] rest     = (Opt (f Nothing),rest)
-        short (OptArg f _:_) xs rest     = (Opt (f (Just xs)),rest)
-        short []             [] rest     = (UnreqOpt optStr,rest)
-        short []             xs rest     = (UnreqOpt optStr,('-':xs):rest)
-
--- miscellaneous error formatting
-
-errAmbig :: [OptDescr a] -> String -> OptKind a
-errAmbig ods optStr = OptErr (usageInfo header ods)
-   where header = "option `" ++ optStr ++ "' is ambiguous; could be one of:"
-
-errReq :: String -> String -> OptKind a
-errReq d optStr = OptErr ("option `" ++ optStr ++ "' requires an argument " ++ d ++ "\n")
-
-errUnrec :: String -> String
-errUnrec optStr = "unrecognized option `" ++ optStr ++ "'\n"
-
-errNoArg :: String -> OptKind a
-errNoArg optStr = OptErr ("option `" ++ optStr ++ "' doesn't allow an argument\n")
-
-{-
------------------------------------------------------------------------------------------
--- and here a small and hopefully enlightening example:
-
-data Flag = Verbose | Version | Name String | Output String | Arg String   deriving Show
-
-options :: [OptDescr Flag]
-options =
-   [Option ['v']     ["verbose"]           (NoArg Verbose)      "verbosely list files",
-    Option ['V','?'] ["version","release"] (NoArg Version)      "show version info",
-    Option ['o']     ["output"]            (OptArg out "FILE")  "use FILE for dump",
-    Option ['n']     ["name"]              (ReqArg Name "USER") "only dump USER's files"]
-
-out :: Maybe String -> Flag
-out Nothing  = Output "stdout"
-out (Just o) = Output o
-
-test :: ArgOrder Flag -> [String] -> String
-test order cmdline = case getOpt order options cmdline of
-                        (o,n,[]  ) -> "options=" ++ show o ++ "  args=" ++ show n ++ "\n"
-                        (_,_,errs) -> concat errs ++ usageInfo header options
-   where header = "Usage: foobar [OPTION...] files..."
-
--- example runs:
--- putStr (test RequireOrder ["foo","-v"])
---    ==> options=[]  args=["foo", "-v"]
--- putStr (test Permute ["foo","-v"])
---    ==> options=[Verbose]  args=["foo"]
--- putStr (test (ReturnInOrder Arg) ["foo","-v"])
---    ==> options=[Arg "foo", Verbose]  args=[]
--- putStr (test Permute ["foo","--","-v"])
---    ==> options=[]  args=["foo", "-v"]
--- putStr (test Permute ["-?o","--name","bar","--na=baz"])
---    ==> options=[Version, Output "stdout", Name "bar", Name "baz"]  args=[]
--- putStr (test Permute ["--ver","foo"])
---    ==> option `--ver' is ambiguous; could be one of:
---          -v      --verbose             verbosely list files
---          -V, -?  --version, --release  show version info   
---        Usage: foobar [OPTION...] files...
---          -v        --verbose             verbosely list files  
---          -V, -?    --version, --release  show version info     
---          -o[FILE]  --output[=FILE]       use FILE for dump     
---          -n USER   --name=USER           only dump USER's files
------------------------------------------------------------------------------------------
--}
-
-{- $example
-
-To hopefully illuminate the role of the different data
-structures, here\'s the command-line options for a (very simple)
-compiler:
-
->    module Opts where
->    
->    import System.Console.GetOpt
->    import Data.Maybe ( fromMaybe )
->    
->    data Flag 
->     = Verbose  | Version 
->     | Input String | Output String | LibDir String
->       deriving Show
->    
->    options :: [OptDescr Flag]
->    options =
->     [ Option ['v']     ["verbose"] (NoArg Verbose)       "chatty output on stderr"
->     , Option ['V','?'] ["version"] (NoArg Version)       "show version number"
->     , Option ['o']     ["output"]  (OptArg outp "FILE")  "output FILE"
->     , Option ['c']     []          (OptArg inp  "FILE")  "input FILE"
->     , Option ['L']     ["libdir"]  (ReqArg LibDir "DIR") "library directory"
->     ]
->    
->    inp,outp :: Maybe String -> Flag
->    outp = Output . fromMaybe "stdout"
->    inp  = Input  . fromMaybe "stdin"
->    
->    compilerOpts :: [String] -> IO ([Flag], [String])
->    compilerOpts argv = 
->       case getOpt Permute options argv of
->          (o,n,[]  ) -> return (o,n)
->          (_,_,errs) -> ioError (userError (concat errs ++ usageInfo header options))
->      where header = "Usage: ic [OPTION...] files..."
-
--}
scripts/hoogle/src/CmdLine/Main.hs view
@@ -15,11 +15,12 @@ module CmdLine.Main where
 
 import Hoogle.Hoogle
-import System
-import List
-import Maybe
-import Char
-import CmdLine.GetOpt
+import System.Environment
+import Data.List
+import Data.Maybe
+import Data.Char
+import System.Console.GetOpt
+import System.Directory
 
 
 -- | The main function
@@ -29,14 +30,22 @@         let newargs = map safeArrow args
             (flags,query) = parseArgs newargs
             
-            path = fromPath $ fromMaybe (Path []) (find isPath flags)
+            path = fromPath $ fromMaybe (Path "hoogle.txt") (find isPath flags)
             verbose = Verbose `elem` flags
             help = HelpMsg `elem` flags
             color = Color `elem` flags
             count = fromCount $ fromMaybe (Count 0) (find isCount flags)
             
             query2 = concat $ intersperse " " query
-        hoogle path verbose count color (if help then "" else query2)
+            query3 = if help then "" else query2
+        
+        if null query3
+            then putStr helpMsg
+            else do
+                path2 <- checkPath path
+                if null path2
+                    then putStrLn $ "Could not find hoogle database, looked for: " ++ path
+                    else hoogle path2 verbose count color query3
     where
         safeArrow "-#" = " ->"
         safeArrow "->" = " ->"
@@ -108,7 +117,7 @@ helpMsg
     = unlines $ [
         "HOOGLE - Haskell API Search",
-        "(C) Neil Mitchell 2004-2005, York University, UK",
+        "(C) Neil Mitchell 2004-2006, York University, UK",
         "",
         usageInfo ("Usage: hoogle [OPTION...] search") opts,
         
@@ -149,3 +158,24 @@ parseArgs argv = case getOpt Permute opts argv of
         (flags,query,[]) -> (flags,query)
         (_,_,err)        -> error $ concat err ++ helpMsg
+
+
+
+-- | If a path is given check that it exists
+--   If not then try relative to yourself
+checkPath :: FilePath -> IO FilePath
+checkPath file = do
+    b <- doesFileExist file
+    if b then return file else do
+        prog <- getProgName
+        path <- findExecutable prog
+        case path of
+            Nothing -> return ""
+            Just path -> do
+                file <- return $ setFileName path file
+                b <- doesFileExist file
+                if b then return file else return ""
+
+                    
+setFileName :: FilePath -> String -> FilePath
+setFileName path file = (reverse $ dropWhile (not . (`elem` "\\/")) $ reverse path) ++ file
scripts/hoogle/src/Doc/Main.hs view
@@ -15,9 +15,9 @@ module Doc.Main where
 
 import Web.CGI
-import Maybe
-import Char
-import List
+import Data.Maybe
+import Data.Char
+import Data.List
 
 
 main = do x <- cgiArgs
@@ -59,12 +59,15 @@        let xs = mapMaybe f $ lines x
        return $ case lookup modu xs of
            Just "wiki" -> wikiPrefix ++ modu ++ suffix
-           Just a -> haddockPrefix ++ a ++ "/" ++ map g modu ++ ".html" ++ suffix
+           Just a -> haddockLoc a ++ map g modu ++ ".html" ++ suffix
            Nothing -> failPage
     where
         f ys = case break (== '\t') ys of
                    (a, [] ) -> Nothing
                    (a, b) -> Just (a, dropWhile isSpace b)
-                   
+        
+        haddockLoc "gtk" = "http://haskell.org/gtk2hs/docs/gtk2hs-docs-0.9.10/"
+        haddockLoc a = haddockPrefix ++ a ++ "/"
+        
         g '.' = '-'
         g x   = x
scripts/hoogle/src/Doc/res/documentation.txt view
@@ -1,355 +1,540 @@-Control.Arrow		base
-Control.Concurrent		base
-Control.Concurrent.Chan		base
-Control.Concurrent.MVar		base
-Control.Concurrent.QSem		base
-Control.Concurrent.QSemN		base
-Control.Concurrent.STM		stm
-Control.Concurrent.STM.TChan		stm
-Control.Concurrent.STM.TMVar		stm
-Control.Concurrent.STM.TVar		stm
-Control.Concurrent.SampleVar		base
-Control.Exception		base
-Control.Monad		base
-Control.Monad.Cont		mtl
-Control.Monad.Error		mtl
-Control.Monad.Fix		base
-Control.Monad.Identity		mtl
-Control.Monad.List		mtl
-Control.Monad.RWS		mtl
-Control.Monad.Reader		mtl
-Control.Monad.ST		base
-Control.Monad.ST.Lazy		base
-Control.Monad.ST.Strict		base
-Control.Monad.State		mtl
-Control.Monad.Trans		mtl
-Control.Monad.Writer		mtl
-Control.Parallel		base
-Control.Parallel.Strategies		base
-Data.Array		base
-Data.Array.Diff		base
-Data.Array.IArray		base
-Data.Array.IO		base
-Data.Array.MArray		base
-Data.Array.ST		base
-Data.Array.Storable		base
-Data.Array.Unboxed		base
-Data.Bits		base
-Data.Bool		base
-Data.Char		base
-Data.Complex		base
-Data.Dynamic		base
-Data.Either		base
-Data.FiniteMap		base
-Data.FunctorM		base
-Data.Generics		base
-Data.Generics.Aliases		base
-Data.Generics.Basics		base
-Data.Generics.Instances		base
-Data.Generics.Schemes		base
-Data.Generics.Text		base
-Data.Generics.Twins		base
-Data.Graph		base
-Data.Graph.Inductive		fgl
-Data.Graph.Inductive.Basic		fgl
-Data.Graph.Inductive.Example		fgl
-Data.Graph.Inductive.Graph		fgl
-Data.Graph.Inductive.Graphviz		fgl
-Data.Graph.Inductive.Internal.FiniteMap		fgl
-Data.Graph.Inductive.Internal.Heap		fgl
-Data.Graph.Inductive.Internal.Queue		fgl
-Data.Graph.Inductive.Internal.RootPath		fgl
-Data.Graph.Inductive.Internal.Thread		fgl
-Data.Graph.Inductive.Monad		fgl
-Data.Graph.Inductive.Monad.IOArray		fgl
-Data.Graph.Inductive.NodeMap		fgl
-Data.Graph.Inductive.Query		fgl
-Data.Graph.Inductive.Query.ArtPoint		fgl
-Data.Graph.Inductive.Query.BCC		fgl
-Data.Graph.Inductive.Query.BFS		fgl
-Data.Graph.Inductive.Query.DFS		fgl
-Data.Graph.Inductive.Query.Dominators		fgl
-Data.Graph.Inductive.Query.GVD		fgl
-Data.Graph.Inductive.Query.Indep		fgl
-Data.Graph.Inductive.Query.MST		fgl
-Data.Graph.Inductive.Query.MaxFlow		fgl
-Data.Graph.Inductive.Query.MaxFlow2		fgl
-Data.Graph.Inductive.Query.Monad		fgl
-Data.Graph.Inductive.Query.SP		fgl
-Data.Graph.Inductive.Query.TransClos		fgl
-Data.Graph.Inductive.Tree		fgl
-Data.HashTable		base
-Data.IORef		base
-Data.Int		base
-Data.IntMap		base
-Data.IntSet		base
-Data.Ix		base
-Data.List		base
-Data.Map		base
-Data.Maybe		base
-Data.Monoid		base
-Data.PackedString		base
-Data.Queue		base
-Data.Ratio		base
-Data.STRef		base
-Data.STRef.Lazy		base
-Data.STRef.Strict		base
-Data.Set		base
-Data.Tree		base
-Data.Tuple		base
-Data.Typeable		base
-Data.Unique		base
-Data.Version		base
-Data.Word		base
-Debug.QuickCheck		QuickCheck
-Debug.QuickCheck.Batch		QuickCheck
-Debug.QuickCheck.Poly		QuickCheck
-Debug.QuickCheck.Utils		QuickCheck
-Debug.Trace		base
-Distribution.Compat.Directory		Cabal
-Distribution.Compat.Exception		Cabal
-Distribution.Compat.FilePath		Cabal
-Distribution.Compat.RawSystem		Cabal
-Distribution.Compat.ReadP		Cabal
-Distribution.Extension		Cabal
-Distribution.GetOpt		Cabal
-Distribution.InstalledPackageInfo		Cabal
-Distribution.License		Cabal
-Distribution.Make		Cabal
-Distribution.Package		Cabal
-Distribution.PackageDescription		Cabal
-Distribution.PreProcess		Cabal
-Distribution.PreProcess.Unlit		Cabal
-Distribution.Setup		Cabal
-Distribution.Simple		Cabal
-Distribution.Simple.Build		Cabal
-Distribution.Simple.Configure		Cabal
-Distribution.Simple.GHCPackageConfig		Cabal
-Distribution.Simple.Install		Cabal
-Distribution.Simple.LocalBuildInfo		Cabal
-Distribution.Simple.Register		Cabal
-Distribution.Simple.SrcDist		Cabal
-Distribution.Simple.Utils		Cabal
-Distribution.Version		Cabal
-Foreign		base
-Foreign.C		base
-Foreign.C.Error		base
-Foreign.C.String		base
-Foreign.C.Types		base
-Foreign.Concurrent		base
-Foreign.ForeignPtr		base
-Foreign.Marshal		base
-Foreign.Marshal.Alloc		base
-Foreign.Marshal.Array		base
-Foreign.Marshal.Error		base
-Foreign.Marshal.Pool		base
-Foreign.Marshal.Utils		base
-Foreign.Ptr		base
-Foreign.StablePtr		base
-Foreign.Storable		base
-GHC.Conc		base
-GHC.ConsoleHandler		base
-GHC.Dotnet		base
-GHC.Exts		base
-GHC.Unicode		base
-Graphics.HGL		HGL
-Graphics.HGL.Core		HGL
-Graphics.HGL.Draw		HGL
-Graphics.HGL.Draw.Brush		HGL
-Graphics.HGL.Draw.Font		HGL
-Graphics.HGL.Draw.Monad		HGL
-Graphics.HGL.Draw.Pen		HGL
-Graphics.HGL.Draw.Picture		HGL
-Graphics.HGL.Draw.Region		HGL
-Graphics.HGL.Draw.Text		HGL
-Graphics.HGL.Key		HGL
-Graphics.HGL.Run		HGL
-Graphics.HGL.Units		HGL
-Graphics.HGL.Utils		HGL
-Graphics.HGL.Window		HGL
-Graphics.Rendering.OpenGL		OpenGL
-Graphics.Rendering.OpenGL.GL		OpenGL
-Graphics.Rendering.OpenGL.GL.Antialiasing		OpenGL
-Graphics.Rendering.OpenGL.GL.BasicTypes		OpenGL
-Graphics.Rendering.OpenGL.GL.BeginEnd		OpenGL
-Graphics.Rendering.OpenGL.GL.Bitmaps		OpenGL
-Graphics.Rendering.OpenGL.GL.BufferObjects		OpenGL
-Graphics.Rendering.OpenGL.GL.Clipping		OpenGL
-Graphics.Rendering.OpenGL.GL.ColorSum		OpenGL
-Graphics.Rendering.OpenGL.GL.Colors		OpenGL
-Graphics.Rendering.OpenGL.GL.CoordTrans		OpenGL
-Graphics.Rendering.OpenGL.GL.DisplayLists		OpenGL
-Graphics.Rendering.OpenGL.GL.Evaluators		OpenGL
-Graphics.Rendering.OpenGL.GL.Feedback		OpenGL
-Graphics.Rendering.OpenGL.GL.FlushFinish		OpenGL
-Graphics.Rendering.OpenGL.GL.Fog		OpenGL
-Graphics.Rendering.OpenGL.GL.Framebuffer		OpenGL
-Graphics.Rendering.OpenGL.GL.Hints		OpenGL
-Graphics.Rendering.OpenGL.GL.LineSegments		OpenGL
-Graphics.Rendering.OpenGL.GL.PerFragment		OpenGL
-Graphics.Rendering.OpenGL.GL.PixelRectangles		OpenGL
-Graphics.Rendering.OpenGL.GL.PixelRectangles.ColorTable		OpenGL
-Graphics.Rendering.OpenGL.GL.PixelRectangles.Convolution		OpenGL
-Graphics.Rendering.OpenGL.GL.PixelRectangles.Histogram		OpenGL
-Graphics.Rendering.OpenGL.GL.PixelRectangles.Minmax		OpenGL
-Graphics.Rendering.OpenGL.GL.PixelRectangles.PixelMap		OpenGL
-Graphics.Rendering.OpenGL.GL.PixelRectangles.PixelStorage		OpenGL
-Graphics.Rendering.OpenGL.GL.PixelRectangles.PixelTransfer		OpenGL
-Graphics.Rendering.OpenGL.GL.PixelRectangles.Rasterization		OpenGL
-Graphics.Rendering.OpenGL.GL.Points		OpenGL
-Graphics.Rendering.OpenGL.GL.Polygons		OpenGL
-Graphics.Rendering.OpenGL.GL.RasterPos		OpenGL
-Graphics.Rendering.OpenGL.GL.ReadCopyPixels		OpenGL
-Graphics.Rendering.OpenGL.GL.Rectangles		OpenGL
-Graphics.Rendering.OpenGL.GL.SavingState		OpenGL
-Graphics.Rendering.OpenGL.GL.Selection		OpenGL
-Graphics.Rendering.OpenGL.GL.StateVar		OpenGL
-Graphics.Rendering.OpenGL.GL.StringQueries		OpenGL
-Graphics.Rendering.OpenGL.GL.Texturing		OpenGL
-Graphics.Rendering.OpenGL.GL.Texturing.Application		OpenGL
-Graphics.Rendering.OpenGL.GL.Texturing.Environments		OpenGL
-Graphics.Rendering.OpenGL.GL.Texturing.Objects		OpenGL
-Graphics.Rendering.OpenGL.GL.Texturing.Parameters		OpenGL
-Graphics.Rendering.OpenGL.GL.Texturing.Queries		OpenGL
-Graphics.Rendering.OpenGL.GL.Texturing.Specification		OpenGL
-Graphics.Rendering.OpenGL.GL.VertexArrays		OpenGL
-Graphics.Rendering.OpenGL.GL.VertexSpec		OpenGL
-Graphics.Rendering.OpenGL.GLU		OpenGL
-Graphics.Rendering.OpenGL.GLU.Errors		OpenGL
-Graphics.Rendering.OpenGL.GLU.Initialization		OpenGL
-Graphics.Rendering.OpenGL.GLU.Matrix		OpenGL
-Graphics.Rendering.OpenGL.GLU.Mipmapping		OpenGL
-Graphics.Rendering.OpenGL.GLU.NURBS		OpenGL
-Graphics.Rendering.OpenGL.GLU.Quadrics		OpenGL
-Graphics.Rendering.OpenGL.GLU.Tessellation		OpenGL
-Graphics.SOE		HGL
-Graphics.UI.GLUT		GLUT
-Graphics.UI.GLUT.Begin		GLUT
-Graphics.UI.GLUT.Callbacks		GLUT
-Graphics.UI.GLUT.Callbacks.Global		GLUT
-Graphics.UI.GLUT.Callbacks.Window		GLUT
-Graphics.UI.GLUT.Colormap		GLUT
-Graphics.UI.GLUT.Debugging		GLUT
-Graphics.UI.GLUT.DeviceControl		GLUT
-Graphics.UI.GLUT.Fonts		GLUT
-Graphics.UI.GLUT.GameMode		GLUT
-Graphics.UI.GLUT.Initialization		GLUT
-Graphics.UI.GLUT.Menu		GLUT
-Graphics.UI.GLUT.Objects		GLUT
-Graphics.UI.GLUT.Overlay		GLUT
-Graphics.UI.GLUT.State		GLUT
-Graphics.UI.GLUT.Window		GLUT
-Graphics.X11.Types		X11
-Graphics.X11.Xlib		X11
-Graphics.X11.Xlib.Atom		X11
-Graphics.X11.Xlib.Color		X11
-Graphics.X11.Xlib.Context		X11
-Graphics.X11.Xlib.Display		X11
-Graphics.X11.Xlib.Event		X11
-Graphics.X11.Xlib.Font		X11
-Graphics.X11.Xlib.Misc		X11
-Graphics.X11.Xlib.Region		X11
-Graphics.X11.Xlib.Screen		X11
-Graphics.X11.Xlib.Types		X11
-Graphics.X11.Xlib.Window		X11
-Language.Haskell.Parser		haskell-src
-Language.Haskell.Pretty		haskell-src
-Language.Haskell.Syntax		haskell-src
-Language.Haskell.TH		template-haskell
-Language.Haskell.TH.Lib		template-haskell
-Language.Haskell.TH.Ppr		template-haskell
-Language.Haskell.TH.PprLib		template-haskell
-Language.Haskell.TH.Syntax		template-haskell
-Network		network
-Network.BSD		network
-Network.CGI		network
-Network.Socket		network
-Network.URI		network
-Numeric		base
-Prelude		base
-System.CPUTime		base
-System.Cmd		base
-System.Console.GetOpt		base
-System.Console.Readline		readline
-System.Console.SimpleLineEditor		readline
-System.Directory		base
-System.Environment		base
-System.Exit		base
-System.IO		base
-System.IO.Error		base
-System.IO.Unsafe		base
-System.Info		base
-System.Locale		base
-System.Mem		base
-System.Mem.StableName		base
-System.Mem.Weak		base
-System.Posix		unix
-System.Posix.Directory		unix
-System.Posix.DynamicLinker		unix
-System.Posix.DynamicLinker.Module		unix
-System.Posix.DynamicLinker.Prim		unix
-System.Posix.Env		unix
-System.Posix.Error		unix
-System.Posix.Files		unix
-System.Posix.IO		unix
-System.Posix.Process		unix
-System.Posix.Resource		unix
-System.Posix.Signals		base
-System.Posix.Signals.Exts		unix
-System.Posix.Temp		unix
-System.Posix.Terminal		unix
-System.Posix.Time		unix
-System.Posix.Types		base
-System.Posix.Unistd		unix
-System.Posix.User		unix
-System.Process		base
-System.Random		base
-System.Time		base
-Test.HUnit		HUnit
-Test.HUnit.Base		HUnit
-Test.HUnit.Lang		HUnit
-Test.HUnit.Terminal		HUnit
-Test.HUnit.Text		HUnit
-Test.QuickCheck		QuickCheck
-Test.QuickCheck.Batch		QuickCheck
-Test.QuickCheck.Poly		QuickCheck
-Test.QuickCheck.Utils		QuickCheck
-Text.Html		base
-Text.Html.BlockTable		base
-Text.ParserCombinators.Parsec		parsec
-Text.ParserCombinators.Parsec.Char		parsec
-Text.ParserCombinators.Parsec.Combinator		parsec
-Text.ParserCombinators.Parsec.Error		parsec
-Text.ParserCombinators.Parsec.Expr		parsec
-Text.ParserCombinators.Parsec.Language		parsec
-Text.ParserCombinators.Parsec.Perm		parsec
-Text.ParserCombinators.Parsec.Pos		parsec
-Text.ParserCombinators.Parsec.Prim		parsec
-Text.ParserCombinators.Parsec.Token		parsec
-Text.ParserCombinators.ReadP		base
-Text.ParserCombinators.ReadPrec		base
-Text.PrettyPrint		base
-Text.PrettyPrint.HughesPJ		base
-Text.Printf		base
-Text.Read		base
-Text.Read.Lex		base
-Text.Regex		base
-Text.Regex.Posix		base
-Text.Show		base
-Text.Show.Functions		base
-Ix	wiki
-List	haskell98
-Numeric	haskell98
-IO	haskell98
-System	haskell98
-CPUTime	wiki
-Random	haskell98
-Array	haskell98
-Time	haskell98
-Locale	haskell98
-Complex	haskell98
-Monad	haskell98
-Directory	haskell98
-Char	haskell98
-Ratio	haskell98
-Maybe	haskell98
+Control.Arrow		base+Control.Concurrent		base+Control.Concurrent.Chan		base+Control.Concurrent.MVar		base+Control.Concurrent.QSem		base+Control.Concurrent.QSemN		base+Control.Concurrent.STM		stm+Control.Concurrent.STM.TChan		stm+Control.Concurrent.STM.TMVar		stm+Control.Concurrent.STM.TVar		stm+Control.Concurrent.SampleVar		base+Control.Exception		base+Control.Monad		base+Control.Monad.Cont		mtl+Control.Monad.Error		mtl+Control.Monad.Fix		base+Control.Monad.Identity		mtl+Control.Monad.List		mtl+Control.Monad.RWS		mtl+Control.Monad.Reader		mtl+Control.Monad.ST		base+Control.Monad.ST.Lazy		base+Control.Monad.ST.Strict		base+Control.Monad.State		mtl+Control.Monad.Trans		mtl+Control.Monad.Writer		mtl+Control.Parallel		base+Control.Parallel.Strategies		base+Data.Array		base+Data.Array.Diff		base+Data.Array.IArray		base+Data.Array.IO		base+Data.Array.MArray		base+Data.Array.ST		base+Data.Array.Storable		base+Data.Array.Unboxed		base+Data.Bits		base+Data.Bool		base+Data.Char		base+Data.Complex		base+Data.Dynamic		base+Data.Either		base+Data.FiniteMap		base+Data.FunctorM		base+Data.Generics		base+Data.Generics.Aliases		base+Data.Generics.Basics		base+Data.Generics.Instances		base+Data.Generics.Schemes		base+Data.Generics.Text		base+Data.Generics.Twins		base+Data.Graph		base+Data.Graph.Inductive		fgl+Data.Graph.Inductive.Basic		fgl+Data.Graph.Inductive.Example		fgl+Data.Graph.Inductive.Graph		fgl+Data.Graph.Inductive.Graphviz		fgl+Data.Graph.Inductive.Internal.FiniteMap		fgl+Data.Graph.Inductive.Internal.Heap		fgl+Data.Graph.Inductive.Internal.Queue		fgl+Data.Graph.Inductive.Internal.RootPath		fgl+Data.Graph.Inductive.Internal.Thread		fgl+Data.Graph.Inductive.Monad		fgl+Data.Graph.Inductive.Monad.IOArray		fgl+Data.Graph.Inductive.NodeMap		fgl+Data.Graph.Inductive.Query		fgl+Data.Graph.Inductive.Query.ArtPoint		fgl+Data.Graph.Inductive.Query.BCC		fgl+Data.Graph.Inductive.Query.BFS		fgl+Data.Graph.Inductive.Query.DFS		fgl+Data.Graph.Inductive.Query.Dominators		fgl+Data.Graph.Inductive.Query.GVD		fgl+Data.Graph.Inductive.Query.Indep		fgl+Data.Graph.Inductive.Query.MST		fgl+Data.Graph.Inductive.Query.MaxFlow		fgl+Data.Graph.Inductive.Query.MaxFlow2		fgl+Data.Graph.Inductive.Query.Monad		fgl+Data.Graph.Inductive.Query.SP		fgl+Data.Graph.Inductive.Query.TransClos		fgl+Data.Graph.Inductive.Tree		fgl+Data.HashTable		base+Data.IORef		base+Data.Int		base+Data.IntMap		base+Data.IntSet		base+Data.Ix		base+Data.List		base+Data.Map		base+Data.Maybe		base+Data.Monoid		base+Data.PackedString		base+Data.Queue		base+Data.Ratio		base+Data.STRef		base+Data.STRef.Lazy		base+Data.STRef.Strict		base+Data.Set		base+Data.Tree		base+Data.Tuple		base+Data.Typeable		base+Data.Unique		base+Data.Version		base+Data.Word		base+Debug.QuickCheck		QuickCheck+Debug.QuickCheck.Batch		QuickCheck+Debug.QuickCheck.Poly		QuickCheck+Debug.QuickCheck.Utils		QuickCheck+Debug.Trace		base+Distribution.Compat.Directory		Cabal+Distribution.Compat.Exception		Cabal+Distribution.Compat.FilePath		Cabal+Distribution.Compat.RawSystem		Cabal+Distribution.Compat.ReadP		Cabal+Distribution.Extension		Cabal+Distribution.GetOpt		Cabal+Distribution.InstalledPackageInfo		Cabal+Distribution.License		Cabal+Distribution.Make		Cabal+Distribution.Package		Cabal+Distribution.PackageDescription		Cabal+Distribution.PreProcess		Cabal+Distribution.PreProcess.Unlit		Cabal+Distribution.Setup		Cabal+Distribution.Simple		Cabal+Distribution.Simple.Build		Cabal+Distribution.Simple.Configure		Cabal+Distribution.Simple.GHCPackageConfig		Cabal+Distribution.Simple.Install		Cabal+Distribution.Simple.LocalBuildInfo		Cabal+Distribution.Simple.Register		Cabal+Distribution.Simple.SrcDist		Cabal+Distribution.Simple.Utils		Cabal+Distribution.Version		Cabal+Foreign		base+Foreign.C		base+Foreign.C.Error		base+Foreign.C.String		base+Foreign.C.Types		base+Foreign.Concurrent		base+Foreign.ForeignPtr		base+Foreign.Marshal		base+Foreign.Marshal.Alloc		base+Foreign.Marshal.Array		base+Foreign.Marshal.Error		base+Foreign.Marshal.Pool		base+Foreign.Marshal.Utils		base+Foreign.Ptr		base+Foreign.StablePtr		base+Foreign.Storable		base+GHC.Conc		base+GHC.ConsoleHandler		base+GHC.Dotnet		base+GHC.Exts		base+GHC.Unicode		base+Graphics.HGL		HGL+Graphics.HGL.Core		HGL+Graphics.HGL.Draw		HGL+Graphics.HGL.Draw.Brush		HGL+Graphics.HGL.Draw.Font		HGL+Graphics.HGL.Draw.Monad		HGL+Graphics.HGL.Draw.Pen		HGL+Graphics.HGL.Draw.Picture		HGL+Graphics.HGL.Draw.Region		HGL+Graphics.HGL.Draw.Text		HGL+Graphics.HGL.Key		HGL+Graphics.HGL.Run		HGL+Graphics.HGL.Units		HGL+Graphics.HGL.Utils		HGL+Graphics.HGL.Window		HGL+Graphics.Rendering.OpenGL		OpenGL+Graphics.Rendering.OpenGL.GL		OpenGL+Graphics.Rendering.OpenGL.GL.Antialiasing		OpenGL+Graphics.Rendering.OpenGL.GL.BasicTypes		OpenGL+Graphics.Rendering.OpenGL.GL.BeginEnd		OpenGL+Graphics.Rendering.OpenGL.GL.Bitmaps		OpenGL+Graphics.Rendering.OpenGL.GL.BufferObjects		OpenGL+Graphics.Rendering.OpenGL.GL.Clipping		OpenGL+Graphics.Rendering.OpenGL.GL.ColorSum		OpenGL+Graphics.Rendering.OpenGL.GL.Colors		OpenGL+Graphics.Rendering.OpenGL.GL.CoordTrans		OpenGL+Graphics.Rendering.OpenGL.GL.DisplayLists		OpenGL+Graphics.Rendering.OpenGL.GL.Evaluators		OpenGL+Graphics.Rendering.OpenGL.GL.Feedback		OpenGL+Graphics.Rendering.OpenGL.GL.FlushFinish		OpenGL+Graphics.Rendering.OpenGL.GL.Fog		OpenGL+Graphics.Rendering.OpenGL.GL.Framebuffer		OpenGL+Graphics.Rendering.OpenGL.GL.Hints		OpenGL+Graphics.Rendering.OpenGL.GL.LineSegments		OpenGL+Graphics.Rendering.OpenGL.GL.PerFragment		OpenGL+Graphics.Rendering.OpenGL.GL.PixelRectangles		OpenGL+Graphics.Rendering.OpenGL.GL.PixelRectangles.ColorTable		OpenGL+Graphics.Rendering.OpenGL.GL.PixelRectangles.Convolution		OpenGL+Graphics.Rendering.OpenGL.GL.PixelRectangles.Histogram		OpenGL+Graphics.Rendering.OpenGL.GL.PixelRectangles.Minmax		OpenGL+Graphics.Rendering.OpenGL.GL.PixelRectangles.PixelMap		OpenGL+Graphics.Rendering.OpenGL.GL.PixelRectangles.PixelStorage		OpenGL+Graphics.Rendering.OpenGL.GL.PixelRectangles.PixelTransfer		OpenGL+Graphics.Rendering.OpenGL.GL.PixelRectangles.Rasterization		OpenGL+Graphics.Rendering.OpenGL.GL.Points		OpenGL+Graphics.Rendering.OpenGL.GL.Polygons		OpenGL+Graphics.Rendering.OpenGL.GL.RasterPos		OpenGL+Graphics.Rendering.OpenGL.GL.ReadCopyPixels		OpenGL+Graphics.Rendering.OpenGL.GL.Rectangles		OpenGL+Graphics.Rendering.OpenGL.GL.SavingState		OpenGL+Graphics.Rendering.OpenGL.GL.Selection		OpenGL+Graphics.Rendering.OpenGL.GL.StateVar		OpenGL+Graphics.Rendering.OpenGL.GL.StringQueries		OpenGL+Graphics.Rendering.OpenGL.GL.Texturing		OpenGL+Graphics.Rendering.OpenGL.GL.Texturing.Application		OpenGL+Graphics.Rendering.OpenGL.GL.Texturing.Environments		OpenGL+Graphics.Rendering.OpenGL.GL.Texturing.Objects		OpenGL+Graphics.Rendering.OpenGL.GL.Texturing.Parameters		OpenGL+Graphics.Rendering.OpenGL.GL.Texturing.Queries		OpenGL+Graphics.Rendering.OpenGL.GL.Texturing.Specification		OpenGL+Graphics.Rendering.OpenGL.GL.VertexArrays		OpenGL+Graphics.Rendering.OpenGL.GL.VertexSpec		OpenGL+Graphics.Rendering.OpenGL.GLU		OpenGL+Graphics.Rendering.OpenGL.GLU.Errors		OpenGL+Graphics.Rendering.OpenGL.GLU.Initialization		OpenGL+Graphics.Rendering.OpenGL.GLU.Matrix		OpenGL+Graphics.Rendering.OpenGL.GLU.Mipmapping		OpenGL+Graphics.Rendering.OpenGL.GLU.NURBS		OpenGL+Graphics.Rendering.OpenGL.GLU.Quadrics		OpenGL+Graphics.Rendering.OpenGL.GLU.Tessellation		OpenGL+Graphics.SOE		HGL+Graphics.UI.GLUT		GLUT+Graphics.UI.GLUT.Begin		GLUT+Graphics.UI.GLUT.Callbacks		GLUT+Graphics.UI.GLUT.Callbacks.Global		GLUT+Graphics.UI.GLUT.Callbacks.Window		GLUT+Graphics.UI.GLUT.Colormap		GLUT+Graphics.UI.GLUT.Debugging		GLUT+Graphics.UI.GLUT.DeviceControl		GLUT+Graphics.UI.GLUT.Fonts		GLUT+Graphics.UI.GLUT.GameMode		GLUT+Graphics.UI.GLUT.Initialization		GLUT+Graphics.UI.GLUT.Menu		GLUT+Graphics.UI.GLUT.Objects		GLUT+Graphics.UI.GLUT.Overlay		GLUT+Graphics.UI.GLUT.State		GLUT+Graphics.UI.GLUT.Window		GLUT+Graphics.X11.Types		X11+Graphics.X11.Xlib		X11+Graphics.X11.Xlib.Atom		X11+Graphics.X11.Xlib.Color		X11+Graphics.X11.Xlib.Context		X11+Graphics.X11.Xlib.Display		X11+Graphics.X11.Xlib.Event		X11+Graphics.X11.Xlib.Font		X11+Graphics.X11.Xlib.Misc		X11+Graphics.X11.Xlib.Region		X11+Graphics.X11.Xlib.Screen		X11+Graphics.X11.Xlib.Types		X11+Graphics.X11.Xlib.Window		X11+Language.Haskell.Parser		haskell-src+Language.Haskell.Pretty		haskell-src+Language.Haskell.Syntax		haskell-src+Language.Haskell.TH		template-haskell+Language.Haskell.TH.Lib		template-haskell+Language.Haskell.TH.Ppr		template-haskell+Language.Haskell.TH.PprLib		template-haskell+Language.Haskell.TH.Syntax		template-haskell+Network		network+Network.BSD		network+Network.CGI		network+Network.Socket		network+Network.URI		network+Numeric		base+Prelude		base+System.CPUTime		base+System.Cmd		base+System.Console.GetOpt		base+System.Console.Readline		readline+System.Console.SimpleLineEditor		readline+System.Directory		base+System.Environment		base+System.Exit		base+System.IO		base+System.IO.Error		base+System.IO.Unsafe		base+System.Info		base+System.Locale		base+System.Mem		base+System.Mem.StableName		base+System.Mem.Weak		base+System.Posix		unix+System.Posix.Directory		unix+System.Posix.DynamicLinker		unix+System.Posix.DynamicLinker.Module		unix+System.Posix.DynamicLinker.Prim		unix+System.Posix.Env		unix+System.Posix.Error		unix+System.Posix.Files		unix+System.Posix.IO		unix+System.Posix.Process		unix+System.Posix.Resource		unix+System.Posix.Signals		base+System.Posix.Signals.Exts		unix+System.Posix.Temp		unix+System.Posix.Terminal		unix+System.Posix.Time		unix+System.Posix.Types		base+System.Posix.Unistd		unix+System.Posix.User		unix+System.Process		base+System.Random		base+System.Time		base+Test.HUnit		HUnit+Test.HUnit.Base		HUnit+Test.HUnit.Lang		HUnit+Test.HUnit.Terminal		HUnit+Test.HUnit.Text		HUnit+Test.QuickCheck		QuickCheck+Test.QuickCheck.Batch		QuickCheck+Test.QuickCheck.Poly		QuickCheck+Test.QuickCheck.Utils		QuickCheck+Text.Html		base+Text.Html.BlockTable		base+Text.ParserCombinators.Parsec		parsec+Text.ParserCombinators.Parsec.Char		parsec+Text.ParserCombinators.Parsec.Combinator		parsec+Text.ParserCombinators.Parsec.Error		parsec+Text.ParserCombinators.Parsec.Expr		parsec+Text.ParserCombinators.Parsec.Language		parsec+Text.ParserCombinators.Parsec.Perm		parsec+Text.ParserCombinators.Parsec.Pos		parsec+Text.ParserCombinators.Parsec.Prim		parsec+Text.ParserCombinators.Parsec.Token		parsec+Text.ParserCombinators.ReadP		base+Text.ParserCombinators.ReadPrec		base+Text.PrettyPrint		base+Text.PrettyPrint.HughesPJ		base+Text.Printf		base+Text.Read		base+Text.Read.Lex		base+Text.Regex		base+Text.Regex.Posix		base+Text.Show		base+Text.Show.Functions		base+Ix	wiki+List	haskell98+Numeric	haskell98+IO	haskell98+System	haskell98+CPUTime	wiki+Random	haskell98+Array	haskell98+Time	haskell98+Locale	haskell98+Complex	haskell98+Monad	haskell98+Directory	haskell98+Char	haskell98+Ratio	haskell98+Maybe	haskell98+Graphics.Rendering.Cairo	gtk+Graphics.Rendering.Cairo.Matrix	gtk+Graphics.UI.Gtk	gtk+Graphics.UI.Gtk.Abstract.Bin	gtk+Graphics.UI.Gtk.Abstract.Box	gtk+Graphics.UI.Gtk.Abstract.ButtonBox	gtk+Graphics.UI.Gtk.Abstract.Container	gtk+Graphics.UI.Gtk.Abstract.Misc	gtk+Graphics.UI.Gtk.Abstract.Object	gtk+Graphics.UI.Gtk.Abstract.Paned	gtk+Graphics.UI.Gtk.Abstract.Range	gtk+Graphics.UI.Gtk.Abstract.Scale	gtk+Graphics.UI.Gtk.Abstract.Scrollbar	gtk+Graphics.UI.Gtk.Abstract.Separator	gtk+Graphics.UI.Gtk.Abstract.Widget	gtk+Graphics.UI.Gtk.ActionMenuToolbar.Action	gtk+Graphics.UI.Gtk.ActionMenuToolbar.ActionGroup	gtk+Graphics.UI.Gtk.ActionMenuToolbar.RadioAction	gtk+Graphics.UI.Gtk.ActionMenuToolbar.ToggleAction	gtk+Graphics.UI.Gtk.ActionMenuToolbar.UIManager	gtk+Graphics.UI.Gtk.Buttons.Button	gtk+Graphics.UI.Gtk.Buttons.CheckButton	gtk+Graphics.UI.Gtk.Buttons.RadioButton	gtk+Graphics.UI.Gtk.Buttons.ToggleButton	gtk+Graphics.UI.Gtk.Cairo	gtk+Graphics.UI.Gtk.Display.AccelLabel	gtk+Graphics.UI.Gtk.Display.Image	gtk+Graphics.UI.Gtk.Display.Label	gtk+Graphics.UI.Gtk.Display.ProgressBar	gtk+Graphics.UI.Gtk.Display.Statusbar	gtk+Graphics.UI.Gtk.Embedding.Embedding	gtk+Graphics.UI.Gtk.Embedding.Plug	gtk+Graphics.UI.Gtk.Embedding.Socket	gtk+Graphics.UI.Gtk.Entry.Editable	gtk+Graphics.UI.Gtk.Entry.Entry	gtk+Graphics.UI.Gtk.Entry.EntryCompletion	gtk+Graphics.UI.Gtk.Entry.HScale	gtk+Graphics.UI.Gtk.Entry.SpinButton	gtk+Graphics.UI.Gtk.Entry.VScale	gtk+Graphics.UI.Gtk.Gdk.DrawWindow	gtk+Graphics.UI.Gtk.Gdk.Drawable	gtk+Graphics.UI.Gtk.Gdk.Enums	gtk+Graphics.UI.Gtk.Gdk.Events	gtk+Graphics.UI.Gtk.Gdk.GC	gtk+Graphics.UI.Gtk.Gdk.Gdk	gtk+Graphics.UI.Gtk.Gdk.Keys	gtk+Graphics.UI.Gtk.Gdk.Pixbuf	gtk+Graphics.UI.Gtk.Gdk.Pixmap	gtk+Graphics.UI.Gtk.Gdk.Region	gtk+Graphics.UI.Gtk.General.Enums	gtk+Graphics.UI.Gtk.General.General	gtk+Graphics.UI.Gtk.General.IconFactory	gtk+Graphics.UI.Gtk.General.StockItems	gtk+Graphics.UI.Gtk.General.Structs	gtk+Graphics.UI.Gtk.General.Style	gtk+Graphics.UI.Gtk.Glade	gtk+Graphics.UI.Gtk.Layout.Alignment	gtk+Graphics.UI.Gtk.Layout.AspectFrame	gtk+Graphics.UI.Gtk.Layout.Expander	gtk+Graphics.UI.Gtk.Layout.Fixed	gtk+Graphics.UI.Gtk.Layout.HBox	gtk+Graphics.UI.Gtk.Layout.HButtonBox	gtk+Graphics.UI.Gtk.Layout.HPaned	gtk+Graphics.UI.Gtk.Layout.Layout	gtk+Graphics.UI.Gtk.Layout.Notebook	gtk+Graphics.UI.Gtk.Layout.Table	gtk+Graphics.UI.Gtk.Layout.VBox	gtk+Graphics.UI.Gtk.Layout.VButtonBox	gtk+Graphics.UI.Gtk.Layout.VPaned	gtk+Graphics.UI.Gtk.MenuComboToolbar.CheckMenuItem	gtk+Graphics.UI.Gtk.MenuComboToolbar.Combo	gtk+Graphics.UI.Gtk.MenuComboToolbar.ComboBox	gtk+Graphics.UI.Gtk.MenuComboToolbar.ComboBoxEntry	gtk+Graphics.UI.Gtk.MenuComboToolbar.ImageMenuItem	gtk+Graphics.UI.Gtk.MenuComboToolbar.Menu	gtk+Graphics.UI.Gtk.MenuComboToolbar.MenuBar	gtk+Graphics.UI.Gtk.MenuComboToolbar.MenuItem	gtk+Graphics.UI.Gtk.MenuComboToolbar.MenuShell	gtk+Graphics.UI.Gtk.MenuComboToolbar.MenuToolButton	gtk+Graphics.UI.Gtk.MenuComboToolbar.OptionMenu	gtk+Graphics.UI.Gtk.MenuComboToolbar.RadioMenuItem	gtk+Graphics.UI.Gtk.MenuComboToolbar.RadioToolButton	gtk+Graphics.UI.Gtk.MenuComboToolbar.SeparatorMenuItem	gtk+Graphics.UI.Gtk.MenuComboToolbar.SeparatorToolItem	gtk+Graphics.UI.Gtk.MenuComboToolbar.TearoffMenuItem	gtk+Graphics.UI.Gtk.MenuComboToolbar.ToggleToolButton	gtk+Graphics.UI.Gtk.MenuComboToolbar.ToolButton	gtk+Graphics.UI.Gtk.MenuComboToolbar.ToolItem	gtk+Graphics.UI.Gtk.MenuComboToolbar.Toolbar	gtk+Graphics.UI.Gtk.Misc.Adjustment	gtk+Graphics.UI.Gtk.Misc.Arrow	gtk+Graphics.UI.Gtk.Misc.Calendar	gtk+Graphics.UI.Gtk.Misc.DrawingArea	gtk+Graphics.UI.Gtk.Misc.EventBox	gtk+Graphics.UI.Gtk.Misc.HandleBox	gtk+Graphics.UI.Gtk.Misc.SizeGroup	gtk+Graphics.UI.Gtk.Misc.Tooltips	gtk+Graphics.UI.Gtk.Misc.Viewport	gtk+Graphics.UI.Gtk.Mogul	gtk+Graphics.UI.Gtk.Mogul.GetWidget	gtk+Graphics.UI.Gtk.Mogul.MDialog	gtk+Graphics.UI.Gtk.Mogul.NewWidget	gtk+Graphics.UI.Gtk.Mogul.TreeList	gtk+Graphics.UI.Gtk.Mogul.WidgetTable	gtk+Graphics.UI.Gtk.MozEmbed	gtk+Graphics.UI.Gtk.Multiline.TextBuffer	gtk+Graphics.UI.Gtk.Multiline.TextIter	gtk+Graphics.UI.Gtk.Multiline.TextMark	gtk+Graphics.UI.Gtk.Multiline.TextTag	gtk+Graphics.UI.Gtk.Multiline.TextTagTable	gtk+Graphics.UI.Gtk.Multiline.TextView	gtk+Graphics.UI.Gtk.Ornaments.Frame	gtk+Graphics.UI.Gtk.Ornaments.HSeparator	gtk+Graphics.UI.Gtk.Ornaments.VSeparator	gtk+Graphics.UI.Gtk.Pango.Context	gtk+Graphics.UI.Gtk.Pango.Enums	gtk+Graphics.UI.Gtk.Pango.Font	gtk+Graphics.UI.Gtk.Pango.Layout	gtk+Graphics.UI.Gtk.Pango.Markup	gtk+Graphics.UI.Gtk.Pango.Rendering	gtk+Graphics.UI.Gtk.Scrolling.HScrollbar	gtk+Graphics.UI.Gtk.Scrolling.ScrolledWindow	gtk+Graphics.UI.Gtk.Scrolling.VScrollbar	gtk+Graphics.UI.Gtk.Selectors.ColorButton	gtk+Graphics.UI.Gtk.Selectors.ColorSelection	gtk+Graphics.UI.Gtk.Selectors.ColorSelectionDialog	gtk+Graphics.UI.Gtk.Selectors.FileChooser	gtk+Graphics.UI.Gtk.Selectors.FileChooserButton	gtk+Graphics.UI.Gtk.Selectors.FileChooserDialog	gtk+Graphics.UI.Gtk.Selectors.FileChooserWidget	gtk+Graphics.UI.Gtk.Selectors.FileFilter	gtk+Graphics.UI.Gtk.Selectors.FileSelection	gtk+Graphics.UI.Gtk.Selectors.FontButton	gtk+Graphics.UI.Gtk.Selectors.FontSelection	gtk+Graphics.UI.Gtk.Selectors.FontSelectionDialog	gtk+Graphics.UI.Gtk.SourceView	gtk+Graphics.UI.Gtk.SourceView.SourceBuffer	gtk+Graphics.UI.Gtk.SourceView.SourceIter	gtk+Graphics.UI.Gtk.SourceView.SourceLanguage	gtk+Graphics.UI.Gtk.SourceView.SourceLanguagesManager	gtk+Graphics.UI.Gtk.SourceView.SourceMarker	gtk+Graphics.UI.Gtk.SourceView.SourceStyleScheme	gtk+Graphics.UI.Gtk.SourceView.SourceTag	gtk+Graphics.UI.Gtk.SourceView.SourceTagStyle	gtk+Graphics.UI.Gtk.SourceView.SourceTagTable	gtk+Graphics.UI.Gtk.SourceView.SourceView	gtk+Graphics.UI.Gtk.TreeList.CellRenderer	gtk+Graphics.UI.Gtk.TreeList.CellRendererPixbuf	gtk+Graphics.UI.Gtk.TreeList.CellRendererText	gtk+Graphics.UI.Gtk.TreeList.CellRendererToggle	gtk+Graphics.UI.Gtk.TreeList.CellView	gtk+Graphics.UI.Gtk.TreeList.IconView	gtk+Graphics.UI.Gtk.TreeList.ListStore	gtk+Graphics.UI.Gtk.TreeList.TreeIter	gtk+Graphics.UI.Gtk.TreeList.TreeModel	gtk+Graphics.UI.Gtk.TreeList.TreeModelSort	gtk+Graphics.UI.Gtk.TreeList.TreeSelection	gtk+Graphics.UI.Gtk.TreeList.TreeStore	gtk+Graphics.UI.Gtk.TreeList.TreeView	gtk+Graphics.UI.Gtk.TreeList.TreeViewColumn	gtk+Graphics.UI.Gtk.Windows.AboutDialog	gtk+Graphics.UI.Gtk.Windows.Dialog	gtk+Graphics.UI.Gtk.Windows.Window	gtk+Graphics.UI.Gtk.Windows.WindowGroup	gtk+System.Glib	gtk+System.Glib.Attributes	gtk+System.Glib.FFI	gtk+System.Glib.Flags	gtk+System.Glib.GError	gtk+System.Glib.GList	gtk+System.Glib.GObject	gtk+System.Glib.GParameter	gtk+System.Glib.GType	gtk+System.Glib.GTypeConstants	gtk+System.Glib.GValue	gtk+System.Glib.GValueTypes	gtk+System.Glib.MainLoop	gtk+System.Glib.Properties	gtk+System.Glib.Signals	gtk+System.Glib.StoreValue	gtk+System.Glib.Types	gtk+System.Glib.UTFString	gtk+System.Gnome.GConf	gtk+System.Gnome.GConf.GConfClient	gtk+System.Gnome.GConf.GConfValue	gtk
scripts/hoogle/src/Hoogle/Hoogle.hs view
@@ -9,8 +9,8 @@ import Hoogle.Match
 import Hoogle.TypeSig
 
-import List
-import Char
+import Data.List
+import Data.Char
 
 
 hoogleParse :: String -> Search
scripts/hoogle/src/Hoogle/Lexer.hs view
@@ -18,7 +18,7 @@     ) where
 
 import Prelude
-import Char
+import Data.Char
 
 -- | The data structure for a lexeme
 data Lexeme = OpenSquare  -- ^ \[
scripts/hoogle/src/Hoogle/Match.hs view
@@ -20,7 +20,7 @@ import Hoogle.MatchName
 import Hoogle.MatchType
 
-import List
+import Data.List
 
 
 ---------------------------------------------------------------------
scripts/hoogle/src/Hoogle/MatchName.hs view
@@ -17,9 +17,9 @@ import Hoogle.Result
 import Hoogle.TypeSig
 
-import Char
-import List
-import Maybe
+import Data.Char
+import Data.List
+import Data.Maybe
 
 
 -- | The abstract data type
scripts/hoogle/src/Hoogle/Search.hs view
@@ -5,7 +5,7 @@ import Hoogle.TypeSig
 import Hoogle.TextUtil
 import Hoogle.Parser
-import Char
+import Data.Char
 
 
 data Search = Search String SearchMode
scripts/hoogle/src/Hoogle/TextUtil.hs view
@@ -14,9 +14,9 @@ module Hoogle.TextUtil where
 
 import Prelude
-import Maybe
-import Char
-import List
+import Data.Maybe
+import Data.Char
+import Data.List
 
 
 trim :: String -> String
scripts/hoogle/src/Hoogle/TypeSig.hs view
@@ -13,7 +13,7 @@ 
 module Hoogle.TypeSig where
 
-import List
+import Data.List
 
 
 
scripts/hoogle/src/Score/Main.hs view
@@ -12,10 +12,10 @@ import Hoogle.TypeSig
 import Hoogle.General
 
-import System
-import Maybe
-import List
-import Char
+import System.Environment
+import Data.Maybe
+import Data.List
+import Data.Char
 
 
 type Phrase = [[Char]]
scripts/hoogle/src/Score/examples.txt view
@@ -61,3 +61,9 @@ @ (a -> b) -> [a] -> [b]
 (a -> [b]) -> [a] -> [b]
 (a -> a -> Bool) -> a -> [a] -> [a]
+
+
+@ Ix a => i -> Array a b
+a -> a
+Ix a => (a, a) -> [b] -> Array a b
+
scripts/hoogle/src/Test/Test.hs view
@@ -2,8 +2,8 @@ module Test where
 
 import Debug.QuickCheck
-import List
-import Char
+import Data.List
+import Data.Char
 
 import Hoogle.Parser
 
scripts/hoogle/src/Web/CGI.hs view
@@ -15,11 +15,11 @@ module Web.CGI(cgiArgs, escape, asCgi) where
 
 import Hoogle.TextUtil
-import System
-import Maybe
-import Char
+import System.Environment
+import Data.Maybe
+import Data.Char
 import Numeric
-import List
+import Data.List
 
 
 cgiVariable :: IO String
scripts/hoogle/src/Web/Lambdabot.hs view
@@ -1,8 +1,8 @@ 
 module Web.Lambdabot(query) where
 
-import List
-import Char
+import Data.List
+import Data.Char
 
 query :: String -> IO (Maybe String)
 query x = do d <- readDatabase
scripts/hoogle/src/Web/Main.hs view
@@ -20,11 +20,11 @@ import Web.CGI
 import Web.Lambdabot
 
-import Char
-import System
-import List
-import Maybe
-import Directory
+import Data.Char
+import System.Environment
+import Data.List
+import Data.Maybe
+import System.Directory
 
 
 -- | Should the output be sent to the console and a file.
@@ -42,7 +42,7 @@           putStr "Content-type: text/html\n\n"
           appendFile "log.txt" (show args ++ "\n")
           let input = lookupDef "" "q" args
-          if null input then hoogleBlank
+          if null input then hoogleBlank args
            else do let p = hoogleParse input
                    case hoogleParseError p of
                         Just x -> showError input x
@@ -63,9 +63,10 @@ 
 
 -- | Show the search box
-hoogleBlank :: IO ()
-hoogleBlank = do debugInit
-                 outputFile "front"
+hoogleBlank :: [(String,String)] -> IO ()
+hoogleBlank args = do
+    debugInit
+    outputFile (if ("package","gtk") `elem` args then "front_gtk" else "front")
 
 
 -- | Replace all occurances of $ with the parameter
@@ -96,17 +97,19 @@ showResults :: Search -> [(String, String)] -> IO ()
 showResults input args =
     do
-        res <- hoogleResults "res/hoogle.txt" input
+        let useGtk = ("package","gtk") `elem` args
+        res <- hoogleResults (if useGtk then "res/gtk.txt" else "res/hoogle.txt") input
         let lres = length res
             search = hoogleSearch input
             tSearch = showText search
             useres = take num $ drop start res
 
         debugInit
-        outputFileParam "prefix" tSearch
+        outputFileParam (if useGtk then "prefix_gtk" else "prefix") tSearch
 
         putLine $ 
-            "<table id='heading'><tr><td>Searched for " ++ showTags search ++
+            "<table id='heading'><tr><td>" ++
+            "Searched for " ++ showTags search ++
             "</td><td id='count'>" ++
             (if lres == 0 then "No results found" else f lres) ++
             "</td></tr></table>"
scripts/hoogle/src/Web/res/front.inc view
@@ -3,59 +3,81 @@ 	<head>
 		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
 		<title>Hoogle</title>
-
 		<link type="text/css" rel="stylesheet" href="res/hoogle.css" />
 
 		<script type="text/javascript">
-		function on_load()
-		{
-			document.getElementById('txt').focus();
-		}
+function addHoogle()
+{
+	addEngine('hoogle','png','Programming','4691');
+}
+
+function addEngine(name,ext,cat,pid)
+{
+  if ((typeof window.sidebar == "object") && (typeof window.sidebar.addSearchEngine == "function")) {
+    window.sidebar.addSearchEngine(
+      "http://mycroft.mozdev.org/install.php/" + pid + "/" + name + ".src",
+      "http://mycroft.mozdev.org/install.php/" + pid + "/" + name + "."+ ext, name, cat );
+  } else {
+    alert("You will need a browser which supports Sherlock to install this plugin.");
+  }
+}
+
+function on_load()
+{
+	document.getElementById('txt').focus();
+}
 		</script>
 	</head>
 	<body onload="on_load()" id="front">
 
 
-<table style="width:100%;margin-bottom:30px;">
+<table id="header">
 	<tr>
-		<td style="text-align:center;padding-top:15px;">
-			<img style="vertical-align:top;" src="res/hoogle_large.png" alt="Hoogle" />
-			<sup style="font-family:serif;font-weight:bold;font-size:16pt;">3
-				<span style="color:#b00;">[&beta;]</span>
-			</sup><br/>
-			<i>The Haskell API Search Engine</i><br/>
-			<form id="input" action="?" method="get"
-				style="text-align:center;padding-top:20px;display:block;">
-				<div>
-					<input name="q" id="txt" type="text" style="width:300px;margin-right:5px;" />
-					<input style="padding-left:15px;padding-right:15px;" type="submit" value="Search" />
-				</div>
-			</form>
-
-			<div id="example">
-				Example searches:<br/>
-				<a href="?q=map">map</a><br/>
-				<a href="?q=(a%20-%3E%20b)%20-%3E%20[a]%20-%3E%20[b]">(a -&gt; b) -&gt; [a] -&gt; [b]</a><br/>
-				<a href="?q=Ord%20a%20%3D%3E%20[a]%20-%3E%20[a]">Ord a =&gt; [a] -&gt; [a]</a>
-			</div>
+		<td style="text-align:left;">
+			<a href="http://www.haskell.org/">haskell.org</a>
 		</td>
-		<td id="buttons">
-			<a href="/" id="haskell">haskell.org</a>
-			<a href="help.htm" id="help">Help</a>
-			<a href="about.htm" id="about">About</a>
-			<a href="download.htm" id="down">Download</a>
-			<a href="developers.htm" id="dev">Developers</a>
-			<a href="academics.htm" id="acad">Academics</a>
+		<td style="text-align:right;">
+			<!--[if IE]>
+			<div style="display:none;">
+			<![endif]-->
+			<a href="javascript:addHoogle()">Firefox plugin</a> |
+			<!--[if IE]>
+			</div>
+			<![endif]-->
+			<a href="http://www.haskell.org/haskellwiki/Hoogle/Tutorial">Tutorial</a> |
+			<a href="http://www.haskell.org/haskellwiki/Hoogle">Manual</a>
 		</td>
-	</tr>
 </table>
 
-<p id="footer">
-	&copy; <a href="http://www.cs.york.ac.uk/~ndm/">Neil Mitchell</a> 2004-2005<br/>
-	<i>"Roses are red. Violets are blue. <a href="http://www.google.com/">Google</a> rocks. Homage to you."</i>
+<div style="width:100%;margin-top:30px;margin-bottom:30px;text-align:center;">
+	<img style="vertical-align:top;" src="res/hoogle_large.png" alt="Hoogle" />
+	<sup style="font-family:serif;font-weight:bold;font-size:16pt;">3
+		<span style="color:#b00;">[&beta;]</span>
+	</sup><br/>
+	<i>The Haskell API Search Engine</i><br/>
+	<form id="input" action="?" method="get"
+		style="text-align:center;padding-top:20px;display:block;">
+		<div>
+			<input name="q" id="txt" type="text" style="width:300px;margin-right:5px;" />
+			<input style="padding-left:15px;padding-right:15px;" type="submit" value="Search" />
+		</div>
+	</form>
+
+	<div style="margin:auto;margin-top:40px;padding:3px;width:300px;border:2px solid #cc0;background-color:#ffc;font-size:10pt;text-align:left;">
+		Example searches:<br/>
+		&nbsp; <a href="?q=map">map</a><br/>
+		&nbsp; <a href="?q=(a%20-%3E%20b)%20-%3E%20[a]%20-%3E%20[b]">(a -&gt; b) -&gt; [a] -&gt; [b]</a><br/>
+		&nbsp; <a href="?q=Ord%20a%20%3D%3E%20[a]%20-%3E%20[a]">Ord a =&gt; [a] -&gt; [a]</a>
+	</div>
+</div>
+
+<p style="text-align:center;font-size:10pt;font-style:italic;margin-bottom:3px;">
+	"Roses are red. Violets are blue. <a href="http://www.google.com/">Google</a> rocks. Homage to you."
 </p>
+<p id="footer" style="margin-top:3px;">
+	&copy; <a href="http://www.cs.york.ac.uk/~ndm/">Neil Mitchell</a> 2004-2006
+</p>
 
 
 	</body>
-
 </html>
+ scripts/hoogle/src/Web/res/front_gtk.inc view
@@ -0,0 +1,87 @@+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+	<head>
+		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+		<title>Hoogle</title>
+		<link type="text/css" rel="stylesheet" href="res/hoogle.css" />
+
+		<script type="text/javascript">
+function addHoogle()
+{
+	addEngine('hoogle','png','Programming','4691');
+}
+
+function addEngine(name,ext,cat,pid)
+{
+  if ((typeof window.sidebar == "object") && (typeof window.sidebar.addSearchEngine == "function")) {
+    window.sidebar.addSearchEngine(
+      "http://mycroft.mozdev.org/install.php/" + pid + "/" + name + ".src",
+      "http://mycroft.mozdev.org/install.php/" + pid + "/" + name + "."+ ext, name, cat );
+  } else {
+    alert("You will need a browser which supports Sherlock to install this plugin.");
+  }
+}
+
+function on_load()
+{
+	document.getElementById('txt').focus();
+}
+		</script>
+	</head>
+	<body onload="on_load()" id="front">
+
+
+<table id="header">
+	<tr>
+		<td style="text-align:left;">
+			<a href="http://www.haskell.org/">haskell.org</a>
+		</td>
+		<td style="text-align:right;">
+			<!--[if IE]>
+			<div style="display:none;">
+			<![endif]-->
+			<a href="javascript:addHoogle()">Firefox plugin</a> |
+			<!--[if IE]>
+			</div>
+			<![endif]-->
+			<a href="http://www.haskell.org/haskellwiki/Hoogle/Tutorial">Tutorial</a> |
+			<a href="http://www.haskell.org/haskellwiki/Hoogle">Manual</a>
+		</td>
+</table>
+
+<img style="float:left;" src="http://gtk.org/images/gtk-logo-rgb.gif" alt="Gtk" />
+
+<div style="width:100%;margin-top:30px;margin-bottom:30px;text-align:center;">
+	<img style="vertical-align:top;" src="res/hoogle_large.png" alt="Hoogle" />
+	<sup style="font-family:serif;font-weight:bold;font-size:16pt;">3
+		<span style="color:#b00;">[&beta;]</span>
+	</sup>
+	<br/>
+	<i>The Haskell API Search Engine</i> - <a href="http://haskell.org/gtk2hs/">Gtk2Hs</a> edition<br/>
+	<form id="input" action="?" method="get"
+		style="text-align:center;padding-top:20px;display:block;">
+		<div>
+			<input type="hidden" name="package" value="gtk" />
+			<input name="q" id="txt" type="text" style="width:300px;margin-right:5px;" />
+			<input style="padding-left:15px;padding-right:15px;" type="submit" value="Search" />
+		</div>
+	</form>
+
+	<div style="margin:auto;margin-top:40px;padding:3px;width:300px;border:2px solid #cc0;background-color:#ffc;font-size:10pt;text-align:left;">
+		Example searches:<br/>
+		&nbsp; <a href="?q=map">map</a><br/>
+		&nbsp; <a href="?q=(a%20-%3E%20b)%20-%3E%20[a]%20-%3E%20[b]">(a -&gt; b) -&gt; [a] -&gt; [b]</a><br/>
+		&nbsp; <a href="?q=Ord%20a%20%3D%3E%20[a]%20-%3E%20[a]">Ord a =&gt; [a] -&gt; [a]</a>
+	</div>
+</div>
+
+<p style="text-align:center;font-size:10pt;font-style:italic;margin-bottom:3px;">
+	"Roses are red. Violets are blue. <a href="http://www.google.com/">Google</a> rocks. Homage to you."
+</p>
+<p id="footer" style="margin-top:3px;">
+	&copy; <a href="http://www.cs.york.ac.uk/~ndm/">Neil Mitchell</a> 2004-2006
+</p>
+
+
+	</body>
+</html>
+ scripts/hoogle/src/Web/res/gtk.txt view
@@ -0,0 +1,7529 @@+-- Hoogle documentation, generated by Haddock+-- See Hoogle, http://www.haskell.org/hoogle/++module System.Glib.Types+newtype GObject+GObject :: ForeignPtr GObject -> GObject+instance GObjectClass GObject+class GObjectClass o+instance GObjectClass AboutDialog+instance GObjectClass AccelGroup+instance GObjectClass AccelLabel+instance GObjectClass AccelMap+instance GObjectClass Action+instance GObjectClass ActionGroup+instance GObjectClass Adjustment+instance GObjectClass Alignment+instance GObjectClass Arrow+instance GObjectClass AspectFrame+instance GObjectClass Bin+instance GObjectClass Box+instance GObjectClass Button+instance GObjectClass ButtonBox+instance GObjectClass CList+instance GObjectClass CTree+instance GObjectClass Calendar+instance GObjectClass CellRenderer+instance GObjectClass CellRendererPixbuf+instance GObjectClass CellRendererText+instance GObjectClass CellRendererToggle+instance GObjectClass CellView+instance GObjectClass CheckButton+instance GObjectClass CheckMenuItem+instance GObjectClass Clipboard+instance GObjectClass ColorButton+instance GObjectClass ColorSelection+instance GObjectClass ColorSelectionDialog+instance GObjectClass Colormap+instance GObjectClass Combo+instance GObjectClass ComboBox+instance GObjectClass ComboBoxEntry+instance GObjectClass Container+instance GObjectClass Curve+instance GObjectClass Dialog+instance GObjectClass Display+instance GObjectClass DragContext+instance GObjectClass DrawWindow+instance GObjectClass Drawable+instance GObjectClass DrawingArea+instance GObjectClass Editable+instance GObjectClass Entry+instance GObjectClass EntryCompletion+instance GObjectClass EventBox+instance GObjectClass Expander+instance GObjectClass FileChooser+instance GObjectClass FileChooserButton+instance GObjectClass FileChooserDialog+instance GObjectClass FileChooserWidget+instance GObjectClass FileFilter+instance GObjectClass FileSelection+instance GObjectClass Fixed+instance GObjectClass Font+instance GObjectClass FontButton+instance GObjectClass FontFace+instance GObjectClass FontFamily+instance GObjectClass FontMap+instance GObjectClass FontSelection+instance GObjectClass FontSelectionDialog+instance GObjectClass FontSet+instance GObjectClass Frame+instance GObjectClass GC+instance GObjectClass GConf+instance GObjectClass GObject+instance GObjectClass GammaCurve+instance GObjectClass GladeXML+instance GObjectClass HBox+instance GObjectClass HButtonBox+instance GObjectClass HPaned+instance GObjectClass HRuler+instance GObjectClass HScale+instance GObjectClass HScrollbar+instance GObjectClass HSeparator+instance GObjectClass HandleBox+instance GObjectClass IMContext+instance GObjectClass IMMulticontext+instance GObjectClass IconFactory+instance GObjectClass IconView+instance GObjectClass Image+instance GObjectClass ImageMenuItem+instance GObjectClass InputDialog+instance GObjectClass Invisible+instance GObjectClass Item+instance GObjectClass ItemFactory+instance GObjectClass Label+instance GObjectClass Layout+instance GObjectClass List+instance GObjectClass ListItem+instance GObjectClass ListStore+instance GObjectClass Menu+instance GObjectClass MenuBar+instance GObjectClass MenuItem+instance GObjectClass MenuShell+instance GObjectClass MenuToolButton+instance GObjectClass MessageDialog+instance GObjectClass Misc+instance GObjectClass MozEmbed+instance GObjectClass Notebook+instance GObjectClass Object+instance GObjectClass OptionMenu+instance GObjectClass Paned+instance GObjectClass PangoContext+instance GObjectClass PangoLayoutRaw+instance GObjectClass Pixbuf+instance GObjectClass Pixmap+instance GObjectClass Plug+instance GObjectClass Preview+instance GObjectClass ProgressBar+instance GObjectClass RadioAction+instance GObjectClass RadioButton+instance GObjectClass RadioMenuItem+instance GObjectClass RadioToolButton+instance GObjectClass Range+instance GObjectClass RcStyle+instance GObjectClass Ruler+instance GObjectClass Scale+instance GObjectClass Screen+instance GObjectClass Scrollbar+instance GObjectClass ScrolledWindow+instance GObjectClass Separator+instance GObjectClass SeparatorMenuItem+instance GObjectClass SeparatorToolItem+instance GObjectClass Settings+instance GObjectClass SizeGroup+instance GObjectClass Socket+instance GObjectClass SourceBuffer+instance GObjectClass SourceLanguage+instance GObjectClass SourceLanguagesManager+instance GObjectClass SourceMarker+instance GObjectClass SourceStyleScheme+instance GObjectClass SourceTag+instance GObjectClass SourceTagTable+instance GObjectClass SourceView+instance GObjectClass SpinButton+instance GObjectClass Statusbar+instance GObjectClass Style+instance GObjectClass Table+instance GObjectClass TearoffMenuItem+instance GObjectClass TextBuffer+instance GObjectClass TextChildAnchor+instance GObjectClass TextMark+instance GObjectClass TextTag+instance GObjectClass TextTagTable+instance GObjectClass TextView+instance GObjectClass TipsQuery+instance GObjectClass ToggleAction+instance GObjectClass ToggleButton+instance GObjectClass ToggleToolButton+instance GObjectClass ToolButton+instance GObjectClass ToolItem+instance GObjectClass Toolbar+instance GObjectClass Tooltips+instance GObjectClass TreeModel+instance GObjectClass TreeModelSort+instance GObjectClass TreeSelection+instance GObjectClass TreeStore+instance GObjectClass TreeView+instance GObjectClass TreeViewColumn+instance GObjectClass UIManager+instance GObjectClass VBox+instance GObjectClass VButtonBox+instance GObjectClass VPaned+instance GObjectClass VRuler+instance GObjectClass VScale+instance GObjectClass VScrollbar+instance GObjectClass VSeparator+instance GObjectClass Viewport+instance GObjectClass Widget+instance GObjectClass Window+instance GObjectClass WindowGroup+toGObject :: GObjectClass o => o -> GObject+fromGObject :: GObjectClass o => GObject -> o+castToGObject :: GObjectClass obj => obj -> obj++module System.Glib.GList+type GList = Ptr ()+readGList :: GList -> IO [Ptr a]+fromGList :: GList -> IO [Ptr a]+toGList :: [Ptr a] -> IO GList+type GSList = Ptr ()+readGSList :: GSList -> IO [Ptr a]+fromGSList :: GSList -> IO [Ptr a]+fromGSListRev :: GSList -> IO [Ptr a]+toGSList :: [Ptr a] -> IO GSList++module System.Glib.Flags+class (Enum a, Bounded a) => Flags a+instance Flags AccelFlags+instance Flags AttachOptions+instance Flags CalendarDisplayOptions+instance Flags EventMask+instance Flags ExtensionMode+instance Flags FileFilterFlags+instance Flags FontMask+instance Flags IOCondition+instance Flags InputCondition+instance Flags Modifier+instance Flags SourceSearchFlags+instance Flags TextSearchFlags+instance Flags TreeModelFlags+instance Flags UIManagerItemType+instance Flags WindowState+fromFlags :: Flags a => [a] -> Int+toFlags :: Flags a => Int -> [a]++module System.Glib.FFI+with :: Storable a => a -> (Ptr a -> IO b) -> IO b+nullForeignPtr :: ForeignPtr a+maybeNull :: (IO (Ptr a) -> IO a) -> IO (Ptr a) -> IO (Maybe a)+withForeignPtrs :: [ForeignPtr a] -> ([Ptr a] -> IO b) -> IO b+withArrayLen :: Storable a => [a] -> (Int -> Ptr a -> IO b) -> IO b++module System.Glib.GType+type GType = CULong+typeInstanceIsA :: Ptr () -> GType -> Bool++module System.Glib.GTypeConstants+invalid :: GType+uint :: GType+int :: GType+uchar :: GType+char :: GType+bool :: GType+enum :: GType+flags :: GType+pointer :: GType+float :: GType+double :: GType+string :: GType+object :: GType+boxed :: GType++module System.Glib.GValue+newtype GValue+GValue :: Ptr GValue -> GValue+valueInit :: GValue -> GType -> IO ()+valueUnset :: GValue -> IO ()+valueGetType :: GValue -> IO GType+allocaGValue :: (GValue -> IO b) -> IO b++module System.Glib.GParameter+newtype GParameter+GParameter :: (String, GValue) -> GParameter+instance Storable GParameter++module System.Glib.GObject+objectNew :: GType -> [(String, GValue)] -> IO (Ptr GObject)+objectRef :: GObjectClass obj => Ptr obj -> IO ()+objectUnref :: Ptr a -> FinalizerPtr a+makeNewGObject :: GObjectClass obj => (ForeignPtr obj -> obj) -> IO (Ptr obj) -> IO obj+type DestroyNotify = FunPtr (Ptr () -> IO ())+mkFunPtrDestroyNotify :: FunPtr a -> IO DestroyNotify+type GWeakNotify = FunPtr (Ptr () -> Ptr GObject -> IO ())+objectWeakref :: GObjectClass o => o -> IO () -> IO GWeakNotify+objectWeakunref :: GObjectClass o => o -> GWeakNotify -> IO ()++module System.Glib.MainLoop+type HandlerId = CUInt+timeoutAdd :: IO Bool -> Int -> IO HandlerId+timeoutAddFull :: IO Bool -> Priority -> Int -> IO HandlerId+timeoutRemove :: HandlerId -> IO ()+idleAdd :: IO Bool -> Priority -> IO HandlerId+idleRemove :: HandlerId -> IO ()+data IOCondition+instance Bounded IOCondition+instance Enum IOCondition+instance Eq IOCondition+instance Flags IOCondition+inputAdd :: FD -> [IOCondition] -> Priority -> IO Bool -> IO HandlerId+inputRemove :: HandlerId -> IO ()+type Priority = Int+priorityLow :: Int+priorityDefaultIdle :: Int+priorityHighIdle :: Int+priorityDefault :: Int+priorityHigh :: Int++module System.Glib.UTFString+withUTFString :: String -> (CString -> IO a) -> IO a+withUTFStringLen :: String -> (CStringLen -> IO a) -> IO a+newUTFString :: String -> IO CString+newUTFStringLen :: String -> IO CStringLen+peekUTFString :: CString -> IO String+peekUTFStringLen :: CStringLen -> IO String+readUTFString :: CString -> IO String+readCString :: CString -> IO String+withUTFStrings :: [String] -> ([CString] -> IO a) -> IO a+withUTFStringArray :: [String] -> (Ptr CString -> IO a) -> IO a+withUTFStringArray0 :: [String] -> (Ptr CString -> IO a) -> IO a+peekUTFStringArray :: Int -> Ptr CString -> IO [String]+peekUTFStringArray0 :: Ptr CString -> IO [String]+data UTFCorrection+instance Show UTFCorrection+genUTFOfs :: String -> UTFCorrection+ofsToUTF :: Int -> UTFCorrection -> Int+ofsFromUTF :: Int -> UTFCorrection -> Int++module System.Glib.GError+data GError+GError :: GErrorDomain -> GErrorCode -> GErrorMessage -> GError+instance Storable GError+instance Typeable GError+type GErrorDomain = GQuark+type GErrorCode = Int+type GErrorMessage = String+catchGError :: IO a -> (GError -> IO a) -> IO a+catchGErrorJust :: GErrorClass err => err -> IO a -> (GErrorMessage -> IO a) -> IO a+catchGErrorJustDomain :: GErrorClass err => IO a -> (err -> GErrorMessage -> IO a) -> IO a+handleGError :: (GError -> IO a) -> IO a -> IO a+handleGErrorJust :: GErrorClass err => err -> (GErrorMessage -> IO a) -> IO a -> IO a+handleGErrorJustDomain :: GErrorClass err => (err -> GErrorMessage -> IO a) -> IO a -> IO a+failOnGError :: IO a -> IO a+throwGError :: GError -> IO a+class Enum err => GErrorClass err+gerrorDomain :: GErrorClass err => err -> GErrorDomain+instance GErrorClass FileChooserError+instance GErrorClass GConfError+instance GErrorClass PixbufError+propagateGError :: (Ptr (Ptr ()) -> IO a) -> IO a+checkGError :: (Ptr (Ptr ()) -> IO a) -> (GError -> IO a) -> IO a+checkGErrorWithCont :: (Ptr (Ptr ()) -> IO b) -> (GError -> IO a) -> (b -> IO a) -> IO a++module System.Glib.GValueTypes+valueSetUInt :: GValue -> Word -> IO ()+valueGetUInt :: GValue -> IO Word+valueSetInt :: GValue -> Int -> IO ()+valueGetInt :: GValue -> IO Int+valueSetBool :: GValue -> Bool -> IO ()+valueGetBool :: GValue -> IO Bool+valueSetPointer :: GValue -> Ptr () -> IO ()+valueGetPointer :: GValue -> IO (Ptr ())+valueSetFloat :: GValue -> Float -> IO ()+valueGetFloat :: GValue -> IO Float+valueSetDouble :: GValue -> Double -> IO ()+valueGetDouble :: GValue -> IO Double+valueSetEnum :: Enum enum => GValue -> enum -> IO ()+valueGetEnum :: Enum enum => GValue -> IO enum+valueSetFlags :: Flags flag => GValue -> [flag] -> IO ()+valueGetFlags :: Flags flag => GValue -> IO [flag]+valueSetString :: GValue -> String -> IO ()+valueGetString :: GValue -> IO String+valueSetMaybeString :: GValue -> Maybe String -> IO ()+valueGetMaybeString :: GValue -> IO (Maybe String)+valueSetGObject :: GObjectClass gobj => GValue -> gobj -> IO ()+valueGetGObject :: GObjectClass gobj => GValue -> IO gobj++module System.Glib.Signals+data ConnectId o+ConnectId :: CULong -> o -> ConnectId o+disconnect :: GObjectClass obj => ConnectId obj -> IO ()++module System.Gnome.GConf.GConfValue+class GConfValueClass value => GConfPrimitiveValueClass value+instance GConfPrimitiveValueClass Bool+instance GConfPrimitiveValueClass Double+instance GConfPrimitiveValueClass Int+instance GConfPrimitiveValueClass String+class GConfValueClass value+marshalFromGConfValue :: GConfValueClass value => GConfValue -> IO value+marshalToGConfValue :: GConfValueClass value => value -> IO GConfValue+instance GConfValueClass Bool+instance GConfValueClass Double+instance GConfValueClass GConfValueDyn+instance GConfValueClass Int+instance GConfValueClass String+instance (GConfPrimitiveValueClass a, GConfPrimitiveValueClass b) => GConfValueClass (a, b)+instance GConfValueClass value => GConfValueClass Maybe value+instance GConfPrimitiveValueClass a => GConfValueClass [a]+marshalFromGConfValue :: GConfValueClass value => GConfValue -> IO value+marshalToGConfValue :: GConfValueClass value => value -> IO GConfValue+newtype GConfValue+GConfValue :: Ptr GConfValue -> GConfValue+data GConfValueDyn+GConfValueString :: String -> GConfValueDyn+GConfValueInt :: Int -> GConfValueDyn+GConfValueFloat :: Double -> GConfValueDyn+GConfValueBool :: Bool -> GConfValueDyn+GConfValueSchema :: GConfValueDyn+GConfValueList :: [GConfValueDyn] -> GConfValueDyn+GConfValuePair :: (GConfValueDyn, GConfValueDyn) -> GConfValueDyn+instance GConfValueClass GConfValueDyn++module System.Gnome.GConf.GConfClient+data GConf+instance GConfClass GConf+instance GObjectClass GConf+data GConfPreloadType+instance Enum GConfPreloadType+data GConfError+instance Enum GConfError+instance GErrorClass GConfError+gconfGetDefault :: IO GConf+gconfAddDir :: GConf -> String -> IO ()+gconfRemoveDir :: GConf -> String -> IO ()+gconfNotifyAdd :: GConfValueClass value => GConf -> String -> (String -> value -> IO ()) -> IO GConfConnectId+gconfNotifyRemove :: GConf -> GConfConnectId -> IO ()+onValueChanged :: GConf -> (String -> Maybe GConfValueDyn -> IO ()) -> IO (ConnectId GConf)+afterValueChanged :: GConf -> (String -> Maybe GConfValueDyn -> IO ()) -> IO (ConnectId GConf)+gconfGet :: GConfValueClass value => GConf -> String -> IO value+gconfSet :: GConfValueClass value => GConf -> String -> value -> IO ()+gconfGetWithoutDefault :: GConfValueClass value => GConf -> String -> IO value+gconfGetDefaultFromSchema :: GConfValueClass value => GConf -> String -> IO value+gconfUnset :: GConf -> String -> IO ()+gconfClearCache :: GConf -> IO ()+gconfPreload :: GConf -> String -> GConfPreloadType -> IO ()+gconfSuggestSync :: GConf -> IO ()+gconfAllEntries :: GConf -> String -> IO [(String, GConfValueDyn)]+gconfAllDirs :: GConf -> String -> IO [String]+gconfDirExists :: GConf -> String -> IO Bool+class GConfValueClass value+instance GConfValueClass Bool+instance GConfValueClass Double+instance GConfValueClass GConfValueDyn+instance GConfValueClass Int+instance GConfValueClass String+instance (GConfPrimitiveValueClass a, GConfPrimitiveValueClass b) => GConfValueClass (a, b)+instance GConfValueClass value => GConfValueClass Maybe value+instance GConfPrimitiveValueClass a => GConfValueClass [a]+class GConfValueClass value => GConfPrimitiveValueClass value+instance GConfPrimitiveValueClass Bool+instance GConfPrimitiveValueClass Double+instance GConfPrimitiveValueClass Int+instance GConfPrimitiveValueClass String+data GConfValue+data GConfValueDyn+GConfValueString :: String -> GConfValueDyn+GConfValueInt :: Int -> GConfValueDyn+GConfValueFloat :: Double -> GConfValueDyn+GConfValueBool :: Bool -> GConfValueDyn+GConfValueSchema :: GConfValueDyn+GConfValueList :: [GConfValueDyn] -> GConfValueDyn+GConfValuePair :: (GConfValueDyn, GConfValueDyn) -> GConfValueDyn+instance GConfValueClass GConfValueDyn++module System.Gnome.GConf++module System.Glib.Attributes+type Attr o a = ReadWriteAttr o a a+type ReadAttr o a = ReadWriteAttr o a ()+type WriteAttr o b = ReadWriteAttr o () b+data ReadWriteAttr o a b+data AttrOp o+:= :: ReadWriteAttr o a b -> b -> AttrOp o+:~ :: ReadWriteAttr o a b -> (a -> b) -> AttrOp o+:=> :: ReadWriteAttr o a b -> IO b -> AttrOp o+:~> :: ReadWriteAttr o a b -> (a -> IO b) -> AttrOp o+::= :: ReadWriteAttr o a b -> (o -> b) -> AttrOp o+::~ :: ReadWriteAttr o a b -> (o -> a -> b) -> AttrOp o+get :: o -> ReadWriteAttr o a b -> IO a+set :: o -> [AttrOp o] -> IO ()+newAttr :: (o -> IO a) -> (o -> b -> IO ()) -> ReadWriteAttr o a b+readAttr :: (o -> IO a) -> ReadAttr o a+writeAttr :: (o -> b -> IO ()) -> WriteAttr o b++module System.Glib.Properties+objectSetPropertyInt :: GObjectClass gobj => String -> gobj -> Int -> IO ()+objectGetPropertyInt :: GObjectClass gobj => String -> gobj -> IO Int+objectSetPropertyUInt :: GObjectClass gobj => String -> gobj -> Int -> IO ()+objectGetPropertyUInt :: GObjectClass gobj => String -> gobj -> IO Int+objectSetPropertyBool :: GObjectClass gobj => String -> gobj -> Bool -> IO ()+objectGetPropertyBool :: GObjectClass gobj => String -> gobj -> IO Bool+objectSetPropertyEnum :: (GObjectClass gobj, Enum enum) => GType -> String -> gobj -> enum -> IO ()+objectGetPropertyEnum :: (GObjectClass gobj, Enum enum) => GType -> String -> gobj -> IO enum+objectSetPropertyFlags :: (GObjectClass gobj, Flags flag) => String -> gobj -> [flag] -> IO ()+objectGetPropertyFlags :: (GObjectClass gobj, Flags flag) => String -> gobj -> IO [flag]+objectSetPropertyFloat :: GObjectClass gobj => String -> gobj -> Float -> IO ()+objectGetPropertyFloat :: GObjectClass gobj => String -> gobj -> IO Float+objectSetPropertyDouble :: GObjectClass gobj => String -> gobj -> Double -> IO ()+objectGetPropertyDouble :: GObjectClass gobj => String -> gobj -> IO Double+objectSetPropertyString :: GObjectClass gobj => String -> gobj -> String -> IO ()+objectGetPropertyString :: GObjectClass gobj => String -> gobj -> IO String+objectSetPropertyMaybeString :: GObjectClass gobj => String -> gobj -> Maybe String -> IO ()+objectGetPropertyMaybeString :: GObjectClass gobj => String -> gobj -> IO (Maybe String)+objectSetPropertyGObject :: (GObjectClass gobj, GObjectClass gobj') => GType -> String -> gobj -> gobj' -> IO ()+objectGetPropertyGObject :: (GObjectClass gobj, GObjectClass gobj') => GType -> String -> gobj -> IO gobj'+objectSetPropertyInternal :: GObjectClass gobj => GType -> (GValue -> a -> IO ()) -> String -> gobj -> a -> IO ()+objectGetPropertyInternal :: GObjectClass gobj => GType -> (GValue -> IO a) -> String -> gobj -> IO a+newAttrFromIntProperty :: GObjectClass gobj => String -> Attr gobj Int+readAttrFromIntProperty :: GObjectClass gobj => String -> ReadAttr gobj Int+newAttrFromUIntProperty :: GObjectClass gobj => String -> Attr gobj Int+writeAttrFromUIntProperty :: GObjectClass gobj => String -> WriteAttr gobj Int+newAttrFromBoolProperty :: GObjectClass gobj => String -> Attr gobj Bool+newAttrFromFloatProperty :: GObjectClass gobj => String -> Attr gobj Float+newAttrFromDoubleProperty :: GObjectClass gobj => String -> Attr gobj Double+newAttrFromEnumProperty :: (GObjectClass gobj, Enum enum) => String -> GType -> Attr gobj enum+readAttrFromEnumProperty :: (GObjectClass gobj, Enum enum) => String -> GType -> ReadAttr gobj enum+newAttrFromFlagsProperty :: (GObjectClass gobj, Flags flag) => String -> Attr gobj [flag]+newAttrFromStringProperty :: GObjectClass gobj => String -> Attr gobj String+readAttrFromStringProperty :: GObjectClass gobj => String -> ReadAttr gobj String+writeAttrFromStringProperty :: GObjectClass gobj => String -> WriteAttr gobj String+newAttrFromMaybeStringProperty :: GObjectClass gobj => String -> Attr gobj (Maybe String)+newAttrFromObjectProperty :: (GObjectClass gobj, GObjectClass gobj', GObjectClass gobj'') => String -> GType -> ReadWriteAttr gobj gobj' gobj''+writeAttrFromObjectProperty :: (GObjectClass gobj, GObjectClass gobj') => String -> GType -> WriteAttr gobj gobj'++module System.Glib.StoreValue+data TMType+TMinvalid :: TMType+TMuint :: TMType+TMint :: TMType+TMboolean :: TMType+TMenum :: TMType+TMflags :: TMType+TMfloat :: TMType+TMdouble :: TMType+TMstring :: TMType+TMobject :: TMType+instance Enum TMType+data GenericValue+GVuint :: Word -> GenericValue+GVint :: Int -> GenericValue+GVboolean :: Bool -> GenericValue+GVenum :: Int -> GenericValue+GVflags :: Int -> GenericValue+GVfloat :: Float -> GenericValue+GVdouble :: Double -> GenericValue+GVstring :: Maybe String -> GenericValue+GVobject :: GObject -> GenericValue+valueSetGenericValue :: GValue -> GenericValue -> IO ()+valueGetGenericValue :: GValue -> IO GenericValue++module System.Glib++module Graphics.UI.Gtk.Windows.WindowGroup+data WindowGroup+instance GObjectClass WindowGroup+instance WindowGroupClass WindowGroup+class GObjectClass o => WindowGroupClass o+instance WindowGroupClass WindowGroup+castToWindowGroup :: GObjectClass obj => obj -> WindowGroup+toWindowGroup :: WindowGroupClass o => o -> WindowGroup+windowGroupNew :: IO WindowGroup+windowGroupAddWindow :: (WindowGroupClass self, WindowClass window) => self -> window -> IO ()+windowGroupRemoveWindow :: (WindowGroupClass self, WindowClass window) => self -> window -> IO ()++module Graphics.UI.Gtk.TreeList.CellRenderer+data CellRenderer+instance CellRendererClass CellRenderer+instance GObjectClass CellRenderer+instance ObjectClass CellRenderer+class ObjectClass o => CellRendererClass o+instance CellRendererClass CellRenderer+instance CellRendererClass CellRendererPixbuf+instance CellRendererClass CellRendererText+instance CellRendererClass CellRendererToggle+castToCellRenderer :: GObjectClass obj => obj -> CellRenderer+toCellRenderer :: CellRendererClass o => o -> CellRenderer+data Attribute cr a+Attribute :: [String] -> [TMType] -> (a -> IO [GenericValue]) -> ([GenericValue] -> IO a) -> Attribute cr a+cellRendererSet :: CellRendererClass cr => cr -> Attribute cr val -> val -> IO ()+cellRendererGet :: CellRendererClass cr => cr -> Attribute cr val -> IO val++module Graphics.UI.Gtk.SourceView.SourceMarker+data SourceMarker+instance GObjectClass SourceMarker+instance SourceMarkerClass SourceMarker+instance TextMarkClass SourceMarker+castToSourceMarker :: GObjectClass obj => obj -> SourceMarker+sourceMarkerSetMarkerType :: SourceMarker -> String -> IO ()+sourceMarkerGetMarkerType :: SourceMarker -> IO String+sourceMarkerGetLine :: SourceMarker -> IO Int+sourceMarkerGetName :: SourceMarker -> IO String+sourceMarkerGetBuffer :: SourceMarker -> IO SourceBuffer+sourceMarkerNext :: SourceMarker -> IO SourceMarker+sourceMarkerPrev :: SourceMarker -> IO SourceMarker++module Graphics.UI.Gtk.SourceView.SourceLanguagesManager+data SourceLanguagesManager+instance GObjectClass SourceLanguagesManager+instance SourceLanguagesManagerClass SourceLanguagesManager+castToSourceLanguagesManager :: GObjectClass obj => obj -> SourceLanguagesManager+sourceLanguagesManagerNew :: IO SourceLanguagesManager+sourceLanguagesManagerGetAvailableLanguages :: SourceLanguagesManager -> IO [SourceLanguage]+sourceLanguagesManagerGetLanguageFromMimeType :: SourceLanguagesManager -> String -> IO (Maybe SourceLanguage)+sourceLanguagesManagerGetLangFilesDirs :: SourceLanguagesManager -> IO [FilePath]++module Graphics.UI.Gtk.Pango.Enums+data FontStyle+StyleNormal :: FontStyle+StyleOblique :: FontStyle+StyleItalic :: FontStyle+instance Enum FontStyle+instance Eq FontStyle+instance Show FontStyle+data Weight+WeightUltralight :: Weight+WeightLight :: Weight+WeightNormal :: Weight+WeightSemibold :: Weight+WeightBold :: Weight+WeightUltrabold :: Weight+WeightHeavy :: Weight+instance Enum Weight+instance Eq Weight+instance Show Weight+data Variant+VariantNormal :: Variant+VariantSmallCaps :: Variant+instance Enum Variant+instance Eq Variant+instance Show Variant+data Stretch+StretchUltraCondensed :: Stretch+StretchExtraCondensed :: Stretch+StretchCondensed :: Stretch+StretchSemiCondensed :: Stretch+StretchNormal :: Stretch+StretchSemiExpanded :: Stretch+StretchExpanded :: Stretch+StretchExtraExpanded :: Stretch+StretchUltraExpanded :: Stretch+instance Enum Stretch+instance Eq Stretch+instance Show Stretch+data Underline+UnderlineNone :: Underline+UnderlineSingle :: Underline+UnderlineDouble :: Underline+UnderlineLow :: Underline+UnderlineError :: Underline+instance Enum Underline+instance Eq Underline+instance Show Underline+data EllipsizeMode+EllipsizeNone :: EllipsizeMode+EllipsizeStart :: EllipsizeMode+EllipsizeMiddle :: EllipsizeMode+EllipsizeEnd :: EllipsizeMode+instance Enum EllipsizeMode+instance Eq EllipsizeMode++module Graphics.UI.Gtk.Multiline.TextTagTable+data TextTagTable+instance GObjectClass TextTagTable+instance TextTagTableClass TextTagTable+class GObjectClass o => TextTagTableClass o+instance TextTagTableClass SourceTagTable+instance TextTagTableClass TextTagTable+castToTextTagTable :: GObjectClass obj => obj -> TextTagTable+toTextTagTable :: TextTagTableClass o => o -> TextTagTable+textTagTableNew :: IO TextTagTable+textTagTableAdd :: (TextTagTableClass self, TextTagClass tag) => self -> tag -> IO ()+textTagTableRemove :: (TextTagTableClass self, TextTagClass tag) => self -> tag -> IO ()+textTagTableLookup :: TextTagTableClass self => self -> String -> IO (Maybe TextTag)+textTagTableForeach :: TextTagTableClass self => self -> (TextTag -> IO ()) -> IO ()+textTagTableGetSize :: TextTagTableClass self => self -> IO Int++module Graphics.UI.Gtk.Multiline.TextMark+data TextMark+instance GObjectClass TextMark+instance TextMarkClass TextMark+class GObjectClass o => TextMarkClass o+instance TextMarkClass SourceMarker+instance TextMarkClass TextMark+castToTextMark :: GObjectClass obj => obj -> TextMark+toTextMark :: TextMarkClass o => o -> TextMark+type MarkName = String+textMarkSetVisible :: TextMarkClass self => self -> Bool -> IO ()+textMarkGetVisible :: TextMarkClass self => self -> IO Bool+textMarkGetDeleted :: TextMarkClass self => self -> IO Bool+textMarkGetName :: TextMarkClass self => self -> IO (Maybe MarkName)+textMarkGetBuffer :: TextMarkClass self => self -> IO (Maybe TextBuffer)+textMarkGetLeftGravity :: TextMarkClass self => self -> IO Bool+textMarkVisible :: TextMarkClass self => Attr self Bool++module Graphics.UI.Gtk.Misc.SizeGroup+data SizeGroup+instance GObjectClass SizeGroup+instance SizeGroupClass SizeGroup+class GObjectClass o => SizeGroupClass o+instance SizeGroupClass SizeGroup+castToSizeGroup :: GObjectClass obj => obj -> SizeGroup+toSizeGroup :: SizeGroupClass o => o -> SizeGroup+sizeGroupNew :: SizeGroupMode -> IO SizeGroup+data SizeGroupMode+SizeGroupNone :: SizeGroupMode+SizeGroupHorizontal :: SizeGroupMode+SizeGroupVertical :: SizeGroupMode+SizeGroupBoth :: SizeGroupMode+instance Enum SizeGroupMode+sizeGroupSetMode :: SizeGroupClass self => self -> SizeGroupMode -> IO ()+sizeGroupGetMode :: SizeGroupClass self => self -> IO SizeGroupMode+sizeGroupAddWidget :: (SizeGroupClass self, WidgetClass widget) => self -> widget -> IO ()+sizeGroupRemoveWidget :: (SizeGroupClass self, WidgetClass widget) => self -> widget -> IO ()+sizeGroupSetIgnoreHidden :: SizeGroupClass self => self -> Bool -> IO ()+sizeGroupGetIgnoreHidden :: SizeGroupClass self => self -> IO Bool+sizeGroupMode :: SizeGroupClass self => Attr self SizeGroupMode+sizeGroupIgnoreHidden :: SizeGroupClass self => Attr self Bool++module Graphics.UI.Gtk.Gdk.Keys+type KeyVal = Word32+keyvalName :: KeyVal -> IO String+keyvalFromName :: String -> IO KeyVal+keyvalToChar :: KeyVal -> IO (Maybe Char)++module Graphics.UI.Gtk.Gdk.Gdk+beep :: IO ()+flush :: IO ()++module Graphics.UI.Gtk.Gdk.Enums+data CapStyle+CapNotLast :: CapStyle+CapButt :: CapStyle+CapRound :: CapStyle+CapProjecting :: CapStyle+instance Enum CapStyle+data CrossingMode+CrossingNormal :: CrossingMode+CrossingGrab :: CrossingMode+CrossingUngrab :: CrossingMode+instance Enum CrossingMode+data Dither+RgbDitherNone :: Dither+RgbDitherNormal :: Dither+RgbDitherMax :: Dither+instance Enum Dither+data EventMask+ExposureMask :: EventMask+PointerMotionMask :: EventMask+PointerMotionHintMask :: EventMask+ButtonMotionMask :: EventMask+Button1MotionMask :: EventMask+Button2MotionMask :: EventMask+Button3MotionMask :: EventMask+ButtonPressMask :: EventMask+ButtonReleaseMask :: EventMask+KeyPressMask :: EventMask+KeyReleaseMask :: EventMask+EnterNotifyMask :: EventMask+LeaveNotifyMask :: EventMask+FocusChangeMask :: EventMask+StructureMask :: EventMask+PropertyChangeMask :: EventMask+VisibilityNotifyMask :: EventMask+ProximityInMask :: EventMask+ProximityOutMask :: EventMask+SubstructureMask :: EventMask+ScrollMask :: EventMask+AllEventsMask :: EventMask+instance Bounded EventMask+instance Enum EventMask+instance Flags EventMask+data ExtensionMode+ExtensionEventsNone :: ExtensionMode+ExtensionEventsAll :: ExtensionMode+ExtensionEventsCursor :: ExtensionMode+instance Bounded ExtensionMode+instance Enum ExtensionMode+instance Flags ExtensionMode+data Fill+Solid :: Fill+Tiled :: Fill+Stippled :: Fill+OpaqueStippled :: Fill+instance Enum Fill+data FillRule+EvenOddRule :: FillRule+WindingRule :: FillRule+instance Enum FillRule+data Function+Copy :: Function+Invert :: Function+Xor :: Function+Clear :: Function+And :: Function+AndReverse :: Function+AndInvert :: Function+Noop :: Function+Or :: Function+Equiv :: Function+OrReverse :: Function+CopyInvert :: Function+OrInvert :: Function+Nand :: Function+Nor :: Function+Set :: Function+instance Enum Function+data InputCondition+InputRead :: InputCondition+InputWrite :: InputCondition+InputException :: InputCondition+instance Bounded InputCondition+instance Enum InputCondition+instance Flags InputCondition+data JoinStyle+JoinMiter :: JoinStyle+JoinRound :: JoinStyle+JoinBevel :: JoinStyle+instance Enum JoinStyle+data LineStyle+LineSolid :: LineStyle+LineOnOffDash :: LineStyle+LineDoubleDash :: LineStyle+instance Enum LineStyle+data NotifyType+NotifyAncestor :: NotifyType+NotifyVirtual :: NotifyType+NotifyInferior :: NotifyType+NotifyNonlinear :: NotifyType+NotifyNonlinearVirtual :: NotifyType+NotifyUnknown :: NotifyType+instance Enum NotifyType+data OverlapType+OverlapRectangleIn :: OverlapType+OverlapRectangleOut :: OverlapType+OverlapRectanglePart :: OverlapType+instance Enum OverlapType+data ScrollDirection+ScrollUp :: ScrollDirection+ScrollDown :: ScrollDirection+ScrollLeft :: ScrollDirection+ScrollRight :: ScrollDirection+instance Enum ScrollDirection+data SubwindowMode+ClipByChildren :: SubwindowMode+IncludeInferiors :: SubwindowMode+instance Enum SubwindowMode+data VisibilityState+VisibilityUnobscured :: VisibilityState+VisibilityPartialObscured :: VisibilityState+VisibilityFullyObscured :: VisibilityState+instance Enum VisibilityState+data WindowState+WindowStateWithdrawn :: WindowState+WindowStateIconified :: WindowState+WindowStateMaximized :: WindowState+WindowStateSticky :: WindowState+WindowStateFullscreen :: WindowState+WindowStateAbove :: WindowState+WindowStateBelow :: WindowState+instance Bounded WindowState+instance Enum WindowState+instance Flags WindowState+data WindowEdge+WindowEdgeNorthWest :: WindowEdge+WindowEdgeNorth :: WindowEdge+WindowEdgeNorthEast :: WindowEdge+WindowEdgeWest :: WindowEdge+WindowEdgeEast :: WindowEdge+WindowEdgeSouthWest :: WindowEdge+WindowEdgeSouth :: WindowEdge+WindowEdgeSouthEast :: WindowEdge+instance Enum WindowEdge+data WindowTypeHint+WindowTypeHintNormal :: WindowTypeHint+WindowTypeHintDialog :: WindowTypeHint+WindowTypeHintMenu :: WindowTypeHint+WindowTypeHintToolbar :: WindowTypeHint+WindowTypeHintSplashscreen :: WindowTypeHint+WindowTypeHintUtility :: WindowTypeHint+WindowTypeHintDock :: WindowTypeHint+WindowTypeHintDesktop :: WindowTypeHint+instance Enum WindowTypeHint+data Gravity+GravityNorthWest :: Gravity+GravityNorth :: Gravity+GravityNorthEast :: Gravity+GravityWest :: Gravity+GravityCenter :: Gravity+GravityEast :: Gravity+GravitySouthWest :: Gravity+GravitySouth :: Gravity+GravitySouthEast :: Gravity+GravityStatic :: Gravity+instance Enum Gravity++module Graphics.UI.Gtk.General.Enums+data AccelFlags+AccelVisible :: AccelFlags+AccelLocked :: AccelFlags+AccelMask :: AccelFlags+instance Bounded AccelFlags+instance Enum AccelFlags+instance Eq AccelFlags+instance Flags AccelFlags+data ArrowType+ArrowUp :: ArrowType+ArrowDown :: ArrowType+ArrowLeft :: ArrowType+ArrowRight :: ArrowType+instance Enum ArrowType+instance Eq ArrowType+data AttachOptions+Expand :: AttachOptions+Shrink :: AttachOptions+Fill :: AttachOptions+instance Bounded AttachOptions+instance Enum AttachOptions+instance Eq AttachOptions+instance Flags AttachOptions+data MouseButton+LeftButton :: MouseButton+MiddleButton :: MouseButton+RightButton :: MouseButton+instance Enum MouseButton+instance Eq MouseButton+instance Show MouseButton+data ButtonBoxStyle+ButtonboxDefaultStyle :: ButtonBoxStyle+ButtonboxSpread :: ButtonBoxStyle+ButtonboxEdge :: ButtonBoxStyle+ButtonboxStart :: ButtonBoxStyle+ButtonboxEnd :: ButtonBoxStyle+instance Enum ButtonBoxStyle+instance Eq ButtonBoxStyle+data CalendarDisplayOptions+CalendarShowHeading :: CalendarDisplayOptions+CalendarShowDayNames :: CalendarDisplayOptions+CalendarNoMonthChange :: CalendarDisplayOptions+CalendarShowWeekNumbers :: CalendarDisplayOptions+CalendarWeekStartMonday :: CalendarDisplayOptions+instance Bounded CalendarDisplayOptions+instance Enum CalendarDisplayOptions+instance Eq CalendarDisplayOptions+instance Flags CalendarDisplayOptions+data Click+SingleClick :: Click+DoubleClick :: Click+TripleClick :: Click+ReleaseClick :: Click+data CornerType+CornerTopLeft :: CornerType+CornerBottomLeft :: CornerType+CornerTopRight :: CornerType+CornerBottomRight :: CornerType+instance Enum CornerType+instance Eq CornerType+data CurveType+CurveTypeLinear :: CurveType+CurveTypeSpline :: CurveType+CurveTypeFree :: CurveType+instance Enum CurveType+instance Eq CurveType+data DeleteType+DeleteChars :: DeleteType+DeleteWordEnds :: DeleteType+DeleteWords :: DeleteType+DeleteDisplayLines :: DeleteType+DeleteDisplayLineEnds :: DeleteType+DeleteParagraphEnds :: DeleteType+DeleteParagraphs :: DeleteType+DeleteWhitespace :: DeleteType+instance Enum DeleteType+instance Eq DeleteType+data DirectionType+DirTabForward :: DirectionType+DirTabBackward :: DirectionType+DirUp :: DirectionType+DirDown :: DirectionType+DirLeft :: DirectionType+DirRight :: DirectionType+instance Enum DirectionType+instance Eq DirectionType+data Justification+JustifyLeft :: Justification+JustifyRight :: Justification+JustifyCenter :: Justification+JustifyFill :: Justification+instance Enum Justification+instance Eq Justification+data MatchType+MatchAll :: MatchType+MatchAllTail :: MatchType+MatchHead :: MatchType+MatchTail :: MatchType+MatchExact :: MatchType+MatchLast :: MatchType+instance Enum MatchType+instance Eq MatchType+data MenuDirectionType+MenuDirParent :: MenuDirectionType+MenuDirChild :: MenuDirectionType+MenuDirNext :: MenuDirectionType+MenuDirPrev :: MenuDirectionType+instance Enum MenuDirectionType+instance Eq MenuDirectionType+data MetricType+Pixels :: MetricType+Inches :: MetricType+Centimeters :: MetricType+instance Enum MetricType+instance Eq MetricType+data MovementStep+MovementLogicalPositions :: MovementStep+MovementVisualPositions :: MovementStep+MovementWords :: MovementStep+MovementDisplayLines :: MovementStep+MovementDisplayLineEnds :: MovementStep+MovementParagraphs :: MovementStep+MovementParagraphEnds :: MovementStep+MovementPages :: MovementStep+MovementBufferEnds :: MovementStep+MovementHorizontalPages :: MovementStep+instance Enum MovementStep+instance Eq MovementStep+data Orientation+OrientationHorizontal :: Orientation+OrientationVertical :: Orientation+instance Enum Orientation+instance Eq Orientation+data Packing+PackRepel :: Packing+PackGrow :: Packing+PackNatural :: Packing+instance Enum Packing+instance Eq Packing+toPacking :: Bool -> Bool -> Packing+fromPacking :: Packing -> (Bool, Bool)+data PackType+PackStart :: PackType+PackEnd :: PackType+instance Enum PackType+instance Eq PackType+data PathPriorityType+PathPrioLowest :: PathPriorityType+PathPrioGtk :: PathPriorityType+PathPrioApplication :: PathPriorityType+PathPrioTheme :: PathPriorityType+PathPrioRc :: PathPriorityType+PathPrioHighest :: PathPriorityType+instance Enum PathPriorityType+instance Eq PathPriorityType+data PathType+PathWidget :: PathType+PathWidgetClass :: PathType+PathClass :: PathType+instance Enum PathType+instance Eq PathType+data PolicyType+PolicyAlways :: PolicyType+PolicyAutomatic :: PolicyType+PolicyNever :: PolicyType+instance Enum PolicyType+instance Eq PolicyType+data PositionType+PosLeft :: PositionType+PosRight :: PositionType+PosTop :: PositionType+PosBottom :: PositionType+instance Enum PositionType+instance Eq PositionType+data ProgressBarOrientation+ProgressLeftToRight :: ProgressBarOrientation+ProgressRightToLeft :: ProgressBarOrientation+ProgressBottomToTop :: ProgressBarOrientation+ProgressTopToBottom :: ProgressBarOrientation+instance Enum ProgressBarOrientation+instance Eq ProgressBarOrientation+data ReliefStyle+ReliefNormal :: ReliefStyle+ReliefHalf :: ReliefStyle+ReliefNone :: ReliefStyle+instance Enum ReliefStyle+instance Eq ReliefStyle+data ResizeMode+ResizeParent :: ResizeMode+ResizeQueue :: ResizeMode+ResizeImmediate :: ResizeMode+instance Enum ResizeMode+instance Eq ResizeMode+data ScrollType+ScrollNone :: ScrollType+ScrollJump :: ScrollType+ScrollStepBackward :: ScrollType+ScrollStepForward :: ScrollType+ScrollPageBackward :: ScrollType+ScrollPageForward :: ScrollType+ScrollStepUp :: ScrollType+ScrollStepDown :: ScrollType+ScrollPageUp :: ScrollType+ScrollPageDown :: ScrollType+ScrollStepLeft :: ScrollType+ScrollStepRight :: ScrollType+ScrollPageLeft :: ScrollType+ScrollPageRight :: ScrollType+ScrollStart :: ScrollType+ScrollEnd :: ScrollType+instance Enum ScrollType+instance Eq ScrollType+data SelectionMode+SelectionNone :: SelectionMode+SelectionSingle :: SelectionMode+SelectionBrowse :: SelectionMode+SelectionMultiple :: SelectionMode+instance Enum SelectionMode+data ShadowType+ShadowNone :: ShadowType+ShadowIn :: ShadowType+ShadowOut :: ShadowType+ShadowEtchedIn :: ShadowType+ShadowEtchedOut :: ShadowType+instance Enum ShadowType+instance Eq ShadowType+data StateType+StateNormal :: StateType+StateActive :: StateType+StatePrelight :: StateType+StateSelected :: StateType+StateInsensitive :: StateType+instance Enum StateType+instance Eq StateType+data SubmenuDirection+DirectionLeft :: SubmenuDirection+DirectionRight :: SubmenuDirection+instance Enum SubmenuDirection+instance Eq SubmenuDirection+data SubmenuPlacement+TopBottom :: SubmenuPlacement+LeftRight :: SubmenuPlacement+instance Enum SubmenuPlacement+instance Eq SubmenuPlacement+data SpinButtonUpdatePolicy+UpdateAlways :: SpinButtonUpdatePolicy+UpdateIfValid :: SpinButtonUpdatePolicy+instance Enum SpinButtonUpdatePolicy+instance Eq SpinButtonUpdatePolicy+data SpinType+SpinStepForward :: SpinType+SpinStepBackward :: SpinType+SpinPageForward :: SpinType+SpinPageBackward :: SpinType+SpinHome :: SpinType+SpinEnd :: SpinType+SpinUserDefined :: SpinType+instance Enum SpinType+instance Eq SpinType+data TextDirection+TextDirNone :: TextDirection+TextDirLtr :: TextDirection+TextDirRtl :: TextDirection+instance Enum TextDirection+instance Eq TextDirection+data TextSearchFlags+TextSearchVisibleOnly :: TextSearchFlags+TextSearchTextOnly :: TextSearchFlags+instance Bounded TextSearchFlags+instance Enum TextSearchFlags+instance Eq TextSearchFlags+instance Flags TextSearchFlags+data TextWindowType+TextWindowPrivate :: TextWindowType+TextWindowWidget :: TextWindowType+TextWindowText :: TextWindowType+TextWindowLeft :: TextWindowType+TextWindowRight :: TextWindowType+TextWindowTop :: TextWindowType+TextWindowBottom :: TextWindowType+instance Enum TextWindowType+instance Eq TextWindowType+data ToolbarStyle+ToolbarIcons :: ToolbarStyle+ToolbarText :: ToolbarStyle+ToolbarBoth :: ToolbarStyle+ToolbarBothHoriz :: ToolbarStyle+instance Enum ToolbarStyle+instance Eq ToolbarStyle+data TreeViewColumnSizing+TreeViewColumnGrowOnly :: TreeViewColumnSizing+TreeViewColumnAutosize :: TreeViewColumnSizing+TreeViewColumnFixed :: TreeViewColumnSizing+instance Enum TreeViewColumnSizing+instance Eq TreeViewColumnSizing+data UpdateType+UpdateContinuous :: UpdateType+UpdateDiscontinuous :: UpdateType+UpdateDelayed :: UpdateType+instance Enum UpdateType+instance Eq UpdateType+data Visibility+VisibilityNone :: Visibility+VisibilityPartial :: Visibility+VisibilityFull :: Visibility+instance Enum Visibility+instance Eq Visibility+data WindowPosition+WinPosNone :: WindowPosition+WinPosCenter :: WindowPosition+WinPosMouse :: WindowPosition+WinPosCenterAlways :: WindowPosition+WinPosCenterOnParent :: WindowPosition+instance Enum WindowPosition+instance Eq WindowPosition+data WindowType+WindowToplevel :: WindowType+WindowPopup :: WindowType+instance Enum WindowType+instance Eq WindowType+data WrapMode+WrapNone :: WrapMode+WrapChar :: WrapMode+WrapWord :: WrapMode+WrapWordChar :: WrapMode+instance Enum WrapMode+instance Eq WrapMode+data SortType+SortAscending :: SortType+SortDescending :: SortType+instance Enum SortType+instance Eq SortType++module Graphics.UI.Gtk.Multiline.TextTag+data TextTag+instance GObjectClass TextTag+instance TextTagClass TextTag+class GObjectClass o => TextTagClass o+instance TextTagClass SourceTag+instance TextTagClass TextTag+castToTextTag :: GObjectClass obj => obj -> TextTag+toTextTag :: TextTagClass o => o -> TextTag+type TagName = String+textTagNew :: TagName -> IO TextTag+textTagSetPriority :: TextTagClass self => self -> Int -> IO ()+textTagGetPriority :: TextTagClass self => self -> IO Int+newtype TextAttributes+TextAttributes :: ForeignPtr TextAttributes -> TextAttributes+textAttributesNew :: IO TextAttributes+makeNewTextAttributes :: Ptr TextAttributes -> IO TextAttributes+textTagName :: TextTagClass self => Attr self (Maybe String)+textTagBackground :: TextTagClass self => WriteAttr self String+textTagBackgroundFullHeight :: TextTagClass self => Attr self Bool+textTagBackgroundStipple :: (TextTagClass self, PixmapClass pixmap) => ReadWriteAttr self Pixmap pixmap+textTagForeground :: TextTagClass self => WriteAttr self String+textTagForegroundStipple :: (TextTagClass self, PixmapClass pixmap) => ReadWriteAttr self Pixmap pixmap+textTagDirection :: TextTagClass self => Attr self TextDirection+textTagEditable :: TextTagClass self => Attr self Bool+textTagFont :: TextTagClass self => Attr self String+textTagFamily :: TextTagClass self => Attr self String+textTagStyle :: TextTagClass self => Attr self FontStyle+textTagVariant :: TextTagClass self => Attr self Variant+textTagWeight :: TextTagClass self => Attr self Int+textTagStretch :: TextTagClass self => Attr self Stretch+textTagSize :: TextTagClass self => Attr self Int+textTagScale :: TextTagClass self => Attr self Double+textTagSizePoints :: TextTagClass self => Attr self Double+textTagJustification :: TextTagClass self => Attr self Justification+textTagLanguage :: TextTagClass self => Attr self String+textTagLeftMargin :: TextTagClass self => Attr self Int+textTagRightMargin :: TextTagClass self => Attr self Int+textTagIndent :: TextTagClass self => Attr self Int+textTagRise :: TextTagClass self => Attr self Int+textTagPixelsAboveLines :: TextTagClass self => Attr self Int+textTagPixelsBelowLines :: TextTagClass self => Attr self Int+textTagPixelsInsideWrap :: TextTagClass self => Attr self Int+textTagStrikethrough :: TextTagClass self => Attr self Bool+textTagUnderline :: TextTagClass self => Attr self Underline+textTagWrapMode :: TextTagClass self => Attr self WrapMode+textTagInvisible :: TextTagClass self => Attr self Bool+textTagParagraphBackground :: TextTagClass self => WriteAttr self String+textTagPriority :: TextTagClass self => Attr self Int++module Graphics.UI.Gtk.Embedding.Embedding+socketHasPlug :: SocketClass s => s -> IO Bool+type NativeWindowId = Word32++module Graphics.UI.Gtk.ActionMenuToolbar.ToggleAction+data ToggleAction+instance ActionClass ToggleAction+instance GObjectClass ToggleAction+instance ToggleActionClass ToggleAction+class ActionClass o => ToggleActionClass o+instance ToggleActionClass RadioAction+instance ToggleActionClass ToggleAction+castToToggleAction :: GObjectClass obj => obj -> ToggleAction+toToggleAction :: ToggleActionClass o => o -> ToggleAction+toggleActionNew :: String -> String -> Maybe String -> Maybe String -> IO ToggleAction+toggleActionToggled :: ToggleActionClass self => self -> IO ()+toggleActionSetActive :: ToggleActionClass self => self -> Bool -> IO ()+toggleActionGetActive :: ToggleActionClass self => self -> IO Bool+toggleActionSetDrawAsRadio :: ToggleActionClass self => self -> Bool -> IO ()+toggleActionGetDrawAsRadio :: ToggleActionClass self => self -> IO Bool+toggleActionDrawAsRadio :: ToggleActionClass self => Attr self Bool+toggleActionActive :: ToggleActionClass self => Attr self Bool+onToggleActionToggled :: ToggleActionClass self => self -> IO () -> IO (ConnectId self)+afterToggleActionToggled :: ToggleActionClass self => self -> IO () -> IO (ConnectId self)++module Graphics.UI.Gtk.ActionMenuToolbar.RadioAction+data RadioAction+instance ActionClass RadioAction+instance GObjectClass RadioAction+instance RadioActionClass RadioAction+instance ToggleActionClass RadioAction+class ToggleActionClass o => RadioActionClass o+instance RadioActionClass RadioAction+castToRadioAction :: GObjectClass obj => obj -> RadioAction+toRadioAction :: RadioActionClass o => o -> RadioAction+radioActionNew :: String -> String -> Maybe String -> Maybe String -> Int -> IO RadioAction+radioActionGetGroup :: RadioActionClass self => self -> IO [RadioAction]+radioActionSetGroup :: (RadioActionClass self, RadioActionClass groupMember) => self -> groupMember -> IO ()+radioActionGetCurrentValue :: RadioActionClass self => self -> IO Int+radioActionGroup :: RadioActionClass self => ReadWriteAttr self [RadioAction] RadioAction+onRadioActionChanged :: RadioActionClass self => self -> (RadioAction -> IO ()) -> IO (ConnectId self)+afterRadioActionChanged :: RadioActionClass self => self -> (RadioAction -> IO ()) -> IO (ConnectId self)++module Graphics.UI.Gtk.Abstract.Separator+data Separator+instance GObjectClass Separator+instance ObjectClass Separator+instance SeparatorClass Separator+instance WidgetClass Separator+class WidgetClass o => SeparatorClass o+instance SeparatorClass HSeparator+instance SeparatorClass Separator+instance SeparatorClass VSeparator+castToSeparator :: GObjectClass obj => obj -> Separator+toSeparator :: SeparatorClass o => o -> Separator++module Graphics.UI.Gtk.Abstract.Scrollbar+data Scrollbar+instance GObjectClass Scrollbar+instance ObjectClass Scrollbar+instance RangeClass Scrollbar+instance ScrollbarClass Scrollbar+instance WidgetClass Scrollbar+class RangeClass o => ScrollbarClass o+instance ScrollbarClass HScrollbar+instance ScrollbarClass Scrollbar+instance ScrollbarClass VScrollbar+castToScrollbar :: GObjectClass obj => obj -> Scrollbar+toScrollbar :: ScrollbarClass o => o -> Scrollbar++module Graphics.UI.Gtk.Abstract.Object+data Object+instance GObjectClass Object+instance ObjectClass Object+class GObjectClass o => ObjectClass o+instance ObjectClass AboutDialog+instance ObjectClass AccelLabel+instance ObjectClass Adjustment+instance ObjectClass Alignment+instance ObjectClass Arrow+instance ObjectClass AspectFrame+instance ObjectClass Bin+instance ObjectClass Box+instance ObjectClass Button+instance ObjectClass ButtonBox+instance ObjectClass CList+instance ObjectClass CTree+instance ObjectClass Calendar+instance ObjectClass CellRenderer+instance ObjectClass CellRendererPixbuf+instance ObjectClass CellRendererText+instance ObjectClass CellRendererToggle+instance ObjectClass CellView+instance ObjectClass CheckButton+instance ObjectClass CheckMenuItem+instance ObjectClass ColorButton+instance ObjectClass ColorSelection+instance ObjectClass ColorSelectionDialog+instance ObjectClass Combo+instance ObjectClass ComboBox+instance ObjectClass ComboBoxEntry+instance ObjectClass Container+instance ObjectClass Curve+instance ObjectClass Dialog+instance ObjectClass DrawingArea+instance ObjectClass Entry+instance ObjectClass EventBox+instance ObjectClass Expander+instance ObjectClass FileChooserButton+instance ObjectClass FileChooserDialog+instance ObjectClass FileChooserWidget+instance ObjectClass FileFilter+instance ObjectClass FileSelection+instance ObjectClass Fixed+instance ObjectClass FontButton+instance ObjectClass FontSelection+instance ObjectClass FontSelectionDialog+instance ObjectClass Frame+instance ObjectClass GammaCurve+instance ObjectClass HBox+instance ObjectClass HButtonBox+instance ObjectClass HPaned+instance ObjectClass HRuler+instance ObjectClass HScale+instance ObjectClass HScrollbar+instance ObjectClass HSeparator+instance ObjectClass HandleBox+instance ObjectClass IMContext+instance ObjectClass IMMulticontext+instance ObjectClass IconView+instance ObjectClass Image+instance ObjectClass ImageMenuItem+instance ObjectClass InputDialog+instance ObjectClass Invisible+instance ObjectClass Item+instance ObjectClass ItemFactory+instance ObjectClass Label+instance ObjectClass Layout+instance ObjectClass List+instance ObjectClass ListItem+instance ObjectClass Menu+instance ObjectClass MenuBar+instance ObjectClass MenuItem+instance ObjectClass MenuShell+instance ObjectClass MenuToolButton+instance ObjectClass MessageDialog+instance ObjectClass Misc+instance ObjectClass MozEmbed+instance ObjectClass Notebook+instance ObjectClass Object+instance ObjectClass OptionMenu+instance ObjectClass Paned+instance ObjectClass Plug+instance ObjectClass Preview+instance ObjectClass ProgressBar+instance ObjectClass RadioButton+instance ObjectClass RadioMenuItem+instance ObjectClass RadioToolButton+instance ObjectClass Range+instance ObjectClass Ruler+instance ObjectClass Scale+instance ObjectClass Scrollbar+instance ObjectClass ScrolledWindow+instance ObjectClass Separator+instance ObjectClass SeparatorMenuItem+instance ObjectClass SeparatorToolItem+instance ObjectClass Socket+instance ObjectClass SourceView+instance ObjectClass SpinButton+instance ObjectClass Statusbar+instance ObjectClass Table+instance ObjectClass TearoffMenuItem+instance ObjectClass TextView+instance ObjectClass TipsQuery+instance ObjectClass ToggleButton+instance ObjectClass ToggleToolButton+instance ObjectClass ToolButton+instance ObjectClass ToolItem+instance ObjectClass Toolbar+instance ObjectClass Tooltips+instance ObjectClass TreeView+instance ObjectClass TreeViewColumn+instance ObjectClass VBox+instance ObjectClass VButtonBox+instance ObjectClass VPaned+instance ObjectClass VRuler+instance ObjectClass VScale+instance ObjectClass VScrollbar+instance ObjectClass VSeparator+instance ObjectClass Viewport+instance ObjectClass Widget+instance ObjectClass Window+castToObject :: GObjectClass obj => obj -> Object+toObject :: ObjectClass o => o -> Object+objectSink :: ObjectClass obj => Ptr obj -> IO ()+makeNewObject :: ObjectClass obj => (ForeignPtr obj -> obj) -> IO (Ptr obj) -> IO obj++module Graphics.UI.Gtk.Abstract.Range+data Range+instance GObjectClass Range+instance ObjectClass Range+instance RangeClass Range+instance WidgetClass Range+class WidgetClass o => RangeClass o+instance RangeClass HScale+instance RangeClass HScrollbar+instance RangeClass Range+instance RangeClass Scale+instance RangeClass Scrollbar+instance RangeClass VScale+instance RangeClass VScrollbar+castToRange :: GObjectClass obj => obj -> Range+toRange :: RangeClass o => o -> Range+rangeGetAdjustment :: RangeClass self => self -> IO Adjustment+rangeSetAdjustment :: RangeClass self => self -> Adjustment -> IO ()+data UpdateType+UpdateContinuous :: UpdateType+UpdateDiscontinuous :: UpdateType+UpdateDelayed :: UpdateType+instance Enum UpdateType+instance Eq UpdateType+rangeGetUpdatePolicy :: RangeClass self => self -> IO UpdateType+rangeSetUpdatePolicy :: RangeClass self => self -> UpdateType -> IO ()+rangeGetInverted :: RangeClass self => self -> IO Bool+rangeSetInverted :: RangeClass self => self -> Bool -> IO ()+rangeGetValue :: RangeClass self => self -> IO Double+rangeSetValue :: RangeClass self => self -> Double -> IO ()+rangeSetIncrements :: RangeClass self => self -> Double -> Double -> IO ()+rangeSetRange :: RangeClass self => self -> Double -> Double -> IO ()+data ScrollType+ScrollNone :: ScrollType+ScrollJump :: ScrollType+ScrollStepBackward :: ScrollType+ScrollStepForward :: ScrollType+ScrollPageBackward :: ScrollType+ScrollPageForward :: ScrollType+ScrollStepUp :: ScrollType+ScrollStepDown :: ScrollType+ScrollPageUp :: ScrollType+ScrollPageDown :: ScrollType+ScrollStepLeft :: ScrollType+ScrollStepRight :: ScrollType+ScrollPageLeft :: ScrollType+ScrollPageRight :: ScrollType+ScrollStart :: ScrollType+ScrollEnd :: ScrollType+instance Enum ScrollType+instance Eq ScrollType+rangeUpdatePolicy :: RangeClass self => Attr self UpdateType+rangeAdjustment :: RangeClass self => Attr self Adjustment+rangeInverted :: RangeClass self => Attr self Bool+rangeValue :: RangeClass self => Attr self Double+onMoveSlider :: RangeClass self => self -> (ScrollType -> IO ()) -> IO (ConnectId self)+afterMoveSlider :: RangeClass self => self -> (ScrollType -> IO ()) -> IO (ConnectId self)+onAdjustBounds :: RangeClass self => self -> (Double -> IO ()) -> IO (ConnectId self)+afterAdjustBounds :: RangeClass self => self -> (Double -> IO ()) -> IO (ConnectId self)++module Graphics.UI.Gtk.Abstract.Scale+data Scale+instance GObjectClass Scale+instance ObjectClass Scale+instance RangeClass Scale+instance ScaleClass Scale+instance WidgetClass Scale+class RangeClass o => ScaleClass o+instance ScaleClass HScale+instance ScaleClass Scale+instance ScaleClass VScale+castToScale :: GObjectClass obj => obj -> Scale+toScale :: ScaleClass o => o -> Scale+scaleSetDigits :: ScaleClass self => self -> Int -> IO ()+scaleGetDigits :: ScaleClass self => self -> IO Int+scaleSetDrawValue :: ScaleClass self => self -> Bool -> IO ()+scaleGetDrawValue :: ScaleClass self => self -> IO Bool+data PositionType+PosLeft :: PositionType+PosRight :: PositionType+PosTop :: PositionType+PosBottom :: PositionType+instance Enum PositionType+instance Eq PositionType+scaleSetValuePos :: ScaleClass self => self -> PositionType -> IO ()+scaleGetValuePos :: ScaleClass self => self -> IO PositionType+scaleDigits :: ScaleClass self => Attr self Int+scaleDrawValue :: ScaleClass self => Attr self Bool+scaleValuePos :: ScaleClass self => Attr self PositionType++module Graphics.UI.Gtk.ActionMenuToolbar.UIManager+data UIManager+instance GObjectClass UIManager+instance UIManagerClass UIManager+class GObjectClass o => UIManagerClass o+instance UIManagerClass UIManager+castToUIManager :: GObjectClass obj => obj -> UIManager+toUIManager :: UIManagerClass o => o -> UIManager+data UIManagerItemType+UiManagerAuto :: UIManagerItemType+UiManagerMenubar :: UIManagerItemType+UiManagerMenu :: UIManagerItemType+UiManagerToolbar :: UIManagerItemType+UiManagerPlaceholder :: UIManagerItemType+UiManagerPopup :: UIManagerItemType+UiManagerMenuitem :: UIManagerItemType+UiManagerToolitem :: UIManagerItemType+UiManagerSeparator :: UIManagerItemType+UiManagerAccelerator :: UIManagerItemType+instance Bounded UIManagerItemType+instance Enum UIManagerItemType+instance Flags UIManagerItemType+data MergeId+uiManagerNew :: IO UIManager+uiManagerSetAddTearoffs :: UIManager -> Bool -> IO ()+uiManagerGetAddTearoffs :: UIManager -> IO Bool+uiManagerInsertActionGroup :: UIManager -> ActionGroup -> Int -> IO ()+uiManagerRemoveActionGroup :: UIManager -> ActionGroup -> IO ()+uiManagerGetActionGroups :: UIManager -> IO [ActionGroup]+uiManagerGetAccelGroup :: UIManager -> IO AccelGroup+uiManagerGetWidget :: UIManager -> String -> IO (Maybe Widget)+uiManagerGetToplevels :: UIManager -> [UIManagerItemType] -> IO [Widget]+uiManagerGetAction :: UIManager -> String -> IO (Maybe Action)+uiManagerAddUiFromString :: UIManager -> String -> IO MergeId+uiManagerAddUiFromFile :: UIManager -> String -> IO MergeId+uiManagerNewMergeId :: UIManager -> IO MergeId+uiManagerAddUi :: UIManager -> MergeId -> String -> String -> Maybe String -> [UIManagerItemType] -> Bool -> IO ()+uiManagerRemoveUi :: UIManager -> MergeId -> IO ()+uiManagerGetUi :: UIManager -> IO String+uiManagerEnsureUpdate :: UIManager -> IO ()+uiManagerAddTearoffs :: Attr UIManager Bool+uiManagerUi :: ReadAttr UIManager String+onAddWidget :: UIManagerClass self => self -> (Widget -> IO ()) -> IO (ConnectId self)+afterAddWidget :: UIManagerClass self => self -> (Widget -> IO ()) -> IO (ConnectId self)+onActionsChanged :: UIManagerClass self => self -> IO () -> IO (ConnectId self)+afterActionsChanged :: UIManagerClass self => self -> IO () -> IO (ConnectId self)+onConnectProxy :: UIManagerClass self => self -> (Action -> Widget -> IO ()) -> IO (ConnectId self)+afterConnectProxy :: UIManagerClass self => self -> (Action -> Widget -> IO ()) -> IO (ConnectId self)+onDisconnectProxy :: UIManagerClass self => self -> (Action -> Widget -> IO ()) -> IO (ConnectId self)+afterDisconnectProxy :: UIManagerClass self => self -> (Action -> Widget -> IO ()) -> IO (ConnectId self)+onPreActivate :: UIManagerClass self => self -> (Action -> IO ()) -> IO (ConnectId self)+afterPreActivate :: UIManagerClass self => self -> (Action -> IO ()) -> IO (ConnectId self)+onPostActivate :: UIManagerClass self => self -> (Action -> IO ()) -> IO (ConnectId self)+afterPostActivate :: UIManagerClass self => self -> (Action -> IO ()) -> IO (ConnectId self)++module Graphics.UI.Gtk.Buttons.Button+data Button+instance BinClass Button+instance ButtonClass Button+instance ContainerClass Button+instance GObjectClass Button+instance ObjectClass Button+instance WidgetClass Button+class BinClass o => ButtonClass o+instance ButtonClass Button+instance ButtonClass CheckButton+instance ButtonClass ColorButton+instance ButtonClass FontButton+instance ButtonClass OptionMenu+instance ButtonClass RadioButton+instance ButtonClass ToggleButton+castToButton :: GObjectClass obj => obj -> Button+toButton :: ButtonClass o => o -> Button+buttonNew :: IO Button+buttonNewWithLabel :: String -> IO Button+buttonNewWithMnemonic :: String -> IO Button+buttonNewFromStock :: String -> IO Button+buttonPressed :: ButtonClass self => self -> IO ()+buttonReleased :: ButtonClass self => self -> IO ()+buttonClicked :: ButtonClass self => self -> IO ()+buttonEnter :: ButtonClass self => self -> IO ()+buttonLeave :: ButtonClass self => self -> IO ()+data ReliefStyle+ReliefNormal :: ReliefStyle+ReliefHalf :: ReliefStyle+ReliefNone :: ReliefStyle+instance Enum ReliefStyle+instance Eq ReliefStyle+buttonSetRelief :: ButtonClass self => self -> ReliefStyle -> IO ()+buttonGetRelief :: ButtonClass self => self -> IO ReliefStyle+buttonSetLabel :: ButtonClass self => self -> String -> IO ()+buttonGetLabel :: ButtonClass self => self -> IO String+buttonSetUseStock :: ButtonClass self => self -> Bool -> IO ()+buttonGetUseStock :: ButtonClass self => self -> IO Bool+buttonSetUseUnderline :: ButtonClass self => self -> Bool -> IO ()+buttonGetUseUnderline :: ButtonClass self => self -> IO Bool+buttonSetFocusOnClick :: ButtonClass self => self -> Bool -> IO ()+buttonGetFocusOnClick :: ButtonClass self => self -> IO Bool+buttonSetAlignment :: ButtonClass self => self -> (Float, Float) -> IO ()+buttonGetAlignment :: ButtonClass self => self -> IO (Float, Float)+buttonGetImage :: ButtonClass self => self -> IO (Maybe Widget)+buttonSetImage :: (ButtonClass self, WidgetClass image) => self -> image -> IO ()+buttonLabel :: ButtonClass self => Attr self String+buttonUseUnderline :: ButtonClass self => Attr self Bool+buttonUseStock :: ButtonClass self => Attr self Bool+buttonFocusOnClick :: ButtonClass self => Attr self Bool+buttonRelief :: ButtonClass self => Attr self ReliefStyle+buttonXalign :: ButtonClass self => Attr self Float+buttonYalign :: ButtonClass self => Attr self Float+buttonImage :: (ButtonClass self, WidgetClass image) => ReadWriteAttr self (Maybe Widget) image+onButtonActivate :: ButtonClass b => b -> IO () -> IO (ConnectId b)+afterButtonActivate :: ButtonClass b => b -> IO () -> IO (ConnectId b)+onClicked :: ButtonClass b => b -> IO () -> IO (ConnectId b)+afterClicked :: ButtonClass b => b -> IO () -> IO (ConnectId b)+onEnter :: ButtonClass b => b -> IO () -> IO (ConnectId b)+afterEnter :: ButtonClass b => b -> IO () -> IO (ConnectId b)+onLeave :: ButtonClass b => b -> IO () -> IO (ConnectId b)+afterLeave :: ButtonClass b => b -> IO () -> IO (ConnectId b)+onPressed :: ButtonClass b => b -> IO () -> IO (ConnectId b)+afterPressed :: ButtonClass b => b -> IO () -> IO (ConnectId b)+onReleased :: ButtonClass b => b -> IO () -> IO (ConnectId b)+afterReleased :: ButtonClass b => b -> IO () -> IO (ConnectId b)++module Graphics.UI.Gtk.Buttons.CheckButton+data CheckButton+instance BinClass CheckButton+instance ButtonClass CheckButton+instance CheckButtonClass CheckButton+instance ContainerClass CheckButton+instance GObjectClass CheckButton+instance ObjectClass CheckButton+instance ToggleButtonClass CheckButton+instance WidgetClass CheckButton+class ToggleButtonClass o => CheckButtonClass o+instance CheckButtonClass CheckButton+instance CheckButtonClass RadioButton+castToCheckButton :: GObjectClass obj => obj -> CheckButton+toCheckButton :: CheckButtonClass o => o -> CheckButton+checkButtonNew :: IO CheckButton+checkButtonNewWithLabel :: String -> IO CheckButton+checkButtonNewWithMnemonic :: String -> IO CheckButton++module Graphics.UI.Gtk.Buttons.RadioButton+data RadioButton+instance BinClass RadioButton+instance ButtonClass RadioButton+instance CheckButtonClass RadioButton+instance ContainerClass RadioButton+instance GObjectClass RadioButton+instance ObjectClass RadioButton+instance RadioButtonClass RadioButton+instance ToggleButtonClass RadioButton+instance WidgetClass RadioButton+class CheckButtonClass o => RadioButtonClass o+instance RadioButtonClass RadioButton+castToRadioButton :: GObjectClass obj => obj -> RadioButton+toRadioButton :: RadioButtonClass o => o -> RadioButton+radioButtonNew :: IO RadioButton+radioButtonNewWithLabel :: String -> IO RadioButton+radioButtonNewWithMnemonic :: String -> IO RadioButton+radioButtonNewFromWidget :: RadioButton -> IO RadioButton+radioButtonNewWithLabelFromWidget :: RadioButton -> String -> IO RadioButton+radioButtonNewWithMnemonicFromWidget :: RadioButton -> String -> IO RadioButton+radioButtonSetGroup :: RadioButton -> RadioButton -> IO ()+radioButtonGetGroup :: RadioButton -> IO [RadioButton]+radioButtonGroup :: ReadWriteAttr RadioButton [RadioButton] RadioButton+onGroupChanged :: RadioButtonClass self => self -> IO () -> IO (ConnectId self)+afterGroupChanged :: RadioButtonClass self => self -> IO () -> IO (ConnectId self)++module Graphics.UI.Gtk.Buttons.ToggleButton+data ToggleButton+instance BinClass ToggleButton+instance ButtonClass ToggleButton+instance ContainerClass ToggleButton+instance GObjectClass ToggleButton+instance ObjectClass ToggleButton+instance ToggleButtonClass ToggleButton+instance WidgetClass ToggleButton+class ButtonClass o => ToggleButtonClass o+instance ToggleButtonClass CheckButton+instance ToggleButtonClass RadioButton+instance ToggleButtonClass ToggleButton+castToToggleButton :: GObjectClass obj => obj -> ToggleButton+toToggleButton :: ToggleButtonClass o => o -> ToggleButton+toggleButtonNew :: IO ToggleButton+toggleButtonNewWithLabel :: String -> IO ToggleButton+toggleButtonNewWithMnemonic :: String -> IO ToggleButton+toggleButtonSetMode :: ToggleButtonClass self => self -> Bool -> IO ()+toggleButtonGetMode :: ToggleButtonClass self => self -> IO Bool+toggleButtonToggled :: ToggleButtonClass self => self -> IO ()+toggleButtonGetActive :: ToggleButtonClass self => self -> IO Bool+toggleButtonSetActive :: ToggleButtonClass self => self -> Bool -> IO ()+toggleButtonGetInconsistent :: ToggleButtonClass self => self -> IO Bool+toggleButtonSetInconsistent :: ToggleButtonClass self => self -> Bool -> IO ()+toggleButtonActive :: ToggleButtonClass self => Attr self Bool+toggleButtonInconsistent :: ToggleButtonClass self => Attr self Bool+toggleButtonDrawIndicator :: ToggleButtonClass self => Attr self Bool+toggleButtonMode :: ToggleButtonClass self => Attr self Bool+onToggled :: ToggleButtonClass self => self -> IO () -> IO (ConnectId self)+afterToggled :: ToggleButtonClass self => self -> IO () -> IO (ConnectId self)++module Graphics.UI.Gtk.Display.AccelLabel+data AccelLabel+instance AccelLabelClass AccelLabel+instance GObjectClass AccelLabel+instance LabelClass AccelLabel+instance MiscClass AccelLabel+instance ObjectClass AccelLabel+instance WidgetClass AccelLabel+class LabelClass o => AccelLabelClass o+instance AccelLabelClass AccelLabel+castToAccelLabel :: GObjectClass obj => obj -> AccelLabel+toAccelLabel :: AccelLabelClass o => o -> AccelLabel+accelLabelNew :: String -> IO AccelLabel+accelLabelSetAccelWidget :: (AccelLabelClass self, WidgetClass accelWidget) => self -> accelWidget -> IO ()+accelLabelGetAccelWidget :: AccelLabelClass self => self -> IO (Maybe Widget)+accelLabelAccelWidget :: (AccelLabelClass self, WidgetClass accelWidget) => ReadWriteAttr self (Maybe Widget) accelWidget++module Graphics.UI.Gtk.Display.ProgressBar+data ProgressBar+instance GObjectClass ProgressBar+instance ObjectClass ProgressBar+instance ProgressBarClass ProgressBar+instance WidgetClass ProgressBar+class WidgetClass o => ProgressBarClass o+instance ProgressBarClass ProgressBar+castToProgressBar :: GObjectClass obj => obj -> ProgressBar+toProgressBar :: ProgressBarClass o => o -> ProgressBar+progressBarNew :: IO ProgressBar+progressBarPulse :: ProgressBarClass self => self -> IO ()+progressBarSetText :: ProgressBarClass self => self -> String -> IO ()+progressBarSetFraction :: ProgressBarClass self => self -> Double -> IO ()+progressBarSetPulseStep :: ProgressBarClass self => self -> Double -> IO ()+progressBarGetFraction :: ProgressBarClass self => self -> IO Double+progressBarGetPulseStep :: ProgressBarClass self => self -> IO Double+progressBarGetText :: ProgressBarClass self => self -> IO (Maybe String)+data ProgressBarOrientation+ProgressLeftToRight :: ProgressBarOrientation+ProgressRightToLeft :: ProgressBarOrientation+ProgressBottomToTop :: ProgressBarOrientation+ProgressTopToBottom :: ProgressBarOrientation+instance Enum ProgressBarOrientation+instance Eq ProgressBarOrientation+progressBarSetOrientation :: ProgressBarClass self => self -> ProgressBarOrientation -> IO ()+progressBarGetOrientation :: ProgressBarClass self => self -> IO ProgressBarOrientation+progressBarSetEllipsize :: ProgressBarClass self => self -> EllipsizeMode -> IO ()+progressBarGetEllipsize :: ProgressBarClass self => self -> IO EllipsizeMode+progressBarOrientation :: ProgressBarClass self => Attr self ProgressBarOrientation+progressBarDiscreteBlocks :: ProgressBarClass self => Attr self Int+progressBarFraction :: ProgressBarClass self => Attr self Double+progressBarPulseStep :: ProgressBarClass self => Attr self Double+progressBarText :: ProgressBarClass self => ReadWriteAttr self (Maybe String) String+progressBarEllipsize :: ProgressBarClass self => Attr self EllipsizeMode++module Graphics.UI.Gtk.Display.Statusbar+data Statusbar+instance BoxClass Statusbar+instance ContainerClass Statusbar+instance GObjectClass Statusbar+instance HBoxClass Statusbar+instance ObjectClass Statusbar+instance StatusbarClass Statusbar+instance WidgetClass Statusbar+class HBoxClass o => StatusbarClass o+instance StatusbarClass Statusbar+castToStatusbar :: GObjectClass obj => obj -> Statusbar+toStatusbar :: StatusbarClass o => o -> Statusbar+statusbarNew :: IO Statusbar+statusbarGetContextId :: StatusbarClass self => self -> String -> IO ContextId+statusbarPush :: StatusbarClass self => self -> ContextId -> String -> IO MessageId+statusbarPop :: StatusbarClass self => self -> ContextId -> IO ()+statusbarRemove :: StatusbarClass self => self -> ContextId -> MessageId -> IO ()+statusbarSetHasResizeGrip :: StatusbarClass self => self -> Bool -> IO ()+statusbarGetHasResizeGrip :: StatusbarClass self => self -> IO Bool+statusbarHasResizeGrip :: StatusbarClass self => Attr self Bool+onTextPopped :: StatusbarClass self => self -> (ContextId -> String -> IO ()) -> IO (ConnectId self)+afterTextPopped :: StatusbarClass self => self -> (ContextId -> String -> IO ()) -> IO (ConnectId self)+onTextPushed :: StatusbarClass self => self -> (ContextId -> String -> IO ()) -> IO (ConnectId self)+afterTextPushed :: StatusbarClass self => self -> (ContextId -> String -> IO ()) -> IO (ConnectId self)++module Graphics.UI.Gtk.Embedding.Plug+data Plug+instance BinClass Plug+instance ContainerClass Plug+instance GObjectClass Plug+instance ObjectClass Plug+instance PlugClass Plug+instance WidgetClass Plug+instance WindowClass Plug+class WindowClass o => PlugClass o+instance PlugClass Plug+castToPlug :: GObjectClass obj => obj -> Plug+toPlug :: PlugClass o => o -> Plug+type NativeWindowId = Word32+plugNew :: Maybe NativeWindowId -> IO Plug+plugGetId :: PlugClass self => self -> IO NativeWindowId+onEmbedded :: PlugClass self => self -> IO () -> IO (ConnectId self)+afterEmbedded :: PlugClass self => self -> IO () -> IO (ConnectId self)++module Graphics.UI.Gtk.Embedding.Socket+data Socket+instance ContainerClass Socket+instance GObjectClass Socket+instance ObjectClass Socket+instance SocketClass Socket+instance WidgetClass Socket+class ContainerClass o => SocketClass o+instance SocketClass Socket+castToSocket :: GObjectClass obj => obj -> Socket+toSocket :: SocketClass o => o -> Socket+type NativeWindowId = Word32+socketNew :: IO Socket+socketHasPlug :: SocketClass s => s -> IO Bool+socketAddId :: SocketClass self => self -> NativeWindowId -> IO ()+socketGetId :: SocketClass self => self -> IO NativeWindowId+onPlugAdded :: SocketClass self => self -> IO () -> IO (ConnectId self)+afterPlugAdded :: SocketClass self => self -> IO () -> IO (ConnectId self)+onPlugRemoved :: SocketClass self => self -> IO () -> IO (ConnectId self)+afterPlugRemoved :: SocketClass self => self -> IO () -> IO (ConnectId self)++module Graphics.UI.Gtk.Entry.Editable+data Editable+instance EditableClass Editable+instance GObjectClass Editable+class GObjectClass o => EditableClass o+instance EditableClass Editable+instance EditableClass Entry+instance EditableClass SpinButton+castToEditable :: GObjectClass obj => obj -> Editable+toEditable :: EditableClass o => o -> Editable+editableSelectRegion :: EditableClass self => self -> Int -> Int -> IO ()+editableGetSelectionBounds :: EditableClass self => self -> IO (Int, Int)+editableInsertText :: EditableClass self => self -> String -> Int -> IO Int+editableDeleteText :: EditableClass self => self -> Int -> Int -> IO ()+editableGetChars :: EditableClass self => self -> Int -> Int -> IO String+editableCutClipboard :: EditableClass self => self -> IO ()+editableCopyClipboard :: EditableClass self => self -> IO ()+editablePasteClipboard :: EditableClass self => self -> IO ()+editableDeleteSelection :: EditableClass self => self -> IO ()+editableSetEditable :: EditableClass self => self -> Bool -> IO ()+editableGetEditable :: EditableClass self => self -> IO Bool+editableSetPosition :: EditableClass self => self -> Int -> IO ()+editableGetPosition :: EditableClass self => self -> IO Int+editablePosition :: EditableClass self => Attr self Int+editableEditable :: EditableClass self => Attr self Bool+onEditableChanged :: EditableClass ec => ec -> IO () -> IO (ConnectId ec)+afterEditableChanged :: EditableClass ec => ec -> IO () -> IO (ConnectId ec)+onDeleteText :: EditableClass self => self -> (Int -> Int -> IO ()) -> IO (ConnectId self)+afterDeleteText :: EditableClass self => self -> (Int -> Int -> IO ()) -> IO (ConnectId self)++module Graphics.UI.Gtk.Entry.Entry+data Entry+instance EditableClass Entry+instance EntryClass Entry+instance GObjectClass Entry+instance ObjectClass Entry+instance WidgetClass Entry+class WidgetClass o => EntryClass o+instance EntryClass Entry+instance EntryClass SpinButton+castToEntry :: GObjectClass obj => obj -> Entry+toEntry :: EntryClass o => o -> Entry+entryNew :: IO Entry+entrySetText :: EntryClass self => self -> String -> IO ()+entryGetText :: EntryClass self => self -> IO String+entryAppendText :: EntryClass self => self -> String -> IO ()+entryPrependText :: EntryClass self => self -> String -> IO ()+entrySetVisibility :: EntryClass self => self -> Bool -> IO ()+entryGetVisibility :: EntryClass self => self -> IO Bool+entrySetInvisibleChar :: EntryClass self => self -> Char -> IO ()+entryGetInvisibleChar :: EntryClass self => self -> IO Char+entrySetMaxLength :: EntryClass self => self -> Int -> IO ()+entryGetMaxLength :: EntryClass self => self -> IO Int+entryGetActivatesDefault :: EntryClass self => self -> IO Bool+entrySetActivatesDefault :: EntryClass self => self -> Bool -> IO ()+entryGetHasFrame :: EntryClass self => self -> IO Bool+entrySetHasFrame :: EntryClass self => self -> Bool -> IO ()+entryGetWidthChars :: EntryClass self => self -> IO Int+entrySetWidthChars :: EntryClass self => self -> Int -> IO ()+entrySetAlignment :: EntryClass self => self -> Float -> IO ()+entryGetAlignment :: EntryClass self => self -> IO Float+entrySetCompletion :: EntryClass self => self -> EntryCompletion -> IO ()+entryGetCompletion :: EntryClass self => self -> IO EntryCompletion+entryCursorPosition :: EntryClass self => ReadAttr self Int+entrySelectionBound :: EntryClass self => ReadAttr self Int+entryEditable :: EntryClass self => Attr self Bool+entryMaxLength :: EntryClass self => Attr self Int+entryVisibility :: EntryClass self => Attr self Bool+entryHasFrame :: EntryClass self => Attr self Bool+entryInvisibleChar :: EntryClass self => Attr self Char+entryActivatesDefault :: EntryClass self => Attr self Bool+entryWidthChars :: EntryClass self => Attr self Int+entryScrollOffset :: EntryClass self => ReadAttr self Int+entryText :: EntryClass self => Attr self String+entryXalign :: EntryClass self => Attr self Float+entryAlignment :: EntryClass self => Attr self Float+entryCompletion :: EntryClass self => Attr self EntryCompletion+onEntryActivate :: EntryClass ec => ec -> IO () -> IO (ConnectId ec)+afterEntryActivate :: EntryClass ec => ec -> IO () -> IO (ConnectId ec)+onCopyClipboard :: EntryClass ec => ec -> IO () -> IO (ConnectId ec)+afterCopyClipboard :: EntryClass ec => ec -> IO () -> IO (ConnectId ec)+onCutClipboard :: EntryClass ec => ec -> IO () -> IO (ConnectId ec)+afterCutClipboard :: EntryClass ec => ec -> IO () -> IO (ConnectId ec)+onPasteClipboard :: EntryClass ec => ec -> IO () -> IO (ConnectId ec)+afterPasteClipboard :: EntryClass ec => ec -> IO () -> IO (ConnectId ec)+onInsertAtCursor :: EntryClass ec => ec -> (String -> IO ()) -> IO (ConnectId ec)+afterInsertAtCursor :: EntryClass ec => ec -> (String -> IO ()) -> IO (ConnectId ec)+onToggleOverwrite :: EntryClass ec => ec -> IO () -> IO (ConnectId ec)+afterToggleOverwrite :: EntryClass ec => ec -> IO () -> IO (ConnectId ec)++module Graphics.UI.Gtk.Entry.HScale+data HScale+instance GObjectClass HScale+instance HScaleClass HScale+instance ObjectClass HScale+instance RangeClass HScale+instance ScaleClass HScale+instance WidgetClass HScale+class ScaleClass o => HScaleClass o+instance HScaleClass HScale+castToHScale :: GObjectClass obj => obj -> HScale+toHScale :: HScaleClass o => o -> HScale+hScaleNew :: Adjustment -> IO HScale+hScaleNewWithRange :: Double -> Double -> Double -> IO HScale++module Graphics.UI.Gtk.Entry.VScale+data VScale+instance GObjectClass VScale+instance ObjectClass VScale+instance RangeClass VScale+instance ScaleClass VScale+instance VScaleClass VScale+instance WidgetClass VScale+class ScaleClass o => VScaleClass o+instance VScaleClass VScale+castToVScale :: GObjectClass obj => obj -> VScale+toVScale :: VScaleClass o => o -> VScale+vScaleNew :: Adjustment -> IO VScale+vScaleNewWithRange :: Double -> Double -> Double -> IO VScale++module Graphics.UI.Gtk.General.General+initGUI :: IO [String]+eventsPending :: IO Int+mainGUI :: IO ()+mainLevel :: IO Int+mainQuit :: IO ()+mainIteration :: IO Bool+mainIterationDo :: Bool -> IO Bool+grabAdd :: WidgetClass wd => wd -> IO ()+grabGetCurrent :: IO (Maybe Widget)+grabRemove :: WidgetClass w => w -> IO ()+type Priority = Int+priorityLow :: Int+priorityDefaultIdle :: Int+priorityHighIdle :: Int+priorityDefault :: Int+priorityHigh :: Int+timeoutAdd :: IO Bool -> Int -> IO HandlerId+timeoutAddFull :: IO Bool -> Priority -> Int -> IO HandlerId+timeoutRemove :: HandlerId -> IO ()+idleAdd :: IO Bool -> Priority -> IO HandlerId+idleRemove :: HandlerId -> IO ()+inputAdd :: FD -> [IOCondition] -> Priority -> IO Bool -> IO HandlerId+inputRemove :: HandlerId -> IO ()+data IOCondition+instance Bounded IOCondition+instance Enum IOCondition+instance Eq IOCondition+instance Flags IOCondition+type HandlerId = CUInt++module Graphics.UI.Gtk.General.Structs+type Point = (Int, Int)+data Rectangle+Rectangle :: Int -> Int -> Int -> Int -> Rectangle+instance Storable Rectangle+data Color+Color :: Word16 -> Word16 -> Word16 -> Color+instance Storable Color+data GCValues+GCValues :: Color -> Color -> Function -> Fill -> Maybe Pixmap -> Maybe Pixmap -> Maybe Pixmap -> SubwindowMode -> Int -> Int -> Int -> Int -> Bool -> Int -> LineStyle -> CapStyle -> JoinStyle -> GCValues+foreground :: GCValues -> Color+background :: GCValues -> Color+function :: GCValues -> Function+fill :: GCValues -> Fill+tile :: GCValues -> Maybe Pixmap+stipple :: GCValues -> Maybe Pixmap+clipMask :: GCValues -> Maybe Pixmap+subwindowMode :: GCValues -> SubwindowMode+tsXOrigin :: GCValues -> Int+tsYOrigin :: GCValues -> Int+clipXOrigin :: GCValues -> Int+clipYOrigin :: GCValues -> Int+graphicsExposure :: GCValues -> Bool+lineWidth :: GCValues -> Int+lineStyle :: GCValues -> LineStyle+capStyle :: GCValues -> CapStyle+joinStyle :: GCValues -> JoinStyle+instance Storable GCValues+pokeGCValues :: Ptr GCValues -> GCValues -> IO CInt+newGCValues :: GCValues+widgetGetState :: WidgetClass w => w -> IO StateType+widgetGetSavedState :: WidgetClass w => w -> IO StateType+type Allocation = Rectangle+data Requisition+Requisition :: Int -> Int -> Requisition+instance Storable Requisition+treeIterSize :: Int+textIterSize :: Int+inputError :: Int32+dialogGetUpper :: DialogClass dc => dc -> IO VBox+dialogGetActionArea :: DialogClass dc => dc -> IO HBox+fileSelectionGetButtons :: FileSelectionClass fsel => fsel -> IO (Button, Button)+data ResponseId+ResponseNone :: ResponseId+ResponseReject :: ResponseId+ResponseAccept :: ResponseId+ResponseDeleteEvent :: ResponseId+ResponseOk :: ResponseId+ResponseCancel :: ResponseId+ResponseClose :: ResponseId+ResponseYes :: ResponseId+ResponseNo :: ResponseId+ResponseApply :: ResponseId+ResponseHelp :: ResponseId+ResponseUser :: Int -> ResponseId+instance Show ResponseId+fromResponse :: Integral a => ResponseId -> a+toResponse :: Integral a => a -> ResponseId+toolbarChildButton :: CInt+toolbarChildToggleButton :: CInt+toolbarChildRadioButton :: CInt+type IconSize = Int+iconSizeInvalid :: IconSize+iconSizeMenu :: IconSize+iconSizeSmallToolbar :: IconSize+iconSizeLargeToolbar :: IconSize+iconSizeButton :: IconSize+iconSizeDialog :: IconSize+comboGetList :: Combo -> IO List+drawingAreaGetDrawWindow :: DrawingArea -> IO DrawWindow+drawingAreaGetSize :: DrawingArea -> IO (Int, Int)+layoutGetDrawWindow :: Layout -> IO DrawWindow+pangoScale :: Int+data PangoDirection+PangoDirectionLtr :: PangoDirection+PangoDirectionRtl :: PangoDirection+PangoDirectionWeakLtr :: PangoDirection+PangoDirectionWeakRtl :: PangoDirection+PangoDirectionNeutral :: PangoDirection+instance Enum PangoDirection+instance Eq PangoDirection+instance Ord PangoDirection+pangodirToLevel :: PangoDirection -> Int+setAttrPos :: UTFCorrection -> Int -> Int -> IO (Ptr ()) -> IO (Ptr ())+pangoItemRawGetFont :: Ptr pangoItem -> IO Font+pangoItemRawGetLanguage :: Ptr pangoItem -> IO (Ptr CChar)+pangoItemRawAnalysis :: Ptr pangoItem -> Ptr pangoAnalysis+pangoItemRawGetLevel :: Ptr pangoItem -> IO Bool+styleGetForeground :: StateType -> Style -> IO GC+styleGetBackground :: StateType -> Style -> IO GC+styleGetLight :: StateType -> Style -> IO GC+styleGetMiddle :: StateType -> Style -> IO GC+styleGetDark :: StateType -> Style -> IO GC+styleGetText :: StateType -> Style -> IO GC+styleGetBase :: StateType -> Style -> IO GC+styleGetAntiAliasing :: StateType -> Style -> IO GC++module Graphics.UI.Gtk.ActionMenuToolbar.Action+data Action+instance ActionClass Action+instance GObjectClass Action+class GObjectClass o => ActionClass o+instance ActionClass Action+instance ActionClass RadioAction+instance ActionClass ToggleAction+castToAction :: GObjectClass obj => obj -> Action+toAction :: ActionClass o => o -> Action+actionNew :: String -> String -> Maybe String -> Maybe String -> IO Action+actionGetName :: ActionClass self => self -> IO String+actionIsSensitive :: ActionClass self => self -> IO Bool+actionGetSensitive :: ActionClass self => self -> IO Bool+actionSetSensitive :: ActionClass self => self -> Bool -> IO ()+actionIsVisible :: ActionClass self => self -> IO Bool+actionGetVisible :: ActionClass self => self -> IO Bool+actionSetVisible :: ActionClass self => self -> Bool -> IO ()+actionActivate :: ActionClass self => self -> IO ()+actionCreateMenuItem :: ActionClass self => self -> IO Widget+actionCreateToolItem :: ActionClass self => self -> IO Widget+actionConnectProxy :: (ActionClass self, WidgetClass proxy) => self -> proxy -> IO ()+actionDisconnectProxy :: (ActionClass self, WidgetClass proxy) => self -> proxy -> IO ()+actionGetProxies :: ActionClass self => self -> IO [Widget]+actionConnectAccelerator :: ActionClass self => self -> IO ()+actionDisconnectAccelerator :: ActionClass self => self -> IO ()+actionGetAccelPath :: ActionClass self => self -> IO (Maybe String)+actionSetAccelPath :: ActionClass self => self -> String -> IO ()+actionSetAccelGroup :: ActionClass self => self -> AccelGroup -> IO ()+actionName :: ActionClass self => Attr self String+actionLabel :: ActionClass self => Attr self String+actionShortLabel :: ActionClass self => Attr self String+actionTooltip :: ActionClass self => Attr self (Maybe String)+actionStockId :: ActionClass self => Attr self (Maybe String)+actionVisibleHorizontal :: ActionClass self => Attr self Bool+actionVisibleOverflown :: ActionClass self => Attr self Bool+actionVisibleVertical :: ActionClass self => Attr self Bool+actionIsImportant :: ActionClass self => Attr self Bool+actionHideIfEmpty :: ActionClass self => Attr self Bool+actionSensitive :: ActionClass self => Attr self Bool+actionVisible :: ActionClass self => Attr self Bool+actionAccelPath :: ActionClass self => ReadWriteAttr self (Maybe String) String+onActionActivate :: ActionClass self => self -> IO () -> IO (ConnectId self)+afterActionActivate :: ActionClass self => self -> IO () -> IO (ConnectId self)++module Graphics.UI.Gtk.ActionMenuToolbar.ActionGroup+data ActionGroup+instance ActionGroupClass ActionGroup+instance GObjectClass ActionGroup+class GObjectClass o => ActionGroupClass o+instance ActionGroupClass ActionGroup+castToActionGroup :: GObjectClass obj => obj -> ActionGroup+toActionGroup :: ActionGroupClass o => o -> ActionGroup+actionGroupNew :: String -> IO ActionGroup+actionGroupGetName :: ActionGroup -> IO String+actionGroupGetSensitive :: ActionGroup -> IO Bool+actionGroupSetSensitive :: ActionGroup -> Bool -> IO ()+actionGroupGetVisible :: ActionGroup -> IO Bool+actionGroupSetVisible :: ActionGroup -> Bool -> IO ()+actionGroupGetAction :: ActionGroup -> String -> IO (Maybe Action)+actionGroupListActions :: ActionGroup -> IO [Action]+actionGroupAddAction :: ActionClass action => ActionGroup -> action -> IO ()+actionGroupAddActionWithAccel :: ActionClass action => ActionGroup -> action -> Maybe String -> IO ()+actionGroupRemoveAction :: ActionClass action => ActionGroup -> action -> IO ()+actionGroupAddActions :: ActionGroup -> [ActionEntry] -> IO ()+actionGroupAddToggleActions :: ActionGroup -> [ToggleActionEntry] -> IO ()+actionGroupAddRadioActions :: ActionGroup -> [RadioActionEntry] -> Int -> (RadioAction -> IO ()) -> IO ()+actionGroupSetTranslateFunc :: ActionGroup -> (String -> IO String) -> IO ()+actionGroupSetTranslationDomain :: ActionGroup -> String -> IO ()+actionGroupTranslateString :: ActionGroup -> String -> IO String+actionGroupName :: Attr ActionGroup String+actionGroupSensitive :: Attr ActionGroup Bool+actionGroupVisible :: Attr ActionGroup Bool++module Graphics.UI.Gtk.Display.Image+data Image+instance GObjectClass Image+instance ImageClass Image+instance MiscClass Image+instance ObjectClass Image+instance WidgetClass Image+class MiscClass o => ImageClass o+instance ImageClass Image+castToImage :: GObjectClass obj => obj -> Image+toImage :: ImageClass o => o -> Image+imageNewFromFile :: FilePath -> IO Image+imageNewFromPixbuf :: Pixbuf -> IO Image+imageNewFromStock :: String -> IconSize -> IO Image+imageNew :: IO Image+imageNewFromIconName :: String -> IconSize -> IO Image+imageGetPixbuf :: Image -> IO Pixbuf+imageSetFromPixbuf :: Image -> Pixbuf -> IO ()+imageSetFromFile :: Image -> FilePath -> IO ()+imageSetFromStock :: Image -> String -> IconSize -> IO ()+imageSetFromIconName :: Image -> String -> IconSize -> IO ()+imageSetPixelSize :: Image -> Int -> IO ()+imageGetPixelSize :: Image -> IO Int+imageClear :: Image -> IO ()+type IconSize = Int+iconSizeMenu :: IconSize+iconSizeSmallToolbar :: IconSize+iconSizeLargeToolbar :: IconSize+iconSizeButton :: IconSize+iconSizeDialog :: IconSize+imagePixbuf :: PixbufClass pixbuf => ReadWriteAttr Image Pixbuf pixbuf+imagePixmap :: PixmapClass pixmap => ReadWriteAttr Image Pixmap pixmap+imageImage :: ImageClass image => ReadWriteAttr Image Image image+imageMask :: PixmapClass pixmap => ReadWriteAttr Image Pixmap pixmap+imageFile :: Attr Image String+imageStock :: Attr Image String+imageIconSize :: Attr Image Int+imagePixelSize :: Attr Image Int+imageIconName :: Attr Image String+imageStorageType :: ReadAttr Image ImageType++module Graphics.UI.Gtk.Entry.SpinButton+data SpinButton+instance EditableClass SpinButton+instance EntryClass SpinButton+instance GObjectClass SpinButton+instance ObjectClass SpinButton+instance SpinButtonClass SpinButton+instance WidgetClass SpinButton+class EntryClass o => SpinButtonClass o+instance SpinButtonClass SpinButton+castToSpinButton :: GObjectClass obj => obj -> SpinButton+toSpinButton :: SpinButtonClass o => o -> SpinButton+spinButtonNew :: Adjustment -> Double -> Int -> IO SpinButton+spinButtonNewWithRange :: Double -> Double -> Double -> IO SpinButton+spinButtonConfigure :: SpinButtonClass self => self -> Adjustment -> Double -> Int -> IO ()+spinButtonSetAdjustment :: SpinButtonClass self => self -> Adjustment -> IO ()+spinButtonGetAdjustment :: SpinButtonClass self => self -> IO Adjustment+spinButtonSetDigits :: SpinButtonClass self => self -> Int -> IO ()+spinButtonGetDigits :: SpinButtonClass self => self -> IO Int+spinButtonSetIncrements :: SpinButtonClass self => self -> Double -> Double -> IO ()+spinButtonGetIncrements :: SpinButtonClass self => self -> IO (Double, Double)+spinButtonSetRange :: SpinButtonClass self => self -> Double -> Double -> IO ()+spinButtonGetRange :: SpinButtonClass self => self -> IO (Double, Double)+spinButtonGetValue :: SpinButtonClass self => self -> IO Double+spinButtonGetValueAsInt :: SpinButtonClass self => self -> IO Int+spinButtonSetValue :: SpinButtonClass self => self -> Double -> IO ()+data SpinButtonUpdatePolicy+UpdateAlways :: SpinButtonUpdatePolicy+UpdateIfValid :: SpinButtonUpdatePolicy+instance Enum SpinButtonUpdatePolicy+instance Eq SpinButtonUpdatePolicy+spinButtonSetUpdatePolicy :: SpinButtonClass self => self -> SpinButtonUpdatePolicy -> IO ()+spinButtonGetUpdatePolicy :: SpinButtonClass self => self -> IO SpinButtonUpdatePolicy+spinButtonSetNumeric :: SpinButtonClass self => self -> Bool -> IO ()+spinButtonGetNumeric :: SpinButtonClass self => self -> IO Bool+data SpinType+SpinStepForward :: SpinType+SpinStepBackward :: SpinType+SpinPageForward :: SpinType+SpinPageBackward :: SpinType+SpinHome :: SpinType+SpinEnd :: SpinType+SpinUserDefined :: SpinType+instance Enum SpinType+instance Eq SpinType+spinButtonSpin :: SpinButtonClass self => self -> SpinType -> Double -> IO ()+spinButtonSetWrap :: SpinButtonClass self => self -> Bool -> IO ()+spinButtonGetWrap :: SpinButtonClass self => self -> IO Bool+spinButtonSetSnapToTicks :: SpinButtonClass self => self -> Bool -> IO ()+spinButtonGetSnapToTicks :: SpinButtonClass self => self -> IO Bool+spinButtonUpdate :: SpinButtonClass self => self -> IO ()+spinButtonAdjustment :: SpinButtonClass self => Attr self Adjustment+spinButtonClimbRate :: SpinButtonClass self => Attr self Double+spinButtonDigits :: SpinButtonClass self => Attr self Int+spinButtonSnapToTicks :: SpinButtonClass self => Attr self Bool+spinButtonNumeric :: SpinButtonClass self => Attr self Bool+spinButtonWrap :: SpinButtonClass self => Attr self Bool+spinButtonUpdatePolicy :: SpinButtonClass self => Attr self SpinButtonUpdatePolicy+spinButtonValue :: SpinButtonClass self => Attr self Double+onInput :: SpinButtonClass sb => sb -> IO (Maybe Double) -> IO (ConnectId sb)+afterInput :: SpinButtonClass sb => sb -> IO (Maybe Double) -> IO (ConnectId sb)+onOutput :: SpinButtonClass sb => sb -> IO Bool -> IO (ConnectId sb)+afterOutput :: SpinButtonClass sb => sb -> IO Bool -> IO (ConnectId sb)+onValueSpinned :: SpinButtonClass sb => sb -> IO () -> IO (ConnectId sb)+afterValueSpinned :: SpinButtonClass sb => sb -> IO () -> IO (ConnectId sb)++module Graphics.UI.Gtk.Gdk.Pixbuf+data Pixbuf+instance GObjectClass Pixbuf+instance PixbufClass Pixbuf+class GObjectClass o => PixbufClass o+instance PixbufClass Pixbuf+data PixbufError+PixbufErrorCorruptImage :: PixbufError+PixbufErrorInsufficientMemory :: PixbufError+PixbufErrorBadOption :: PixbufError+PixbufErrorUnknownType :: PixbufError+PixbufErrorUnsupportedOperation :: PixbufError+PixbufErrorFailed :: PixbufError+instance Enum PixbufError+instance GErrorClass PixbufError+data Colorspace+ColorspaceRgb :: Colorspace+instance Enum Colorspace+pixbufGetColorSpace :: Pixbuf -> IO Colorspace+pixbufGetNChannels :: Pixbuf -> IO Int+pixbufGetHasAlpha :: Pixbuf -> IO Bool+pixbufGetBitsPerSample :: Pixbuf -> IO Int+data PixbufData i e+instance HasBounds PixbufData+instance Storable e => MArray PixbufData e IO+pixbufGetPixels :: (Ix i, Num i, Storable e) => Pixbuf -> IO (PixbufData i e)+pixbufGetWidth :: Pixbuf -> IO Int+pixbufGetHeight :: Pixbuf -> IO Int+pixbufGetRowstride :: Pixbuf -> IO Int+pixbufGetOption :: Pixbuf -> String -> IO (Maybe String)+pixbufNewFromFile :: FilePath -> IO (Either (PixbufError, String) Pixbuf)+type ImageType = String+pixbufGetFormats :: [ImageType]+pixbufSave :: Pixbuf -> FilePath -> ImageType -> [(String, String)] -> IO (Maybe (PixbufError, String))+pixbufNew :: Colorspace -> Bool -> Int -> Int -> Int -> IO Pixbuf+pixbufNewFromXPMData :: [String] -> IO Pixbuf+data InlineImage+pixbufNewFromInline :: Ptr InlineImage -> IO Pixbuf+pixbufNewSubpixbuf :: Pixbuf -> Int -> Int -> Int -> Int -> IO Pixbuf+pixbufCopy :: Pixbuf -> IO Pixbuf+data InterpType+InterpNearest :: InterpType+InterpTiles :: InterpType+InterpBilinear :: InterpType+InterpHyper :: InterpType+instance Enum InterpType+pixbufScaleSimple :: Pixbuf -> Int -> Int -> InterpType -> IO Pixbuf+pixbufScale :: Pixbuf -> Pixbuf -> Int -> Int -> Int -> Int -> Double -> Double -> Double -> Double -> InterpType -> IO ()+pixbufComposite :: Pixbuf -> Pixbuf -> Int -> Int -> Int -> Int -> Double -> Double -> Double -> Double -> InterpType -> Word8 -> IO ()+pixbufAddAlpha :: Pixbuf -> Maybe (Word8, Word8, Word8) -> IO Pixbuf+pixbufCopyArea :: Pixbuf -> Int -> Int -> Int -> Int -> Pixbuf -> Int -> Int -> IO ()+pixbufFill :: Pixbuf -> Word8 -> Word8 -> Word8 -> Word8 -> IO ()+pixbufGetFromDrawable :: DrawableClass d => d -> Rectangle -> IO (Maybe Pixbuf)++module Graphics.UI.Gtk.Gdk.Region+makeNewRegion :: Ptr Region -> IO Region+newtype Region+Region :: ForeignPtr Region -> Region+regionNew :: IO Region+data FillRule+EvenOddRule :: FillRule+WindingRule :: FillRule+instance Enum FillRule+regionPolygon :: [Point] -> FillRule -> IO Region+regionCopy :: Region -> IO Region+regionRectangle :: Rectangle -> IO Region+regionGetClipbox :: Region -> IO Rectangle+regionGetRectangles :: Region -> IO [Rectangle]+regionEmpty :: Region -> IO Bool+regionEqual :: Region -> Region -> IO Bool+regionPointIn :: Region -> Point -> IO Bool+data OverlapType+OverlapRectangleIn :: OverlapType+OverlapRectangleOut :: OverlapType+OverlapRectanglePart :: OverlapType+instance Enum OverlapType+regionRectIn :: Region -> Rectangle -> IO OverlapType+regionOffset :: Region -> Int -> Int -> IO ()+regionShrink :: Region -> Int -> Int -> IO ()+regionUnionWithRect :: Region -> Rectangle -> IO ()+regionIntersect :: Region -> Region -> IO ()+regionUnion :: Region -> Region -> IO ()+regionSubtract :: Region -> Region -> IO ()+regionXor :: Region -> Region -> IO ()++module Graphics.UI.Gtk.Gdk.Events+data Modifier+Shift :: Modifier+Control :: Modifier+Alt :: Modifier+Apple :: Modifier+Compose :: Modifier+instance Bounded Modifier+instance Enum Modifier+instance Eq Modifier+instance Flags Modifier+instance Ord Modifier+data Event+Event :: Bool -> Event+eventSent :: Event -> Bool+Expose :: Bool -> Rectangle -> Region -> Int -> Event+eventSent :: Event -> Bool+eventArea :: Event -> Rectangle+eventRegion :: Event -> Region+eventCount :: Event -> Int+Motion :: Bool -> Word32 -> Double -> Double -> [Modifier] -> Bool -> Double -> Double -> Event+eventSent :: Event -> Bool+eventTime :: Event -> Word32+eventX :: Event -> Double+eventY :: Event -> Double+eventModifier :: Event -> [Modifier]+eventIsHint :: Event -> Bool+eventXRoot :: Event -> Double+eventYRoot :: Event -> Double+Button :: Bool -> Click -> Word32 -> Double -> Double -> [Modifier] -> MouseButton -> Double -> Double -> Event+eventSent :: Event -> Bool+eventClick :: Event -> Click+eventTime :: Event -> Word32+eventX :: Event -> Double+eventY :: Event -> Double+eventModifier :: Event -> [Modifier]+eventButton :: Event -> MouseButton+eventXRoot :: Event -> Double+eventYRoot :: Event -> Double+Key :: Bool -> Bool -> Word32 -> [Modifier] -> Bool -> Bool -> Bool -> String -> Maybe Char -> Event+eventRelease :: Event -> Bool+eventSent :: Event -> Bool+eventTime :: Event -> Word32+eventModifier :: Event -> [Modifier]+eventWithCapsLock :: Event -> Bool+eventWithNumLock :: Event -> Bool+eventWithScrollLock :: Event -> Bool+eventKeyName :: Event -> String+eventKeyChar :: Event -> Maybe Char+Crossing :: Bool -> Word32 -> Double -> Double -> Double -> Double -> CrossingMode -> NotifyType -> [Modifier] -> Event+eventSent :: Event -> Bool+eventTime :: Event -> Word32+eventX :: Event -> Double+eventY :: Event -> Double+eventXRoot :: Event -> Double+eventYRoot :: Event -> Double+eventCrossingMode :: Event -> CrossingMode+eventNotifyType :: Event -> NotifyType+eventModifier :: Event -> [Modifier]+Focus :: Bool -> Bool -> Event+eventSent :: Event -> Bool+eventInFocus :: Event -> Bool+Configure :: Bool -> Int -> Int -> Int -> Int -> Event+eventSent :: Event -> Bool+eventXParent :: Event -> Int+eventYParent :: Event -> Int+eventWidth :: Event -> Int+eventHeight :: Event -> Int+Visibility :: Bool -> VisibilityState -> Event+eventSent :: Event -> Bool+eventVisible :: Event -> VisibilityState+Scroll :: Bool -> Word32 -> Double -> Double -> ScrollDirection -> Double -> Double -> Event+eventSent :: Event -> Bool+eventTime :: Event -> Word32+eventX :: Event -> Double+eventY :: Event -> Double+eventDirection :: Event -> ScrollDirection+eventXRoot :: Event -> Double+eventYRoot :: Event -> Double+WindowState :: Bool -> [WindowState] -> [WindowState] -> Event+eventSent :: Event -> Bool+eventWindowMask :: Event -> [WindowState]+eventWindowState :: Event -> [WindowState]+Proximity :: Bool -> Word32 -> Bool -> Event+eventSent :: Event -> Bool+eventTime :: Event -> Word32+eventInContact :: Event -> Bool+data VisibilityState+VisibilityUnobscured :: VisibilityState+VisibilityPartialObscured :: VisibilityState+VisibilityFullyObscured :: VisibilityState+instance Enum VisibilityState+data CrossingMode+CrossingNormal :: CrossingMode+CrossingGrab :: CrossingMode+CrossingUngrab :: CrossingMode+instance Enum CrossingMode+data NotifyType+NotifyAncestor :: NotifyType+NotifyVirtual :: NotifyType+NotifyInferior :: NotifyType+NotifyNonlinear :: NotifyType+NotifyNonlinearVirtual :: NotifyType+NotifyUnknown :: NotifyType+instance Enum NotifyType+data WindowState+WindowStateWithdrawn :: WindowState+WindowStateIconified :: WindowState+WindowStateMaximized :: WindowState+WindowStateSticky :: WindowState+WindowStateFullscreen :: WindowState+WindowStateAbove :: WindowState+WindowStateBelow :: WindowState+instance Bounded WindowState+instance Enum WindowState+instance Flags WindowState+data ScrollDirection+ScrollUp :: ScrollDirection+ScrollDown :: ScrollDirection+ScrollLeft :: ScrollDirection+ScrollRight :: ScrollDirection+instance Enum ScrollDirection+data MouseButton+LeftButton :: MouseButton+MiddleButton :: MouseButton+RightButton :: MouseButton+instance Enum MouseButton+instance Eq MouseButton+instance Show MouseButton+data Click+SingleClick :: Click+DoubleClick :: Click+TripleClick :: Click+ReleaseClick :: Click+data Rectangle+Rectangle :: Int -> Int -> Int -> Int -> Rectangle+instance Storable Rectangle++module Graphics.UI.Gtk.Gdk.DrawWindow+data DrawWindow+instance DrawWindowClass DrawWindow+instance DrawableClass DrawWindow+instance GObjectClass DrawWindow+class DrawableClass o => DrawWindowClass o+instance DrawWindowClass DrawWindow+castToDrawWindow :: GObjectClass obj => obj -> DrawWindow+data WindowState+WindowStateWithdrawn :: WindowState+WindowStateIconified :: WindowState+WindowStateMaximized :: WindowState+WindowStateSticky :: WindowState+WindowStateFullscreen :: WindowState+WindowStateAbove :: WindowState+WindowStateBelow :: WindowState+instance Bounded WindowState+instance Enum WindowState+instance Flags WindowState+drawWindowGetState :: DrawWindowClass self => self -> IO [WindowState]+drawWindowClear :: DrawWindowClass self => self -> IO ()+drawWindowClearArea :: DrawWindowClass self => self -> Int -> Int -> Int -> Int -> IO ()+drawWindowClearAreaExpose :: DrawWindowClass self => self -> Int -> Int -> Int -> Int -> IO ()+drawWindowRaise :: DrawWindowClass self => self -> IO ()+drawWindowLower :: DrawWindowClass self => self -> IO ()+drawWindowBeginPaintRect :: DrawWindowClass self => self -> Rectangle -> IO ()+drawWindowBeginPaintRegion :: DrawWindowClass self => self -> Region -> IO ()+drawWindowEndPaint :: DrawWindowClass self => self -> IO ()+drawWindowInvalidateRect :: DrawWindowClass self => self -> Rectangle -> Bool -> IO ()+drawWindowInvalidateRegion :: DrawWindowClass self => self -> Region -> Bool -> IO ()+drawWindowGetUpdateArea :: DrawWindowClass self => self -> IO (Maybe Region)+drawWindowFreezeUpdates :: DrawWindowClass self => self -> IO ()+drawWindowThawUpdates :: DrawWindowClass self => self -> IO ()+drawWindowProcessUpdates :: DrawWindowClass self => self -> Bool -> IO ()+drawWindowSetAcceptFocus :: DrawWindowClass self => self -> Bool -> IO ()+drawWindowShapeCombineRegion :: DrawWindowClass self => self -> Maybe Region -> Int -> Int -> IO ()+drawWindowSetChildShapes :: DrawWindowClass self => self -> IO ()+drawWindowMergeChildShapes :: DrawWindowClass self => self -> IO ()+drawWindowGetPointer :: DrawWindowClass self => self -> IO (Maybe (Bool, Int, Int, [Modifier]))++module Graphics.UI.Gtk.General.StockItems+data StockItem+StockItem :: StockId -> String -> [Modifier] -> KeyVal -> String -> StockItem+siStockId :: StockItem -> StockId+siLabel :: StockItem -> String+siModifier :: StockItem -> [Modifier]+siKeyval :: StockItem -> KeyVal+siTransDom :: StockItem -> String+instance Storable StockItem+type StockId = String+siStockId :: StockItem -> StockId+siLabel :: StockItem -> String+siModifier :: StockItem -> [Modifier]+siKeyval :: StockItem -> KeyVal+siTransDom :: StockItem -> String+stockAddItem :: [StockItem] -> IO ()+stockLookupItem :: StockId -> IO (Maybe StockItem)+stockListIds :: IO [StockId]+stockAdd :: StockId+stockApply :: StockId+stockBold :: StockId+stockCancel :: StockId+stockCDROM :: StockId+stockClear :: StockId+stockClose :: StockId+stockColorPicker :: StockId+stockConvert :: StockId+stockCopy :: StockId+stockCut :: StockId+stockDelete :: StockId+stockDialogError :: StockId+stockDialogInfo :: StockId+stockDialogQuestion :: StockId+stockDialogWarning :: StockId+stockDnd :: StockId+stockDndMultiple :: StockId+stockExecute :: StockId+stockFind :: StockId+stockFindAndRelpace :: StockId+stockFloppy :: StockId+stockGotoBottom :: StockId+stockGotoFirst :: StockId+stockGotoLast :: StockId+stockGotoTop :: StockId+stockGoBack :: StockId+stockGoDown :: StockId+stockGoForward :: StockId+stockGoUp :: StockId+stockHelp :: StockId+stockHome :: StockId+stockIndex :: StockId+stockItalic :: StockId+stockJumpTo :: StockId+stockJustifyCenter :: StockId+stockJustifyFill :: StockId+stockJustifyLeft :: StockId+stockJustifyRight :: StockId+stockMissingImage :: StockId+stockNew :: StockId+stockNo :: StockId+stockOk :: StockId+stockOpen :: StockId+stockPaste :: StockId+stockPreferences :: StockId+stockPrint :: StockId+stockPrintPreview :: StockId+stockProperties :: StockId+stockQuit :: StockId+stockRedo :: StockId+stockRefresh :: StockId+stockRemove :: StockId+stockRevertToSaved :: StockId+stockSave :: StockId+stockSaveAs :: StockId+stockSelectColor :: StockId+stockSelectFont :: StockId+stockSortAscending :: StockId+stockSortDescending :: StockId+stockSpellCheck :: StockId+stockStop :: StockId+stockStrikethrough :: StockId+stockUndelete :: StockId+stockUnderline :: StockId+stockUndo :: StockId+stockYes :: StockId+stockZoom100 :: StockId+stockZoomFit :: StockId+stockZoomIn :: StockId+stockZoomOut :: StockId++module Graphics.UI.Gtk.Gdk.GC+data GC+instance GCClass GC+instance GObjectClass GC+class GObjectClass o => GCClass o+instance GCClass GC+castToGC :: GObjectClass obj => obj -> GC+gcNew :: DrawableClass d => d -> IO GC+data GCValues+GCValues :: Color -> Color -> Function -> Fill -> Maybe Pixmap -> Maybe Pixmap -> Maybe Pixmap -> SubwindowMode -> Int -> Int -> Int -> Int -> Bool -> Int -> LineStyle -> CapStyle -> JoinStyle -> GCValues+foreground :: GCValues -> Color+background :: GCValues -> Color+function :: GCValues -> Function+fill :: GCValues -> Fill+tile :: GCValues -> Maybe Pixmap+stipple :: GCValues -> Maybe Pixmap+clipMask :: GCValues -> Maybe Pixmap+subwindowMode :: GCValues -> SubwindowMode+tsXOrigin :: GCValues -> Int+tsYOrigin :: GCValues -> Int+clipXOrigin :: GCValues -> Int+clipYOrigin :: GCValues -> Int+graphicsExposure :: GCValues -> Bool+lineWidth :: GCValues -> Int+lineStyle :: GCValues -> LineStyle+capStyle :: GCValues -> CapStyle+joinStyle :: GCValues -> JoinStyle+instance Storable GCValues+newGCValues :: GCValues+data Color+Color :: Word16 -> Word16 -> Word16 -> Color+instance Storable Color+foreground :: GCValues -> Color+background :: GCValues -> Color+data Function+Copy :: Function+Invert :: Function+Xor :: Function+Clear :: Function+And :: Function+AndReverse :: Function+AndInvert :: Function+Noop :: Function+Or :: Function+Equiv :: Function+OrReverse :: Function+CopyInvert :: Function+OrInvert :: Function+Nand :: Function+Nor :: Function+Set :: Function+instance Enum Function+function :: GCValues -> Function+data Fill+Solid :: Fill+Tiled :: Fill+Stippled :: Fill+OpaqueStippled :: Fill+instance Enum Fill+fill :: GCValues -> Fill+tile :: GCValues -> Maybe Pixmap+stipple :: GCValues -> Maybe Pixmap+clipMask :: GCValues -> Maybe Pixmap+data SubwindowMode+ClipByChildren :: SubwindowMode+IncludeInferiors :: SubwindowMode+instance Enum SubwindowMode+subwindowMode :: GCValues -> SubwindowMode+tsXOrigin :: GCValues -> Int+tsYOrigin :: GCValues -> Int+clipXOrigin :: GCValues -> Int+clipYOrigin :: GCValues -> Int+graphicsExposure :: GCValues -> Bool+lineWidth :: GCValues -> Int+data LineStyle+LineSolid :: LineStyle+LineOnOffDash :: LineStyle+LineDoubleDash :: LineStyle+instance Enum LineStyle+lineStyle :: GCValues -> LineStyle+data CapStyle+CapNotLast :: CapStyle+CapButt :: CapStyle+CapRound :: CapStyle+CapProjecting :: CapStyle+instance Enum CapStyle+capStyle :: GCValues -> CapStyle+data JoinStyle+JoinMiter :: JoinStyle+JoinRound :: JoinStyle+JoinBevel :: JoinStyle+instance Enum JoinStyle+joinStyle :: GCValues -> JoinStyle+gcNewWithValues :: DrawableClass d => d -> GCValues -> IO GC+gcSetValues :: GC -> GCValues -> IO ()+gcGetValues :: GC -> IO GCValues+gcSetClipRectangle :: GC -> Rectangle -> IO ()+gcSetClipRegion :: GC -> Region -> IO ()+gcSetDashes :: GC -> Int -> [(Int, Int)] -> IO ()++module Graphics.UI.Gtk.General.IconFactory+data IconFactory+instance GObjectClass IconFactory+instance IconFactoryClass IconFactory+class GObjectClass o => IconFactoryClass o+instance IconFactoryClass IconFactory+castToIconFactory :: GObjectClass obj => obj -> IconFactory+toIconFactory :: IconFactoryClass o => o -> IconFactory+iconFactoryNew :: IO IconFactory+iconFactoryAdd :: IconFactory -> String -> IconSet -> IO ()+iconFactoryAddDefault :: IconFactory -> IO ()+iconFactoryLookup :: IconFactory -> String -> IO (Maybe IconSet)+iconFactoryLookupDefault :: String -> IO (Maybe IconSet)+iconFactoryRemoveDefault :: IconFactory -> IO ()+data IconSet+iconSetNew :: IO IconSet+iconSetNewFromPixbuf :: Pixbuf -> IO IconSet+iconSetAddSource :: IconSet -> IconSource -> IO ()+iconSetRenderIcon :: WidgetClass widget => IconSet -> TextDirection -> StateType -> IconSize -> widget -> IO Pixbuf+iconSetGetSizes :: IconSet -> IO [IconSize]+data IconSource+iconSourceNew :: IO IconSource+data TextDirection+TextDirNone :: TextDirection+TextDirLtr :: TextDirection+TextDirRtl :: TextDirection+instance Enum TextDirection+instance Eq TextDirection+iconSourceGetDirection :: IconSource -> IO (Maybe TextDirection)+iconSourceSetDirection :: IconSource -> TextDirection -> IO ()+iconSourceGetFilename :: IconSource -> IO (Maybe String)+iconSourceSetFilename :: IconSource -> FilePath -> IO ()+iconSourceGetPixbuf :: IconSource -> IO (Maybe Pixbuf)+iconSourceSetPixbuf :: IconSource -> Pixbuf -> IO ()+iconSourceGetSize :: IconSource -> IO (Maybe IconSize)+iconSourceSetSize :: IconSource -> IconSize -> IO ()+iconSourceResetSize :: IconSource -> IO ()+data StateType+StateNormal :: StateType+StateActive :: StateType+StatePrelight :: StateType+StateSelected :: StateType+StateInsensitive :: StateType+instance Enum StateType+instance Eq StateType+iconSourceGetState :: IconSource -> IO (Maybe StateType)+iconSourceSetState :: IconSource -> StateType -> IO ()+iconSourceResetState :: IconSource -> IO ()+type IconSize = Int+iconSizeInvalid :: IconSize+iconSizeMenu :: IconSize+iconSizeSmallToolbar :: IconSize+iconSizeLargeToolbar :: IconSize+iconSizeButton :: IconSize+iconSizeDialog :: IconSize+iconSizeCheck :: IconSize -> IO Bool+iconSizeRegister :: Int -> String -> Int -> IO IconSize+iconSizeRegisterAlias :: IconSize -> String -> IO ()+iconSizeFromName :: String -> IO IconSize+iconSizeGetName :: IconSize -> IO (Maybe String)++module Graphics.UI.Gtk.General.Style+data Style+instance GObjectClass Style+instance StyleClass Style+class GObjectClass o => StyleClass o+instance StyleClass Style+castToStyle :: GObjectClass obj => obj -> Style+toStyle :: StyleClass o => o -> Style+styleGetForeground :: StateType -> Style -> IO GC+styleGetBackground :: StateType -> Style -> IO GC+styleGetLight :: StateType -> Style -> IO GC+styleGetMiddle :: StateType -> Style -> IO GC+styleGetDark :: StateType -> Style -> IO GC+styleGetText :: StateType -> Style -> IO GC+styleGetBase :: StateType -> Style -> IO GC+styleGetAntiAliasing :: StateType -> Style -> IO GC++module Graphics.UI.Gtk.Multiline.TextIter+newtype TextIter+TextIter :: ForeignPtr TextIter -> TextIter+data TextSearchFlags+TextSearchVisibleOnly :: TextSearchFlags+TextSearchTextOnly :: TextSearchFlags+instance Bounded TextSearchFlags+instance Enum TextSearchFlags+instance Eq TextSearchFlags+instance Flags TextSearchFlags+mkTextIterCopy :: Ptr TextIter -> IO TextIter+makeEmptyTextIter :: IO TextIter+textIterGetBuffer :: TextIter -> IO TextBuffer+textIterCopy :: TextIter -> IO TextIter+textIterGetOffset :: TextIter -> IO Int+textIterGetLine :: TextIter -> IO Int+textIterGetLineOffset :: TextIter -> IO Int+textIterGetVisibleLineOffset :: TextIter -> IO Int+textIterGetChar :: TextIter -> IO (Maybe Char)+textIterGetSlice :: TextIter -> TextIter -> IO String+textIterGetText :: TextIter -> TextIter -> IO String+textIterGetVisibleSlice :: TextIter -> TextIter -> IO String+textIterGetVisibleText :: TextIter -> TextIter -> IO String+textIterGetPixbuf :: TextIter -> IO (Maybe Pixbuf)+textIterBeginsTag :: TextIter -> TextTag -> IO Bool+textIterEndsTag :: TextIter -> TextTag -> IO Bool+textIterTogglesTag :: TextIter -> TextTag -> IO Bool+textIterHasTag :: TextIter -> TextTag -> IO Bool+textIterEditable :: TextIter -> Bool -> IO Bool+textIterCanInsert :: TextIter -> Bool -> IO Bool+textIterStartsWord :: TextIter -> IO Bool+textIterEndsWord :: TextIter -> IO Bool+textIterInsideWord :: TextIter -> IO Bool+textIterStartsLine :: TextIter -> IO Bool+textIterEndsLine :: TextIter -> IO Bool+textIterStartsSentence :: TextIter -> IO Bool+textIterEndsSentence :: TextIter -> IO Bool+textIterInsideSentence :: TextIter -> IO Bool+textIterIsCursorPosition :: TextIter -> IO Bool+textIterGetCharsInLine :: TextIter -> IO Int+textIterIsEnd :: TextIter -> IO Bool+textIterIsStart :: TextIter -> IO Bool+textIterForwardChar :: TextIter -> IO Bool+textIterBackwardChar :: TextIter -> IO Bool+textIterForwardChars :: TextIter -> Int -> IO Bool+textIterBackwardChars :: TextIter -> Int -> IO Bool+textIterForwardLine :: TextIter -> IO Bool+textIterBackwardLine :: TextIter -> IO Bool+textIterForwardLines :: TextIter -> Int -> IO Bool+textIterBackwardLines :: TextIter -> Int -> IO Bool+textIterForwardWordEnds :: TextIter -> Int -> IO Bool+textIterBackwardWordStarts :: TextIter -> Int -> IO Bool+textIterForwardWordEnd :: TextIter -> IO Bool+textIterBackwardWordStart :: TextIter -> IO Bool+textIterForwardCursorPosition :: TextIter -> IO Bool+textIterBackwardCursorPosition :: TextIter -> IO Bool+textIterForwardCursorPositions :: TextIter -> Int -> IO Bool+textIterBackwardCursorPositions :: TextIter -> Int -> IO Bool+textIterForwardSentenceEnds :: TextIter -> Int -> IO Bool+textIterBackwardSentenceStarts :: TextIter -> Int -> IO Bool+textIterForwardSentenceEnd :: TextIter -> IO Bool+textIterBackwardSentenceStart :: TextIter -> IO Bool+textIterSetOffset :: TextIter -> Int -> IO ()+textIterSetLine :: TextIter -> Int -> IO ()+textIterSetLineOffset :: TextIter -> Int -> IO ()+textIterSetVisibleLineOffset :: TextIter -> Int -> IO ()+textIterForwardToEnd :: TextIter -> IO ()+textIterForwardToLineEnd :: TextIter -> IO Bool+textIterForwardToTagToggle :: TextIter -> Maybe TextTag -> IO Bool+textIterBackwardToTagToggle :: TextIter -> Maybe TextTag -> IO Bool+textIterForwardFindChar :: TextIter -> (Char -> Bool) -> Maybe TextIter -> IO Bool+textIterBackwardFindChar :: TextIter -> (Char -> Bool) -> Maybe TextIter -> IO Bool+textIterForwardSearch :: TextIter -> String -> [TextSearchFlags] -> Maybe TextIter -> IO (Maybe (TextIter, TextIter))+textIterBackwardSearch :: TextIter -> String -> [TextSearchFlags] -> Maybe TextIter -> IO (Maybe (TextIter, TextIter))+textIterEqual :: TextIter -> TextIter -> IO Bool+textIterCompare :: TextIter -> TextIter -> IO Ordering+textIterForwardVisibleLine :: TextIter -> IO Bool+textIterBackwardVisibleLine :: TextIter -> IO Bool+textIterForwardVisibleLines :: TextIter -> Int -> IO Bool+textIterBackwardVisibleLines :: TextIter -> Int -> IO Bool+textIterVisibleLineOffset :: Attr TextIter Int+textIterOffset :: Attr TextIter Int+textIterLineOffset :: Attr TextIter Int+textIterLine :: Attr TextIter Int++module Graphics.UI.Gtk.Multiline.TextBuffer+data TextBuffer+instance GObjectClass TextBuffer+instance TextBufferClass TextBuffer+class GObjectClass o => TextBufferClass o+instance TextBufferClass SourceBuffer+instance TextBufferClass TextBuffer+castToTextBuffer :: GObjectClass obj => obj -> TextBuffer+toTextBuffer :: TextBufferClass o => o -> TextBuffer+textBufferNew :: Maybe TextTagTable -> IO TextBuffer+textBufferGetLineCount :: TextBufferClass self => self -> IO Int+textBufferGetCharCount :: TextBufferClass self => self -> IO Int+textBufferGetTagTable :: TextBufferClass self => self -> IO TextTagTable+textBufferInsert :: TextBufferClass self => self -> TextIter -> String -> IO ()+textBufferInsertAtCursor :: TextBufferClass self => self -> String -> IO ()+textBufferInsertInteractive :: TextBufferClass self => self -> TextIter -> String -> Bool -> IO Bool+textBufferInsertInteractiveAtCursor :: TextBufferClass self => self -> String -> Bool -> IO Bool+textBufferInsertRange :: TextBufferClass self => self -> TextIter -> TextIter -> TextIter -> IO ()+textBufferInsertRangeInteractive :: TextBufferClass self => self -> TextIter -> TextIter -> TextIter -> Bool -> IO Bool+textBufferDelete :: TextBufferClass self => self -> TextIter -> TextIter -> IO ()+textBufferDeleteInteractive :: TextBufferClass self => self -> TextIter -> TextIter -> Bool -> IO Bool+textBufferSetText :: TextBufferClass self => self -> String -> IO ()+textBufferGetText :: TextBufferClass self => self -> TextIter -> TextIter -> Bool -> IO String+textBufferGetSlice :: TextBufferClass self => self -> TextIter -> TextIter -> Bool -> IO String+textBufferInsertPixbuf :: TextBufferClass self => self -> TextIter -> Pixbuf -> IO ()+textBufferCreateMark :: TextBufferClass self => self -> Maybe MarkName -> TextIter -> Bool -> IO TextMark+textBufferMoveMark :: (TextBufferClass self, TextMarkClass mark) => self -> mark -> TextIter -> IO ()+textBufferMoveMarkByName :: TextBufferClass self => self -> MarkName -> TextIter -> IO ()+textBufferDeleteMark :: (TextBufferClass self, TextMarkClass mark) => self -> mark -> IO ()+textBufferDeleteMarkByName :: TextBufferClass self => self -> MarkName -> IO ()+textBufferGetMark :: TextBufferClass self => self -> MarkName -> IO (Maybe TextMark)+textBufferGetInsert :: TextBufferClass self => self -> IO TextMark+textBufferGetSelectionBound :: TextBufferClass self => self -> IO TextMark+textBufferPlaceCursor :: TextBufferClass self => self -> TextIter -> IO ()+textBufferApplyTag :: (TextBufferClass self, TextTagClass tag) => self -> tag -> TextIter -> TextIter -> IO ()+textBufferRemoveTag :: (TextBufferClass self, TextTagClass tag) => self -> tag -> TextIter -> TextIter -> IO ()+textBufferApplyTagByName :: TextBufferClass self => self -> TagName -> TextIter -> TextIter -> IO ()+textBufferRemoveTagByName :: TextBufferClass self => self -> TagName -> TextIter -> TextIter -> IO ()+textBufferRemoveAllTags :: TextBufferClass self => self -> TextIter -> TextIter -> IO ()+textBufferGetIterAtLineOffset :: TextBufferClass self => self -> Int -> Int -> IO TextIter+textBufferGetIterAtOffset :: TextBufferClass self => self -> Int -> IO TextIter+textBufferGetIterAtLine :: TextBufferClass self => self -> Int -> IO TextIter+textBufferGetIterAtMark :: (TextBufferClass self, TextMarkClass mark) => self -> mark -> IO TextIter+textBufferGetStartIter :: TextBufferClass self => self -> IO TextIter+textBufferGetEndIter :: TextBufferClass self => self -> IO TextIter+textBufferGetModified :: TextBufferClass self => self -> IO Bool+textBufferSetModified :: TextBufferClass self => self -> Bool -> IO ()+textBufferDeleteSelection :: TextBufferClass self => self -> Bool -> Bool -> IO Bool+textBufferHasSelection :: TextBufferClass self => self -> IO Bool+textBufferGetSelectionBounds :: TextBufferClass self => self -> IO (TextIter, TextIter)+textBufferSelectRange :: TextBufferClass self => self -> TextIter -> TextIter -> IO ()+textBufferGetBounds :: TextBufferClass self => self -> TextIter -> TextIter -> IO ()+textBufferBeginUserAction :: TextBufferClass self => self -> IO ()+textBufferEndUserAction :: TextBufferClass self => self -> IO ()+textBufferBackspace :: TextBufferClass self => self -> TextIter -> Bool -> Bool -> IO Bool+textBufferInsertChildAnchor :: TextBufferClass self => self -> TextIter -> TextChildAnchor -> IO ()+textBufferCreateChildAnchor :: TextBufferClass self => self -> TextIter -> IO TextChildAnchor+textBufferGetIterAtChildAnchor :: TextBufferClass self => self -> TextIter -> TextChildAnchor -> IO ()+textBufferTagTable :: (TextBufferClass self, TextTagTableClass textTagTable) => ReadWriteAttr self TextTagTable textTagTable+textBufferText :: TextBufferClass self => Attr self String+textBufferModified :: TextBufferClass self => Attr self Bool+onApplyTag :: TextBufferClass self => self -> (TextTag -> TextIter -> TextIter -> IO ()) -> IO (ConnectId self)+afterApplyTag :: TextBufferClass self => self -> (TextTag -> TextIter -> TextIter -> IO ()) -> IO (ConnectId self)+onBeginUserAction :: TextBufferClass self => self -> IO () -> IO (ConnectId self)+afterBeginUserAction :: TextBufferClass self => self -> IO () -> IO (ConnectId self)+onBufferChanged :: TextBufferClass self => self -> IO () -> IO (ConnectId self)+afterBufferChanged :: TextBufferClass self => self -> IO () -> IO (ConnectId self)+onDeleteRange :: TextBufferClass self => self -> (TextIter -> TextIter -> IO ()) -> IO (ConnectId self)+afterDeleteRange :: TextBufferClass self => self -> (TextIter -> TextIter -> IO ()) -> IO (ConnectId self)+onEndUserAction :: TextBufferClass self => self -> IO () -> IO (ConnectId self)+afterEndUserAction :: TextBufferClass self => self -> IO () -> IO (ConnectId self)+onInsertPixbuf :: TextBufferClass self => self -> (TextIter -> Pixbuf -> IO ()) -> IO (ConnectId self)+afterInsertPixbuf :: TextBufferClass self => self -> (TextIter -> Pixbuf -> IO ()) -> IO (ConnectId self)+onInsertText :: TextBufferClass self => self -> (TextIter -> String -> IO ()) -> IO (ConnectId self)+afterInsertText :: TextBufferClass self => self -> (TextIter -> String -> IO ()) -> IO (ConnectId self)+onMarkDeleted :: TextBufferClass self => self -> (TextMark -> IO ()) -> IO (ConnectId self)+afterMarkDeleted :: TextBufferClass self => self -> (TextMark -> IO ()) -> IO (ConnectId self)+onMarkSet :: TextBufferClass self => self -> (TextIter -> TextMark -> IO ()) -> IO (ConnectId self)+afterMarkSet :: TextBufferClass self => self -> (TextIter -> TextMark -> IO ()) -> IO (ConnectId self)+onModifiedChanged :: TextBufferClass self => self -> IO () -> IO (ConnectId self)+afterModifiedChanged :: TextBufferClass self => self -> IO () -> IO (ConnectId self)+onRemoveTag :: TextBufferClass self => self -> (TextTag -> TextIter -> TextIter -> IO ()) -> IO (ConnectId self)+afterRemoveTag :: TextBufferClass self => self -> (TextTag -> TextIter -> TextIter -> IO ()) -> IO (ConnectId self)++module Graphics.UI.Gtk.Abstract.Widget+data Widget+instance GObjectClass Widget+instance ObjectClass Widget+instance WidgetClass Widget+class ObjectClass o => WidgetClass o+instance WidgetClass AboutDialog+instance WidgetClass AccelLabel+instance WidgetClass Alignment+instance WidgetClass Arrow+instance WidgetClass AspectFrame+instance WidgetClass Bin+instance WidgetClass Box+instance WidgetClass Button+instance WidgetClass ButtonBox+instance WidgetClass CList+instance WidgetClass CTree+instance WidgetClass Calendar+instance WidgetClass CellView+instance WidgetClass CheckButton+instance WidgetClass CheckMenuItem+instance WidgetClass ColorButton+instance WidgetClass ColorSelection+instance WidgetClass ColorSelectionDialog+instance WidgetClass Combo+instance WidgetClass ComboBox+instance WidgetClass ComboBoxEntry+instance WidgetClass Container+instance WidgetClass Curve+instance WidgetClass Dialog+instance WidgetClass DrawingArea+instance WidgetClass Entry+instance WidgetClass EventBox+instance WidgetClass Expander+instance WidgetClass FileChooserButton+instance WidgetClass FileChooserDialog+instance WidgetClass FileChooserWidget+instance WidgetClass FileSelection+instance WidgetClass Fixed+instance WidgetClass FontButton+instance WidgetClass FontSelection+instance WidgetClass FontSelectionDialog+instance WidgetClass Frame+instance WidgetClass GammaCurve+instance WidgetClass HBox+instance WidgetClass HButtonBox+instance WidgetClass HPaned+instance WidgetClass HRuler+instance WidgetClass HScale+instance WidgetClass HScrollbar+instance WidgetClass HSeparator+instance WidgetClass HandleBox+instance WidgetClass IconView+instance WidgetClass Image+instance WidgetClass ImageMenuItem+instance WidgetClass InputDialog+instance WidgetClass Invisible+instance WidgetClass Item+instance WidgetClass Label+instance WidgetClass Layout+instance WidgetClass List+instance WidgetClass ListItem+instance WidgetClass Menu+instance WidgetClass MenuBar+instance WidgetClass MenuItem+instance WidgetClass MenuShell+instance WidgetClass MenuToolButton+instance WidgetClass MessageDialog+instance WidgetClass Misc+instance WidgetClass MozEmbed+instance WidgetClass Notebook+instance WidgetClass OptionMenu+instance WidgetClass Paned+instance WidgetClass Plug+instance WidgetClass Preview+instance WidgetClass ProgressBar+instance WidgetClass RadioButton+instance WidgetClass RadioMenuItem+instance WidgetClass RadioToolButton+instance WidgetClass Range+instance WidgetClass Ruler+instance WidgetClass Scale+instance WidgetClass Scrollbar+instance WidgetClass ScrolledWindow+instance WidgetClass Separator+instance WidgetClass SeparatorMenuItem+instance WidgetClass SeparatorToolItem+instance WidgetClass Socket+instance WidgetClass SourceView+instance WidgetClass SpinButton+instance WidgetClass Statusbar+instance WidgetClass Table+instance WidgetClass TearoffMenuItem+instance WidgetClass TextView+instance WidgetClass TipsQuery+instance WidgetClass ToggleButton+instance WidgetClass ToggleToolButton+instance WidgetClass ToolButton+instance WidgetClass ToolItem+instance WidgetClass Toolbar+instance WidgetClass TreeView+instance WidgetClass VBox+instance WidgetClass VButtonBox+instance WidgetClass VPaned+instance WidgetClass VRuler+instance WidgetClass VScale+instance WidgetClass VScrollbar+instance WidgetClass VSeparator+instance WidgetClass Viewport+instance WidgetClass Widget+instance WidgetClass Window+castToWidget :: GObjectClass obj => obj -> Widget+toWidget :: WidgetClass o => o -> Widget+type Allocation = Rectangle+data Requisition+Requisition :: Int -> Int -> Requisition+instance Storable Requisition+data Rectangle+Rectangle :: Int -> Int -> Int -> Int -> Rectangle+instance Storable Rectangle+widgetGetState :: WidgetClass w => w -> IO StateType+widgetGetSavedState :: WidgetClass w => w -> IO StateType+widgetShow :: WidgetClass self => self -> IO ()+widgetShowNow :: WidgetClass self => self -> IO ()+widgetHide :: WidgetClass self => self -> IO ()+widgetShowAll :: WidgetClass self => self -> IO ()+widgetHideAll :: WidgetClass self => self -> IO ()+widgetDestroy :: WidgetClass self => self -> IO ()+widgetQueueDraw :: WidgetClass self => self -> IO ()+widgetHasIntersection :: WidgetClass self => self -> Rectangle -> IO Bool+widgetIntersect :: WidgetClass self => self -> Rectangle -> IO (Maybe Rectangle)+widgetRegionIntersect :: WidgetClass self => self -> Region -> IO Region+widgetActivate :: WidgetClass self => self -> IO Bool+widgetSetSensitivity :: WidgetClass self => self -> Bool -> IO ()+widgetSetSizeRequest :: WidgetClass self => self -> Int -> Int -> IO ()+widgetGetSizeRequest :: WidgetClass self => self -> IO (Int, Int)+widgetIsFocus :: WidgetClass self => self -> IO Bool+widgetGrabFocus :: WidgetClass self => self -> IO ()+widgetSetAppPaintable :: WidgetClass self => self -> Bool -> IO ()+widgetSetName :: WidgetClass self => self -> String -> IO ()+widgetGetName :: WidgetClass self => self -> IO String+data EventMask+ExposureMask :: EventMask+PointerMotionMask :: EventMask+PointerMotionHintMask :: EventMask+ButtonMotionMask :: EventMask+Button1MotionMask :: EventMask+Button2MotionMask :: EventMask+Button3MotionMask :: EventMask+ButtonPressMask :: EventMask+ButtonReleaseMask :: EventMask+KeyPressMask :: EventMask+KeyReleaseMask :: EventMask+EnterNotifyMask :: EventMask+LeaveNotifyMask :: EventMask+FocusChangeMask :: EventMask+StructureMask :: EventMask+PropertyChangeMask :: EventMask+VisibilityNotifyMask :: EventMask+ProximityInMask :: EventMask+ProximityOutMask :: EventMask+SubstructureMask :: EventMask+ScrollMask :: EventMask+AllEventsMask :: EventMask+instance Bounded EventMask+instance Enum EventMask+instance Flags EventMask+widgetDelEvents :: WidgetClass self => self -> [EventMask] -> IO ()+widgetAddEvents :: WidgetClass self => self -> [EventMask] -> IO ()+widgetGetEvents :: WidgetClass self => self -> IO [EventMask]+data ExtensionMode+ExtensionEventsNone :: ExtensionMode+ExtensionEventsAll :: ExtensionMode+ExtensionEventsCursor :: ExtensionMode+instance Bounded ExtensionMode+instance Enum ExtensionMode+instance Flags ExtensionMode+widgetSetExtensionEvents :: WidgetClass self => self -> [ExtensionMode] -> IO ()+widgetGetExtensionEvents :: WidgetClass self => self -> IO [ExtensionMode]+widgetGetToplevel :: WidgetClass self => self -> IO Widget+widgetIsAncestor :: (WidgetClass self, WidgetClass ancestor) => self -> ancestor -> IO Bool+widgetReparent :: (WidgetClass self, WidgetClass newParent) => self -> newParent -> IO ()+data TextDirection+TextDirNone :: TextDirection+TextDirLtr :: TextDirection+TextDirRtl :: TextDirection+instance Enum TextDirection+instance Eq TextDirection+widgetSetDirection :: WidgetClass self => self -> TextDirection -> IO ()+widgetGetDirection :: WidgetClass self => self -> IO TextDirection+widgetQueueDrawArea :: WidgetClass self => self -> Int -> Int -> Int -> Int -> IO ()+widgetSetDoubleBuffered :: WidgetClass self => self -> Bool -> IO ()+widgetSetRedrawOnAllocate :: WidgetClass self => self -> Bool -> IO ()+widgetGetParentWindow :: WidgetClass self => self -> IO DrawWindow+widgetGetPointer :: WidgetClass self => self -> IO (Int, Int)+widgetTranslateCoordinates :: (WidgetClass self, WidgetClass destWidget) => self -> destWidget -> Int -> Int -> IO (Maybe (Int, Int))+widgetPath :: WidgetClass self => self -> IO (Int, String, String)+widgetClassPath :: WidgetClass self => self -> IO (Int, String, String)+widgetGetCompositeName :: WidgetClass self => self -> IO (Maybe String)+widgetSetCompositeName :: WidgetClass self => self -> String -> IO ()+widgetGetParent :: WidgetClass self => self -> IO (Maybe Widget)+widgetSetDefaultDirection :: TextDirection -> IO ()+widgetGetDefaultDirection :: IO TextDirection+widgetModifyStyle :: (WidgetClass self, RcStyleClass style) => self -> style -> IO ()+widgetGetModifierStyle :: WidgetClass self => self -> IO RcStyle+widgetModifyFg :: WidgetClass self => self -> StateType -> Color -> IO ()+widgetModifyBg :: WidgetClass self => self -> StateType -> Color -> IO ()+widgetModifyText :: WidgetClass self => self -> StateType -> Color -> IO ()+widgetModifyBase :: WidgetClass self => self -> StateType -> Color -> IO ()+widgetModifyFont :: WidgetClass self => self -> Maybe FontDescription -> IO ()+widgetCreateLayout :: WidgetClass self => self -> String -> IO PangoLayout+widgetCreatePangoContext :: WidgetClass self => self -> IO PangoContext+widgetGetPangoContext :: WidgetClass self => self -> IO PangoContext+widgetRenderIcon :: WidgetClass self => self -> StockId -> IconSize -> String -> IO (Maybe Pixbuf)+widgetGetCanFocus :: WidgetClass self => self -> IO Bool+widgetSetCanFocus :: WidgetClass self => self -> Bool -> IO ()+widgetExtensionEvents :: WidgetClass self => Attr self [ExtensionMode]+widgetDirection :: WidgetClass self => Attr self TextDirection+widgetCanFocus :: WidgetClass self => Attr self Bool+onButtonPress :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)+afterButtonPress :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)+onButtonRelease :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)+afterButtonRelease :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)+onClient :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)+afterClient :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)+onConfigure :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)+afterConfigure :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)+onDelete :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)+afterDelete :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)+onDestroyEvent :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)+afterDestroyEvent :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)+onDirectionChanged :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)+afterDirectionChanged :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)+onEnterNotify :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)+afterEnterNotify :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)+onLeaveNotify :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)+afterLeaveNotify :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)+onExpose :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)+afterExpose :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)+onExposeRect :: WidgetClass w => w -> (Rectangle -> IO ()) -> IO (ConnectId w)+afterExposeRect :: WidgetClass w => w -> (Rectangle -> IO ()) -> IO (ConnectId w)+onFocusIn :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)+afterFocusIn :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)+onFocusOut :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)+afterFocusOut :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)+onGrabFocus :: WidgetClass w => w -> IO () -> IO (ConnectId w)+afterGrabFocus :: WidgetClass w => w -> IO () -> IO (ConnectId w)+onDestroy :: WidgetClass w => w -> IO () -> IO (ConnectId w)+afterDestroy :: WidgetClass w => w -> IO () -> IO (ConnectId w)+onHide :: WidgetClass w => w -> IO () -> IO (ConnectId w)+afterHide :: WidgetClass w => w -> IO () -> IO (ConnectId w)+onHierarchyChanged :: WidgetClass w => w -> IO () -> IO (ConnectId w)+afterHierarchyChanged :: WidgetClass w => w -> IO () -> IO (ConnectId w)+onKeyPress :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)+afterKeyPress :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)+onKeyRelease :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)+afterKeyRelease :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)+onMnemonicActivate :: WidgetClass w => w -> (Bool -> IO Bool) -> IO (ConnectId w)+afterMnemonicActivate :: WidgetClass w => w -> (Bool -> IO Bool) -> IO (ConnectId w)+onMotionNotify :: WidgetClass w => w -> Bool -> (Event -> IO Bool) -> IO (ConnectId w)+afterMotionNotify :: WidgetClass w => w -> Bool -> (Event -> IO Bool) -> IO (ConnectId w)+onParentSet :: (WidgetClass w, WidgetClass old) => w -> (old -> IO ()) -> IO (ConnectId w)+afterParentSet :: (WidgetClass w, WidgetClass old) => w -> (old -> IO ()) -> IO (ConnectId w)+onPopupMenu :: WidgetClass w => w -> IO () -> IO (ConnectId w)+afterPopupMenu :: WidgetClass w => w -> IO () -> IO (ConnectId w)+onProximityIn :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)+afterProximityIn :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)+onProximityOut :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)+afterProximityOut :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)+onRealize :: WidgetClass w => w -> IO () -> IO (ConnectId w)+afterRealize :: WidgetClass w => w -> IO () -> IO (ConnectId w)+onScroll :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)+afterScroll :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)+onShow :: WidgetClass w => w -> IO () -> IO (ConnectId w)+afterShow :: WidgetClass w => w -> IO () -> IO (ConnectId w)+onSizeAllocate :: WidgetClass w => w -> (Allocation -> IO ()) -> IO (ConnectId w)+afterSizeAllocate :: WidgetClass w => w -> (Allocation -> IO ()) -> IO (ConnectId w)+onSizeRequest :: WidgetClass w => w -> IO Requisition -> IO (ConnectId w)+afterSizeRequest :: WidgetClass w => w -> IO Requisition -> IO (ConnectId w)+data StateType+StateNormal :: StateType+StateActive :: StateType+StatePrelight :: StateType+StateSelected :: StateType+StateInsensitive :: StateType+instance Enum StateType+instance Eq StateType+onStateChanged :: WidgetClass w => w -> (StateType -> IO ()) -> IO (ConnectId w)+afterStateChanged :: WidgetClass w => w -> (StateType -> IO ()) -> IO (ConnectId w)+onUnmap :: WidgetClass w => w -> IO () -> IO (ConnectId w)+afterUnmap :: WidgetClass w => w -> IO () -> IO (ConnectId w)+onUnrealize :: WidgetClass w => w -> IO () -> IO (ConnectId w)+afterUnrealize :: WidgetClass w => w -> IO () -> IO (ConnectId w)+onVisibilityNotify :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)+afterVisibilityNotify :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)+onWindowState :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)+afterWindowState :: WidgetClass w => w -> (Event -> IO Bool) -> IO (ConnectId w)++module Graphics.UI.Gtk.Gdk.Drawable+data Drawable+instance DrawableClass Drawable+instance GObjectClass Drawable+class GObjectClass o => DrawableClass o+instance DrawableClass DrawWindow+instance DrawableClass Drawable+instance DrawableClass Pixmap+castToDrawable :: GObjectClass obj => obj -> Drawable+toDrawable :: DrawableClass o => o -> Drawable+drawableGetDepth :: DrawableClass d => d -> IO Int+drawableGetSize :: DrawableClass d => d -> IO (Int, Int)+drawableGetClipRegion :: DrawableClass d => d -> IO Region+drawableGetVisibleRegion :: DrawableClass d => d -> IO Region+type Point = (Int, Int)+drawPoint :: DrawableClass d => d -> GC -> Point -> IO ()+drawPoints :: DrawableClass d => d -> GC -> [Point] -> IO ()+drawLine :: DrawableClass d => d -> GC -> Point -> Point -> IO ()+drawLines :: DrawableClass d => d -> GC -> [Point] -> IO ()+data Dither+RgbDitherNone :: Dither+RgbDitherNormal :: Dither+RgbDitherMax :: Dither+instance Enum Dither+drawPixbuf :: DrawableClass d => d -> GC -> Pixbuf -> Int -> Int -> Int -> Int -> Int -> Int -> Dither -> Int -> Int -> IO ()+drawSegments :: DrawableClass d => d -> GC -> [(Point, Point)] -> IO ()+drawRectangle :: DrawableClass d => d -> GC -> Bool -> Int -> Int -> Int -> Int -> IO ()+drawArc :: DrawableClass d => d -> GC -> Bool -> Int -> Int -> Int -> Int -> Int -> Int -> IO ()+drawPolygon :: DrawableClass d => d -> GC -> Bool -> [Point] -> IO ()+drawGlyphs :: DrawableClass d => d -> GC -> Int -> Int -> GlyphItem -> IO ()+drawLayoutLine :: DrawableClass d => d -> GC -> Int -> Int -> LayoutLine -> IO ()+drawLayoutLineWithColors :: DrawableClass d => d -> GC -> Int -> Int -> LayoutLine -> Maybe Color -> Maybe Color -> IO ()+drawLayout :: DrawableClass d => d -> GC -> Int -> Int -> PangoLayout -> IO ()+drawLayoutWithColors :: DrawableClass d => d -> GC -> Int -> Int -> PangoLayout -> Maybe Color -> Maybe Color -> IO ()+drawDrawable :: (DrawableClass src, DrawableClass dest) => dest -> GC -> src -> Int -> Int -> Int -> Int -> Int -> Int -> IO ()++module Graphics.UI.Gtk.Gdk.Pixmap+data Pixmap+instance DrawableClass Pixmap+instance GObjectClass Pixmap+instance PixmapClass Pixmap+class DrawableClass o => PixmapClass o+instance PixmapClass Pixmap+pixmapNew :: DrawableClass drawable => Maybe drawable -> Int -> Int -> Maybe Int -> IO Pixmap++module Graphics.UI.Gtk.Pango.Font+data PangoUnit+instance Enum PangoUnit+instance Eq PangoUnit+instance Fractional PangoUnit+instance Integral PangoUnit+instance Num PangoUnit+instance Ord PangoUnit+instance Real PangoUnit+instance Show PangoUnit+data FontDescription+fontDescriptionNew :: IO FontDescription+fontDescriptionCopy :: FontDescription -> IO FontDescription+fontDescriptionSetFamily :: FontDescription -> String -> IO ()+fontDescriptionGetFamily :: FontDescription -> IO (Maybe String)+fontDescriptionSetStyle :: FontDescription -> FontStyle -> IO ()+fontDescriptionGetStyle :: FontDescription -> IO (Maybe FontStyle)+fontDescriptionSetVariant :: FontDescription -> Variant -> IO ()+fontDescriptionGetVariant :: FontDescription -> IO (Maybe Variant)+fontDescriptionSetWeight :: FontDescription -> Weight -> IO ()+fontDescriptionGetWeight :: FontDescription -> IO (Maybe Weight)+fontDescriptionSetStretch :: FontDescription -> Stretch -> IO ()+fontDescriptionGetStretch :: FontDescription -> IO (Maybe Stretch)+fontDescriptionSetSize :: FontDescription -> PangoUnit -> IO ()+fontDescriptionGetSize :: FontDescription -> IO (Maybe PangoUnit)+data FontMask+PangoFontMaskFamily :: FontMask+PangoFontMaskStyle :: FontMask+PangoFontMaskVariant :: FontMask+PangoFontMaskWeight :: FontMask+PangoFontMaskStretch :: FontMask+PangoFontMaskSize :: FontMask+instance Bounded FontMask+instance Enum FontMask+instance Flags FontMask+fontDescriptionUnsetFields :: FontDescription -> [FontMask] -> IO ()+fontDescriptionMerge :: FontDescription -> FontDescription -> Bool -> IO ()+fontDescriptionBetterMatch :: FontDescription -> FontDescription -> FontDescription -> Bool+fontDescriptionFromString :: String -> IO FontDescription+fontDescriptionToString :: FontDescription -> IO String+data FontMap+instance FontMapClass FontMap+instance GObjectClass FontMap+pangoFontMapListFamilies :: FontMap -> IO [FontFamily]+data FontFamily+instance FontFamilyClass FontFamily+instance GObjectClass FontFamily+instance Show FontFamily+pangoFontFamilyIsMonospace :: FontFamily -> Bool+pangoFontFamilyListFaces :: FontFamily -> IO [FontFace]+data FontFace+instance FontFaceClass FontFace+instance GObjectClass FontFace+instance Show FontFace+pangoFontFaceListSizes :: FontFace -> IO (Maybe [PangoUnit])+pangoFontFaceDescribe :: FontFace -> IO FontDescription+data FontMetrics+FontMetrics :: PangoUnit -> PangoUnit -> PangoUnit -> PangoUnit -> PangoUnit -> PangoUnit -> PangoUnit -> PangoUnit -> FontMetrics+ascent :: FontMetrics -> PangoUnit+descent :: FontMetrics -> PangoUnit+approximateCharWidth :: FontMetrics -> PangoUnit+approximateDigitWidth :: FontMetrics -> PangoUnit+underlineThickness :: FontMetrics -> PangoUnit+underlinePosition :: FontMetrics -> PangoUnit+strikethroughThickenss :: FontMetrics -> PangoUnit+strikethroughPosition :: FontMetrics -> PangoUnit+instance Show FontMetrics++module Graphics.UI.Gtk.Pango.Context+data PangoContext+instance GObjectClass PangoContext+instance PangoContextClass PangoContext+data PangoDirection+PangoDirectionLtr :: PangoDirection+PangoDirectionRtl :: PangoDirection+PangoDirectionWeakLtr :: PangoDirection+PangoDirectionWeakRtl :: PangoDirection+PangoDirectionNeutral :: PangoDirection+instance Enum PangoDirection+instance Eq PangoDirection+instance Ord PangoDirection+contextListFamilies :: PangoContext -> IO [FontFamily]+contextGetMetrics :: PangoContext -> FontDescription -> Language -> IO FontMetrics+contextSetFontDescription :: PangoContext -> FontDescription -> IO ()+contextGetFontDescription :: PangoContext -> IO FontDescription+data Language+instance Eq Language+instance Show Language+languageFromString :: String -> IO Language+contextSetLanguage :: PangoContext -> Language -> IO ()+contextGetLanguage :: PangoContext -> IO Language+contextSetTextDir :: PangoContext -> PangoDirection -> IO ()+contextGetTextDir :: PangoContext -> IO PangoDirection++module Graphics.UI.Gtk.Pango.Markup+type Markup = String+data SpanAttribute+FontDescr :: String -> SpanAttribute+FontFamily :: String -> SpanAttribute+FontSize :: Size -> SpanAttribute+FontStyle :: FontStyle -> SpanAttribute+FontWeight :: Weight -> SpanAttribute+FontVariant :: Variant -> SpanAttribute+FontStretch :: Stretch -> SpanAttribute+FontForeground :: String -> SpanAttribute+FontBackground :: String -> SpanAttribute+FontUnderline :: Underline -> SpanAttribute+FontRise :: Double -> SpanAttribute+FontLang :: Language -> SpanAttribute+instance Show SpanAttribute+markSpan :: [SpanAttribute] -> String -> String+data Size+SizePoint :: Double -> Size+SizeUnreadable :: Size+SizeTiny :: Size+SizeSmall :: Size+SizeMedium :: Size+SizeLarge :: Size+SizeHuge :: Size+SizeGiant :: Size+SizeSmaller :: Size+SizeLarger :: Size+instance Show Size++module Graphics.UI.Gtk.Display.Label+data Label+instance GObjectClass Label+instance LabelClass Label+instance MiscClass Label+instance ObjectClass Label+instance WidgetClass Label+class MiscClass o => LabelClass o+instance LabelClass AccelLabel+instance LabelClass Label+instance LabelClass TipsQuery+castToLabel :: GObjectClass obj => obj -> Label+toLabel :: LabelClass o => o -> Label+labelNew :: Maybe String -> IO Label+labelNewWithMnemonic :: String -> IO Label+labelSetText :: LabelClass self => self -> String -> IO ()+labelSetLabel :: LabelClass self => self -> String -> IO ()+labelSetTextWithMnemonic :: LabelClass self => self -> String -> IO ()+labelSetMarkup :: LabelClass self => self -> Markup -> IO ()+labelSetMarkupWithMnemonic :: LabelClass self => self -> Markup -> IO ()+labelSetMnemonicWidget :: (LabelClass self, WidgetClass widget) => self -> widget -> IO ()+labelGetMnemonicWidget :: LabelClass self => self -> IO (Maybe Widget)+type KeyVal = Word32+labelGetMnemonicKeyval :: LabelClass self => self -> IO KeyVal+labelSetUseMarkup :: LabelClass self => self -> Bool -> IO ()+labelGetUseMarkup :: LabelClass self => self -> IO Bool+labelSetUseUnderline :: LabelClass self => self -> Bool -> IO ()+labelGetUseUnderline :: LabelClass self => self -> IO Bool+labelGetText :: LabelClass self => self -> IO String+labelGetLabel :: LabelClass self => self -> IO String+labelSetPattern :: LabelClass l => l -> [Int] -> IO ()+data Justification+JustifyLeft :: Justification+JustifyRight :: Justification+JustifyCenter :: Justification+JustifyFill :: Justification+instance Enum Justification+instance Eq Justification+labelSetJustify :: LabelClass self => self -> Justification -> IO ()+labelGetJustify :: LabelClass self => self -> IO Justification+labelGetLayout :: LabelClass self => self -> IO PangoLayout+labelSetLineWrap :: LabelClass self => self -> Bool -> IO ()+labelGetLineWrap :: LabelClass self => self -> IO Bool+labelSetSelectable :: LabelClass self => self -> Bool -> IO ()+labelGetSelectable :: LabelClass self => self -> IO Bool+labelSelectRegion :: LabelClass self => self -> Int -> Int -> IO ()+labelGetSelectionBounds :: LabelClass self => self -> IO (Maybe (Int, Int))+labelGetLayoutOffsets :: LabelClass self => self -> IO (Int, Int)+labelSetEllipsize :: LabelClass self => self -> EllipsizeMode -> IO ()+labelGetEllipsize :: LabelClass self => self -> IO EllipsizeMode+labelSetWidthChars :: LabelClass self => self -> Int -> IO ()+labelGetWidthChars :: LabelClass self => self -> IO Int+labelSetMaxWidthChars :: LabelClass self => self -> Int -> IO ()+labelGetMaxWidthChars :: LabelClass self => self -> IO Int+labelSetSingleLineMode :: LabelClass self => self -> Bool -> IO ()+labelGetSingleLineMode :: LabelClass self => self -> IO Bool+labelSetAngle :: LabelClass self => self -> Double -> IO ()+labelGetAngle :: LabelClass self => self -> IO Double+labelLabel :: LabelClass self => Attr self String+labelUseMarkup :: LabelClass self => Attr self Bool+labelUseUnderline :: LabelClass self => Attr self Bool+labelJustify :: LabelClass self => Attr self Justification+labelWrap :: LabelClass self => Attr self Bool+labelSelectable :: LabelClass self => Attr self Bool+labelMnemonicWidget :: (LabelClass self, WidgetClass widget) => ReadWriteAttr self (Maybe Widget) widget+labelCursorPosition :: LabelClass self => ReadAttr self Int+labelSelectionBound :: LabelClass self => ReadAttr self Int+labelEllipsize :: LabelClass self => Attr self EllipsizeMode+labelWidthChars :: LabelClass self => Attr self Int+labelSingleLineMode :: LabelClass self => Attr self Bool+labelAngle :: LabelClass self => Attr self Double+labelMaxWidthChars :: LabelClass self => Attr self Int+labelLineWrap :: LabelClass self => Attr self Bool+labelText :: LabelClass self => Attr self String++module Graphics.UI.Gtk.Pango.Rendering+data PangoAttribute+AttrLanguage :: Int -> Int -> Language -> PangoAttribute+paStart :: PangoAttribute -> Int+paEnd :: PangoAttribute -> Int+paLang :: PangoAttribute -> Language+AttrFamily :: Int -> Int -> String -> PangoAttribute+paStart :: PangoAttribute -> Int+paEnd :: PangoAttribute -> Int+paFamily :: PangoAttribute -> String+AttrStyle :: Int -> Int -> FontStyle -> PangoAttribute+paStart :: PangoAttribute -> Int+paEnd :: PangoAttribute -> Int+paStyle :: PangoAttribute -> FontStyle+AttrWeight :: Int -> Int -> Weight -> PangoAttribute+paStart :: PangoAttribute -> Int+paEnd :: PangoAttribute -> Int+paWeight :: PangoAttribute -> Weight+AttrVariant :: Int -> Int -> Variant -> PangoAttribute+paStart :: PangoAttribute -> Int+paEnd :: PangoAttribute -> Int+paVariant :: PangoAttribute -> Variant+AttrStretch :: Int -> Int -> Stretch -> PangoAttribute+paStart :: PangoAttribute -> Int+paEnd :: PangoAttribute -> Int+paStretch :: PangoAttribute -> Stretch+AttrSize :: Int -> Int -> PangoUnit -> PangoAttribute+paStart :: PangoAttribute -> Int+paEnd :: PangoAttribute -> Int+paSize :: PangoAttribute -> PangoUnit+AttrAbsSize :: Int -> Int -> PangoUnit -> PangoAttribute+paStart :: PangoAttribute -> Int+paEnd :: PangoAttribute -> Int+paSize :: PangoAttribute -> PangoUnit+AttrFontDescription :: Int -> Int -> FontDescription -> PangoAttribute+paStart :: PangoAttribute -> Int+paEnd :: PangoAttribute -> Int+paFontDescription :: PangoAttribute -> FontDescription+AttrForeground :: Int -> Int -> Color -> PangoAttribute+paStart :: PangoAttribute -> Int+paEnd :: PangoAttribute -> Int+paColor :: PangoAttribute -> Color+AttrBackground :: Int -> Int -> Color -> PangoAttribute+paStart :: PangoAttribute -> Int+paEnd :: PangoAttribute -> Int+paColor :: PangoAttribute -> Color+AttrUnderline :: Int -> Int -> Underline -> PangoAttribute+paStart :: PangoAttribute -> Int+paEnd :: PangoAttribute -> Int+paUnderline :: PangoAttribute -> Underline+AttrUnderlineColor :: Int -> Int -> Color -> PangoAttribute+paStart :: PangoAttribute -> Int+paEnd :: PangoAttribute -> Int+paColor :: PangoAttribute -> Color+AttrStrikethrough :: Int -> Int -> Bool -> PangoAttribute+paStart :: PangoAttribute -> Int+paEnd :: PangoAttribute -> Int+paStrikethrough :: PangoAttribute -> Bool+AttrStrikethroughColor :: Int -> Int -> Color -> PangoAttribute+paStart :: PangoAttribute -> Int+paEnd :: PangoAttribute -> Int+paColor :: PangoAttribute -> Color+AttrRise :: Int -> Int -> PangoUnit -> PangoAttribute+paStart :: PangoAttribute -> Int+paEnd :: PangoAttribute -> Int+paRise :: PangoAttribute -> PangoUnit+AttrShape :: Int -> Int -> PangoRectangle -> PangoRectangle -> PangoAttribute+paStart :: PangoAttribute -> Int+paEnd :: PangoAttribute -> Int+paInk :: PangoAttribute -> PangoRectangle+paLogical :: PangoAttribute -> PangoRectangle+AttrScale :: Int -> Int -> Double -> PangoAttribute+paStart :: PangoAttribute -> Int+paEnd :: PangoAttribute -> Int+paScale :: PangoAttribute -> Double+AttrFallback :: Int -> Int -> Bool -> PangoAttribute+paStart :: PangoAttribute -> Int+paEnd :: PangoAttribute -> Int+paFallback :: PangoAttribute -> Bool+AttrLetterSpacing :: Int -> Int -> PangoUnit -> PangoAttribute+paStart :: PangoAttribute -> Int+paEnd :: PangoAttribute -> Int+paLetterSpacing :: PangoAttribute -> PangoUnit+data PangoItem+pangoItemize :: PangoContext -> String -> [PangoAttribute] -> IO [PangoItem]+pangoItemGetFontMetrics :: PangoItem -> IO FontMetrics+data GlyphItem+pangoShape :: PangoItem -> IO GlyphItem+glyphItemExtents :: GlyphItem -> IO (PangoRectangle, PangoRectangle)+glyphItemExtentsRange :: GlyphItem -> Int -> Int -> IO (PangoRectangle, PangoRectangle)+glyphItemIndexToX :: GlyphItem -> Int -> Bool -> IO PangoUnit+glyphItemXToIndex :: GlyphItem -> PangoUnit -> IO (Int, Bool)+glyphItemGetLogicalWidths :: GlyphItem -> Maybe Bool -> IO [PangoUnit]+glyphItemSplit :: GlyphItem -> Int -> IO (GlyphItem, GlyphItem)++module Graphics.UI.Gtk.Pango.Layout+data PangoRectangle+PangoRectangle :: PangoUnit -> PangoUnit -> PangoUnit -> PangoUnit -> PangoRectangle+data PangoLayout+layoutEmpty :: PangoContext -> IO PangoLayout+layoutText :: PangoContext -> String -> IO PangoLayout+layoutCopy :: PangoLayout -> IO PangoLayout+layoutGetContext :: PangoLayout -> IO PangoContext+layoutContextChanged :: PangoLayout -> IO ()+layoutSetText :: PangoLayout -> String -> IO ()+layoutGetText :: PangoLayout -> IO String+layoutSetMarkup :: PangoLayout -> Markup -> IO String+escapeMarkup :: String -> String+layoutSetMarkupWithAccel :: PangoLayout -> Markup -> IO (Char, String)+layoutSetAttributes :: PangoLayout -> [PangoAttribute] -> IO ()+layoutSetFontDescription :: PangoLayout -> Maybe FontDescription -> IO ()+layoutGetFontDescription :: PangoLayout -> IO (Maybe FontDescription)+layoutSetWidth :: PangoLayout -> Maybe PangoUnit -> IO ()+layoutGetWidth :: PangoLayout -> IO (Maybe PangoUnit)+data LayoutWrapMode+WrapWholeWords :: LayoutWrapMode+WrapAnywhere :: LayoutWrapMode+WrapPartialWords :: LayoutWrapMode+instance Enum LayoutWrapMode+layoutSetWrap :: PangoLayout -> LayoutWrapMode -> IO ()+layoutGetWrap :: PangoLayout -> IO LayoutWrapMode+data EllipsizeMode+EllipsizeNone :: EllipsizeMode+EllipsizeStart :: EllipsizeMode+EllipsizeMiddle :: EllipsizeMode+EllipsizeEnd :: EllipsizeMode+instance Enum EllipsizeMode+instance Eq EllipsizeMode+layoutSetEllipsize :: PangoLayout -> EllipsizeMode -> IO ()+layoutGetEllipsize :: PangoLayout -> IO EllipsizeMode+layoutSetIndent :: PangoLayout -> PangoUnit -> IO ()+layoutGetIndent :: PangoLayout -> IO PangoUnit+layoutSetSpacing :: PangoLayout -> PangoUnit -> IO ()+layoutGetSpacing :: PangoLayout -> IO PangoUnit+layoutSetJustify :: PangoLayout -> Bool -> IO ()+layoutGetJustify :: PangoLayout -> IO Bool+layoutSetAutoDir :: PangoLayout -> Bool -> IO ()+layoutGetAutoDir :: PangoLayout -> IO Bool+data LayoutAlignment+AlignLeft :: LayoutAlignment+AlignCenter :: LayoutAlignment+AlignRight :: LayoutAlignment+instance Enum LayoutAlignment+layoutSetAlignment :: PangoLayout -> LayoutAlignment -> IO ()+layoutGetAlignment :: PangoLayout -> IO LayoutAlignment+data TabAlign+instance Enum TabAlign+type TabPosition = (PangoUnit, TabAlign)+layoutSetTabs :: PangoLayout -> [TabPosition] -> IO ()+layoutResetTabs :: PangoLayout -> IO ()+layoutGetTabs :: PangoLayout -> IO (Maybe [TabPosition])+layoutSetSingleParagraphMode :: PangoLayout -> Bool -> IO ()+layoutGetSingleParagraphMode :: PangoLayout -> IO Bool+layoutXYToIndex :: PangoLayout -> PangoUnit -> PangoUnit -> IO (Bool, Int, Int)+layoutIndexToPos :: PangoLayout -> Int -> IO PangoRectangle+layoutGetCursorPos :: PangoLayout -> Int -> IO (PangoRectangle, PangoRectangle)+data CursorPos+CursorPosPrevPara :: CursorPos+CursorPos :: Int -> Int -> CursorPos+CursorPosNextPara :: CursorPos+layoutMoveCursorVisually :: PangoLayout -> Bool -> Int -> Bool -> IO CursorPos+layoutGetExtents :: PangoLayout -> IO (PangoRectangle, PangoRectangle)+layoutGetPixelExtents :: PangoLayout -> IO (Rectangle, Rectangle)+layoutGetLineCount :: PangoLayout -> IO Int+layoutGetLine :: PangoLayout -> Int -> IO LayoutLine+layoutGetLines :: PangoLayout -> IO [LayoutLine]+data LayoutIter+layoutGetIter :: PangoLayout -> IO LayoutIter+layoutIterNextItem :: LayoutIter -> IO Bool+layoutIterNextChar :: LayoutIter -> IO Bool+layoutIterNextCluster :: LayoutIter -> IO Bool+layoutIterNextLine :: LayoutIter -> IO Bool+layoutIterAtLastLine :: LayoutIter -> IO Bool+layoutIterGetIndex :: LayoutIter -> IO Int+layoutIterGetBaseline :: LayoutIter -> IO PangoUnit+layoutIterGetItem :: LayoutIter -> IO (Maybe GlyphItem)+layoutIterGetLine :: LayoutIter -> IO (Maybe LayoutLine)+layoutIterGetCharExtents :: LayoutIter -> IO PangoRectangle+layoutIterGetClusterExtents :: LayoutIter -> IO (PangoRectangle, PangoRectangle)+layoutIterGetRunExtents :: LayoutIter -> IO (PangoRectangle, PangoRectangle)+layoutIterGetLineYRange :: LayoutIter -> IO (PangoUnit, PangoUnit)+layoutIterGetLineExtents :: LayoutIter -> IO (PangoRectangle, PangoRectangle)+data LayoutLine+layoutLineGetExtents :: LayoutLine -> IO (PangoRectangle, PangoRectangle)+layoutLineGetPixelExtents :: LayoutLine -> IO (Rectangle, Rectangle)+layoutLineIndexToX :: LayoutLine -> Int -> Bool -> IO PangoUnit+layoutLineXToIndex :: LayoutLine -> PangoUnit -> IO (Bool, Int, Int)+layoutLineGetXRanges :: LayoutLine -> Int -> Int -> IO [(PangoUnit, PangoUnit)]++module Graphics.UI.Gtk.SourceView.SourceTagStyle+data SourceTagStyle+SourceTagStyle :: Bool -> Maybe Color -> Maybe Color -> Bool -> Bool -> Bool -> Bool -> SourceTagStyle+isDefault :: SourceTagStyle -> Bool+foreground :: SourceTagStyle -> Maybe Color+background :: SourceTagStyle -> Maybe Color+italic :: SourceTagStyle -> Bool+bold :: SourceTagStyle -> Bool+underline :: SourceTagStyle -> Bool+strikethrough :: SourceTagStyle -> Bool+instance Storable SourceTagStyle++module Graphics.UI.Gtk.SourceView.SourceStyleScheme+data SourceStyleScheme+instance GObjectClass SourceStyleScheme+instance SourceStyleSchemeClass SourceStyleScheme+castToSourceStyleScheme :: GObjectClass obj => obj -> SourceStyleScheme+sourceStyleSchemeGetTagStyle :: SourceStyleScheme -> String -> IO SourceTagStyle+sourceStyleSchemeGetName :: SourceStyleScheme -> IO String+sourceStyleSchemeGetDefault :: IO SourceStyleScheme++module Graphics.UI.Gtk.SourceView.SourceTag+data SourceTag+instance GObjectClass SourceTag+instance SourceTagClass SourceTag+instance TextTagClass SourceTag+castToSourceTag :: GObjectClass obj => obj -> SourceTag+syntaxTagNew :: String -> String -> String -> String -> IO SourceTag+patternTagNew :: String -> String -> String -> IO SourceTag+keywordListTagNew :: String -> String -> [String] -> Bool -> Bool -> Bool -> String -> String -> IO SourceTag+blockCommentTagNew :: String -> String -> String -> String -> IO SourceTag+lineCommentTagNew :: String -> String -> String -> IO SourceTag+stringTagNew :: String -> String -> String -> String -> Bool -> IO SourceTag+sourceTagGetStyle :: SourceTag -> IO SourceTagStyle+sourceTagSetStyle :: SourceTag -> SourceTagStyle -> IO ()++module Graphics.UI.Gtk.SourceView.SourceTagTable+data SourceTagTable+instance GObjectClass SourceTagTable+instance SourceTagTableClass SourceTagTable+instance TextTagTableClass SourceTagTable+class TextTagTableClass o => SourceTagTableClass o+instance SourceTagTableClass SourceTagTable+castToSourceTagTable :: GObjectClass obj => obj -> SourceTagTable+sourceTagTableNew :: IO SourceTagTable+sourceTagTableAddTags :: SourceTagTable -> [SourceTag] -> IO ()+sourceTagTableRemoveSourceTags :: SourceTagTable -> IO ()++module Graphics.UI.Gtk.TreeList.TreeIter+newtype TreeIter+TreeIter :: ForeignPtr TreeIter -> TreeIter+createTreeIter :: Ptr TreeIter -> IO TreeIter+mallocTreeIter :: IO TreeIter+receiveTreeIter :: (TreeIter -> IO Bool) -> IO (Maybe TreeIter)++module Graphics.UI.Gtk.Entry.EntryCompletion+data EntryCompletion+instance EntryCompletionClass EntryCompletion+instance GObjectClass EntryCompletion+class GObjectClass o => EntryCompletionClass o+instance EntryCompletionClass EntryCompletion+castToEntryCompletion :: GObjectClass obj => obj -> EntryCompletion+toEntryCompletion :: EntryCompletionClass o => o -> EntryCompletion+entryCompletionNew :: IO EntryCompletion+entryCompletionGetEntry :: EntryCompletion -> IO (Maybe Entry)+entryCompletionSetModel :: TreeModelClass model => EntryCompletion -> Maybe model -> IO ()+entryCompletionGetModel :: EntryCompletion -> IO (Maybe TreeModel)+entryCompletionSetMatchFunc :: EntryCompletion -> (String -> TreeIter -> IO ()) -> IO ()+entryCompletionSetMinimumKeyLength :: EntryCompletion -> Int -> IO ()+entryCompletionGetMinimumKeyLength :: EntryCompletion -> IO Int+entryCompletionComplete :: EntryCompletion -> IO ()+entryCompletionInsertActionText :: EntryCompletion -> Int -> String -> IO ()+entryCompletionInsertActionMarkup :: EntryCompletion -> Int -> String -> IO ()+entryCompletionDeleteAction :: EntryCompletion -> Int -> IO ()+entryCompletionSetTextColumn :: EntryCompletion -> Int -> IO ()+entryCompletionInsertPrefix :: EntryCompletion -> IO ()+entryCompletionGetTextColumn :: EntryCompletion -> IO Int+entryCompletionSetInlineCompletion :: EntryCompletion -> Bool -> IO ()+entryCompletionGetInlineCompletion :: EntryCompletion -> IO Bool+entryCompletionSetPopupCompletion :: EntryCompletion -> Bool -> IO ()+entryCompletionGetPopupCompletion :: EntryCompletion -> IO Bool+entryCompletionSetPopupSetWidth :: EntryCompletion -> Bool -> IO ()+entryCompletionGetPopupSetWidth :: EntryCompletion -> IO Bool+entryCompletionSetPopupSingleMatch :: EntryCompletion -> Bool -> IO ()+entryCompletionGetPopupSingleMatch :: EntryCompletion -> IO Bool+entryCompletionModel :: TreeModelClass model => ReadWriteAttr EntryCompletion (Maybe TreeModel) (Maybe model)+entryCompletionMinimumKeyLength :: Attr EntryCompletion Int+entryCompletionTextColumn :: Attr EntryCompletion Int+entryCompletionInlineCompletion :: Attr EntryCompletion Bool+entryCompletionPopupCompletion :: Attr EntryCompletion Bool+entryCompletionPopupSetWidth :: Attr EntryCompletion Bool+entryCompletionPopupSingleMatch :: Attr EntryCompletion Bool+onInsertPrefix :: EntryCompletionClass self => self -> (String -> IO Bool) -> IO (ConnectId self)+afterInsertPrefix :: EntryCompletionClass self => self -> (String -> IO Bool) -> IO (ConnectId self)+onActionActivated :: EntryCompletionClass self => self -> (Int -> IO ()) -> IO (ConnectId self)+afterActionActivated :: EntryCompletionClass self => self -> (Int -> IO ()) -> IO (ConnectId self)++module Graphics.UI.Gtk.TreeList.TreeModel+data TreeModel+instance GObjectClass TreeModel+instance TreeModelClass TreeModel+class GObjectClass o => TreeModelClass o+instance TreeModelClass ListStore+instance TreeModelClass TreeModel+instance TreeModelClass TreeModelSort+instance TreeModelClass TreeStore+castToTreeModel :: GObjectClass obj => obj -> TreeModel+toTreeModel :: TreeModelClass o => o -> TreeModel+data TreeModelFlags+TreeModelItersPersist :: TreeModelFlags+TreeModelListOnly :: TreeModelFlags+instance Bounded TreeModelFlags+instance Enum TreeModelFlags+instance Flags TreeModelFlags+type TreePath = [Int]+data TreeRowReference+data TreeIter+treeModelGetFlags :: TreeModelClass self => self -> IO [TreeModelFlags]+treeModelGetNColumns :: TreeModelClass self => self -> IO Int+treeModelGetColumnType :: TreeModelClass self => self -> Int -> IO TMType+treeModelGetValue :: TreeModelClass self => self -> TreeIter -> Int -> IO GenericValue+treeRowReferenceNew :: TreeModelClass self => self -> NativeTreePath -> IO TreeRowReference+treeRowReferenceGetPath :: TreeRowReference -> IO TreePath+treeRowReferenceValid :: TreeRowReference -> IO Bool+treeModelGetIter :: TreeModelClass self => self -> TreePath -> IO (Maybe TreeIter)+treeModelGetIterFromString :: TreeModelClass self => self -> String -> IO (Maybe TreeIter)+gtk_tree_model_get_iter_from_string :: Ptr TreeModel -> Ptr TreeIter -> Ptr CChar -> IO CInt+treeModelGetIterFirst :: TreeModelClass self => self -> IO (Maybe TreeIter)+treeModelGetPath :: TreeModelClass self => self -> TreeIter -> IO TreePath+treeModelIterNext :: TreeModelClass self => self -> TreeIter -> IO Bool+treeModelIterChildren :: TreeModelClass self => self -> TreeIter -> IO (Maybe TreeIter)+treeModelIterHasChild :: TreeModelClass self => self -> TreeIter -> IO Bool+treeModelIterNChildren :: TreeModelClass self => self -> Maybe TreeIter -> IO Int+treeModelIterNthChild :: TreeModelClass self => self -> Maybe TreeIter -> Int -> IO (Maybe TreeIter)+treeModelIterParent :: TreeModelClass self => self -> TreeIter -> IO (Maybe TreeIter)++module Graphics.UI.Gtk.TreeList.ListStore+data ListStore+instance GObjectClass ListStore+instance ListStoreClass ListStore+instance TreeModelClass ListStore+class TreeModelClass o => ListStoreClass o+instance ListStoreClass ListStore+castToListStore :: GObjectClass obj => obj -> ListStore+toListStore :: ListStoreClass o => o -> ListStore+data TMType+TMinvalid :: TMType+TMuint :: TMType+TMint :: TMType+TMboolean :: TMType+TMenum :: TMType+TMflags :: TMType+TMfloat :: TMType+TMdouble :: TMType+TMstring :: TMType+TMobject :: TMType+instance Enum TMType+data GenericValue+GVuint :: Word -> GenericValue+GVint :: Int -> GenericValue+GVboolean :: Bool -> GenericValue+GVenum :: Int -> GenericValue+GVflags :: Int -> GenericValue+GVfloat :: Float -> GenericValue+GVdouble :: Double -> GenericValue+GVstring :: Maybe String -> GenericValue+GVobject :: GObject -> GenericValue+listStoreNew :: [TMType] -> IO ListStore+listStoreSetValue :: ListStoreClass self => self -> TreeIter -> Int -> GenericValue -> IO ()+listStoreRemove :: ListStoreClass self => self -> TreeIter -> IO Bool+listStoreInsert :: ListStoreClass self => self -> Int -> IO TreeIter+listStoreInsertBefore :: ListStoreClass self => self -> TreeIter -> IO TreeIter+listStoreInsertAfter :: ListStoreClass self => self -> TreeIter -> IO TreeIter+listStorePrepend :: ListStoreClass self => self -> IO TreeIter+listStoreAppend :: ListStoreClass self => self -> IO TreeIter+listStoreClear :: ListStoreClass self => self -> IO ()+listStoreReorder :: ListStoreClass self => self -> [Int] -> IO ()+listStoreSwap :: ListStoreClass self => self -> TreeIter -> TreeIter -> IO ()+listStoreMoveBefore :: ListStoreClass self => self -> TreeIter -> Maybe TreeIter -> IO ()+listStoreMoveAfter :: ListStoreClass self => self -> TreeIter -> Maybe TreeIter -> IO ()++module Graphics.UI.Gtk.TreeList.TreeStore+data TreeStore+instance GObjectClass TreeStore+instance TreeModelClass TreeStore+instance TreeStoreClass TreeStore+class TreeModelClass o => TreeStoreClass o+instance TreeStoreClass TreeStore+castToTreeStore :: GObjectClass obj => obj -> TreeStore+toTreeStore :: TreeStoreClass o => o -> TreeStore+data TMType+TMinvalid :: TMType+TMuint :: TMType+TMint :: TMType+TMboolean :: TMType+TMenum :: TMType+TMflags :: TMType+TMfloat :: TMType+TMdouble :: TMType+TMstring :: TMType+TMobject :: TMType+instance Enum TMType+data GenericValue+GVuint :: Word -> GenericValue+GVint :: Int -> GenericValue+GVboolean :: Bool -> GenericValue+GVenum :: Int -> GenericValue+GVflags :: Int -> GenericValue+GVfloat :: Float -> GenericValue+GVdouble :: Double -> GenericValue+GVstring :: Maybe String -> GenericValue+GVobject :: GObject -> GenericValue+treeStoreNew :: [TMType] -> IO TreeStore+treeStoreSetValue :: TreeStoreClass self => self -> TreeIter -> Int -> GenericValue -> IO ()+treeStoreRemove :: TreeStoreClass self => self -> TreeIter -> IO Bool+treeStoreInsert :: TreeStoreClass self => self -> Maybe TreeIter -> Int -> IO TreeIter+treeStoreInsertBefore :: TreeStoreClass self => self -> TreeIter -> IO TreeIter+treeStoreInsertAfter :: TreeStoreClass self => self -> TreeIter -> IO TreeIter+treeStorePrepend :: TreeStoreClass self => self -> Maybe TreeIter -> IO TreeIter+treeStoreAppend :: TreeStoreClass self => self -> Maybe TreeIter -> IO TreeIter+treeStoreIsAncestor :: TreeStoreClass self => self -> TreeIter -> TreeIter -> IO Bool+treeStoreIterDepth :: TreeStoreClass self => self -> TreeIter -> IO Int+treeStoreClear :: TreeStoreClass self => self -> IO ()++module Graphics.UI.Gtk.TreeList.TreeModelSort+data TreeModelSort+instance GObjectClass TreeModelSort+instance TreeModelClass TreeModelSort+instance TreeModelSortClass TreeModelSort+class GObjectClass o => TreeModelSortClass o+instance TreeModelSortClass TreeModelSort+castToTreeModelSort :: GObjectClass obj => obj -> TreeModelSort+toTreeModelSort :: TreeModelSortClass o => o -> TreeModelSort+treeModelSortNewWithModel :: TreeModelClass childModel => childModel -> IO TreeModelSort+treeModelSortGetModel :: TreeModelSortClass self => self -> IO TreeModel+treeModelSortConvertChildPathToPath :: TreeModelSortClass self => self -> TreePath -> IO TreePath+treeModelSortConvertPathToChildPath :: TreeModelSortClass self => self -> TreePath -> IO TreePath+treeModelSortConvertChildIterToIter :: TreeModelSortClass self => self -> TreeIter -> IO TreeIter+treeModelSortConvertIterToChildIter :: TreeModelSortClass self => self -> TreeIter -> IO TreeIter+treeModelSortResetDefaultSortFunc :: TreeModelSortClass self => self -> IO ()+treeModelSortClearCache :: TreeModelSortClass self => self -> IO ()+treeModelSortIterIsValid :: TreeModelSortClass self => self -> TreeIter -> IO Bool++module Graphics.UI.Gtk.Glade+class GObjectClass o => GladeXMLClass o+instance GladeXMLClass GladeXML+data GladeXML+instance GObjectClass GladeXML+instance GladeXMLClass GladeXML+xmlNew :: FilePath -> IO (Maybe GladeXML)+xmlNewWithRootAndDomain :: FilePath -> Maybe String -> Maybe String -> IO (Maybe GladeXML)+xmlGetWidget :: WidgetClass widget => GladeXML -> (GObject -> widget) -> String -> IO widget+xmlGetWidgetRaw :: GladeXML -> String -> IO (Maybe Widget)++module Graphics.UI.Gtk.Layout.Alignment+data Alignment+instance AlignmentClass Alignment+instance BinClass Alignment+instance ContainerClass Alignment+instance GObjectClass Alignment+instance ObjectClass Alignment+instance WidgetClass Alignment+class BinClass o => AlignmentClass o+instance AlignmentClass Alignment+castToAlignment :: GObjectClass obj => obj -> Alignment+toAlignment :: AlignmentClass o => o -> Alignment+alignmentNew :: Float -> Float -> Float -> Float -> IO Alignment+alignmentSet :: AlignmentClass self => self -> Float -> Float -> Float -> Float -> IO ()+alignmentSetPadding :: AlignmentClass self => self -> Int -> Int -> Int -> Int -> IO ()+alignmentGetPadding :: AlignmentClass self => self -> IO (Int, Int, Int, Int)+alignmentXAlign :: AlignmentClass self => Attr self Float+alignmentYAlign :: AlignmentClass self => Attr self Float+alignmentXScale :: AlignmentClass self => Attr self Float+alignmentYScale :: AlignmentClass self => Attr self Float+alignmentTopPadding :: AlignmentClass self => Attr self Int+alignmentBottomPadding :: AlignmentClass self => Attr self Int+alignmentLeftPadding :: AlignmentClass self => Attr self Int+alignmentRightPadding :: AlignmentClass self => Attr self Int++module Graphics.UI.Gtk.Layout.AspectFrame+data AspectFrame+instance AspectFrameClass AspectFrame+instance BinClass AspectFrame+instance ContainerClass AspectFrame+instance FrameClass AspectFrame+instance GObjectClass AspectFrame+instance ObjectClass AspectFrame+instance WidgetClass AspectFrame+class FrameClass o => AspectFrameClass o+instance AspectFrameClass AspectFrame+castToAspectFrame :: GObjectClass obj => obj -> AspectFrame+toAspectFrame :: AspectFrameClass o => o -> AspectFrame+aspectFrameNew :: Float -> Float -> Maybe Float -> IO AspectFrame+aspectFrameSet :: AspectFrameClass self => self -> Float -> Float -> Maybe Float -> IO ()+aspectFrameXAlign :: AspectFrameClass self => Attr self Float+aspectFrameYAlign :: AspectFrameClass self => Attr self Float+aspectFrameRatio :: AspectFrameClass self => Attr self Float+aspectFrameObeyChild :: AspectFrameClass self => Attr self Bool++module Graphics.UI.Gtk.Layout.Expander+data Expander+instance BinClass Expander+instance ContainerClass Expander+instance ExpanderClass Expander+instance GObjectClass Expander+instance ObjectClass Expander+instance WidgetClass Expander+class BinClass o => ExpanderClass o+instance ExpanderClass Expander+castToExpander :: GObjectClass obj => obj -> Expander+toExpander :: ExpanderClass o => o -> Expander+expanderNew :: String -> IO Expander+expanderNewWithMnemonic :: String -> IO Expander+expanderSetExpanded :: Expander -> Bool -> IO ()+expanderGetExpanded :: Expander -> IO Bool+expanderSetSpacing :: Expander -> Int -> IO ()+expanderGetSpacing :: Expander -> IO Int+expanderSetLabel :: Expander -> String -> IO ()+expanderGetLabel :: Expander -> IO String+expanderSetUseUnderline :: Expander -> Bool -> IO ()+expanderGetUseUnderline :: Expander -> IO Bool+expanderSetUseMarkup :: Expander -> Bool -> IO ()+expanderGetUseMarkup :: Expander -> IO Bool+expanderSetLabelWidget :: WidgetClass labelWidget => Expander -> labelWidget -> IO ()+expanderGetLabelWidget :: Expander -> IO Widget+expanderExpanded :: Attr Expander Bool+expanderLabel :: Attr Expander String+expanderUseUnderline :: Attr Expander Bool+expanderUseMarkup :: Attr Expander Bool+expanderSpacing :: Attr Expander Int+expanderLabelWidget :: WidgetClass labelWidget => ReadWriteAttr Expander Widget labelWidget+onActivate :: Expander -> IO () -> IO (ConnectId Expander)+afterActivate :: Expander -> IO () -> IO (ConnectId Expander)++module Graphics.UI.Gtk.Layout.HBox+data HBox+instance BoxClass HBox+instance ContainerClass HBox+instance GObjectClass HBox+instance HBoxClass HBox+instance ObjectClass HBox+instance WidgetClass HBox+class BoxClass o => HBoxClass o+instance HBoxClass Combo+instance HBoxClass FileChooserButton+instance HBoxClass HBox+instance HBoxClass Statusbar+castToHBox :: GObjectClass obj => obj -> HBox+toHBox :: HBoxClass o => o -> HBox+hBoxNew :: Bool -> Int -> IO HBox++module Graphics.UI.Gtk.Layout.HButtonBox+data HButtonBox+instance BoxClass HButtonBox+instance ButtonBoxClass HButtonBox+instance ContainerClass HButtonBox+instance GObjectClass HButtonBox+instance HButtonBoxClass HButtonBox+instance ObjectClass HButtonBox+instance WidgetClass HButtonBox+class ButtonBoxClass o => HButtonBoxClass o+instance HButtonBoxClass HButtonBox+castToHButtonBox :: GObjectClass obj => obj -> HButtonBox+toHButtonBox :: HButtonBoxClass o => o -> HButtonBox+hButtonBoxNew :: IO HButtonBox++module Graphics.UI.Gtk.Layout.HPaned+data HPaned+instance ContainerClass HPaned+instance GObjectClass HPaned+instance HPanedClass HPaned+instance ObjectClass HPaned+instance PanedClass HPaned+instance WidgetClass HPaned+class PanedClass o => HPanedClass o+instance HPanedClass HPaned+castToHPaned :: GObjectClass obj => obj -> HPaned+toHPaned :: HPanedClass o => o -> HPaned+hPanedNew :: IO HPaned++module Graphics.UI.Gtk.Layout.VBox+data VBox+instance BoxClass VBox+instance ContainerClass VBox+instance GObjectClass VBox+instance ObjectClass VBox+instance VBoxClass VBox+instance WidgetClass VBox+class BoxClass o => VBoxClass o+instance VBoxClass ColorSelection+instance VBoxClass FileChooserWidget+instance VBoxClass FontSelection+instance VBoxClass GammaCurve+instance VBoxClass VBox+castToVBox :: GObjectClass obj => obj -> VBox+toVBox :: VBoxClass o => o -> VBox+vBoxNew :: Bool -> Int -> IO VBox++module Graphics.UI.Gtk.Layout.VButtonBox+data VButtonBox+instance BoxClass VButtonBox+instance ButtonBoxClass VButtonBox+instance ContainerClass VButtonBox+instance GObjectClass VButtonBox+instance ObjectClass VButtonBox+instance VButtonBoxClass VButtonBox+instance WidgetClass VButtonBox+class ButtonBoxClass o => VButtonBoxClass o+instance VButtonBoxClass VButtonBox+castToVButtonBox :: GObjectClass obj => obj -> VButtonBox+toVButtonBox :: VButtonBoxClass o => o -> VButtonBox+vButtonBoxNew :: IO VButtonBox++module Graphics.UI.Gtk.Layout.VPaned+data VPaned+instance ContainerClass VPaned+instance GObjectClass VPaned+instance ObjectClass VPaned+instance PanedClass VPaned+instance VPanedClass VPaned+instance WidgetClass VPaned+class PanedClass o => VPanedClass o+instance VPanedClass VPaned+castToVPaned :: GObjectClass obj => obj -> VPaned+toVPaned :: VPanedClass o => o -> VPaned+vPanedNew :: IO VPaned++module Graphics.UI.Gtk.MenuComboToolbar.CheckMenuItem+data CheckMenuItem+instance BinClass CheckMenuItem+instance CheckMenuItemClass CheckMenuItem+instance ContainerClass CheckMenuItem+instance GObjectClass CheckMenuItem+instance ItemClass CheckMenuItem+instance MenuItemClass CheckMenuItem+instance ObjectClass CheckMenuItem+instance WidgetClass CheckMenuItem+class MenuItemClass o => CheckMenuItemClass o+instance CheckMenuItemClass CheckMenuItem+instance CheckMenuItemClass RadioMenuItem+castToCheckMenuItem :: GObjectClass obj => obj -> CheckMenuItem+toCheckMenuItem :: CheckMenuItemClass o => o -> CheckMenuItem+checkMenuItemNew :: IO CheckMenuItem+checkMenuItemNewWithLabel :: String -> IO CheckMenuItem+checkMenuItemNewWithMnemonic :: String -> IO CheckMenuItem+checkMenuItemSetActive :: CheckMenuItemClass self => self -> Bool -> IO ()+checkMenuItemGetActive :: CheckMenuItemClass self => self -> IO Bool+checkMenuItemToggled :: CheckMenuItemClass self => self -> IO ()+checkMenuItemSetInconsistent :: CheckMenuItemClass self => self -> Bool -> IO ()+checkMenuItemGetInconsistent :: CheckMenuItemClass self => self -> IO Bool+checkMenuItemGetDrawAsRadio :: CheckMenuItemClass self => self -> IO Bool+checkMenuItemSetDrawAsRadio :: CheckMenuItemClass self => self -> Bool -> IO ()+checkMenuItemActive :: CheckMenuItemClass self => Attr self Bool+checkMenuItemInconsistent :: CheckMenuItemClass self => Attr self Bool+checkMenuItemDrawAsRadio :: CheckMenuItemClass self => Attr self Bool++module Graphics.UI.Gtk.MenuComboToolbar.ComboBox+data ComboBox+instance BinClass ComboBox+instance ComboBoxClass ComboBox+instance ContainerClass ComboBox+instance GObjectClass ComboBox+instance ObjectClass ComboBox+instance WidgetClass ComboBox+class BinClass o => ComboBoxClass o+instance ComboBoxClass ComboBox+instance ComboBoxClass ComboBoxEntry+castToComboBox :: GObjectClass obj => obj -> ComboBox+toComboBox :: ComboBoxClass o => o -> ComboBox+comboBoxNew :: IO ComboBox+comboBoxNewText :: IO ComboBox+comboBoxNewWithModel :: TreeModelClass model => model -> IO ComboBox+comboBoxSetWrapWidth :: ComboBoxClass self => self -> Int -> IO ()+comboBoxSetRowSpanColumn :: ComboBoxClass self => self -> Int -> IO ()+comboBoxSetColumnSpanColumn :: ComboBoxClass self => self -> Int -> IO ()+comboBoxGetActive :: ComboBoxClass self => self -> IO (Maybe Int)+comboBoxSetActive :: ComboBoxClass self => self -> Int -> IO ()+comboBoxGetActiveIter :: ComboBoxClass self => self -> IO (Maybe TreeIter)+comboBoxSetActiveIter :: ComboBoxClass self => self -> TreeIter -> IO ()+comboBoxGetModel :: ComboBoxClass self => self -> IO (Maybe TreeModel)+comboBoxSetModel :: (ComboBoxClass self, TreeModelClass model) => self -> Maybe model -> IO ()+comboBoxAppendText :: ComboBoxClass self => self -> String -> IO ()+comboBoxInsertText :: ComboBoxClass self => self -> Int -> String -> IO ()+comboBoxPrependText :: ComboBoxClass self => self -> String -> IO ()+comboBoxRemoveText :: ComboBoxClass self => self -> Int -> IO ()+comboBoxPopup :: ComboBoxClass self => self -> IO ()+comboBoxPopdown :: ComboBoxClass self => self -> IO ()+comboBoxGetWrapWidth :: ComboBoxClass self => self -> IO Int+comboBoxGetRowSpanColumn :: ComboBoxClass self => self -> IO Int+comboBoxGetColumnSpanColumn :: ComboBoxClass self => self -> IO Int+comboBoxGetActiveText :: ComboBoxClass self => self -> IO (Maybe String)+comboBoxSetAddTearoffs :: ComboBoxClass self => self -> Bool -> IO ()+comboBoxGetAddTearoffs :: ComboBoxClass self => self -> IO Bool+comboBoxSetFocusOnClick :: ComboBoxClass self => self -> Bool -> IO ()+comboBoxGetFocusOnClick :: ComboBoxClass self => self -> IO Bool+comboBoxModel :: (ComboBoxClass self, TreeModelClass model) => ReadWriteAttr self (Maybe TreeModel) (Maybe model)+comboBoxWrapWidth :: ComboBoxClass self => Attr self Int+comboBoxRowSpanColumn :: ComboBoxClass self => Attr self Int+comboBoxColumnSpanColumn :: ComboBoxClass self => Attr self Int+comboBoxAddTearoffs :: ComboBoxClass self => Attr self Bool+comboBoxHasFrame :: ComboBoxClass self => Attr self Bool+comboBoxFocusOnClick :: ComboBoxClass self => Attr self Bool+onChanged :: ComboBoxClass self => self -> IO () -> IO (ConnectId self)+afterChanged :: ComboBoxClass self => self -> IO () -> IO (ConnectId self)++module Graphics.UI.Gtk.MenuComboToolbar.ComboBoxEntry+data ComboBoxEntry+instance BinClass ComboBoxEntry+instance ComboBoxClass ComboBoxEntry+instance ComboBoxEntryClass ComboBoxEntry+instance ContainerClass ComboBoxEntry+instance GObjectClass ComboBoxEntry+instance ObjectClass ComboBoxEntry+instance WidgetClass ComboBoxEntry+class ComboBoxClass o => ComboBoxEntryClass o+instance ComboBoxEntryClass ComboBoxEntry+castToComboBoxEntry :: GObjectClass obj => obj -> ComboBoxEntry+toComboBoxEntry :: ComboBoxEntryClass o => o -> ComboBoxEntry+comboBoxEntryNew :: IO ComboBoxEntry+comboBoxEntryNewWithModel :: TreeModelClass model => model -> Int -> IO ComboBoxEntry+comboBoxEntryNewText :: IO ComboBoxEntry+comboBoxEntrySetTextColumn :: ComboBoxEntryClass self => self -> Int -> IO ()+comboBoxEntryGetTextColumn :: ComboBoxEntryClass self => self -> IO Int+comboBoxEntryTextColumn :: ComboBoxEntryClass self => Attr self Int++module Graphics.UI.Gtk.MenuComboToolbar.ImageMenuItem+data ImageMenuItem+instance BinClass ImageMenuItem+instance ContainerClass ImageMenuItem+instance GObjectClass ImageMenuItem+instance ImageMenuItemClass ImageMenuItem+instance ItemClass ImageMenuItem+instance MenuItemClass ImageMenuItem+instance ObjectClass ImageMenuItem+instance WidgetClass ImageMenuItem+class MenuItemClass o => ImageMenuItemClass o+instance ImageMenuItemClass ImageMenuItem+castToImageMenuItem :: GObjectClass obj => obj -> ImageMenuItem+toImageMenuItem :: ImageMenuItemClass o => o -> ImageMenuItem+imageMenuItemNew :: IO ImageMenuItem+imageMenuItemNewFromStock :: String -> IO ImageMenuItem+imageMenuItemNewWithLabel :: String -> IO ImageMenuItem+imageMenuItemNewWithMnemonic :: String -> IO ImageMenuItem+imageMenuItemSetImage :: (ImageMenuItemClass self, WidgetClass image) => self -> image -> IO ()+imageMenuItemGetImage :: ImageMenuItemClass self => self -> IO (Maybe Widget)+imageMenuItemImage :: (ImageMenuItemClass self, WidgetClass image) => ReadWriteAttr self (Maybe Widget) image++module Graphics.UI.Gtk.MenuComboToolbar.MenuBar+data MenuBar+instance ContainerClass MenuBar+instance GObjectClass MenuBar+instance MenuBarClass MenuBar+instance MenuShellClass MenuBar+instance ObjectClass MenuBar+instance WidgetClass MenuBar+class MenuShellClass o => MenuBarClass o+instance MenuBarClass MenuBar+castToMenuBar :: GObjectClass obj => obj -> MenuBar+toMenuBar :: MenuBarClass o => o -> MenuBar+data PackDirection+PackDirectionLtr :: PackDirection+PackDirectionRtl :: PackDirection+PackDirectionTtb :: PackDirection+PackDirectionBtt :: PackDirection+instance Enum PackDirection+menuBarNew :: IO MenuBar+menuBarSetPackDirection :: MenuBarClass self => self -> PackDirection -> IO ()+menuBarGetPackDirection :: MenuBarClass self => self -> IO PackDirection+menuBarSetChildPackDirection :: MenuBarClass self => self -> PackDirection -> IO ()+menuBarGetChildPackDirection :: MenuBarClass self => self -> IO PackDirection+menuBarPackDirection :: MenuBarClass self => Attr self PackDirection+menuBarChildPackDirection :: MenuBarClass self => Attr self PackDirection++module Graphics.UI.Gtk.MenuComboToolbar.MenuItem+data MenuItem+instance BinClass MenuItem+instance ContainerClass MenuItem+instance GObjectClass MenuItem+instance ItemClass MenuItem+instance MenuItemClass MenuItem+instance ObjectClass MenuItem+instance WidgetClass MenuItem+class ItemClass o => MenuItemClass o+instance MenuItemClass CheckMenuItem+instance MenuItemClass ImageMenuItem+instance MenuItemClass MenuItem+instance MenuItemClass RadioMenuItem+instance MenuItemClass SeparatorMenuItem+instance MenuItemClass TearoffMenuItem+castToMenuItem :: GObjectClass obj => obj -> MenuItem+toMenuItem :: MenuItemClass o => o -> MenuItem+menuItemNew :: IO MenuItem+menuItemNewWithLabel :: String -> IO MenuItem+menuItemNewWithMnemonic :: String -> IO MenuItem+menuItemSetSubmenu :: (MenuItemClass self, MenuClass submenu) => self -> submenu -> IO ()+menuItemGetSubmenu :: MenuItemClass self => self -> IO (Maybe Widget)+menuItemRemoveSubmenu :: MenuItemClass self => self -> IO ()+menuItemSelect :: MenuItemClass self => self -> IO ()+menuItemDeselect :: MenuItemClass self => self -> IO ()+menuItemActivate :: MenuItemClass self => self -> IO ()+menuItemSetRightJustified :: MenuItemClass self => self -> Bool -> IO ()+menuItemGetRightJustified :: MenuItemClass self => self -> IO Bool+menuItemSetAccelPath :: MenuItemClass self => self -> Maybe String -> IO ()+menuItemSubmenu :: (MenuItemClass self, MenuClass submenu) => ReadWriteAttr self (Maybe Widget) submenu+menuItemRightJustified :: MenuItemClass self => Attr self Bool+onActivateItem :: MenuItemClass self => self -> IO () -> IO (ConnectId self)+afterActivateItem :: MenuItemClass self => self -> IO () -> IO (ConnectId self)+onActivateLeaf :: MenuItemClass self => self -> IO () -> IO (ConnectId self)+afterActivateLeaf :: MenuItemClass self => self -> IO () -> IO (ConnectId self)+onSelect :: ItemClass i => i -> IO () -> IO (ConnectId i)+afterSelect :: ItemClass i => i -> IO () -> IO (ConnectId i)+onDeselect :: ItemClass i => i -> IO () -> IO (ConnectId i)+afterDeselect :: ItemClass i => i -> IO () -> IO (ConnectId i)+onToggle :: ItemClass i => i -> IO () -> IO (ConnectId i)+afterToggle :: ItemClass i => i -> IO () -> IO (ConnectId i)++module Graphics.UI.Gtk.MenuComboToolbar.MenuShell+data MenuShell+instance ContainerClass MenuShell+instance GObjectClass MenuShell+instance MenuShellClass MenuShell+instance ObjectClass MenuShell+instance WidgetClass MenuShell+class ContainerClass o => MenuShellClass o+instance MenuShellClass Menu+instance MenuShellClass MenuBar+instance MenuShellClass MenuShell+castToMenuShell :: GObjectClass obj => obj -> MenuShell+toMenuShell :: MenuShellClass o => o -> MenuShell+menuShellAppend :: (MenuShellClass self, MenuItemClass child) => self -> child -> IO ()+menuShellPrepend :: (MenuShellClass self, MenuItemClass child) => self -> child -> IO ()+menuShellInsert :: (MenuShellClass self, MenuItemClass child) => self -> child -> Int -> IO ()+menuShellDeactivate :: MenuShellClass self => self -> IO ()+menuShellActivateItem :: (MenuShellClass self, MenuItemClass menuItem) => self -> menuItem -> Bool -> IO ()+menuShellSelectItem :: (MenuShellClass self, MenuItemClass menuItem) => self -> menuItem -> IO ()+menuShellDeselect :: MenuShellClass self => self -> IO ()+menuShellSelectFirst :: MenuShellClass self => self -> Bool -> IO ()+menuShellCancel :: MenuShellClass self => self -> IO ()+menuShellSetTakeFocus :: MenuShellClass self => self -> Bool -> IO ()+menuShellGetTakeFocus :: MenuShellClass self => self -> IO Bool+menuShellTakeFocus :: MenuShellClass self => Attr self Bool+onActivateCurrent :: MenuShellClass self => self -> (Bool -> IO ()) -> IO (ConnectId self)+afterActivateCurrent :: MenuShellClass self => self -> (Bool -> IO ()) -> IO (ConnectId self)+onCancel :: MenuShellClass self => self -> IO () -> IO (ConnectId self)+afterCancel :: MenuShellClass self => self -> IO () -> IO (ConnectId self)+onDeactivated :: MenuShellClass self => self -> IO () -> IO (ConnectId self)+afterDeactivated :: MenuShellClass self => self -> IO () -> IO (ConnectId self)+data MenuDirectionType+MenuDirParent :: MenuDirectionType+MenuDirChild :: MenuDirectionType+MenuDirNext :: MenuDirectionType+MenuDirPrev :: MenuDirectionType+instance Enum MenuDirectionType+instance Eq MenuDirectionType+onMoveCurrent :: MenuShellClass self => self -> (MenuDirectionType -> IO ()) -> IO (ConnectId self)+afterMoveCurrent :: MenuShellClass self => self -> (MenuDirectionType -> IO ()) -> IO (ConnectId self)+onSelectionDone :: MenuShellClass self => self -> IO () -> IO (ConnectId self)+afterSelectionDone :: MenuShellClass self => self -> IO () -> IO (ConnectId self)++module Graphics.UI.Gtk.MenuComboToolbar.MenuToolButton+data MenuToolButton+instance BinClass MenuToolButton+instance ContainerClass MenuToolButton+instance GObjectClass MenuToolButton+instance MenuToolButtonClass MenuToolButton+instance ObjectClass MenuToolButton+instance ToolItemClass MenuToolButton+instance WidgetClass MenuToolButton+class ToolItemClass o => MenuToolButtonClass o+instance MenuToolButtonClass MenuToolButton+castToMenuToolButton :: GObjectClass obj => obj -> MenuToolButton+toMenuToolButton :: MenuToolButtonClass o => o -> MenuToolButton+menuToolButtonNew :: WidgetClass iconWidget => Maybe iconWidget -> Maybe String -> IO MenuToolButton+menuToolButtonNewFromStock :: String -> IO MenuToolButton+menuToolButtonSetMenu :: (MenuToolButtonClass self, MenuClass menu) => self -> Maybe menu -> IO ()+menuToolButtonGetMenu :: MenuToolButtonClass self => self -> IO (Maybe Menu)+menuToolButtonSetArrowTooltip :: MenuToolButtonClass self => self -> Tooltips -> String -> String -> IO ()+menuToolButtonMenu :: (MenuToolButtonClass self, MenuClass menu) => ReadWriteAttr self (Maybe Menu) (Maybe menu)+onShowMenu :: MenuToolButtonClass self => self -> IO () -> IO (ConnectId self)+afterShowMenu :: MenuToolButtonClass self => self -> IO () -> IO (ConnectId self)++module Graphics.UI.Gtk.MenuComboToolbar.OptionMenu+data OptionMenu+instance BinClass OptionMenu+instance ButtonClass OptionMenu+instance ContainerClass OptionMenu+instance GObjectClass OptionMenu+instance ObjectClass OptionMenu+instance OptionMenuClass OptionMenu+instance WidgetClass OptionMenu+class ButtonClass o => OptionMenuClass o+instance OptionMenuClass OptionMenu+castToOptionMenu :: GObjectClass obj => obj -> OptionMenu+toOptionMenu :: OptionMenuClass o => o -> OptionMenu+optionMenuNew :: IO OptionMenu+optionMenuGetMenu :: OptionMenuClass self => self -> IO Menu+optionMenuSetMenu :: (OptionMenuClass self, MenuClass menu) => self -> menu -> IO ()+optionMenuRemoveMenu :: OptionMenuClass self => self -> IO ()+optionMenuSetHistory :: OptionMenuClass self => self -> Int -> IO ()+optionMenuGetHistory :: OptionMenuClass self => self -> IO Int+optionMenuMenu :: (OptionMenuClass self, MenuClass menu) => ReadWriteAttr self Menu menu+onOMChanged :: OptionMenuClass self => self -> IO () -> IO (ConnectId self)+afterOMChanged :: OptionMenuClass self => self -> IO () -> IO (ConnectId self)++module Graphics.UI.Gtk.MenuComboToolbar.RadioMenuItem+data RadioMenuItem+instance BinClass RadioMenuItem+instance CheckMenuItemClass RadioMenuItem+instance ContainerClass RadioMenuItem+instance GObjectClass RadioMenuItem+instance ItemClass RadioMenuItem+instance MenuItemClass RadioMenuItem+instance ObjectClass RadioMenuItem+instance RadioMenuItemClass RadioMenuItem+instance WidgetClass RadioMenuItem+class CheckMenuItemClass o => RadioMenuItemClass o+instance RadioMenuItemClass RadioMenuItem+castToRadioMenuItem :: GObjectClass obj => obj -> RadioMenuItem+toRadioMenuItem :: RadioMenuItemClass o => o -> RadioMenuItem+radioMenuItemNew :: IO RadioMenuItem+radioMenuItemNewWithLabel :: String -> IO RadioMenuItem+radioMenuItemNewWithMnemonic :: String -> IO RadioMenuItem+radioMenuItemNewFromWidget :: RadioMenuItem -> IO RadioMenuItem+radioMenuItemNewWithLabelFromWidget :: RadioMenuItem -> String -> IO RadioMenuItem+radioMenuItemNewWithMnemonicFromWidget :: RadioMenuItem -> String -> IO RadioMenuItem++module Graphics.UI.Gtk.MenuComboToolbar.RadioToolButton+data RadioToolButton+instance BinClass RadioToolButton+instance ContainerClass RadioToolButton+instance GObjectClass RadioToolButton+instance ObjectClass RadioToolButton+instance RadioToolButtonClass RadioToolButton+instance ToggleToolButtonClass RadioToolButton+instance ToolButtonClass RadioToolButton+instance ToolItemClass RadioToolButton+instance WidgetClass RadioToolButton+class ToggleToolButtonClass o => RadioToolButtonClass o+instance RadioToolButtonClass RadioToolButton+castToRadioToolButton :: GObjectClass obj => obj -> RadioToolButton+toRadioToolButton :: RadioToolButtonClass o => o -> RadioToolButton+radioToolButtonNew :: IO RadioToolButton+radioToolButtonNewFromStock :: String -> IO RadioToolButton+radioToolButtonNewFromWidget :: RadioToolButtonClass groupMember => groupMember -> IO RadioToolButton+radioToolButtonNewWithStockFromWidget :: RadioToolButtonClass groupMember => groupMember -> String -> IO RadioToolButton+radioToolButtonGetGroup :: RadioToolButtonClass self => self -> IO [RadioToolButton]+radioToolButtonSetGroup :: RadioToolButtonClass self => self -> RadioToolButton -> IO ()+radioToolButtonGroup :: RadioToolButtonClass self => ReadWriteAttr self [RadioToolButton] RadioToolButton++module Graphics.UI.Gtk.MenuComboToolbar.SeparatorMenuItem+data SeparatorMenuItem+instance BinClass SeparatorMenuItem+instance ContainerClass SeparatorMenuItem+instance GObjectClass SeparatorMenuItem+instance ItemClass SeparatorMenuItem+instance MenuItemClass SeparatorMenuItem+instance ObjectClass SeparatorMenuItem+instance SeparatorMenuItemClass SeparatorMenuItem+instance WidgetClass SeparatorMenuItem+class MenuItemClass o => SeparatorMenuItemClass o+instance SeparatorMenuItemClass SeparatorMenuItem+castToSeparatorMenuItem :: GObjectClass obj => obj -> SeparatorMenuItem+toSeparatorMenuItem :: SeparatorMenuItemClass o => o -> SeparatorMenuItem+separatorMenuItemNew :: IO SeparatorMenuItem++module Graphics.UI.Gtk.MenuComboToolbar.SeparatorToolItem+data SeparatorToolItem+instance BinClass SeparatorToolItem+instance ContainerClass SeparatorToolItem+instance GObjectClass SeparatorToolItem+instance ObjectClass SeparatorToolItem+instance SeparatorToolItemClass SeparatorToolItem+instance ToolItemClass SeparatorToolItem+instance WidgetClass SeparatorToolItem+class ToolItemClass o => SeparatorToolItemClass o+instance SeparatorToolItemClass SeparatorToolItem+castToSeparatorToolItem :: GObjectClass obj => obj -> SeparatorToolItem+toSeparatorToolItem :: SeparatorToolItemClass o => o -> SeparatorToolItem+separatorToolItemNew :: IO SeparatorToolItem+separatorToolItemSetDraw :: SeparatorToolItemClass self => self -> Bool -> IO ()+separatorToolItemGetDraw :: SeparatorToolItemClass self => self -> IO Bool+separatorToolItemDraw :: SeparatorToolItemClass self => Attr self Bool++module Graphics.UI.Gtk.MenuComboToolbar.TearoffMenuItem+data TearoffMenuItem+instance BinClass TearoffMenuItem+instance ContainerClass TearoffMenuItem+instance GObjectClass TearoffMenuItem+instance ItemClass TearoffMenuItem+instance MenuItemClass TearoffMenuItem+instance ObjectClass TearoffMenuItem+instance TearoffMenuItemClass TearoffMenuItem+instance WidgetClass TearoffMenuItem+class MenuItemClass o => TearoffMenuItemClass o+instance TearoffMenuItemClass TearoffMenuItem+castToTearoffMenuItem :: GObjectClass obj => obj -> TearoffMenuItem+toTearoffMenuItem :: TearoffMenuItemClass o => o -> TearoffMenuItem+tearoffMenuItemNew :: IO TearoffMenuItem++module Graphics.UI.Gtk.MenuComboToolbar.ToggleToolButton+data ToggleToolButton+instance BinClass ToggleToolButton+instance ContainerClass ToggleToolButton+instance GObjectClass ToggleToolButton+instance ObjectClass ToggleToolButton+instance ToggleToolButtonClass ToggleToolButton+instance ToolButtonClass ToggleToolButton+instance ToolItemClass ToggleToolButton+instance WidgetClass ToggleToolButton+class ToolButtonClass o => ToggleToolButtonClass o+instance ToggleToolButtonClass RadioToolButton+instance ToggleToolButtonClass ToggleToolButton+castToToggleToolButton :: GObjectClass obj => obj -> ToggleToolButton+toToggleToolButton :: ToggleToolButtonClass o => o -> ToggleToolButton+toggleToolButtonNew :: IO ToggleToolButton+toggleToolButtonNewFromStock :: String -> IO ToggleToolButton+toggleToolButtonSetActive :: ToggleToolButtonClass self => self -> Bool -> IO ()+toggleToolButtonGetActive :: ToggleToolButtonClass self => self -> IO Bool+toggleToolButtonActive :: ToggleToolButtonClass self => Attr self Bool+onToolButtonToggled :: ToggleToolButtonClass self => self -> IO () -> IO (ConnectId self)+afterToolButtonToggled :: ToggleToolButtonClass self => self -> IO () -> IO (ConnectId self)++module Graphics.UI.Gtk.MenuComboToolbar.ToolButton+data ToolButton+instance BinClass ToolButton+instance ContainerClass ToolButton+instance GObjectClass ToolButton+instance ObjectClass ToolButton+instance ToolButtonClass ToolButton+instance ToolItemClass ToolButton+instance WidgetClass ToolButton+class ToolItemClass o => ToolButtonClass o+instance ToolButtonClass RadioToolButton+instance ToolButtonClass ToggleToolButton+instance ToolButtonClass ToolButton+castToToolButton :: GObjectClass obj => obj -> ToolButton+toToolButton :: ToolButtonClass o => o -> ToolButton+toolButtonNew :: WidgetClass iconWidget => Maybe iconWidget -> Maybe String -> IO ToolButton+toolButtonNewFromStock :: String -> IO ToolButton+toolButtonSetLabel :: ToolButtonClass self => self -> Maybe String -> IO ()+toolButtonGetLabel :: ToolButtonClass self => self -> IO (Maybe String)+toolButtonSetUseUnderline :: ToolButtonClass self => self -> Bool -> IO ()+toolButtonGetUseUnderline :: ToolButtonClass self => self -> IO Bool+toolButtonSetStockId :: ToolButtonClass self => self -> Maybe String -> IO ()+toolButtonGetStockId :: ToolButtonClass self => self -> IO (Maybe String)+toolButtonSetIconWidget :: (ToolButtonClass self, WidgetClass iconWidget) => self -> Maybe iconWidget -> IO ()+toolButtonGetIconWidget :: ToolButtonClass self => self -> IO (Maybe Widget)+toolButtonSetLabelWidget :: (ToolButtonClass self, WidgetClass labelWidget) => self -> Maybe labelWidget -> IO ()+toolButtonGetLabelWidget :: ToolButtonClass self => self -> IO (Maybe Widget)+toolButtonSetIconName :: ToolButtonClass self => self -> String -> IO ()+toolButtonGetIconName :: ToolButtonClass self => self -> IO String+toolButtonLabel :: ToolButtonClass self => Attr self (Maybe String)+toolButtonUseUnderline :: ToolButtonClass self => Attr self Bool+toolButtonLabelWidget :: (ToolButtonClass self, WidgetClass labelWidget) => ReadWriteAttr self (Maybe Widget) (Maybe labelWidget)+toolButtonStockId :: ToolButtonClass self => ReadWriteAttr self (Maybe String) (Maybe String)+toolButtonIconName :: ToolButtonClass self => Attr self String+toolButtonIconWidget :: (ToolButtonClass self, WidgetClass iconWidget) => ReadWriteAttr self (Maybe Widget) (Maybe iconWidget)+onToolButtonClicked :: ToolButtonClass self => self -> IO () -> IO (ConnectId self)+afterToolButtonClicked :: ToolButtonClass self => self -> IO () -> IO (ConnectId self)++module Graphics.UI.Gtk.MenuComboToolbar.ToolItem+data ToolItem+instance BinClass ToolItem+instance ContainerClass ToolItem+instance GObjectClass ToolItem+instance ObjectClass ToolItem+instance ToolItemClass ToolItem+instance WidgetClass ToolItem+class BinClass o => ToolItemClass o+instance ToolItemClass MenuToolButton+instance ToolItemClass RadioToolButton+instance ToolItemClass SeparatorToolItem+instance ToolItemClass ToggleToolButton+instance ToolItemClass ToolButton+instance ToolItemClass ToolItem+castToToolItem :: GObjectClass obj => obj -> ToolItem+toToolItem :: ToolItemClass o => o -> ToolItem+toolItemNew :: IO ToolItem+toolItemSetHomogeneous :: ToolItemClass self => self -> Bool -> IO ()+toolItemGetHomogeneous :: ToolItemClass self => self -> IO Bool+toolItemSetExpand :: ToolItemClass self => self -> Bool -> IO ()+toolItemGetExpand :: ToolItemClass self => self -> IO Bool+toolItemSetTooltip :: ToolItemClass self => self -> Tooltips -> String -> String -> IO ()+toolItemSetUseDragWindow :: ToolItemClass self => self -> Bool -> IO ()+toolItemGetUseDragWindow :: ToolItemClass self => self -> IO Bool+toolItemSetVisibleHorizontal :: ToolItemClass self => self -> Bool -> IO ()+toolItemGetVisibleHorizontal :: ToolItemClass self => self -> IO Bool+toolItemSetVisibleVertical :: ToolItemClass self => self -> Bool -> IO ()+toolItemGetVisibleVertical :: ToolItemClass self => self -> IO Bool+toolItemSetIsImportant :: ToolItemClass self => self -> Bool -> IO ()+toolItemGetIsImportant :: ToolItemClass self => self -> IO Bool+type IconSize = Int+toolItemGetIconSize :: ToolItemClass self => self -> IO IconSize+data Orientation+OrientationHorizontal :: Orientation+OrientationVertical :: Orientation+instance Enum Orientation+instance Eq Orientation+toolItemGetOrientation :: ToolItemClass self => self -> IO Orientation+data ToolbarStyle+ToolbarIcons :: ToolbarStyle+ToolbarText :: ToolbarStyle+ToolbarBoth :: ToolbarStyle+ToolbarBothHoriz :: ToolbarStyle+instance Enum ToolbarStyle+instance Eq ToolbarStyle+toolItemGetToolbarStyle :: ToolItemClass self => self -> IO ToolbarStyle+data ReliefStyle+ReliefNormal :: ReliefStyle+ReliefHalf :: ReliefStyle+ReliefNone :: ReliefStyle+instance Enum ReliefStyle+instance Eq ReliefStyle+toolItemGetReliefStyle :: ToolItemClass self => self -> IO ReliefStyle+toolItemRetrieveProxyMenuItem :: ToolItemClass self => self -> IO (Maybe Widget)+toolItemGetProxyMenuItem :: ToolItemClass self => self -> String -> IO (Maybe Widget)+toolItemSetProxyMenuItem :: (ToolItemClass self, MenuItemClass menuItem) => self -> String -> menuItem -> IO ()+toolItemVisibleHorizontal :: ToolItemClass self => Attr self Bool+toolItemVisibleVertical :: ToolItemClass self => Attr self Bool+toolItemIsImportant :: ToolItemClass self => Attr self Bool+toolItemExpand :: ToolItemClass self => Attr self Bool+toolItemHomogeneous :: ToolItemClass self => Attr self Bool+toolItemUseDragWindow :: ToolItemClass self => Attr self Bool++module Graphics.UI.Gtk.Misc.Adjustment+data Adjustment+instance AdjustmentClass Adjustment+instance GObjectClass Adjustment+instance ObjectClass Adjustment+class ObjectClass o => AdjustmentClass o+instance AdjustmentClass Adjustment+castToAdjustment :: GObjectClass obj => obj -> Adjustment+toAdjustment :: AdjustmentClass o => o -> Adjustment+adjustmentNew :: Double -> Double -> Double -> Double -> Double -> Double -> IO Adjustment+adjustmentSetLower :: Adjustment -> Double -> IO ()+adjustmentGetLower :: Adjustment -> IO Double+adjustmentSetPageIncrement :: Adjustment -> Double -> IO ()+adjustmentGetPageIncrement :: Adjustment -> IO Double+adjustmentSetPageSize :: Adjustment -> Double -> IO ()+adjustmentGetPageSize :: Adjustment -> IO Double+adjustmentSetStepIncrement :: Adjustment -> Double -> IO ()+adjustmentGetStepIncrement :: Adjustment -> IO Double+adjustmentSetUpper :: Adjustment -> Double -> IO ()+adjustmentGetUpper :: Adjustment -> IO Double+adjustmentSetValue :: Adjustment -> Double -> IO ()+adjustmentGetValue :: Adjustment -> IO Double+adjustmentClampPage :: Adjustment -> Double -> Double -> IO ()+adjustmentValue :: Attr Adjustment Double+adjustmentLower :: Attr Adjustment Double+adjustmentUpper :: Attr Adjustment Double+adjustmentStepIncrement :: Attr Adjustment Double+adjustmentPageIncrement :: Attr Adjustment Double+adjustmentPageSize :: Attr Adjustment Double+onAdjChanged :: Adjustment -> IO () -> IO (ConnectId Adjustment)+afterAdjChanged :: Adjustment -> IO () -> IO (ConnectId Adjustment)+onValueChanged :: Adjustment -> IO () -> IO (ConnectId Adjustment)+afterValueChanged :: Adjustment -> IO () -> IO (ConnectId Adjustment)++module Graphics.UI.Gtk.Misc.Arrow+data Arrow+instance ArrowClass Arrow+instance GObjectClass Arrow+instance MiscClass Arrow+instance ObjectClass Arrow+instance WidgetClass Arrow+class MiscClass o => ArrowClass o+instance ArrowClass Arrow+castToArrow :: GObjectClass obj => obj -> Arrow+toArrow :: ArrowClass o => o -> Arrow+data ArrowType+ArrowUp :: ArrowType+ArrowDown :: ArrowType+ArrowLeft :: ArrowType+ArrowRight :: ArrowType+instance Enum ArrowType+instance Eq ArrowType+data ShadowType+ShadowNone :: ShadowType+ShadowIn :: ShadowType+ShadowOut :: ShadowType+ShadowEtchedIn :: ShadowType+ShadowEtchedOut :: ShadowType+instance Enum ShadowType+instance Eq ShadowType+arrowNew :: ArrowType -> ShadowType -> IO Arrow+arrowSet :: ArrowClass self => self -> ArrowType -> ShadowType -> IO ()+arrowArrowType :: ArrowClass self => Attr self ArrowType+arrowShadowType :: ArrowClass self => Attr self ShadowType++module Graphics.UI.Gtk.Misc.Calendar+data Calendar+instance CalendarClass Calendar+instance GObjectClass Calendar+instance ObjectClass Calendar+instance WidgetClass Calendar+class WidgetClass o => CalendarClass o+instance CalendarClass Calendar+castToCalendar :: GObjectClass obj => obj -> Calendar+toCalendar :: CalendarClass o => o -> Calendar+data CalendarDisplayOptions+CalendarShowHeading :: CalendarDisplayOptions+CalendarShowDayNames :: CalendarDisplayOptions+CalendarNoMonthChange :: CalendarDisplayOptions+CalendarShowWeekNumbers :: CalendarDisplayOptions+CalendarWeekStartMonday :: CalendarDisplayOptions+instance Bounded CalendarDisplayOptions+instance Enum CalendarDisplayOptions+instance Eq CalendarDisplayOptions+instance Flags CalendarDisplayOptions+calendarNew :: IO Calendar+calendarSelectMonth :: CalendarClass self => self -> Int -> Int -> IO Bool+calendarSelectDay :: CalendarClass self => self -> Int -> IO ()+calendarMarkDay :: CalendarClass self => self -> Int -> IO Bool+calendarUnmarkDay :: CalendarClass self => self -> Int -> IO Bool+calendarClearMarks :: CalendarClass self => self -> IO ()+calendarDisplayOptions :: CalendarClass self => self -> [CalendarDisplayOptions] -> IO ()+calendarSetDisplayOptions :: CalendarClass self => self -> [CalendarDisplayOptions] -> IO ()+calendarGetDisplayOptions :: CalendarClass self => self -> IO [CalendarDisplayOptions]+calendarGetDate :: CalendarClass self => self -> IO (Int, Int, Int)+calendarFreeze :: CalendarClass self => self -> IO a -> IO a+calendarYear :: CalendarClass self => Attr self Int+calendarMonth :: CalendarClass self => Attr self Int+calendarDay :: CalendarClass self => Attr self Int+calendarShowHeading :: CalendarClass self => Attr self Bool+calendarShowDayNames :: CalendarClass self => Attr self Bool+calendarNoMonthChange :: CalendarClass self => Attr self Bool+calendarShowWeekNumbers :: CalendarClass self => Attr self Bool+onDaySelected :: CalendarClass self => self -> IO () -> IO (ConnectId self)+afterDaySelected :: CalendarClass self => self -> IO () -> IO (ConnectId self)+onDaySelectedDoubleClick :: CalendarClass self => self -> IO () -> IO (ConnectId self)+afterDaySelectedDoubleClick :: CalendarClass self => self -> IO () -> IO (ConnectId self)+onMonthChanged :: CalendarClass self => self -> IO () -> IO (ConnectId self)+afterMonthChanged :: CalendarClass self => self -> IO () -> IO (ConnectId self)+onNextMonth :: CalendarClass self => self -> IO () -> IO (ConnectId self)+afterNextMonth :: CalendarClass self => self -> IO () -> IO (ConnectId self)+onNextYear :: CalendarClass self => self -> IO () -> IO (ConnectId self)+afterNextYear :: CalendarClass self => self -> IO () -> IO (ConnectId self)+onPrevMonth :: CalendarClass self => self -> IO () -> IO (ConnectId self)+afterPrevMonth :: CalendarClass self => self -> IO () -> IO (ConnectId self)+onPrevYear :: CalendarClass self => self -> IO () -> IO (ConnectId self)+afterPrevYear :: CalendarClass self => self -> IO () -> IO (ConnectId self)++module Graphics.UI.Gtk.Misc.DrawingArea+data DrawingArea+instance DrawingAreaClass DrawingArea+instance GObjectClass DrawingArea+instance ObjectClass DrawingArea+instance WidgetClass DrawingArea+class WidgetClass o => DrawingAreaClass o+instance DrawingAreaClass Curve+instance DrawingAreaClass DrawingArea+castToDrawingArea :: GObjectClass obj => obj -> DrawingArea+toDrawingArea :: DrawingAreaClass o => o -> DrawingArea+drawingAreaNew :: IO DrawingArea+drawingAreaGetDrawWindow :: DrawingArea -> IO DrawWindow+drawingAreaGetSize :: DrawingArea -> IO (Int, Int)++module Graphics.UI.Gtk.Misc.EventBox+data EventBox+instance BinClass EventBox+instance ContainerClass EventBox+instance EventBoxClass EventBox+instance GObjectClass EventBox+instance ObjectClass EventBox+instance WidgetClass EventBox+class BinClass o => EventBoxClass o+instance EventBoxClass EventBox+castToEventBox :: GObjectClass obj => obj -> EventBox+toEventBox :: EventBoxClass o => o -> EventBox+eventBoxNew :: IO EventBox+eventBoxSetVisibleWindow :: EventBox -> Bool -> IO ()+eventBoxGetVisibleWindow :: EventBox -> IO Bool+eventBoxSetAboveChild :: EventBox -> Bool -> IO ()+eventBoxGetAboveChild :: EventBox -> IO Bool+eventBoxVisibleWindow :: Attr EventBox Bool+eventBoxAboveChild :: Attr EventBox Bool++module Graphics.UI.Gtk.Misc.HandleBox+data HandleBox+instance BinClass HandleBox+instance ContainerClass HandleBox+instance GObjectClass HandleBox+instance HandleBoxClass HandleBox+instance ObjectClass HandleBox+instance WidgetClass HandleBox+class BinClass o => HandleBoxClass o+instance HandleBoxClass HandleBox+castToHandleBox :: GObjectClass obj => obj -> HandleBox+toHandleBox :: HandleBoxClass o => o -> HandleBox+handleBoxNew :: IO HandleBox+data ShadowType+ShadowNone :: ShadowType+ShadowIn :: ShadowType+ShadowOut :: ShadowType+ShadowEtchedIn :: ShadowType+ShadowEtchedOut :: ShadowType+instance Enum ShadowType+instance Eq ShadowType+handleBoxSetShadowType :: HandleBoxClass self => self -> ShadowType -> IO ()+handleBoxGetShadowType :: HandleBoxClass self => self -> IO ShadowType+data PositionType+PosLeft :: PositionType+PosRight :: PositionType+PosTop :: PositionType+PosBottom :: PositionType+instance Enum PositionType+instance Eq PositionType+handleBoxSetHandlePosition :: HandleBoxClass self => self -> PositionType -> IO ()+handleBoxGetHandlePosition :: HandleBoxClass self => self -> IO PositionType+handleBoxSetSnapEdge :: HandleBoxClass self => self -> PositionType -> IO ()+handleBoxGetSnapEdge :: HandleBoxClass self => self -> IO PositionType+handleBoxShadowType :: HandleBoxClass self => Attr self ShadowType+handleBoxHandlePosition :: HandleBoxClass self => Attr self PositionType+handleBoxSnapEdge :: HandleBoxClass self => Attr self PositionType+handleBoxSnapEdgeSet :: HandleBoxClass self => Attr self Bool+onChildAttached :: HandleBoxClass self => self -> IO () -> IO (ConnectId self)+afterChildAttached :: HandleBoxClass self => self -> IO () -> IO (ConnectId self)+onChildDetached :: HandleBoxClass self => self -> IO () -> IO (ConnectId self)+afterChildDetached :: HandleBoxClass self => self -> IO () -> IO (ConnectId self)++module Graphics.UI.Gtk.Misc.Tooltips+data Tooltips+instance GObjectClass Tooltips+instance ObjectClass Tooltips+instance TooltipsClass Tooltips+class ObjectClass o => TooltipsClass o+instance TooltipsClass Tooltips+castToTooltips :: GObjectClass obj => obj -> Tooltips+toTooltips :: TooltipsClass o => o -> Tooltips+tooltipsNew :: IO Tooltips+tooltipsEnable :: TooltipsClass self => self -> IO ()+tooltipsDisable :: TooltipsClass self => self -> IO ()+tooltipsSetDelay :: TooltipsClass self => self -> Int -> IO ()+tooltipsSetTip :: (TooltipsClass self, WidgetClass widget) => self -> widget -> String -> String -> IO ()+tooltipsDataGet :: WidgetClass w => w -> IO (Maybe (Tooltips, String, String))++module Graphics.UI.Gtk.Misc.Viewport+data Viewport+instance BinClass Viewport+instance ContainerClass Viewport+instance GObjectClass Viewport+instance ObjectClass Viewport+instance ViewportClass Viewport+instance WidgetClass Viewport+class BinClass o => ViewportClass o+instance ViewportClass Viewport+castToViewport :: GObjectClass obj => obj -> Viewport+toViewport :: ViewportClass o => o -> Viewport+viewportNew :: Adjustment -> Adjustment -> IO Viewport+viewportGetHAdjustment :: ViewportClass self => self -> IO Adjustment+viewportGetVAdjustment :: ViewportClass self => self -> IO Adjustment+viewportSetHAdjustment :: ViewportClass self => self -> Adjustment -> IO ()+viewportSetVAdjustment :: ViewportClass self => self -> Adjustment -> IO ()+data ShadowType+ShadowNone :: ShadowType+ShadowIn :: ShadowType+ShadowOut :: ShadowType+ShadowEtchedIn :: ShadowType+ShadowEtchedOut :: ShadowType+instance Enum ShadowType+instance Eq ShadowType+viewportSetShadowType :: ViewportClass self => self -> ShadowType -> IO ()+viewportGetShadowType :: ViewportClass self => self -> IO ShadowType+viewportHAdjustment :: ViewportClass self => Attr self Adjustment+viewportVAdjustment :: ViewportClass self => Attr self Adjustment+viewportShadowType :: ViewportClass self => Attr self ShadowType++module Graphics.UI.Gtk.Mogul.WidgetTable+type WidgetName = String+widgetLookup :: WidgetClass w => WidgetName -> String -> (ForeignPtr w -> w) -> IO w+newNamedWidget :: WidgetClass w => WidgetName -> IO w -> IO w+isValidName :: WidgetName -> IO Bool++module Graphics.UI.Gtk.Mogul.GetWidget+getMisc :: String -> IO Misc+getLabel :: String -> IO Label+getAccelLabel :: String -> IO AccelLabel+getTipsQuery :: String -> IO TipsQuery+getArrow :: String -> IO Arrow+getImage :: String -> IO Image+getContainer :: String -> IO Container+getBin :: String -> IO Bin+getAlignment :: String -> IO Alignment+getFrame :: String -> IO Frame+getAspectFrame :: String -> IO AspectFrame+getButton :: String -> IO Button+getToggleButton :: String -> IO ToggleButton+getCheckButton :: String -> IO CheckButton+getRadioButton :: String -> IO RadioButton+getOptionMenu :: String -> IO OptionMenu+getItem :: String -> IO Item+getMenuItem :: String -> IO MenuItem+getCheckMenuItem :: String -> IO CheckMenuItem+getRadioMenuItem :: String -> IO RadioMenuItem+getTearoffMenuItem :: String -> IO TearoffMenuItem+getListItem :: String -> IO ListItem+getWindow :: String -> IO Window+getDialog :: String -> IO Dialog+getColorSelectionDialog :: String -> IO ColorSelectionDialog+getFileSelection :: String -> IO FileSelection+getFontSelectionDialog :: String -> IO FontSelectionDialog+getInputDialog :: String -> IO InputDialog+getMessageDialog :: String -> IO MessageDialog+getEventBox :: String -> IO EventBox+getHandleBox :: String -> IO HandleBox+getScrolledWindow :: String -> IO ScrolledWindow+getViewport :: String -> IO Viewport+getBox :: String -> IO Box+getButtonBox :: String -> IO ButtonBox+getHButtonBox :: String -> IO HButtonBox+getVButtonBox :: String -> IO VButtonBox+getVBox :: String -> IO VBox+getColorSelection :: String -> IO ColorSelection+getFontSelection :: String -> IO FontSelection+getGammaCurve :: String -> IO GammaCurve+getHBox :: String -> IO HBox+getCombo :: String -> IO Combo+getStatusbar :: String -> IO Statusbar+getCList :: String -> IO CList+getCTree :: String -> IO CTree+getFixed :: String -> IO Fixed+getPaned :: String -> IO Paned+getHPaned :: String -> IO HPaned+getVPaned :: String -> IO VPaned+getLayout :: String -> IO Layout+getList :: String -> IO List+getMenuShell :: String -> IO MenuShell+getMenu :: String -> IO Menu+getMenuBar :: String -> IO MenuBar+getNotebook :: String -> IO Notebook+getTable :: String -> IO Table+getTextView :: String -> IO TextView+getToolbar :: String -> IO Toolbar+getTreeView :: String -> IO TreeView+getCalendar :: String -> IO Calendar+getDrawingArea :: String -> IO DrawingArea+getCurve :: String -> IO Curve+getEntry :: String -> IO Entry+getSpinButton :: String -> IO SpinButton+getRuler :: String -> IO Ruler+getHRuler :: String -> IO HRuler+getVRuler :: String -> IO VRuler+getRange :: String -> IO Range+getScale :: String -> IO Scale+getHScale :: String -> IO HScale+getVScale :: String -> IO VScale+getScrollbar :: String -> IO Scrollbar+getHScrollbar :: String -> IO HScrollbar+getVScrollbar :: String -> IO VScrollbar+getSeparator :: String -> IO Separator+getHSeparator :: String -> IO HSeparator+getVSeparator :: String -> IO VSeparator+getInvisible :: String -> IO Invisible+getPreview :: String -> IO Preview+getProgressBar :: String -> IO ProgressBar++module Graphics.UI.Gtk.MozEmbed+data MozEmbed+instance BinClass MozEmbed+instance ContainerClass MozEmbed+instance GObjectClass MozEmbed+instance MozEmbedClass MozEmbed+instance ObjectClass MozEmbed+instance WidgetClass MozEmbed+mozEmbedNew :: IO MozEmbed+mozEmbedSetCompPath :: String -> IO ()+mozEmbedDefaultCompPath :: String+mozEmbedSetProfilePath :: FilePath -> String -> IO ()+mozEmbedPushStartup :: IO ()+mozEmbedPopStartup :: IO ()+mozEmbedLoadUrl :: MozEmbed -> String -> IO ()+mozEmbedStopLoad :: MozEmbed -> IO ()+mozEmbedRenderData :: MozEmbed -> String -> String -> String -> IO ()+mozEmbedOpenStream :: MozEmbed -> String -> String -> IO ()+mozEmbedAppendData :: MozEmbed -> String -> IO ()+mozEmbedCloseStream :: MozEmbed -> IO ()+mozEmbedGoBack :: MozEmbed -> IO ()+mozEmbedGoForward :: MozEmbed -> IO ()+mozEmbedCanGoBack :: MozEmbed -> IO Bool+mozEmbedCanGoForward :: MozEmbed -> IO Bool+mozEmbedGetTitle :: MozEmbed -> IO String+mozEmbedGetLocation :: MozEmbed -> IO String+mozEmbedGetLinkMessage :: MozEmbed -> IO String+mozEmbedGetJsStatus :: MozEmbed -> IO String+onOpenURI :: MozEmbed -> (String -> IO Bool) -> IO (ConnectId MozEmbed)+onKeyDown :: MozEmbed -> (Ptr a -> IO Int) -> IO (ConnectId MozEmbed)+onKeyPress :: MozEmbed -> (Ptr a -> IO Int) -> IO (ConnectId MozEmbed)+onKeyUp :: MozEmbed -> (Ptr a -> IO Int) -> IO (ConnectId MozEmbed)+onMouseDown :: MozEmbed -> (Ptr a -> IO Int) -> IO (ConnectId MozEmbed)+onMouseUp :: MozEmbed -> (Ptr a -> IO Int) -> IO (ConnectId MozEmbed)+onMouseClick :: MozEmbed -> (Ptr a -> IO Int) -> IO (ConnectId MozEmbed)+onMouseDoubleClick :: MozEmbed -> (Ptr a -> IO Int) -> IO (ConnectId MozEmbed)+onMouseOver :: MozEmbed -> (Ptr a -> IO Int) -> IO (ConnectId MozEmbed)+onMouseOut :: MozEmbed -> (Ptr a -> IO Int) -> IO (ConnectId MozEmbed)++module Graphics.UI.Gtk.Multiline.TextView+data TextView+instance ContainerClass TextView+instance GObjectClass TextView+instance ObjectClass TextView+instance TextViewClass TextView+instance WidgetClass TextView+class ContainerClass o => TextViewClass o+instance TextViewClass SourceView+instance TextViewClass TextView+data TextChildAnchor+instance GObjectClass TextChildAnchor+instance TextChildAnchorClass TextChildAnchor+class GObjectClass o => TextChildAnchorClass o+instance TextChildAnchorClass TextChildAnchor+castToTextView :: GObjectClass obj => obj -> TextView+toTextView :: TextViewClass o => o -> TextView+data DeleteType+DeleteChars :: DeleteType+DeleteWordEnds :: DeleteType+DeleteWords :: DeleteType+DeleteDisplayLines :: DeleteType+DeleteDisplayLineEnds :: DeleteType+DeleteParagraphEnds :: DeleteType+DeleteParagraphs :: DeleteType+DeleteWhitespace :: DeleteType+instance Enum DeleteType+instance Eq DeleteType+data DirectionType+DirTabForward :: DirectionType+DirTabBackward :: DirectionType+DirUp :: DirectionType+DirDown :: DirectionType+DirLeft :: DirectionType+DirRight :: DirectionType+instance Enum DirectionType+instance Eq DirectionType+data Justification+JustifyLeft :: Justification+JustifyRight :: Justification+JustifyCenter :: Justification+JustifyFill :: Justification+instance Enum Justification+instance Eq Justification+data MovementStep+MovementLogicalPositions :: MovementStep+MovementVisualPositions :: MovementStep+MovementWords :: MovementStep+MovementDisplayLines :: MovementStep+MovementDisplayLineEnds :: MovementStep+MovementParagraphs :: MovementStep+MovementParagraphEnds :: MovementStep+MovementPages :: MovementStep+MovementBufferEnds :: MovementStep+MovementHorizontalPages :: MovementStep+instance Enum MovementStep+instance Eq MovementStep+data TextWindowType+TextWindowPrivate :: TextWindowType+TextWindowWidget :: TextWindowType+TextWindowText :: TextWindowType+TextWindowLeft :: TextWindowType+TextWindowRight :: TextWindowType+TextWindowTop :: TextWindowType+TextWindowBottom :: TextWindowType+instance Enum TextWindowType+instance Eq TextWindowType+data WrapMode+WrapNone :: WrapMode+WrapChar :: WrapMode+WrapWord :: WrapMode+WrapWordChar :: WrapMode+instance Enum WrapMode+instance Eq WrapMode+textViewNew :: IO TextView+textViewNewWithBuffer :: TextBufferClass buffer => buffer -> IO TextView+textViewSetBuffer :: (TextViewClass self, TextBufferClass buffer) => self -> buffer -> IO ()+textViewGetBuffer :: TextViewClass self => self -> IO TextBuffer+textViewScrollToMark :: (TextViewClass self, TextMarkClass mark) => self -> mark -> Double -> Maybe (Double, Double) -> IO ()+textViewScrollToIter :: TextViewClass self => self -> TextIter -> Double -> Maybe (Double, Double) -> IO Bool+textViewScrollMarkOnscreen :: (TextViewClass self, TextMarkClass mark) => self -> mark -> IO ()+textViewMoveMarkOnscreen :: (TextViewClass self, TextMarkClass mark) => self -> mark -> IO Bool+textViewPlaceCursorOnscreen :: TextViewClass self => self -> IO Bool+textViewGetLineAtY :: TextViewClass self => self -> Int -> IO (TextIter, Int)+textViewGetLineYrange :: TextViewClass self => self -> TextIter -> IO (Int, Int)+textViewGetIterAtLocation :: TextViewClass self => self -> Int -> Int -> IO TextIter+textViewBufferToWindowCoords :: TextViewClass self => self -> TextWindowType -> (Int, Int) -> IO (Int, Int)+textViewWindowToBufferCoords :: TextViewClass self => self -> TextWindowType -> (Int, Int) -> IO (Int, Int)+textViewGetWindow :: TextViewClass self => self -> TextWindowType -> IO (Maybe DrawWindow)+textViewGetWindowType :: TextViewClass self => self -> DrawWindow -> IO TextWindowType+textViewSetBorderWindowSize :: TextViewClass self => self -> TextWindowType -> Int -> IO ()+textViewGetBorderWindowSize :: TextViewClass self => self -> TextWindowType -> IO Int+textViewForwardDisplayLine :: TextViewClass self => self -> TextIter -> IO Bool+textViewBackwardDisplayLine :: TextViewClass self => self -> TextIter -> IO Bool+textViewForwardDisplayLineEnd :: TextViewClass self => self -> TextIter -> IO Bool+textViewBackwardDisplayLineStart :: TextViewClass self => self -> TextIter -> IO Bool+textViewStartsDisplayLine :: TextViewClass self => self -> TextIter -> IO Bool+textViewMoveVisually :: TextViewClass self => self -> TextIter -> Int -> IO Bool+textViewAddChildAtAnchor :: (TextViewClass self, WidgetClass child) => self -> child -> TextChildAnchor -> IO ()+textChildAnchorNew :: IO TextChildAnchor+textChildAnchorGetWidgets :: TextChildAnchor -> IO [Widget]+textChildAnchorGetDeleted :: TextChildAnchor -> IO Bool+textViewAddChildInWindow :: (TextViewClass self, WidgetClass child) => self -> child -> TextWindowType -> Int -> Int -> IO ()+textViewMoveChild :: (TextViewClass self, WidgetClass child) => self -> child -> Int -> Int -> IO ()+textViewSetWrapMode :: TextViewClass self => self -> WrapMode -> IO ()+textViewGetWrapMode :: TextViewClass self => self -> IO WrapMode+textViewSetEditable :: TextViewClass self => self -> Bool -> IO ()+textViewGetEditable :: TextViewClass self => self -> IO Bool+textViewSetCursorVisible :: TextViewClass self => self -> Bool -> IO ()+textViewGetCursorVisible :: TextViewClass self => self -> IO Bool+textViewSetPixelsAboveLines :: TextViewClass self => self -> Int -> IO ()+textViewGetPixelsAboveLines :: TextViewClass self => self -> IO Int+textViewSetPixelsBelowLines :: TextViewClass self => self -> Int -> IO ()+textViewGetPixelsBelowLines :: TextViewClass self => self -> IO Int+textViewSetPixelsInsideWrap :: TextViewClass self => self -> Int -> IO ()+textViewGetPixelsInsideWrap :: TextViewClass self => self -> IO Int+textViewSetJustification :: TextViewClass self => self -> Justification -> IO ()+textViewGetJustification :: TextViewClass self => self -> IO Justification+textViewSetLeftMargin :: TextViewClass self => self -> Int -> IO ()+textViewGetLeftMargin :: TextViewClass self => self -> IO Int+textViewSetRightMargin :: TextViewClass self => self -> Int -> IO ()+textViewGetRightMargin :: TextViewClass self => self -> IO Int+textViewSetIndent :: TextViewClass self => self -> Int -> IO ()+textViewGetIndent :: TextViewClass self => self -> IO Int+textViewGetDefaultAttributes :: TextViewClass self => self -> IO TextAttributes+textViewGetVisibleRect :: TextViewClass self => self -> IO Rectangle+textViewGetIterLocation :: TextViewClass self => self -> TextIter -> IO Rectangle+textViewGetIterAtPosition :: TextViewClass self => self -> Int -> Int -> IO (TextIter, Int)+textViewSetOverwrite :: TextViewClass self => self -> Bool -> IO ()+textViewGetOverwrite :: TextViewClass self => self -> IO Bool+textViewSetAcceptsTab :: TextViewClass self => self -> Bool -> IO ()+textViewGetAcceptsTab :: TextViewClass self => self -> IO Bool+textViewPixelsAboveLines :: TextViewClass self => Attr self Int+textViewPixelsBelowLines :: TextViewClass self => Attr self Int+textViewPixelsInsideWrap :: TextViewClass self => Attr self Int+textViewEditable :: TextViewClass self => Attr self Bool+textViewWrapMode :: TextViewClass self => Attr self WrapMode+textViewJustification :: TextViewClass self => Attr self Justification+textViewLeftMargin :: TextViewClass self => Attr self Int+textViewRightMargin :: TextViewClass self => Attr self Int+textViewIndent :: TextViewClass self => Attr self Int+textViewCursorVisible :: TextViewClass self => Attr self Bool+textViewBuffer :: TextViewClass self => Attr self TextBuffer+textViewOverwrite :: TextViewClass self => Attr self Bool+textViewAcceptsTab :: TextViewClass self => Attr self Bool+onCopyClipboard :: TextViewClass self => self -> IO () -> IO (ConnectId self)+afterCopyClipboard :: TextViewClass self => self -> IO () -> IO (ConnectId self)+onCutClipboard :: TextViewClass self => self -> IO () -> IO (ConnectId self)+afterCutClipboard :: TextViewClass self => self -> IO () -> IO (ConnectId self)+onDeleteFromCursor :: TextViewClass self => self -> (DeleteType -> Int -> IO ()) -> IO (ConnectId self)+afterDeleteFromCursor :: TextViewClass self => self -> (DeleteType -> Int -> IO ()) -> IO (ConnectId self)+onInsertAtCursor :: TextViewClass self => self -> (String -> IO ()) -> IO (ConnectId self)+afterInsertAtCursor :: TextViewClass self => self -> (String -> IO ()) -> IO (ConnectId self)+onMoveCursor :: TextViewClass self => self -> (MovementStep -> Int -> Bool -> IO ()) -> IO (ConnectId self)+afterMoveCursor :: TextViewClass self => self -> (MovementStep -> Int -> Bool -> IO ()) -> IO (ConnectId self)+onMoveFocus :: TextViewClass self => self -> (DirectionType -> IO ()) -> IO (ConnectId self)+afterMoveFocus :: TextViewClass self => self -> (DirectionType -> IO ()) -> IO (ConnectId self)+onPageHorizontally :: TextViewClass self => self -> (Int -> Bool -> IO ()) -> IO (ConnectId self)+afterPageHorizontally :: TextViewClass self => self -> (Int -> Bool -> IO ()) -> IO (ConnectId self)+onPasteClipboard :: TextViewClass self => self -> IO () -> IO (ConnectId self)+afterPasteClipboard :: TextViewClass self => self -> IO () -> IO (ConnectId self)+onPopulatePopup :: TextViewClass self => self -> (Menu -> IO ()) -> IO (ConnectId self)+afterPopulatePopup :: TextViewClass self => self -> (Menu -> IO ()) -> IO (ConnectId self)+onSetAnchor :: TextViewClass self => self -> IO () -> IO (ConnectId self)+afterSetAnchor :: TextViewClass self => self -> IO () -> IO (ConnectId self)+onSetScrollAdjustments :: TextViewClass self => self -> (Adjustment -> Adjustment -> IO ()) -> IO (ConnectId self)+afterSetScrollAdjustments :: TextViewClass self => self -> (Adjustment -> Adjustment -> IO ()) -> IO (ConnectId self)+onToggleOverwrite :: TextViewClass self => self -> IO () -> IO (ConnectId self)+afterToggleOverwrite :: TextViewClass self => self -> IO () -> IO (ConnectId self)++module Graphics.UI.Gtk.Ornaments.Frame+data Frame+instance BinClass Frame+instance ContainerClass Frame+instance FrameClass Frame+instance GObjectClass Frame+instance ObjectClass Frame+instance WidgetClass Frame+class BinClass o => FrameClass o+instance FrameClass AspectFrame+instance FrameClass Frame+castToFrame :: GObjectClass obj => obj -> Frame+toFrame :: FrameClass o => o -> Frame+frameNew :: IO Frame+frameSetLabel :: FrameClass self => self -> String -> IO ()+frameGetLabel :: FrameClass self => self -> IO String+frameSetLabelWidget :: (FrameClass self, WidgetClass labelWidget) => self -> labelWidget -> IO ()+frameGetLabelWidget :: FrameClass self => self -> IO (Maybe Widget)+frameSetLabelAlign :: FrameClass self => self -> Float -> Float -> IO ()+frameGetLabelAlign :: FrameClass self => self -> IO (Float, Float)+data ShadowType+ShadowNone :: ShadowType+ShadowIn :: ShadowType+ShadowOut :: ShadowType+ShadowEtchedIn :: ShadowType+ShadowEtchedOut :: ShadowType+instance Enum ShadowType+instance Eq ShadowType+frameSetShadowType :: FrameClass self => self -> ShadowType -> IO ()+frameGetShadowType :: FrameClass self => self -> IO ShadowType+frameLabel :: FrameClass self => Attr self String+frameLabelXAlign :: FrameClass self => Attr self Float+frameLabelYAlign :: FrameClass self => Attr self Float+frameShadowType :: FrameClass self => Attr self ShadowType+frameLabelWidget :: (FrameClass self, WidgetClass labelWidget) => ReadWriteAttr self (Maybe Widget) labelWidget++module Graphics.UI.Gtk.Ornaments.HSeparator+data HSeparator+instance GObjectClass HSeparator+instance HSeparatorClass HSeparator+instance ObjectClass HSeparator+instance SeparatorClass HSeparator+instance WidgetClass HSeparator+class SeparatorClass o => HSeparatorClass o+instance HSeparatorClass HSeparator+castToHSeparator :: GObjectClass obj => obj -> HSeparator+toHSeparator :: HSeparatorClass o => o -> HSeparator+hSeparatorNew :: IO HSeparator++module Graphics.UI.Gtk.Ornaments.VSeparator+data VSeparator+instance GObjectClass VSeparator+instance ObjectClass VSeparator+instance SeparatorClass VSeparator+instance VSeparatorClass VSeparator+instance WidgetClass VSeparator+class SeparatorClass o => VSeparatorClass o+instance VSeparatorClass VSeparator+castToVSeparator :: GObjectClass obj => obj -> VSeparator+toVSeparator :: VSeparatorClass o => o -> VSeparator+vSeparatorNew :: IO VSeparator++module Graphics.UI.Gtk.Scrolling.HScrollbar+data HScrollbar+instance GObjectClass HScrollbar+instance HScrollbarClass HScrollbar+instance ObjectClass HScrollbar+instance RangeClass HScrollbar+instance ScrollbarClass HScrollbar+instance WidgetClass HScrollbar+class ScrollbarClass o => HScrollbarClass o+instance HScrollbarClass HScrollbar+castToHScrollbar :: GObjectClass obj => obj -> HScrollbar+toHScrollbar :: HScrollbarClass o => o -> HScrollbar+hScrollbarNew :: Adjustment -> IO HScrollbar+hScrollbarNewDefaults :: IO HScrollbar++module Graphics.UI.Gtk.Scrolling.ScrolledWindow+data ScrolledWindow+instance BinClass ScrolledWindow+instance ContainerClass ScrolledWindow+instance GObjectClass ScrolledWindow+instance ObjectClass ScrolledWindow+instance ScrolledWindowClass ScrolledWindow+instance WidgetClass ScrolledWindow+class BinClass o => ScrolledWindowClass o+instance ScrolledWindowClass ScrolledWindow+castToScrolledWindow :: GObjectClass obj => obj -> ScrolledWindow+toScrolledWindow :: ScrolledWindowClass o => o -> ScrolledWindow+scrolledWindowNew :: Maybe Adjustment -> Maybe Adjustment -> IO ScrolledWindow+scrolledWindowGetHAdjustment :: ScrolledWindowClass self => self -> IO Adjustment+scrolledWindowGetVAdjustment :: ScrolledWindowClass self => self -> IO Adjustment+data PolicyType+PolicyAlways :: PolicyType+PolicyAutomatic :: PolicyType+PolicyNever :: PolicyType+instance Enum PolicyType+instance Eq PolicyType+scrolledWindowSetPolicy :: ScrolledWindowClass self => self -> PolicyType -> PolicyType -> IO ()+scrolledWindowGetPolicy :: ScrolledWindowClass self => self -> IO (PolicyType, PolicyType)+scrolledWindowAddWithViewport :: (ScrolledWindowClass self, WidgetClass child) => self -> child -> IO ()+data CornerType+CornerTopLeft :: CornerType+CornerBottomLeft :: CornerType+CornerTopRight :: CornerType+CornerBottomRight :: CornerType+instance Enum CornerType+instance Eq CornerType+scrolledWindowSetPlacement :: ScrolledWindowClass self => self -> CornerType -> IO ()+scrolledWindowGetPlacement :: ScrolledWindowClass self => self -> IO CornerType+data ShadowType+ShadowNone :: ShadowType+ShadowIn :: ShadowType+ShadowOut :: ShadowType+ShadowEtchedIn :: ShadowType+ShadowEtchedOut :: ShadowType+instance Enum ShadowType+instance Eq ShadowType+scrolledWindowSetShadowType :: ScrolledWindowClass self => self -> ShadowType -> IO ()+scrolledWindowGetShadowType :: ScrolledWindowClass self => self -> IO ShadowType+scrolledWindowSetHAdjustment :: ScrolledWindowClass self => self -> Adjustment -> IO ()+scrolledWindowSetVAdjustment :: ScrolledWindowClass self => self -> Adjustment -> IO ()+scrolledWindowGetHScrollbar :: ScrolledWindowClass self => self -> IO (Maybe HScrollbar)+scrolledWindowGetVScrollbar :: ScrolledWindowClass self => self -> IO (Maybe VScrollbar)+scrolledWindowHAdjustment :: ScrolledWindowClass self => Attr self Adjustment+scrolledWindowVAdjustment :: ScrolledWindowClass self => Attr self Adjustment+scrolledWindowHscrollbarPolicy :: ScrolledWindowClass self => Attr self PolicyType+scrolledWindowVscrollbarPolicy :: ScrolledWindowClass self => Attr self PolicyType+scrolledWindowWindowPlacement :: ScrolledWindowClass self => Attr self CornerType+scrolledWindowShadowType :: ScrolledWindowClass self => Attr self ShadowType+scrolledWindowPlacement :: ScrolledWindowClass self => Attr self CornerType++module Graphics.UI.Gtk.Scrolling.VScrollbar+data VScrollbar+instance GObjectClass VScrollbar+instance ObjectClass VScrollbar+instance RangeClass VScrollbar+instance ScrollbarClass VScrollbar+instance VScrollbarClass VScrollbar+instance WidgetClass VScrollbar+class ScrollbarClass o => VScrollbarClass o+instance VScrollbarClass VScrollbar+castToVScrollbar :: GObjectClass obj => obj -> VScrollbar+toVScrollbar :: VScrollbarClass o => o -> VScrollbar+vScrollbarNew :: Adjustment -> IO VScrollbar+vScrollbarNewDefaults :: IO VScrollbar++module Graphics.UI.Gtk.Selectors.ColorButton+data ColorButton+instance BinClass ColorButton+instance ButtonClass ColorButton+instance ColorButtonClass ColorButton+instance ContainerClass ColorButton+instance GObjectClass ColorButton+instance ObjectClass ColorButton+instance WidgetClass ColorButton+class ButtonClass o => ColorButtonClass o+instance ColorButtonClass ColorButton+castToColorButton :: GObjectClass obj => obj -> ColorButton+toColorButton :: ColorButtonClass o => o -> ColorButton+colorButtonNew :: IO ColorButton+colorButtonNewWithColor :: Color -> IO ColorButton+colorButtonSetColor :: ColorButtonClass self => self -> Color -> IO ()+colorButtonGetColor :: ColorButtonClass self => self -> IO Color+colorButtonSetAlpha :: ColorButtonClass self => self -> Word16 -> IO ()+colorButtonGetAlpha :: ColorButtonClass self => self -> IO Word16+colorButtonSetUseAlpha :: ColorButtonClass self => self -> Bool -> IO ()+colorButtonGetUseAlpha :: ColorButtonClass self => self -> IO Bool+colorButtonSetTitle :: ColorButtonClass self => self -> String -> IO ()+colorButtonGetTitle :: ColorButtonClass self => self -> IO String+colorButtonUseAlpha :: ColorButtonClass self => Attr self Bool+colorButtonTitle :: ColorButtonClass self => Attr self String+colorButtonAlpha :: ColorButtonClass self => Attr self Word16+onColorSet :: ColorButtonClass self => self -> IO () -> IO (ConnectId self)+afterColorSet :: ColorButtonClass self => self -> IO () -> IO (ConnectId self)++module Graphics.UI.Gtk.Selectors.ColorSelection+data ColorSelection+instance BoxClass ColorSelection+instance ColorSelectionClass ColorSelection+instance ContainerClass ColorSelection+instance GObjectClass ColorSelection+instance ObjectClass ColorSelection+instance VBoxClass ColorSelection+instance WidgetClass ColorSelection+class VBoxClass o => ColorSelectionClass o+instance ColorSelectionClass ColorSelection+castToColorSelection :: GObjectClass obj => obj -> ColorSelection+toColorSelection :: ColorSelectionClass o => o -> ColorSelection+colorSelectionNew :: IO ColorSelection+colorSelectionGetCurrentAlpha :: ColorSelectionClass self => self -> IO Int+colorSelectionSetCurrentAlpha :: ColorSelectionClass self => self -> Int -> IO ()+colorSelectionGetCurrentColor :: ColorSelectionClass self => self -> IO Color+colorSelectionSetCurrentColor :: ColorSelectionClass self => self -> Color -> IO ()+colorSelectionGetHasOpacityControl :: ColorSelectionClass self => self -> IO Bool+colorSelectionSetHasOpacityControl :: ColorSelectionClass self => self -> Bool -> IO ()+colorSelectionGetHasPalette :: ColorSelectionClass self => self -> IO Bool+colorSelectionSetHasPalette :: ColorSelectionClass self => self -> Bool -> IO ()+colorSelectionGetPreviousAlpha :: ColorSelectionClass self => self -> IO Int+colorSelectionSetPreviousAlpha :: ColorSelectionClass self => self -> Int -> IO ()+colorSelectionGetPreviousColor :: ColorSelectionClass self => self -> IO Color+colorSelectionSetPreviousColor :: ColorSelectionClass self => self -> Color -> IO ()+colorSelectionIsAdjusting :: ColorSelectionClass self => self -> IO Bool+colorSelectionHasOpacityControl :: ColorSelectionClass self => Attr self Bool+colorSelectionHasPalette :: ColorSelectionClass self => Attr self Bool+colorSelectionCurrentAlpha :: ColorSelectionClass self => Attr self Int+colorSelectionPreviousAlpha :: ColorSelectionClass self => Attr self Int++module Graphics.UI.Gtk.Selectors.ColorSelectionDialog+data ColorSelectionDialog+instance BinClass ColorSelectionDialog+instance ColorSelectionDialogClass ColorSelectionDialog+instance ContainerClass ColorSelectionDialog+instance DialogClass ColorSelectionDialog+instance GObjectClass ColorSelectionDialog+instance ObjectClass ColorSelectionDialog+instance WidgetClass ColorSelectionDialog+instance WindowClass ColorSelectionDialog+class DialogClass o => ColorSelectionDialogClass o+instance ColorSelectionDialogClass ColorSelectionDialog+castToColorSelectionDialog :: GObjectClass obj => obj -> ColorSelectionDialog+toColorSelectionDialog :: ColorSelectionDialogClass o => o -> ColorSelectionDialog+colorSelectionDialogNew :: String -> IO ColorSelectionDialog++module Graphics.UI.Gtk.Selectors.FileChooser+data FileChooser+instance FileChooserClass FileChooser+instance GObjectClass FileChooser+class GObjectClass o => FileChooserClass o+instance FileChooserClass FileChooser+instance FileChooserClass FileChooserButton+instance FileChooserClass FileChooserDialog+instance FileChooserClass FileChooserWidget+castToFileChooser :: GObjectClass obj => obj -> FileChooser+toFileChooser :: FileChooserClass o => o -> FileChooser+data FileChooserAction+FileChooserActionOpen :: FileChooserAction+FileChooserActionSave :: FileChooserAction+FileChooserActionSelectFolder :: FileChooserAction+FileChooserActionCreateFolder :: FileChooserAction+instance Enum FileChooserAction+data FileChooserError+FileChooserErrorNonexistent :: FileChooserError+FileChooserErrorBadFilename :: FileChooserError+instance Enum FileChooserError+instance GErrorClass FileChooserError+data FileChooserConfirmation+FileChooserConfirmationConfirm :: FileChooserConfirmation+FileChooserConfirmationAcceptFilename :: FileChooserConfirmation+FileChooserConfirmationSelectAgain :: FileChooserConfirmation+instance Enum FileChooserConfirmation+fileChooserSetAction :: FileChooserClass self => self -> FileChooserAction -> IO ()+fileChooserGetAction :: FileChooserClass self => self -> IO FileChooserAction+fileChooserSetLocalOnly :: FileChooserClass self => self -> Bool -> IO ()+fileChooserGetLocalOnly :: FileChooserClass self => self -> IO Bool+fileChooserSetSelectMultiple :: FileChooserClass self => self -> Bool -> IO ()+fileChooserGetSelectMultiple :: FileChooserClass self => self -> IO Bool+fileChooserSetCurrentName :: FileChooserClass self => self -> FilePath -> IO ()+fileChooserGetFilename :: FileChooserClass self => self -> IO (Maybe FilePath)+fileChooserSetFilename :: FileChooserClass self => self -> FilePath -> IO Bool+fileChooserSelectFilename :: FileChooserClass self => self -> FilePath -> IO Bool+fileChooserUnselectFilename :: FileChooserClass self => self -> FilePath -> IO ()+fileChooserSelectAll :: FileChooserClass self => self -> IO ()+fileChooserUnselectAll :: FileChooserClass self => self -> IO ()+fileChooserGetFilenames :: FileChooserClass self => self -> IO [FilePath]+fileChooserSetCurrentFolder :: FileChooserClass self => self -> FilePath -> IO Bool+fileChooserGetCurrentFolder :: FileChooserClass self => self -> IO (Maybe FilePath)+fileChooserGetURI :: FileChooserClass self => self -> IO (Maybe String)+fileChooserSetURI :: FileChooserClass self => self -> String -> IO Bool+fileChooserSelectURI :: FileChooserClass self => self -> String -> IO Bool+fileChooserUnselectURI :: FileChooserClass self => self -> String -> IO ()+fileChooserGetURIs :: FileChooserClass self => self -> IO [String]+fileChooserSetCurrentFolderURI :: FileChooserClass self => self -> String -> IO Bool+fileChooserGetCurrentFolderURI :: FileChooserClass self => self -> IO String+fileChooserSetPreviewWidget :: (FileChooserClass self, WidgetClass previewWidget) => self -> previewWidget -> IO ()+fileChooserGetPreviewWidget :: FileChooserClass self => self -> IO (Maybe Widget)+fileChooserSetPreviewWidgetActive :: FileChooserClass self => self -> Bool -> IO ()+fileChooserGetPreviewWidgetActive :: FileChooserClass self => self -> IO Bool+fileChooserSetUsePreviewLabel :: FileChooserClass self => self -> Bool -> IO ()+fileChooserGetUsePreviewLabel :: FileChooserClass self => self -> IO Bool+fileChooserGetPreviewFilename :: FileChooserClass self => self -> IO (Maybe FilePath)+fileChooserGetPreviewURI :: FileChooserClass self => self -> IO (Maybe String)+fileChooserSetExtraWidget :: (FileChooserClass self, WidgetClass extraWidget) => self -> extraWidget -> IO ()+fileChooserGetExtraWidget :: FileChooserClass self => self -> IO (Maybe Widget)+fileChooserAddFilter :: FileChooserClass self => self -> FileFilter -> IO ()+fileChooserRemoveFilter :: FileChooserClass self => self -> FileFilter -> IO ()+fileChooserListFilters :: FileChooserClass self => self -> IO [FileFilter]+fileChooserSetFilter :: FileChooserClass self => self -> FileFilter -> IO ()+fileChooserGetFilter :: FileChooserClass self => self -> IO (Maybe FileFilter)+fileChooserAddShortcutFolder :: FileChooserClass self => self -> FilePath -> IO ()+fileChooserRemoveShortcutFolder :: FileChooserClass self => self -> FilePath -> IO ()+fileChooserListShortcutFolders :: FileChooserClass self => self -> IO [String]+fileChooserAddShortcutFolderURI :: FileChooserClass self => self -> String -> IO ()+fileChooserRemoveShortcutFolderURI :: FileChooserClass self => self -> String -> IO ()+fileChooserListShortcutFolderURIs :: FileChooserClass self => self -> IO [String]+fileChooserErrorDomain :: GErrorDomain+fileChooserSetShowHidden :: FileChooserClass self => self -> Bool -> IO ()+fileChooserGetShowHidden :: FileChooserClass self => self -> IO Bool+fileChooserSetDoOverwriteConfirmation :: FileChooserClass self => self -> Bool -> IO ()+fileChooserGetDoOverwriteConfirmation :: FileChooserClass self => self -> IO Bool+fileChooserUsePreviewLabel :: FileChooserClass self => Attr self Bool+fileChooserShowHidden :: FileChooserClass self => Attr self Bool+fileChooserSelectMultiple :: FileChooserClass self => Attr self Bool+fileChooserPreviewWidgetActive :: FileChooserClass self => Attr self Bool+fileChooserPreviewWidget :: (FileChooserClass self, WidgetClass previewWidget) => ReadWriteAttr self (Maybe Widget) previewWidget+fileChooserLocalOnly :: FileChooserClass self => Attr self Bool+fileChooserFilter :: FileChooserClass self => ReadWriteAttr self (Maybe FileFilter) FileFilter+fileChooserExtraWidget :: (FileChooserClass self, WidgetClass extraWidget) => ReadWriteAttr self (Maybe Widget) extraWidget+fileChooserDoOverwriteConfirmation :: FileChooserClass self => Attr self Bool+fileChooserAction :: FileChooserClass self => Attr self FileChooserAction+onCurrentFolderChanged :: FileChooserClass self => self -> IO () -> IO (ConnectId self)+afterCurrentFolderChanged :: FileChooserClass self => self -> IO () -> IO (ConnectId self)+onFileActivated :: FileChooserClass self => self -> IO () -> IO (ConnectId self)+afterFileActivated :: FileChooserClass self => self -> IO () -> IO (ConnectId self)+onUpdatePreview :: FileChooserClass self => self -> IO () -> IO (ConnectId self)+afterUpdatePreview :: FileChooserClass self => self -> IO () -> IO (ConnectId self)+onConfirmOverwrite :: FileChooserClass self => self -> IO FileChooserConfirmation -> IO (ConnectId self)+afterConfirmOverwrite :: FileChooserClass self => self -> IO FileChooserConfirmation -> IO (ConnectId self)++module Graphics.UI.Gtk.Selectors.FileChooserButton+data FileChooserButton+instance BoxClass FileChooserButton+instance ContainerClass FileChooserButton+instance FileChooserButtonClass FileChooserButton+instance FileChooserClass FileChooserButton+instance GObjectClass FileChooserButton+instance HBoxClass FileChooserButton+instance ObjectClass FileChooserButton+instance WidgetClass FileChooserButton+class HBoxClass o => FileChooserButtonClass o+instance FileChooserButtonClass FileChooserButton+castToFileChooserButton :: GObjectClass obj => obj -> FileChooserButton+toFileChooserButton :: FileChooserButtonClass o => o -> FileChooserButton+fileChooserButtonNew :: String -> FileChooserAction -> IO FileChooserButton+fileChooserButtonNewWithBackend :: String -> FileChooserAction -> String -> IO FileChooserButton+fileChooserButtonNewWithDialog :: FileChooserDialogClass dialog => dialog -> IO FileChooserButton+fileChooserButtonGetTitle :: FileChooserButtonClass self => self -> IO String+fileChooserButtonSetTitle :: FileChooserButtonClass self => self -> String -> IO ()+fileChooserButtonGetWidthChars :: FileChooserButtonClass self => self -> IO Int+fileChooserButtonSetWidthChars :: FileChooserButtonClass self => self -> Int -> IO ()+fileChooserButtonDialog :: (FileChooserButtonClass self, FileChooserDialogClass fileChooserDialog) => WriteAttr self fileChooserDialog+fileChooserButtonTitle :: FileChooserButtonClass self => Attr self String+fileChooserButtonWidthChars :: FileChooserButtonClass self => Attr self Int++module Graphics.UI.Gtk.Selectors.FileChooserWidget+data FileChooserWidget+instance BoxClass FileChooserWidget+instance ContainerClass FileChooserWidget+instance FileChooserClass FileChooserWidget+instance FileChooserWidgetClass FileChooserWidget+instance GObjectClass FileChooserWidget+instance ObjectClass FileChooserWidget+instance VBoxClass FileChooserWidget+instance WidgetClass FileChooserWidget+class VBoxClass o => FileChooserWidgetClass o+instance FileChooserWidgetClass FileChooserWidget+castToFileChooserWidget :: GObjectClass obj => obj -> FileChooserWidget+toFileChooserWidget :: FileChooserWidgetClass o => o -> FileChooserWidget+data FileChooserAction+instance Enum FileChooserAction+fileChooserWidgetNew :: FileChooserAction -> IO FileChooserWidget+fileChooserWidgetNewWithBackend :: FileChooserAction -> String -> IO FileChooserWidget++module Graphics.UI.Gtk.Selectors.FileFilter+data FileFilter+instance FileFilterClass FileFilter+instance GObjectClass FileFilter+instance ObjectClass FileFilter+class ObjectClass o => FileFilterClass o+instance FileFilterClass FileFilter+castToFileFilter :: GObjectClass obj => obj -> FileFilter+toFileFilter :: FileFilterClass o => o -> FileFilter+fileFilterNew :: IO FileFilter+fileFilterSetName :: FileFilter -> String -> IO ()+fileFilterGetName :: FileFilter -> IO String+fileFilterAddMimeType :: FileFilter -> String -> IO ()+fileFilterAddPattern :: FileFilter -> String -> IO ()+fileFilterAddCustom :: FileFilter -> [FileFilterFlags] -> (Maybe String -> Maybe String -> Maybe String -> Maybe String -> IO Bool) -> IO ()+fileFilterAddPixbufFormats :: FileFilter -> IO ()+fileFilterName :: Attr FileFilter String++module Graphics.UI.Gtk.Selectors.FileSelection+data FileSelection+instance BinClass FileSelection+instance ContainerClass FileSelection+instance DialogClass FileSelection+instance FileSelectionClass FileSelection+instance GObjectClass FileSelection+instance ObjectClass FileSelection+instance WidgetClass FileSelection+instance WindowClass FileSelection+class DialogClass o => FileSelectionClass o+instance FileSelectionClass FileSelection+castToFileSelection :: GObjectClass obj => obj -> FileSelection+toFileSelection :: FileSelectionClass o => o -> FileSelection+fileSelectionNew :: String -> IO FileSelection+fileSelectionSetFilename :: FileSelectionClass self => self -> String -> IO ()+fileSelectionGetFilename :: FileSelectionClass self => self -> IO String+fileSelectionShowFileopButtons :: FileSelectionClass self => self -> IO ()+fileSelectionHideFileopButtons :: FileSelectionClass self => self -> IO ()+fileSelectionGetButtons :: FileSelectionClass fsel => fsel -> IO (Button, Button)+fileSelectionComplete :: FileSelectionClass self => self -> String -> IO ()+fileSelectionGetSelections :: FileSelectionClass self => self -> IO [String]+fileSelectionSetSelectMultiple :: FileSelectionClass self => self -> Bool -> IO ()+fileSelectionGetSelectMultiple :: FileSelectionClass self => self -> IO Bool+fileSelectionFilename :: FileSelectionClass self => Attr self String+fileSelectionShowFileops :: FileSelectionClass self => Attr self Bool+fileSelectionSelectMultiple :: FileSelectionClass self => Attr self Bool++module Graphics.UI.Gtk.Selectors.FontButton+data FontButton+instance BinClass FontButton+instance ButtonClass FontButton+instance ContainerClass FontButton+instance FontButtonClass FontButton+instance GObjectClass FontButton+instance ObjectClass FontButton+instance WidgetClass FontButton+class ButtonClass o => FontButtonClass o+instance FontButtonClass FontButton+castToFontButton :: GObjectClass obj => obj -> FontButton+toFontButton :: FontButtonClass o => o -> FontButton+fontButtonNew :: IO FontButton+fontButtonNewWithFont :: String -> IO FontButton+fontButtonSetFontName :: FontButtonClass self => self -> String -> IO Bool+fontButtonGetFontName :: FontButtonClass self => self -> IO String+fontButtonSetShowStyle :: FontButtonClass self => self -> Bool -> IO ()+fontButtonGetShowStyle :: FontButtonClass self => self -> IO Bool+fontButtonSetShowSize :: FontButtonClass self => self -> Bool -> IO ()+fontButtonGetShowSize :: FontButtonClass self => self -> IO Bool+fontButtonSetUseFont :: FontButtonClass self => self -> Bool -> IO ()+fontButtonGetUseFont :: FontButtonClass self => self -> IO Bool+fontButtonSetUseSize :: FontButtonClass self => self -> Bool -> IO ()+fontButtonGetUseSize :: FontButtonClass self => self -> IO Bool+fontButtonSetTitle :: FontButtonClass self => self -> String -> IO ()+fontButtonGetTitle :: FontButtonClass self => self -> IO String+fontButtonTitle :: FontButtonClass self => Attr self String+fontButtonFontName :: FontButtonClass self => Attr self String+fontButtonUseFont :: FontButtonClass self => Attr self Bool+fontButtonUseSize :: FontButtonClass self => Attr self Bool+fontButtonShowStyle :: FontButtonClass self => Attr self Bool+fontButtonShowSize :: FontButtonClass self => Attr self Bool+onFontSet :: FontButtonClass self => self -> IO () -> IO (ConnectId self)+afterFontSet :: FontButtonClass self => self -> IO () -> IO (ConnectId self)++module Graphics.UI.Gtk.Selectors.FontSelection+data FontSelection+instance BoxClass FontSelection+instance ContainerClass FontSelection+instance FontSelectionClass FontSelection+instance GObjectClass FontSelection+instance ObjectClass FontSelection+instance VBoxClass FontSelection+instance WidgetClass FontSelection+class VBoxClass o => FontSelectionClass o+instance FontSelectionClass FontSelection+castToFontSelection :: GObjectClass obj => obj -> FontSelection+toFontSelection :: FontSelectionClass o => o -> FontSelection+fontSelectionNew :: IO FontSelection+fontSelectionGetFontName :: FontSelectionClass self => self -> IO (Maybe String)+fontSelectionSetFontName :: FontSelectionClass self => self -> String -> IO Bool+fontSelectionGetPreviewText :: FontSelectionClass self => self -> IO String+fontSelectionSetPreviewText :: FontSelectionClass self => self -> String -> IO ()+fontSelectionFontName :: FontSelectionClass self => Attr self String+fontSelectionPreviewText :: FontSelectionClass self => Attr self String++module Graphics.UI.Gtk.Selectors.FontSelectionDialog+data FontSelectionDialog+instance BinClass FontSelectionDialog+instance ContainerClass FontSelectionDialog+instance DialogClass FontSelectionDialog+instance FontSelectionDialogClass FontSelectionDialog+instance GObjectClass FontSelectionDialog+instance ObjectClass FontSelectionDialog+instance WidgetClass FontSelectionDialog+instance WindowClass FontSelectionDialog+class DialogClass o => FontSelectionDialogClass o+instance FontSelectionDialogClass FontSelectionDialog+castToFontSelectionDialog :: GObjectClass obj => obj -> FontSelectionDialog+toFontSelectionDialog :: FontSelectionDialogClass o => o -> FontSelectionDialog+fontSelectionDialogNew :: String -> IO FontSelectionDialog+fontSelectionDialogGetFontName :: FontSelectionDialogClass self => self -> IO (Maybe String)+fontSelectionDialogSetFontName :: FontSelectionDialogClass self => self -> String -> IO Bool+fontSelectionDialogGetPreviewText :: FontSelectionDialogClass self => self -> IO String+fontSelectionDialogSetPreviewText :: FontSelectionDialogClass self => self -> String -> IO ()+fontSelectionDialogPreviewText :: FontSelectionDialogClass self => Attr self String++module Graphics.UI.Gtk.SourceView.SourceBuffer+data SourceBuffer+instance GObjectClass SourceBuffer+instance SourceBufferClass SourceBuffer+instance TextBufferClass SourceBuffer+class TextBufferClass o => SourceBufferClass o+instance SourceBufferClass SourceBuffer+castToSourceBuffer :: GObjectClass obj => obj -> SourceBuffer+sourceBufferNew :: Maybe SourceTagTable -> IO SourceBuffer+sourceBufferNewWithLanguage :: SourceLanguage -> IO SourceBuffer+sourceBufferSetCheckBrackets :: SourceBuffer -> Bool -> IO ()+sourceBufferGetCheckBrackets :: SourceBuffer -> IO Bool+sourceBufferSetBracketsMatchStyle :: SourceBuffer -> SourceTagStyle -> IO ()+sourceBufferSetHighlight :: SourceBuffer -> Bool -> IO ()+sourceBufferGetHighlight :: SourceBuffer -> IO Bool+sourceBufferSetMaxUndoLevels :: SourceBuffer -> Int -> IO ()+sourceBufferGetMaxUndoLevels :: SourceBuffer -> IO Int+sourceBufferSetLanguage :: SourceBuffer -> SourceLanguage -> IO ()+sourceBufferGetLanguage :: SourceBuffer -> IO SourceLanguage+sourceBufferSetEscapeChar :: SourceBuffer -> Char -> IO ()+sourceBufferGetEscapeChar :: SourceBuffer -> IO Char+sourceBufferCanUndo :: SourceBuffer -> IO Bool+sourceBufferCanRedo :: SourceBuffer -> IO Bool+sourceBufferUndo :: SourceBuffer -> IO ()+sourceBufferRedo :: SourceBuffer -> IO ()+sourceBufferBeginNotUndoableAction :: SourceBuffer -> IO ()+sourceBufferEndNotUndoableAction :: SourceBuffer -> IO ()+sourceBufferCreateMarker :: SourceBuffer -> String -> String -> TextIter -> IO SourceMarker+sourceBufferMoveMarker :: SourceBuffer -> SourceMarker -> TextIter -> IO ()+sourceBufferDeleteMarker :: SourceBuffer -> SourceMarker -> IO ()+sourceBufferGetMarker :: SourceBuffer -> String -> IO SourceMarker+sourceBufferGetMarkersInRegion :: SourceBuffer -> TextIter -> TextIter -> IO [SourceMarker]+sourceBufferGetFirstMarker :: SourceBuffer -> IO SourceMarker+sourceBufferGetLastMarker :: SourceBuffer -> IO SourceMarker+sourceBufferGetIterAtMarker :: SourceBuffer -> SourceMarker -> IO TextIter+sourceBufferGetNextMarker :: SourceBuffer -> TextIter -> IO (Maybe SourceMarker)+sourceBufferGetPrevMarker :: SourceBuffer -> TextIter -> IO (Maybe SourceMarker)++module Graphics.UI.Gtk.SourceView.SourceIter+sourceIterForwardSearch :: TextIter -> String -> [SourceSearchFlags] -> Maybe TextIter -> IO (Maybe (TextIter, TextIter))+sourceIterBackwardSearch :: TextIter -> String -> [SourceSearchFlags] -> Maybe TextIter -> IO (Maybe (TextIter, TextIter))+sourceIterFindMatchingBracket :: TextIter -> IO Bool++module Graphics.UI.Gtk.SourceView.SourceLanguage+data SourceLanguage+instance GObjectClass SourceLanguage+instance SourceLanguageClass SourceLanguage+castToSourceLanguage :: GObjectClass obj => obj -> SourceLanguage+sourceLanguageGetName :: SourceLanguage -> IO String+sourceLanguageGetSection :: SourceLanguage -> IO String+sourceLanguageGetTags :: SourceLanguage -> IO [SourceTag]+sourceLanguageGetEscapeChar :: SourceLanguage -> IO Char+sourceLanguageGetMimeTypes :: SourceLanguage -> IO [String]+sourceLanguageSetMimeTypes :: SourceLanguage -> [String] -> IO ()+sourceLanguageGetStyleScheme :: SourceLanguage -> IO SourceStyleScheme+sourceLanguageSetStyleScheme :: SourceLanguage -> SourceStyleScheme -> IO ()+sourceLanguageGetTagStyle :: SourceLanguage -> String -> IO SourceTagStyle+sourceLanguageSetTagStyle :: SourceLanguage -> String -> SourceTagStyle -> IO ()+sourceLanguageGetTagDefaultStyle :: SourceLanguage -> String -> IO SourceTagStyle++module Graphics.UI.Gtk.SourceView.SourceView+data SourceView+instance ContainerClass SourceView+instance GObjectClass SourceView+instance ObjectClass SourceView+instance SourceViewClass SourceView+instance TextViewClass SourceView+instance WidgetClass SourceView+class TextViewClass o => SourceViewClass o+instance SourceViewClass SourceView+castToSourceView :: GObjectClass obj => obj -> SourceView+sourceViewNew :: IO SourceView+sourceViewNewWithBuffer :: SourceBuffer -> IO SourceView+sourceViewSetShowLineNumbers :: SourceViewClass sv => sv -> Bool -> IO ()+sourceViewGetShowLineNumbers :: SourceViewClass sv => sv -> IO Bool+sourceViewSetShowLineMarkers :: SourceViewClass sv => sv -> Bool -> IO ()+sourceViewGetShowLineMarkers :: SourceViewClass sv => sv -> IO Bool+sourceViewSetTabsWidth :: SourceViewClass sv => sv -> Int -> IO ()+sourceViewGetTabsWidth :: SourceViewClass sv => sv -> IO Int+sourceViewSetAutoIndent :: SourceViewClass sv => sv -> Bool -> IO ()+sourceViewGetAutoIndent :: SourceViewClass sv => sv -> IO Bool+sourceViewSetInsertSpacesInsteadOfTabs :: SourceViewClass sv => sv -> Bool -> IO ()+sourceViewGetInsertSpacesInsteadOfTabs :: SourceViewClass sv => sv -> IO Bool+sourceViewSetShowMargin :: SourceViewClass sv => sv -> Bool -> IO ()+sourceViewGetShowMargin :: SourceViewClass sv => sv -> IO Bool+sourceViewSetMargin :: SourceViewClass sv => sv -> Int -> IO ()+sourceViewGetMargin :: SourceViewClass sv => sv -> IO Int+sourceViewSetMarkerPixbuf :: SourceViewClass sv => sv -> String -> Pixbuf -> IO ()+sourceViewGetMarkerPixbuf :: SourceViewClass sv => sv -> String -> IO Pixbuf+sourceViewSetSmartHomeEnd :: SourceViewClass sv => sv -> Bool -> IO ()+sourceViewGetSmartHomeEnd :: SourceViewClass sv => sv -> IO Bool++module Graphics.UI.Gtk.SourceView++module Graphics.UI.Gtk.TreeList.CellRendererPixbuf+data CellRendererPixbuf+instance CellRendererClass CellRendererPixbuf+instance CellRendererPixbufClass CellRendererPixbuf+instance GObjectClass CellRendererPixbuf+instance ObjectClass CellRendererPixbuf+class CellRendererClass o => CellRendererPixbufClass o+instance CellRendererPixbufClass CellRendererPixbuf+castToCellRendererPixbuf :: GObjectClass obj => obj -> CellRendererPixbuf+toCellRendererPixbuf :: CellRendererPixbufClass o => o -> CellRendererPixbuf+cellRendererPixbufNew :: IO CellRendererPixbuf++module Graphics.UI.Gtk.TreeList.CellRendererText+data CellRendererText+instance CellRendererClass CellRendererText+instance CellRendererTextClass CellRendererText+instance GObjectClass CellRendererText+instance ObjectClass CellRendererText+class CellRendererClass o => CellRendererTextClass o+instance CellRendererTextClass CellRendererText+castToCellRendererText :: GObjectClass obj => obj -> CellRendererText+toCellRendererText :: CellRendererTextClass o => o -> CellRendererText+cellRendererTextNew :: IO CellRendererText+cellText :: Attribute CellRendererText String+cellMarkup :: Attribute CellRendererText String+cellBackground :: Attribute CellRendererText (Maybe String)+cellForeground :: Attribute CellRendererText (Maybe String)+cellEditable :: Attribute CellRendererText (Maybe Bool)+onEdited :: TreeModelClass tm => CellRendererText -> tm -> (TreeIter -> String -> IO ()) -> IO (ConnectId CellRendererText)+afterEdited :: TreeModelClass tm => CellRendererText -> tm -> (TreeIter -> String -> IO ()) -> IO (ConnectId CellRendererText)++module Graphics.UI.Gtk.TreeList.CellRendererToggle+data CellRendererToggle+instance CellRendererClass CellRendererToggle+instance CellRendererToggleClass CellRendererToggle+instance GObjectClass CellRendererToggle+instance ObjectClass CellRendererToggle+class CellRendererClass o => CellRendererToggleClass o+instance CellRendererToggleClass CellRendererToggle+castToCellRendererToggle :: GObjectClass obj => obj -> CellRendererToggle+toCellRendererToggle :: CellRendererToggleClass o => o -> CellRendererToggle+cellRendererToggleNew :: IO CellRendererToggle+cellRendererToggleGetRadio :: CellRendererToggleClass self => self -> IO Bool+cellRendererToggleSetRadio :: CellRendererToggleClass self => self -> Bool -> IO ()+cellRendererToggleGetActive :: CellRendererToggleClass self => self -> IO Bool+cellRendererToggleSetActive :: CellRendererToggleClass self => self -> Bool -> IO ()+cellActive :: Attribute CellRendererToggle Bool+cellRadio :: Attribute CellRendererToggle Bool++module Graphics.UI.Gtk.TreeList.CellView+data CellView+instance CellViewClass CellView+instance GObjectClass CellView+instance ObjectClass CellView+instance WidgetClass CellView+class WidgetClass o => CellViewClass o+instance CellViewClass CellView+castToCellView :: GObjectClass obj => obj -> CellView+toCellView :: CellViewClass o => o -> CellView+cellViewNew :: IO CellView+cellViewNewWithMarkup :: String -> IO CellView+cellViewNewWithPixbuf :: Pixbuf -> IO CellView+cellViewNewWithText :: String -> IO CellView+cellViewSetModel :: (CellViewClass self, TreeModelClass model) => self -> Maybe model -> IO ()+cellViewSetDisplayedRow :: CellViewClass self => self -> TreePath -> IO ()+cellViewGetDisplayedRow :: CellViewClass self => self -> IO (Maybe TreePath)+cellViewGetSizeOfRow :: CellViewClass self => self -> TreePath -> IO Requisition+cellViewSetBackgroundColor :: CellViewClass self => self -> Color -> IO ()+cellViewGetCellRenderers :: CellViewClass self => self -> IO [CellRenderer]+cellViewDisplayedRow :: CellViewClass self => ReadWriteAttr self (Maybe TreePath) TreePath++module Graphics.UI.Gtk.TreeList.IconView+data IconView+instance ContainerClass IconView+instance GObjectClass IconView+instance IconViewClass IconView+instance ObjectClass IconView+instance WidgetClass IconView+class ContainerClass o => IconViewClass o+instance IconViewClass IconView+castToIconView :: GObjectClass obj => obj -> IconView+toIconView :: IconViewClass o => o -> IconView+iconViewNew :: IO IconView+iconViewNewWithModel :: TreeModelClass model => model -> IO IconView+iconViewSetModel :: (IconViewClass self, TreeModelClass model) => self -> Maybe model -> IO ()+iconViewGetModel :: IconViewClass self => self -> IO (Maybe TreeModel)+iconViewSetTextColumn :: IconViewClass self => self -> Int -> IO ()+iconViewGetTextColumn :: IconViewClass self => self -> IO Int+iconViewSetMarkupColumn :: IconViewClass self => self -> Int -> IO ()+iconViewGetMarkupColumn :: IconViewClass self => self -> IO Int+iconViewSetPixbufColumn :: IconViewClass self => self -> Int -> IO ()+iconViewGetPixbufColumn :: IconViewClass self => self -> IO Int+iconViewGetPathAtPos :: IconViewClass self => self -> Int -> Int -> IO TreePath+iconViewSelectedForeach :: IconViewClass self => self -> (TreePath -> IO ()) -> IO ()+iconViewSetSelectionMode :: IconViewClass self => self -> SelectionMode -> IO ()+iconViewGetSelectionMode :: IconViewClass self => self -> IO SelectionMode+iconViewSetOrientation :: IconViewClass self => self -> Orientation -> IO ()+iconViewGetOrientation :: IconViewClass self => self -> IO Orientation+iconViewSetColumns :: IconViewClass self => self -> Int -> IO ()+iconViewGetColumns :: IconViewClass self => self -> IO Int+iconViewSetItemWidth :: IconViewClass self => self -> Int -> IO ()+iconViewGetItemWidth :: IconViewClass self => self -> IO Int+iconViewSetSpacing :: IconViewClass self => self -> Int -> IO ()+iconViewGetSpacing :: IconViewClass self => self -> IO Int+iconViewSetRowSpacing :: IconViewClass self => self -> Int -> IO ()+iconViewGetRowSpacing :: IconViewClass self => self -> IO Int+iconViewSetColumnSpacing :: IconViewClass self => self -> Int -> IO ()+iconViewGetColumnSpacing :: IconViewClass self => self -> IO Int+iconViewSetMargin :: IconViewClass self => self -> Int -> IO ()+iconViewGetMargin :: IconViewClass self => self -> IO Int+iconViewSelectPath :: IconViewClass self => self -> TreePath -> IO ()+iconViewUnselectPath :: IconViewClass self => self -> TreePath -> IO ()+iconViewPathIsSelected :: IconViewClass self => self -> TreePath -> IO Bool+iconViewGetSelectedItems :: IconViewClass self => self -> IO [TreePath]+iconViewSelectAll :: IconViewClass self => self -> IO ()+iconViewUnselectAll :: IconViewClass self => self -> IO ()+iconViewItemActivated :: IconViewClass self => self -> TreePath -> IO ()+iconViewSelectionMode :: IconViewClass self => Attr self SelectionMode+iconViewPixbufColumn :: IconViewClass self => Attr self Int+iconViewTextColumn :: IconViewClass self => Attr self Int+iconViewMarkupColumn :: IconViewClass self => Attr self Int+iconViewModel :: (IconViewClass self, TreeModelClass model) => ReadWriteAttr self (Maybe TreeModel) (Maybe model)+iconViewColumns :: IconViewClass self => Attr self Int+iconViewItemWidth :: IconViewClass self => Attr self Int+iconViewSpacing :: IconViewClass self => Attr self Int+iconViewRowSpacing :: IconViewClass self => Attr self Int+iconViewColumnSpacing :: IconViewClass self => Attr self Int+iconViewMargin :: IconViewClass self => Attr self Int+iconViewOrientation :: IconViewClass self => Attr self Orientation+onSelectAll :: IconViewClass self => self -> IO () -> IO (ConnectId self)+afterSelectAll :: IconViewClass self => self -> IO () -> IO (ConnectId self)+onUnselectAll :: IconViewClass self => self -> IO () -> IO (ConnectId self)+afterUnselectAll :: IconViewClass self => self -> IO () -> IO (ConnectId self)+onSelectCursorItem :: IconViewClass self => self -> IO () -> IO (ConnectId self)+afterSelectCursorItem :: IconViewClass self => self -> IO () -> IO (ConnectId self)+onToggleCursorItem :: IconViewClass self => self -> IO () -> IO (ConnectId self)+afterToggleCursorItem :: IconViewClass self => self -> IO () -> IO (ConnectId self)+onActivateCursorItem :: IconViewClass self => self -> IO Bool -> IO (ConnectId self)+afterActivateCursorItem :: IconViewClass self => self -> IO Bool -> IO (ConnectId self)++module Graphics.UI.Gtk.TreeList.TreeSelection+data TreeSelection+instance GObjectClass TreeSelection+instance TreeSelectionClass TreeSelection+class GObjectClass o => TreeSelectionClass o+instance TreeSelectionClass TreeSelection+castToTreeSelection :: GObjectClass obj => obj -> TreeSelection+toTreeSelection :: TreeSelectionClass o => o -> TreeSelection+data SelectionMode+SelectionNone :: SelectionMode+SelectionSingle :: SelectionMode+SelectionBrowse :: SelectionMode+SelectionMultiple :: SelectionMode+instance Enum SelectionMode+type TreeSelectionCB = TreePath -> IO Bool+type TreeSelectionForeachCB = TreeIter -> IO ()+treeSelectionSetMode :: TreeSelectionClass self => self -> SelectionMode -> IO ()+treeSelectionGetMode :: TreeSelectionClass self => self -> IO SelectionMode+treeSelectionSetSelectFunction :: TreeSelectionClass self => self -> TreeSelectionCB -> IO ()+treeSelectionGetTreeView :: TreeSelectionClass self => self -> IO TreeView+treeSelectionGetSelected :: TreeSelectionClass self => self -> IO (Maybe TreeIter)+treeSelectionSelectedForeach :: TreeSelectionClass self => self -> TreeSelectionForeachCB -> IO ()+treeSelectionGetSelectedRows :: TreeSelectionClass self => self -> IO [TreePath]+treeSelectionCountSelectedRows :: TreeSelectionClass self => self -> IO Int+treeSelectionSelectPath :: TreeSelectionClass self => self -> TreePath -> IO ()+treeSelectionUnselectPath :: TreeSelectionClass self => self -> TreePath -> IO ()+treeSelectionPathIsSelected :: TreeSelectionClass self => self -> TreePath -> IO Bool+treeSelectionSelectIter :: TreeSelectionClass self => self -> TreeIter -> IO ()+treeSelectionUnselectIter :: TreeSelectionClass self => self -> TreeIter -> IO ()+treeSelectionIterIsSelected :: TreeSelectionClass self => self -> TreeIter -> IO Bool+treeSelectionSelectAll :: TreeSelectionClass self => self -> IO ()+treeSelectionUnselectAll :: TreeSelectionClass self => self -> IO ()+treeSelectionSelectRange :: TreeSelectionClass self => self -> TreePath -> TreePath -> IO ()+treeSelectionUnselectRange :: TreeSelectionClass self => self -> TreePath -> TreePath -> IO ()+treeSelectionMode :: TreeSelectionClass self => Attr self SelectionMode+onSelectionChanged :: TreeSelectionClass self => self -> IO () -> IO (ConnectId self)+afterSelectionChanged :: TreeSelectionClass self => self -> IO () -> IO (ConnectId self)++module Graphics.UI.Gtk.TreeList.TreeViewColumn+data TreeViewColumn+instance GObjectClass TreeViewColumn+instance ObjectClass TreeViewColumn+instance TreeViewColumnClass TreeViewColumn+class ObjectClass o => TreeViewColumnClass o+instance TreeViewColumnClass TreeViewColumn+castToTreeViewColumn :: GObjectClass obj => obj -> TreeViewColumn+toTreeViewColumn :: TreeViewColumnClass o => o -> TreeViewColumn+treeViewColumnNew :: IO TreeViewColumn+treeViewColumnNewWithAttributes :: CellRendererClass cr => String -> cr -> [(String, Int)] -> IO TreeViewColumn+treeViewColumnPackStart :: CellRendererClass cell => TreeViewColumn -> cell -> Bool -> IO ()+treeViewColumnPackEnd :: CellRendererClass cell => TreeViewColumn -> cell -> Bool -> IO ()+treeViewColumnClear :: TreeViewColumn -> IO ()+treeViewColumnGetCellRenderers :: TreeViewColumn -> IO [CellRenderer]+treeViewColumnAddAttribute :: CellRendererClass cellRenderer => TreeViewColumn -> cellRenderer -> String -> Int -> IO ()+treeViewColumnAddAttributes :: CellRendererClass cr => TreeViewColumn -> cr -> [(String, Int)] -> IO ()+treeViewColumnSetAttributes :: CellRendererClass cr => TreeViewColumn -> cr -> [(String, Int)] -> IO ()+treeViewColumnClearAttributes :: CellRendererClass cellRenderer => TreeViewColumn -> cellRenderer -> IO ()+treeViewColumnSetSpacing :: TreeViewColumn -> Int -> IO ()+treeViewColumnGetSpacing :: TreeViewColumn -> IO Int+treeViewColumnSetVisible :: TreeViewColumn -> Bool -> IO ()+treeViewColumnGetVisible :: TreeViewColumn -> IO Bool+treeViewColumnSetResizable :: TreeViewColumn -> Bool -> IO ()+treeViewColumnGetResizable :: TreeViewColumn -> IO Bool+data TreeViewColumnSizing+TreeViewColumnGrowOnly :: TreeViewColumnSizing+TreeViewColumnAutosize :: TreeViewColumnSizing+TreeViewColumnFixed :: TreeViewColumnSizing+instance Enum TreeViewColumnSizing+instance Eq TreeViewColumnSizing+treeViewColumnSetSizing :: TreeViewColumn -> TreeViewColumnSizing -> IO ()+treeViewColumnGetSizing :: TreeViewColumn -> IO TreeViewColumnSizing+treeViewColumnGetWidth :: TreeViewColumn -> IO Int+treeViewColumnSetFixedWidth :: TreeViewColumn -> Int -> IO ()+treeViewColumnGetFixedWidth :: TreeViewColumn -> IO Int+treeViewColumnSetMinWidth :: TreeViewColumn -> Int -> IO ()+treeViewColumnGetMinWidth :: TreeViewColumn -> IO Int+treeViewColumnSetMaxWidth :: TreeViewColumn -> Int -> IO ()+treeViewColumnGetMaxWidth :: TreeViewColumn -> IO Int+treeViewColumnClicked :: TreeViewColumn -> IO ()+treeViewColumnSetTitle :: TreeViewColumn -> String -> IO ()+treeViewColumnGetTitle :: TreeViewColumn -> IO (Maybe String)+treeViewColumnSetClickable :: TreeViewColumn -> Bool -> IO ()+treeViewColumnGetClickable :: TreeViewColumn -> IO Bool+treeViewColumnSetWidget :: WidgetClass widget => TreeViewColumn -> widget -> IO ()+treeViewColumnGetWidget :: TreeViewColumn -> IO Widget+treeViewColumnSetAlignment :: TreeViewColumn -> Float -> IO ()+treeViewColumnGetAlignment :: TreeViewColumn -> IO Float+treeViewColumnSetReorderable :: TreeViewColumn -> Bool -> IO ()+treeViewColumnGetReorderable :: TreeViewColumn -> IO Bool+treeViewColumnSetSortColumnId :: TreeViewColumn -> Int -> IO ()+treeViewColumnGetSortColumnId :: TreeViewColumn -> IO Int+treeViewColumnSetSortIndicator :: TreeViewColumn -> Bool -> IO ()+treeViewColumnGetSortIndicator :: TreeViewColumn -> IO Bool+treeViewColumnSetSortOrder :: TreeViewColumn -> SortType -> IO ()+treeViewColumnGetSortOrder :: TreeViewColumn -> IO SortType+data SortType+SortAscending :: SortType+SortDescending :: SortType+instance Enum SortType+instance Eq SortType+treeViewColumnVisible :: Attr TreeViewColumn Bool+treeViewColumnResizable :: Attr TreeViewColumn Bool+treeViewColumnWidth :: ReadAttr TreeViewColumn Int+treeViewColumnSpacing :: Attr TreeViewColumn Int+treeViewColumnSizing :: Attr TreeViewColumn TreeViewColumnSizing+treeViewColumnFixedWidth :: Attr TreeViewColumn Int+treeViewColumnMinWidth :: Attr TreeViewColumn Int+treeViewColumnMaxWidth :: Attr TreeViewColumn Int+treeViewColumnTitle :: ReadWriteAttr TreeViewColumn (Maybe String) String+treeViewColumnClickable :: Attr TreeViewColumn Bool+treeViewColumnWidget :: WidgetClass widget => ReadWriteAttr TreeViewColumn Widget widget+treeViewColumnAlignment :: Attr TreeViewColumn Float+treeViewColumnReorderable :: Attr TreeViewColumn Bool+treeViewColumnSortIndicator :: Attr TreeViewColumn Bool+treeViewColumnSortOrder :: Attr TreeViewColumn SortType+treeViewColumnSortColumnId :: Attr TreeViewColumn Int+onColClicked :: TreeViewColumnClass self => self -> IO () -> IO (ConnectId self)+afterColClicked :: TreeViewColumnClass self => self -> IO () -> IO (ConnectId self)++module Graphics.UI.Gtk.TreeList.TreeView+data TreeView+instance ContainerClass TreeView+instance GObjectClass TreeView+instance ObjectClass TreeView+instance TreeViewClass TreeView+instance WidgetClass TreeView+class ContainerClass o => TreeViewClass o+instance TreeViewClass TreeView+castToTreeView :: GObjectClass obj => obj -> TreeView+toTreeView :: TreeViewClass o => o -> TreeView+type Point = (Int, Int)+treeViewNew :: IO TreeView+treeViewNewWithModel :: TreeModelClass model => model -> IO TreeView+treeViewGetModel :: TreeViewClass self => self -> IO (Maybe TreeModel)+treeViewSetModel :: (TreeViewClass self, TreeModelClass model) => self -> model -> IO ()+treeViewGetSelection :: TreeViewClass self => self -> IO TreeSelection+treeViewGetHAdjustment :: TreeViewClass self => self -> IO (Maybe Adjustment)+treeViewSetHAdjustment :: TreeViewClass self => self -> Maybe Adjustment -> IO ()+treeViewGetVAdjustment :: TreeViewClass self => self -> IO (Maybe Adjustment)+treeViewSetVAdjustment :: TreeViewClass self => self -> Maybe Adjustment -> IO ()+treeViewGetHeadersVisible :: TreeViewClass self => self -> IO Bool+treeViewSetHeadersVisible :: TreeViewClass self => self -> Bool -> IO ()+treeViewColumnsAutosize :: TreeViewClass self => self -> IO ()+treeViewSetHeadersClickable :: TreeViewClass self => self -> Bool -> IO ()+treeViewGetRulesHint :: TreeViewClass self => self -> IO Bool+treeViewSetRulesHint :: TreeViewClass self => self -> Bool -> IO ()+treeViewAppendColumn :: TreeViewClass self => self -> TreeViewColumn -> IO Int+treeViewRemoveColumn :: TreeViewClass self => self -> TreeViewColumn -> IO Int+treeViewInsertColumn :: TreeViewClass self => self -> TreeViewColumn -> Int -> IO Int+treeViewInsertColumnWithAttributes :: (TreeViewClass self, CellRendererClass cr) => self -> Int -> String -> cr -> [(String, Int)] -> IO ()+treeViewGetColumn :: TreeViewClass self => self -> Int -> IO (Maybe TreeViewColumn)+treeViewGetColumns :: TreeViewClass self => self -> IO [TreeViewColumn]+treeViewMoveColumnAfter :: TreeViewClass self => self -> TreeViewColumn -> TreeViewColumn -> IO ()+treeViewMoveColumnFirst :: TreeViewClass self => self -> TreeViewColumn -> IO ()+treeViewSetExpanderColumn :: TreeViewClass self => self -> Maybe TreeViewColumn -> IO ()+treeViewGetExpanderColumn :: TreeViewClass self => self -> IO TreeViewColumn+treeViewSetColumnDragFunction :: TreeViewClass self => self -> Maybe (TreeViewColumn -> Maybe TreeViewColumn -> Maybe TreeViewColumn -> IO Bool) -> IO ()+treeViewScrollToPoint :: TreeViewClass self => self -> Int -> Int -> IO ()+treeViewScrollToCell :: TreeViewClass self => self -> TreePath -> TreeViewColumn -> Maybe (Float, Float) -> IO ()+treeViewSetCursor :: TreeViewClass self => self -> TreePath -> Maybe (TreeViewColumn, Bool) -> IO ()+treeViewSetCursorOnCell :: (TreeViewClass self, CellRendererClass focusCell) => self -> TreePath -> TreeViewColumn -> focusCell -> Bool -> IO ()+treeViewGetCursor :: TreeViewClass self => self -> IO (TreePath, Maybe TreeViewColumn)+treeViewRowActivated :: TreeViewClass self => self -> TreePath -> TreeViewColumn -> IO ()+treeViewExpandAll :: TreeViewClass self => self -> IO ()+treeViewCollapseAll :: TreeViewClass self => self -> IO ()+treeViewExpandToPath :: TreeViewClass self => self -> TreePath -> IO ()+treeViewExpandRow :: TreeViewClass self => self -> TreePath -> Bool -> IO Bool+treeViewCollapseRow :: TreeViewClass self => self -> TreePath -> IO Bool+treeViewMapExpandedRows :: TreeViewClass self => self -> (TreePath -> IO ()) -> IO ()+treeViewRowExpanded :: TreeViewClass self => self -> TreePath -> IO Bool+treeViewGetReorderable :: TreeViewClass self => self -> IO Bool+treeViewSetReorderable :: TreeViewClass self => self -> Bool -> IO ()+treeViewGetPathAtPos :: TreeViewClass self => self -> Point -> IO (Maybe (TreePath, TreeViewColumn, Point))+treeViewGetCellArea :: TreeViewClass self => self -> Maybe TreePath -> TreeViewColumn -> IO Rectangle+treeViewGetBackgroundArea :: TreeViewClass self => self -> Maybe TreePath -> TreeViewColumn -> IO Rectangle+treeViewGetVisibleRect :: TreeViewClass self => self -> IO Rectangle+treeViewWidgetToTreeCoords :: TreeViewClass self => self -> Point -> IO Point+treeViewTreeToWidgetCoords :: TreeViewClass self => self -> Point -> IO Point+treeViewCreateRowDragIcon :: TreeViewClass self => self -> TreePath -> IO Pixmap+treeViewGetEnableSearch :: TreeViewClass self => self -> IO Bool+treeViewSetEnableSearch :: TreeViewClass self => self -> Bool -> IO ()+treeViewGetSearchColumn :: TreeViewClass self => self -> IO Int+treeViewSetSearchColumn :: TreeViewClass self => self -> Int -> IO ()+treeViewSetSearchEqualFunc :: TreeViewClass self => self -> (Int -> String -> TreeIter -> IO Bool) -> IO ()+treeViewGetFixedHeightMode :: TreeViewClass self => self -> IO Bool+treeViewSetFixedHeightMode :: TreeViewClass self => self -> Bool -> IO ()+treeViewGetHoverSelection :: TreeViewClass self => self -> IO Bool+treeViewSetHoverSelection :: TreeViewClass self => self -> Bool -> IO ()+treeViewGetHoverExpand :: TreeViewClass self => self -> IO Bool+treeViewSetHoverExpand :: TreeViewClass self => self -> Bool -> IO ()+treeViewModel :: (TreeViewClass self, TreeModelClass model) => ReadWriteAttr self (Maybe TreeModel) model+treeViewHAdjustment :: TreeViewClass self => Attr self (Maybe Adjustment)+treeViewVAdjustment :: TreeViewClass self => Attr self (Maybe Adjustment)+treeViewHeadersVisible :: TreeViewClass self => Attr self Bool+treeViewHeadersClickable :: TreeViewClass self => Attr self Bool+treeViewExpanderColumn :: TreeViewClass self => ReadWriteAttr self TreeViewColumn (Maybe TreeViewColumn)+treeViewReorderable :: TreeViewClass self => Attr self Bool+treeViewRulesHint :: TreeViewClass self => Attr self Bool+treeViewEnableSearch :: TreeViewClass self => Attr self Bool+treeViewSearchColumn :: TreeViewClass self => Attr self Int+treeViewFixedHeightMode :: TreeViewClass self => Attr self Bool+treeViewHoverSelection :: TreeViewClass self => Attr self Bool+treeViewHoverExpand :: TreeViewClass self => Attr self Bool+onColumnsChanged :: TreeViewClass self => self -> IO () -> IO (ConnectId self)+afterColumnsChanged :: TreeViewClass self => self -> IO () -> IO (ConnectId self)+onCursorChanged :: TreeViewClass self => self -> IO () -> IO (ConnectId self)+afterCursorChanged :: TreeViewClass self => self -> IO () -> IO (ConnectId self)+onRowActivated :: TreeViewClass self => self -> (TreePath -> TreeViewColumn -> IO ()) -> IO (ConnectId self)+afterRowActivated :: TreeViewClass self => self -> (TreePath -> TreeViewColumn -> IO ()) -> IO (ConnectId self)+onRowCollapsed :: TreeViewClass self => self -> (TreeIter -> TreePath -> IO ()) -> IO (ConnectId self)+afterRowCollapsed :: TreeViewClass self => self -> (TreeIter -> TreePath -> IO ()) -> IO (ConnectId self)+onRowExpanded :: TreeViewClass self => self -> (TreeIter -> TreePath -> IO ()) -> IO (ConnectId self)+afterRowExpanded :: TreeViewClass self => self -> (TreeIter -> TreePath -> IO ()) -> IO (ConnectId self)+onStartInteractiveSearch :: TreeViewClass self => self -> IO () -> IO (ConnectId self)+afterStartInteractiveSearch :: TreeViewClass self => self -> IO () -> IO (ConnectId self)+onTestCollapseRow :: TreeViewClass self => self -> (TreeIter -> TreePath -> IO Bool) -> IO (ConnectId self)+afterTestCollapseRow :: TreeViewClass self => self -> (TreeIter -> TreePath -> IO Bool) -> IO (ConnectId self)+onTestExpandRow :: TreeViewClass self => self -> (TreeIter -> TreePath -> IO Bool) -> IO (ConnectId self)+afterTestExpandRow :: TreeViewClass self => self -> (TreeIter -> TreePath -> IO Bool) -> IO (ConnectId self)++module Graphics.UI.Gtk.Windows.AboutDialog+data AboutDialog+instance AboutDialogClass AboutDialog+instance BinClass AboutDialog+instance ContainerClass AboutDialog+instance DialogClass AboutDialog+instance GObjectClass AboutDialog+instance ObjectClass AboutDialog+instance WidgetClass AboutDialog+instance WindowClass AboutDialog+class DialogClass o => AboutDialogClass o+instance AboutDialogClass AboutDialog+castToAboutDialog :: GObjectClass obj => obj -> AboutDialog+toAboutDialog :: AboutDialogClass o => o -> AboutDialog+aboutDialogNew :: IO AboutDialog+aboutDialogGetName :: AboutDialogClass self => self -> IO String+aboutDialogSetName :: AboutDialogClass self => self -> String -> IO ()+aboutDialogGetVersion :: AboutDialogClass self => self -> IO String+aboutDialogSetVersion :: AboutDialogClass self => self -> String -> IO ()+aboutDialogGetCopyright :: AboutDialogClass self => self -> IO String+aboutDialogSetCopyright :: AboutDialogClass self => self -> String -> IO ()+aboutDialogGetComments :: AboutDialogClass self => self -> IO String+aboutDialogSetComments :: AboutDialogClass self => self -> String -> IO ()+aboutDialogGetLicense :: AboutDialogClass self => self -> IO (Maybe String)+aboutDialogSetLicense :: AboutDialogClass self => self -> Maybe String -> IO ()+aboutDialogGetWebsite :: AboutDialogClass self => self -> IO String+aboutDialogSetWebsite :: AboutDialogClass self => self -> String -> IO ()+aboutDialogGetWebsiteLabel :: AboutDialogClass self => self -> IO String+aboutDialogSetWebsiteLabel :: AboutDialogClass self => self -> String -> IO ()+aboutDialogSetAuthors :: AboutDialogClass self => self -> [String] -> IO ()+aboutDialogGetAuthors :: AboutDialogClass self => self -> IO [String]+aboutDialogSetArtists :: AboutDialogClass self => self -> [String] -> IO ()+aboutDialogGetArtists :: AboutDialogClass self => self -> IO [String]+aboutDialogSetDocumenters :: AboutDialogClass self => self -> [String] -> IO ()+aboutDialogGetDocumenters :: AboutDialogClass self => self -> IO [String]+aboutDialogGetTranslatorCredits :: AboutDialogClass self => self -> IO String+aboutDialogSetTranslatorCredits :: AboutDialogClass self => self -> String -> IO ()+aboutDialogGetLogo :: AboutDialogClass self => self -> IO Pixbuf+aboutDialogSetLogo :: AboutDialogClass self => self -> Maybe Pixbuf -> IO ()+aboutDialogGetLogoIconName :: AboutDialogClass self => self -> IO String+aboutDialogSetLogoIconName :: AboutDialogClass self => self -> Maybe String -> IO ()+aboutDialogSetEmailHook :: (String -> IO ()) -> IO ()+aboutDialogSetUrlHook :: (String -> IO ()) -> IO ()+aboutDialogGetWrapLicense :: AboutDialogClass self => self -> IO Bool+aboutDialogSetWrapLicense :: AboutDialogClass self => self -> Bool -> IO ()+aboutDialogName :: AboutDialogClass self => Attr self String+aboutDialogVersion :: AboutDialogClass self => Attr self String+aboutDialogCopyright :: AboutDialogClass self => Attr self String+aboutDialogComments :: AboutDialogClass self => Attr self String+aboutDialogLicense :: AboutDialogClass self => Attr self (Maybe String)+aboutDialogWebsite :: AboutDialogClass self => Attr self String+aboutDialogWebsiteLabel :: AboutDialogClass self => Attr self String+aboutDialogAuthors :: AboutDialogClass self => Attr self [String]+aboutDialogDocumenters :: AboutDialogClass self => Attr self [String]+aboutDialogArtists :: AboutDialogClass self => Attr self [String]+aboutDialogTranslatorCredits :: AboutDialogClass self => Attr self String+aboutDialogLogo :: AboutDialogClass self => ReadWriteAttr self Pixbuf (Maybe Pixbuf)+aboutDialogLogoIconName :: AboutDialogClass self => ReadWriteAttr self String (Maybe String)+aboutDialogWrapLicense :: AboutDialogClass self => Attr self Bool++module Graphics.UI.Gtk.Windows.Dialog+data Dialog+instance BinClass Dialog+instance ContainerClass Dialog+instance DialogClass Dialog+instance GObjectClass Dialog+instance ObjectClass Dialog+instance WidgetClass Dialog+instance WindowClass Dialog+class WindowClass o => DialogClass o+instance DialogClass AboutDialog+instance DialogClass ColorSelectionDialog+instance DialogClass Dialog+instance DialogClass FileChooserDialog+instance DialogClass FileSelection+instance DialogClass FontSelectionDialog+instance DialogClass InputDialog+instance DialogClass MessageDialog+castToDialog :: GObjectClass obj => obj -> Dialog+toDialog :: DialogClass o => o -> Dialog+dialogNew :: IO Dialog+dialogGetUpper :: DialogClass dc => dc -> IO VBox+dialogGetActionArea :: DialogClass dc => dc -> IO HBox+dialogRun :: DialogClass self => self -> IO ResponseId+dialogResponse :: DialogClass self => self -> ResponseId -> IO ()+data ResponseId+ResponseNone :: ResponseId+ResponseReject :: ResponseId+ResponseAccept :: ResponseId+ResponseDeleteEvent :: ResponseId+ResponseOk :: ResponseId+ResponseCancel :: ResponseId+ResponseClose :: ResponseId+ResponseYes :: ResponseId+ResponseNo :: ResponseId+ResponseApply :: ResponseId+ResponseHelp :: ResponseId+ResponseUser :: Int -> ResponseId+instance Show ResponseId+dialogAddButton :: DialogClass self => self -> String -> ResponseId -> IO Button+dialogAddActionWidget :: (DialogClass self, WidgetClass child) => self -> child -> ResponseId -> IO ()+dialogGetHasSeparator :: DialogClass self => self -> IO Bool+dialogSetDefaultResponse :: DialogClass self => self -> ResponseId -> IO ()+dialogSetHasSeparator :: DialogClass self => self -> Bool -> IO ()+dialogSetResponseSensitive :: DialogClass self => self -> ResponseId -> Bool -> IO ()+dialogHasSeparator :: DialogClass self => Attr self Bool+onResponse :: DialogClass self => self -> (ResponseId -> IO ()) -> IO (ConnectId self)+afterResponse :: DialogClass self => self -> (ResponseId -> IO ()) -> IO (ConnectId self)++module Graphics.UI.Gtk.Windows.Window+data Window+instance BinClass Window+instance ContainerClass Window+instance GObjectClass Window+instance ObjectClass Window+instance WidgetClass Window+instance WindowClass Window+class BinClass o => WindowClass o+instance WindowClass AboutDialog+instance WindowClass ColorSelectionDialog+instance WindowClass Dialog+instance WindowClass FileChooserDialog+instance WindowClass FileSelection+instance WindowClass FontSelectionDialog+instance WindowClass InputDialog+instance WindowClass MessageDialog+instance WindowClass Plug+instance WindowClass Window+castToWindow :: GObjectClass obj => obj -> Window+toWindow :: WindowClass o => o -> Window+data WindowType+WindowToplevel :: WindowType+WindowPopup :: WindowType+instance Enum WindowType+instance Eq WindowType+data WindowEdge+WindowEdgeNorthWest :: WindowEdge+WindowEdgeNorth :: WindowEdge+WindowEdgeNorthEast :: WindowEdge+WindowEdgeWest :: WindowEdge+WindowEdgeEast :: WindowEdge+WindowEdgeSouthWest :: WindowEdge+WindowEdgeSouth :: WindowEdge+WindowEdgeSouthEast :: WindowEdge+instance Enum WindowEdge+data WindowTypeHint+WindowTypeHintNormal :: WindowTypeHint+WindowTypeHintDialog :: WindowTypeHint+WindowTypeHintMenu :: WindowTypeHint+WindowTypeHintToolbar :: WindowTypeHint+WindowTypeHintSplashscreen :: WindowTypeHint+WindowTypeHintUtility :: WindowTypeHint+WindowTypeHintDock :: WindowTypeHint+WindowTypeHintDesktop :: WindowTypeHint+instance Enum WindowTypeHint+data Gravity+GravityNorthWest :: Gravity+GravityNorth :: Gravity+GravityNorthEast :: Gravity+GravityWest :: Gravity+GravityCenter :: Gravity+GravityEast :: Gravity+GravitySouthWest :: Gravity+GravitySouth :: Gravity+GravitySouthEast :: Gravity+GravityStatic :: Gravity+instance Enum Gravity+windowNew :: IO Window+windowSetTitle :: WindowClass self => self -> String -> IO ()+windowGetTitle :: WindowClass self => self -> IO String+windowSetResizable :: WindowClass self => self -> Bool -> IO ()+windowGetResizable :: WindowClass self => self -> IO Bool+windowActivateFocus :: WindowClass self => self -> IO Bool+windowActivateDefault :: WindowClass self => self -> IO Bool+windowSetModal :: WindowClass self => self -> Bool -> IO ()+windowGetModal :: WindowClass self => self -> IO Bool+windowSetDefaultSize :: WindowClass self => self -> Int -> Int -> IO ()+windowGetDefaultSize :: WindowClass self => self -> IO (Int, Int)+windowSetPolicy :: WindowClass self => self -> Bool -> Bool -> Bool -> IO ()+windowSetPosition :: WindowClass self => self -> WindowPosition -> IO ()+data WindowPosition+WinPosNone :: WindowPosition+WinPosCenter :: WindowPosition+WinPosMouse :: WindowPosition+WinPosCenterAlways :: WindowPosition+WinPosCenterOnParent :: WindowPosition+instance Enum WindowPosition+instance Eq WindowPosition+windowSetTransientFor :: (WindowClass self, WindowClass parent) => self -> parent -> IO ()+windowGetTransientFor :: WindowClass self => self -> IO (Maybe Window)+windowSetDestroyWithParent :: WindowClass self => self -> Bool -> IO ()+windowGetDestroyWithParent :: WindowClass self => self -> IO Bool+windowIsActive :: WindowClass self => self -> IO Bool+windowHasToplevelFocus :: WindowClass self => self -> IO Bool+windowPresent :: WindowClass self => self -> IO ()+windowDeiconify :: WindowClass self => self -> IO ()+windowIconify :: WindowClass self => self -> IO ()+windowMaximize :: WindowClass self => self -> IO ()+windowUnmaximize :: WindowClass self => self -> IO ()+windowFullscreen :: WindowClass self => self -> IO ()+windowUnfullscreen :: WindowClass self => self -> IO ()+windowSetKeepAbove :: WindowClass self => self -> Bool -> IO ()+windowSetKeepBelow :: WindowClass self => self -> Bool -> IO ()+windowSetSkipTaskbarHint :: WindowClass self => self -> Bool -> IO ()+windowGetSkipTaskbarHint :: WindowClass self => self -> IO Bool+windowSetSkipPagerHint :: WindowClass self => self -> Bool -> IO ()+windowGetSkipPagerHint :: WindowClass self => self -> IO Bool+windowSetAcceptFocus :: WindowClass self => self -> Bool -> IO ()+windowGetAcceptFocus :: WindowClass self => self -> IO Bool+windowSetFocusOnMap :: WindowClass self => self -> Bool -> IO ()+windowGetFocusOnMap :: WindowClass self => self -> IO Bool+windowSetDecorated :: WindowClass self => self -> Bool -> IO ()+windowGetDecorated :: WindowClass self => self -> IO Bool+windowSetFrameDimensions :: WindowClass self => self -> Int -> Int -> Int -> Int -> IO ()+windowSetRole :: WindowClass self => self -> String -> IO ()+windowGetRole :: WindowClass self => self -> IO (Maybe String)+windowStick :: WindowClass self => self -> IO ()+windowUnstick :: WindowClass self => self -> IO ()+windowAddAccelGroup :: WindowClass self => self -> AccelGroup -> IO ()+windowRemoveAccelGroup :: WindowClass self => self -> AccelGroup -> IO ()+windowSetIcon :: WindowClass self => self -> Pixbuf -> IO ()+windowSetIconName :: WindowClass self => self -> String -> IO ()+windowGetIconName :: WindowClass self => self -> IO String+windowSetDefaultIconName :: String -> IO ()+windowSetGravity :: WindowClass self => self -> Gravity -> IO ()+windowGetGravity :: WindowClass self => self -> IO Gravity+windowSetScreen :: WindowClass self => self -> Screen -> IO ()+windowGetScreen :: WindowClass self => self -> IO Screen+windowBeginResizeDrag :: WindowClass self => self -> WindowEdge -> Int -> Int -> Int -> Word32 -> IO ()+windowBeginMoveDrag :: WindowClass self => self -> Int -> Int -> Int -> Word32 -> IO ()+windowSetTypeHint :: WindowClass self => self -> WindowTypeHint -> IO ()+windowGetTypeHint :: WindowClass self => self -> IO WindowTypeHint+windowGetIcon :: WindowClass self => self -> IO Pixbuf+windowGetPosition :: WindowClass self => self -> IO (Int, Int)+windowGetSize :: WindowClass self => self -> IO (Int, Int)+windowMove :: WindowClass self => self -> Int -> Int -> IO ()+windowResize :: WindowClass self => self -> Int -> Int -> IO ()+windowSetIconFromFile :: WindowClass self => self -> FilePath -> IO Bool+windowSetAutoStartupNotification :: Bool -> IO ()+windowPresentWithTime :: WindowClass self => self -> Word32 -> IO ()+windowSetUrgencyHint :: WindowClass self => self -> Bool -> IO ()+windowGetUrgencyHint :: WindowClass self => self -> IO Bool+windowTitle :: WindowClass self => Attr self String+windowType :: WindowClass self => Attr self WindowType+windowAllowShrink :: WindowClass self => Attr self Bool+windowAllowGrow :: WindowClass self => Attr self Bool+windowResizable :: WindowClass self => Attr self Bool+windowModal :: WindowClass self => Attr self Bool+windowWindowPosition :: WindowClass self => Attr self WindowPosition+windowDefaultWidth :: WindowClass self => Attr self Int+windowDefaultHeight :: WindowClass self => Attr self Int+windowDestroyWithParent :: WindowClass self => Attr self Bool+windowIcon :: WindowClass self => Attr self Pixbuf+windowScreen :: WindowClass self => Attr self Screen+windowTypeHint :: WindowClass self => Attr self WindowTypeHint+windowSkipTaskbarHint :: WindowClass self => Attr self Bool+windowSkipPagerHint :: WindowClass self => Attr self Bool+windowUrgencyHint :: WindowClass self => Attr self Bool+windowAcceptFocus :: WindowClass self => Attr self Bool+windowFocusOnMap :: WindowClass self => Attr self Bool+windowDecorated :: WindowClass self => Attr self Bool+windowGravity :: WindowClass self => Attr self Gravity+windowTransientFor :: (WindowClass self, WindowClass parent) => ReadWriteAttr self (Maybe Window) parent+onFrameEvent :: WindowClass self => self -> (Event -> IO Bool) -> IO (ConnectId self)+afterFrameEvent :: WindowClass self => self -> (Event -> IO Bool) -> IO (ConnectId self)+onSetFocus :: (WindowClass self, WidgetClass foc) => self -> (foc -> IO ()) -> IO (ConnectId self)+afterSetFocus :: (WindowClass self, WidgetClass foc) => self -> (foc -> IO ()) -> IO (ConnectId self)++module Graphics.UI.Gtk.Selectors.FileChooserDialog+data FileChooserDialog+instance BinClass FileChooserDialog+instance ContainerClass FileChooserDialog+instance DialogClass FileChooserDialog+instance FileChooserClass FileChooserDialog+instance FileChooserDialogClass FileChooserDialog+instance GObjectClass FileChooserDialog+instance ObjectClass FileChooserDialog+instance WidgetClass FileChooserDialog+instance WindowClass FileChooserDialog+class DialogClass o => FileChooserDialogClass o+instance FileChooserDialogClass FileChooserDialog+castToFileChooserDialog :: GObjectClass obj => obj -> FileChooserDialog+toFileChooserDialog :: FileChooserDialogClass o => o -> FileChooserDialog+fileChooserDialogNew :: Maybe String -> Maybe Window -> FileChooserAction -> [(String, ResponseId)] -> IO FileChooserDialog+fileChooserDialogNewWithBackend :: Maybe String -> Maybe Window -> FileChooserAction -> [(String, ResponseId)] -> String -> IO FileChooserDialog++module Graphics.UI.Gtk.Abstract.Misc+data Misc+instance GObjectClass Misc+instance MiscClass Misc+instance ObjectClass Misc+instance WidgetClass Misc+class WidgetClass o => MiscClass o+instance MiscClass AccelLabel+instance MiscClass Arrow+instance MiscClass Image+instance MiscClass Label+instance MiscClass Misc+instance MiscClass TipsQuery+castToMisc :: GObjectClass obj => obj -> Misc+toMisc :: MiscClass o => o -> Misc+miscSetAlignment :: MiscClass self => self -> Float -> Float -> IO ()+miscGetAlignment :: MiscClass self => self -> IO (Double, Double)+miscSetPadding :: MiscClass self => self -> Int -> Int -> IO ()+miscGetPadding :: MiscClass self => self -> IO (Int, Int)+miscXalign :: MiscClass self => Attr self Float+miscYalign :: MiscClass self => Attr self Float+miscXpad :: MiscClass self => Attr self Int+miscYpad :: MiscClass self => Attr self Int++module Graphics.UI.Gtk.Abstract.Paned+data Paned+instance ContainerClass Paned+instance GObjectClass Paned+instance ObjectClass Paned+instance PanedClass Paned+instance WidgetClass Paned+class ContainerClass o => PanedClass o+instance PanedClass HPaned+instance PanedClass Paned+instance PanedClass VPaned+castToPaned :: GObjectClass obj => obj -> Paned+toPaned :: PanedClass o => o -> Paned+panedAdd1 :: (PanedClass self, WidgetClass child) => self -> child -> IO ()+panedAdd2 :: (PanedClass self, WidgetClass child) => self -> child -> IO ()+panedPack1 :: (PanedClass self, WidgetClass child) => self -> child -> Bool -> Bool -> IO ()+panedPack2 :: (PanedClass self, WidgetClass child) => self -> child -> Bool -> Bool -> IO ()+panedSetPosition :: PanedClass self => self -> Int -> IO ()+panedGetPosition :: PanedClass self => self -> IO Int+panedGetChild1 :: PanedClass self => self -> IO (Maybe Widget)+panedGetChild2 :: PanedClass self => self -> IO (Maybe Widget)+panedPosition :: PanedClass self => Attr self Int+panedPositionSet :: PanedClass self => Attr self Bool+panedMinPosition :: PanedClass self => ReadAttr self Int+panedMaxPosition :: PanedClass self => ReadAttr self Int+panedChildResize :: (PanedClass self, WidgetClass child) => child -> Attr self Bool+panedChildShrink :: (PanedClass self, WidgetClass child) => child -> Attr self Bool+onCycleChildFocus :: PanedClass self => self -> (Bool -> IO Bool) -> IO (ConnectId self)+afterCycleChildFocus :: PanedClass self => self -> (Bool -> IO Bool) -> IO (ConnectId self)+onToggleHandleFocus :: PanedClass self => self -> IO Bool -> IO (ConnectId self)+afterToggleHandleFocus :: PanedClass self => self -> IO Bool -> IO (ConnectId self)+onMoveHandle :: PanedClass self => self -> (ScrollType -> IO Bool) -> IO (ConnectId self)+afterMoveHandle :: PanedClass self => self -> (ScrollType -> IO Bool) -> IO (ConnectId self)+onCycleHandleFocus :: PanedClass self => self -> (Bool -> IO Bool) -> IO (ConnectId self)+afterCycleHandleFocus :: PanedClass self => self -> (Bool -> IO Bool) -> IO (ConnectId self)+onAcceptPosition :: PanedClass self => self -> IO Bool -> IO (ConnectId self)+afterAcceptPosition :: PanedClass self => self -> IO Bool -> IO (ConnectId self)+onCancelPosition :: PanedClass self => self -> IO Bool -> IO (ConnectId self)+afterCancelPosition :: PanedClass self => self -> IO Bool -> IO (ConnectId self)++module Graphics.UI.Gtk.Layout.Fixed+data Fixed+instance ContainerClass Fixed+instance FixedClass Fixed+instance GObjectClass Fixed+instance ObjectClass Fixed+instance WidgetClass Fixed+class ContainerClass o => FixedClass o+instance FixedClass Fixed+castToFixed :: GObjectClass obj => obj -> Fixed+toFixed :: FixedClass o => o -> Fixed+fixedNew :: IO Fixed+fixedPut :: (FixedClass self, WidgetClass widget) => self -> widget -> (Int, Int) -> IO ()+fixedMove :: (FixedClass self, WidgetClass widget) => self -> widget -> (Int, Int) -> IO ()+fixedSetHasWindow :: FixedClass self => self -> Bool -> IO ()+fixedGetHasWindow :: FixedClass self => self -> IO Bool+fixedHasWindow :: FixedClass self => Attr self Bool+fixedChildX :: (FixedClass self, WidgetClass child) => child -> Attr self Int+fixedChildY :: (FixedClass self, WidgetClass child) => child -> Attr self Int++module Graphics.UI.Gtk.Layout.Layout+data Layout+instance ContainerClass Layout+instance GObjectClass Layout+instance LayoutClass Layout+instance ObjectClass Layout+instance WidgetClass Layout+class ContainerClass o => LayoutClass o+instance LayoutClass Layout+castToLayout :: GObjectClass obj => obj -> Layout+toLayout :: LayoutClass o => o -> Layout+layoutNew :: Maybe Adjustment -> Maybe Adjustment -> IO Layout+layoutPut :: (LayoutClass self, WidgetClass childWidget) => self -> childWidget -> Int -> Int -> IO ()+layoutMove :: (LayoutClass self, WidgetClass childWidget) => self -> childWidget -> Int -> Int -> IO ()+layoutSetSize :: LayoutClass self => self -> Int -> Int -> IO ()+layoutGetSize :: LayoutClass self => self -> IO (Int, Int)+layoutGetHAdjustment :: LayoutClass self => self -> IO Adjustment+layoutGetVAdjustment :: LayoutClass self => self -> IO Adjustment+layoutSetHAdjustment :: LayoutClass self => self -> Adjustment -> IO ()+layoutSetVAdjustment :: LayoutClass self => self -> Adjustment -> IO ()+layoutGetDrawWindow :: Layout -> IO DrawWindow+layoutHAdjustment :: LayoutClass self => Attr self Adjustment+layoutVAdjustment :: LayoutClass self => Attr self Adjustment+layoutWidth :: LayoutClass self => Attr self Int+layoutHeight :: LayoutClass self => Attr self Int+layoutChildX :: (LayoutClass self, WidgetClass child) => child -> Attr self Int+layoutChildY :: (LayoutClass self, WidgetClass child) => child -> Attr self Int+onSetScrollAdjustments :: LayoutClass self => self -> (Adjustment -> Adjustment -> IO ()) -> IO (ConnectId self)+afterSetScrollAdjustments :: LayoutClass self => self -> (Adjustment -> Adjustment -> IO ()) -> IO (ConnectId self)++module Graphics.UI.Gtk.Layout.Notebook+data Notebook+instance ContainerClass Notebook+instance GObjectClass Notebook+instance NotebookClass Notebook+instance ObjectClass Notebook+instance WidgetClass Notebook+class ContainerClass o => NotebookClass o+instance NotebookClass Notebook+castToNotebook :: GObjectClass obj => obj -> Notebook+toNotebook :: NotebookClass o => o -> Notebook+notebookNew :: IO Notebook+notebookAppendPage :: (NotebookClass self, WidgetClass child) => self -> child -> String -> IO Int+notebookAppendPageMenu :: (NotebookClass self, WidgetClass child, WidgetClass tabLabel, WidgetClass menuLabel) => self -> child -> tabLabel -> menuLabel -> IO Int+notebookPrependPage :: (NotebookClass self, WidgetClass child) => self -> child -> String -> IO Int+notebookPrependPageMenu :: (NotebookClass self, WidgetClass child, WidgetClass tabLabel, WidgetClass menuLabel) => self -> child -> tabLabel -> menuLabel -> IO Int+notebookInsertPage :: (NotebookClass self, WidgetClass child) => self -> child -> String -> Int -> IO Int+notebookInsertPageMenu :: (NotebookClass self, WidgetClass child, WidgetClass tabLabel, WidgetClass menuLabel) => self -> child -> tabLabel -> menuLabel -> Int -> IO Int+notebookRemovePage :: NotebookClass self => self -> Int -> IO ()+notebookPageNum :: (NotebookClass self, WidgetClass w) => self -> w -> IO (Maybe Int)+notebookSetCurrentPage :: NotebookClass self => self -> Int -> IO ()+notebookNextPage :: NotebookClass self => self -> IO ()+notebookPrevPage :: NotebookClass self => self -> IO ()+notebookReorderChild :: (NotebookClass self, WidgetClass child) => self -> child -> Int -> IO ()+data PositionType+PosLeft :: PositionType+PosRight :: PositionType+PosTop :: PositionType+PosBottom :: PositionType+instance Enum PositionType+instance Eq PositionType+notebookSetTabPos :: NotebookClass self => self -> PositionType -> IO ()+notebookGetTabPos :: NotebookClass self => self -> IO PositionType+notebookSetShowTabs :: NotebookClass self => self -> Bool -> IO ()+notebookGetShowTabs :: NotebookClass self => self -> IO Bool+notebookSetShowBorder :: NotebookClass self => self -> Bool -> IO ()+notebookGetShowBorder :: NotebookClass self => self -> IO Bool+notebookSetScrollable :: NotebookClass self => self -> Bool -> IO ()+notebookGetScrollable :: NotebookClass self => self -> IO Bool+notebookSetTabBorder :: NotebookClass self => self -> Int -> IO ()+notebookSetTabHBorder :: NotebookClass self => self -> Int -> IO ()+notebookSetTabVBorder :: NotebookClass self => self -> Int -> IO ()+notebookSetPopup :: NotebookClass self => self -> Bool -> IO ()+notebookGetCurrentPage :: NotebookClass self => self -> IO Int+notebookSetMenuLabel :: (NotebookClass self, WidgetClass child, WidgetClass menuLabel) => self -> child -> Maybe menuLabel -> IO ()+notebookGetMenuLabel :: (NotebookClass self, WidgetClass child) => self -> child -> IO (Maybe Widget)+notebookSetMenuLabelText :: (NotebookClass self, WidgetClass child) => self -> child -> String -> IO ()+notebookGetMenuLabelText :: (NotebookClass self, WidgetClass child) => self -> child -> IO (Maybe String)+notebookGetNthPage :: NotebookClass self => self -> Int -> IO (Maybe Widget)+notebookGetNPages :: NotebookClass self => self -> IO Int+notebookGetTabLabel :: (NotebookClass self, WidgetClass child) => self -> child -> IO (Maybe Widget)+notebookGetTabLabelText :: (NotebookClass self, WidgetClass child) => self -> child -> IO (Maybe String)+data Packing+PackRepel :: Packing+PackGrow :: Packing+PackNatural :: Packing+instance Enum Packing+instance Eq Packing+data PackType+PackStart :: PackType+PackEnd :: PackType+instance Enum PackType+instance Eq PackType+notebookQueryTabLabelPacking :: (NotebookClass self, WidgetClass child) => self -> child -> IO (Packing, PackType)+notebookSetTabLabelPacking :: (NotebookClass self, WidgetClass child) => self -> child -> Packing -> PackType -> IO ()+notebookSetHomogeneousTabs :: NotebookClass self => self -> Bool -> IO ()+notebookSetTabLabel :: (NotebookClass self, WidgetClass child, WidgetClass tabLabel) => self -> child -> tabLabel -> IO ()+notebookSetTabLabelText :: (NotebookClass self, WidgetClass child) => self -> child -> String -> IO ()+notebookPage :: NotebookClass self => Attr self Int+notebookTabPos :: NotebookClass self => Attr self PositionType+notebookTabBorder :: NotebookClass self => WriteAttr self Int+notebookTabHborder :: NotebookClass self => Attr self Int+notebookTabVborder :: NotebookClass self => Attr self Int+notebookShowTabs :: NotebookClass self => Attr self Bool+notebookShowBorder :: NotebookClass self => Attr self Bool+notebookScrollable :: NotebookClass self => Attr self Bool+notebookEnablePopup :: NotebookClass self => Attr self Bool+notebookHomogeneous :: NotebookClass self => Attr self Bool+notebookCurrentPage :: NotebookClass self => Attr self Int+notebookChildTabLabel :: (NotebookClass self, WidgetClass child) => child -> Attr self String+notebookChildMenuLabel :: (NotebookClass self, WidgetClass child) => child -> Attr self String+notebookChildPosition :: (NotebookClass self, WidgetClass child) => child -> Attr self Int+notebookChildTabPacking :: (NotebookClass self, WidgetClass child) => child -> Attr self Packing+notebookChildTabPackType :: (NotebookClass self, WidgetClass child) => child -> Attr self PackType+onSwitchPage :: NotebookClass nb => nb -> (Int -> IO ()) -> IO (ConnectId nb)+afterSwitchPage :: NotebookClass nb => nb -> (Int -> IO ()) -> IO (ConnectId nb)++module Graphics.UI.Gtk.Layout.Table+data Table+instance ContainerClass Table+instance GObjectClass Table+instance ObjectClass Table+instance TableClass Table+instance WidgetClass Table+class ContainerClass o => TableClass o+instance TableClass Table+castToTable :: GObjectClass obj => obj -> Table+toTable :: TableClass o => o -> Table+tableNew :: Int -> Int -> Bool -> IO Table+tableResize :: TableClass self => self -> Int -> Int -> IO ()+data AttachOptions+Expand :: AttachOptions+Shrink :: AttachOptions+Fill :: AttachOptions+instance Bounded AttachOptions+instance Enum AttachOptions+instance Eq AttachOptions+instance Flags AttachOptions+tableAttach :: (TableClass self, WidgetClass child) => self -> child -> Int -> Int -> Int -> Int -> [AttachOptions] -> [AttachOptions] -> Int -> Int -> IO ()+tableAttachDefaults :: (TableClass self, WidgetClass widget) => self -> widget -> Int -> Int -> Int -> Int -> IO ()+tableSetRowSpacing :: TableClass self => self -> Int -> Int -> IO ()+tableGetRowSpacing :: TableClass self => self -> Int -> IO Int+tableSetColSpacing :: TableClass self => self -> Int -> Int -> IO ()+tableGetColSpacing :: TableClass self => self -> Int -> IO Int+tableSetRowSpacings :: TableClass self => self -> Int -> IO ()+tableGetDefaultRowSpacing :: TableClass self => self -> IO Int+tableSetColSpacings :: TableClass self => self -> Int -> IO ()+tableGetDefaultColSpacing :: TableClass self => self -> IO Int+tableSetHomogeneous :: TableClass self => self -> Bool -> IO ()+tableGetHomogeneous :: TableClass self => self -> IO Bool+tableNRows :: TableClass self => Attr self Int+tableNColumns :: TableClass self => Attr self Int+tableRowSpacing :: TableClass self => Attr self Int+tableColumnSpacing :: TableClass self => Attr self Int+tableHomogeneous :: TableClass self => Attr self Bool+tableChildLeftAttach :: (TableClass self, WidgetClass child) => child -> Attr self Int+tableChildRightAttach :: (TableClass self, WidgetClass child) => child -> Attr self Int+tableChildTopAttach :: (TableClass self, WidgetClass child) => child -> Attr self Int+tableChildBottomAttach :: (TableClass self, WidgetClass child) => child -> Attr self Int+tableChildXOptions :: (TableClass self, WidgetClass child) => child -> Attr self [AttachOptions]+tableChildYOptions :: (TableClass self, WidgetClass child) => child -> Attr self [AttachOptions]+tableChildXPadding :: (TableClass self, WidgetClass child) => child -> Attr self Int+tableChildYPadding :: (TableClass self, WidgetClass child) => child -> Attr self Int++module Graphics.UI.Gtk.MenuComboToolbar.Menu+data Menu+instance ContainerClass Menu+instance GObjectClass Menu+instance MenuClass Menu+instance MenuShellClass Menu+instance ObjectClass Menu+instance WidgetClass Menu+class MenuShellClass o => MenuClass o+instance MenuClass Menu+castToMenu :: GObjectClass obj => obj -> Menu+toMenu :: MenuClass o => o -> Menu+menuNew :: IO Menu+menuReorderChild :: (MenuClass self, MenuItemClass child) => self -> child -> Int -> IO ()+menuPopup :: MenuClass self => self -> Event -> IO ()+menuSetAccelGroup :: MenuClass self => self -> AccelGroup -> IO ()+menuGetAccelGroup :: MenuClass self => self -> IO AccelGroup+menuSetAccelPath :: MenuClass self => self -> String -> IO ()+menuSetTitle :: MenuClass self => self -> String -> IO ()+menuGetTitle :: MenuClass self => self -> IO (Maybe String)+menuPopdown :: MenuClass self => self -> IO ()+menuReposition :: MenuClass self => self -> IO ()+menuGetActive :: MenuClass self => self -> IO MenuItem+menuSetActive :: MenuClass self => self -> Int -> IO ()+menuSetTearoffState :: MenuClass self => self -> Bool -> IO ()+menuGetTearoffState :: MenuClass self => self -> IO Bool+menuAttachToWidget :: (MenuClass self, WidgetClass attachWidget) => self -> attachWidget -> IO ()+menuDetach :: MenuClass self => self -> IO ()+menuGetAttachWidget :: MenuClass self => self -> IO (Maybe Widget)+menuSetScreen :: MenuClass self => self -> Maybe Screen -> IO ()+menuSetMonitor :: MenuClass self => self -> Int -> IO ()+menuAttach :: (MenuClass self, MenuItemClass child) => self -> child -> Int -> Int -> Int -> Int -> IO ()+menuGetForAttachWidget :: WidgetClass widget => widget -> IO [Menu]+menuTearoffState :: MenuClass self => Attr self Bool+menuAccelGroup :: MenuClass self => Attr self AccelGroup+menuActive :: MenuClass self => ReadWriteAttr self MenuItem Int+menuTitle :: MenuClass self => ReadWriteAttr self (Maybe String) String+menuChildLeftAttach :: (MenuClass self, WidgetClass child) => child -> Attr self Int+menuChildRightAttach :: (MenuClass self, WidgetClass child) => child -> Attr self Int+menuChildTopAttach :: (MenuClass self, WidgetClass child) => child -> Attr self Int+menuChildBottomAttach :: (MenuClass self, WidgetClass child) => child -> Attr self Int++module Graphics.UI.Gtk.MenuComboToolbar.Toolbar+data Toolbar+instance ContainerClass Toolbar+instance GObjectClass Toolbar+instance ObjectClass Toolbar+instance ToolbarClass Toolbar+instance WidgetClass Toolbar+class ContainerClass o => ToolbarClass o+instance ToolbarClass Toolbar+castToToolbar :: GObjectClass obj => obj -> Toolbar+toToolbar :: ToolbarClass o => o -> Toolbar+data Orientation+OrientationHorizontal :: Orientation+OrientationVertical :: Orientation+instance Enum Orientation+instance Eq Orientation+data ToolbarStyle+ToolbarIcons :: ToolbarStyle+ToolbarText :: ToolbarStyle+ToolbarBoth :: ToolbarStyle+ToolbarBothHoriz :: ToolbarStyle+instance Enum ToolbarStyle+instance Eq ToolbarStyle+toolbarNew :: IO Toolbar+toolbarInsertNewButton :: ToolbarClass self => self -> Int -> String -> Maybe (String, String) -> IO Button+toolbarAppendNewButton :: ToolbarClass self => self -> String -> Maybe (String, String) -> IO Button+toolbarPrependNewButton :: ToolbarClass self => self -> String -> Maybe (String, String) -> IO Button+toolbarInsertNewToggleButton :: ToolbarClass self => self -> Int -> String -> Maybe (String, String) -> IO ToggleButton+toolbarAppendNewToggleButton :: ToolbarClass self => self -> String -> Maybe (String, String) -> IO ToggleButton+toolbarPrependNewToggleButton :: ToolbarClass self => self -> String -> Maybe (String, String) -> IO ToggleButton+toolbarInsertNewRadioButton :: (ToolbarClass self, RadioButtonClass rb) => self -> Int -> String -> Maybe (String, String) -> Maybe rb -> IO RadioButton+toolbarAppendNewRadioButton :: (ToolbarClass self, RadioButtonClass rb) => self -> String -> Maybe (String, String) -> Maybe rb -> IO RadioButton+toolbarPrependNewRadioButton :: (ToolbarClass self, RadioButtonClass rb) => self -> String -> Maybe (String, String) -> Maybe rb -> IO RadioButton+toolbarInsertNewWidget :: (ToolbarClass self, WidgetClass w) => self -> Int -> w -> Maybe (String, String) -> IO ()+toolbarAppendNewWidget :: (ToolbarClass self, WidgetClass w) => self -> w -> Maybe (String, String) -> IO ()+toolbarPrependNewWidget :: (ToolbarClass self, WidgetClass w) => self -> w -> Maybe (String, String) -> IO ()+toolbarSetOrientation :: ToolbarClass self => self -> Orientation -> IO ()+toolbarGetOrientation :: ToolbarClass self => self -> IO Orientation+toolbarSetStyle :: ToolbarClass self => self -> ToolbarStyle -> IO ()+toolbarGetStyle :: ToolbarClass self => self -> IO ToolbarStyle+toolbarUnsetStyle :: ToolbarClass self => self -> IO ()+toolbarSetTooltips :: ToolbarClass self => self -> Bool -> IO ()+toolbarGetTooltips :: ToolbarClass self => self -> IO Bool+type IconSize = Int+iconSizeInvalid :: IconSize+iconSizeSmallToolbar :: IconSize+iconSizeLargeToolbar :: IconSize+toolbarSetIconSize :: ToolbarClass self => self -> IconSize -> IO ()+toolbarGetIconSize :: ToolbarClass self => self -> IO IconSize+toolbarInsert :: (ToolbarClass self, ToolItemClass item) => self -> item -> Int -> IO ()+toolbarGetItemIndex :: (ToolbarClass self, ToolItemClass item) => self -> item -> IO Int+toolbarGetNItems :: ToolbarClass self => self -> IO Int+toolbarGetNthItem :: ToolbarClass self => self -> Int -> IO (Maybe ToolItem)+toolbarGetDropIndex :: ToolbarClass self => self -> (Int, Int) -> IO Int+toolbarSetDropHighlightItem :: (ToolbarClass self, ToolItemClass toolItem) => self -> Maybe toolItem -> Int -> IO ()+toolbarSetShowArrow :: ToolbarClass self => self -> Bool -> IO ()+toolbarGetShowArrow :: ToolbarClass self => self -> IO Bool+data ReliefStyle+ReliefNormal :: ReliefStyle+ReliefHalf :: ReliefStyle+ReliefNone :: ReliefStyle+instance Enum ReliefStyle+instance Eq ReliefStyle+toolbarGetReliefStyle :: ToolbarClass self => self -> IO ReliefStyle+toolbarOrientation :: ToolbarClass self => Attr self Orientation+toolbarShowArrow :: ToolbarClass self => Attr self Bool+toolbarTooltips :: ToolbarClass self => Attr self Bool+toolbarStyle :: ToolbarClass self => Attr self ToolbarStyle+toolbarChildExpand :: (ToolbarClass self, WidgetClass child) => child -> Attr self Bool+toolbarChildHomogeneous :: (ToolbarClass self, WidgetClass child) => child -> Attr self Bool+onOrientationChanged :: ToolbarClass self => self -> (Orientation -> IO ()) -> IO (ConnectId self)+afterOrientationChanged :: ToolbarClass self => self -> (Orientation -> IO ()) -> IO (ConnectId self)+onStyleChanged :: ToolbarClass self => self -> (ToolbarStyle -> IO ()) -> IO (ConnectId self)+afterStyleChanged :: ToolbarClass self => self -> (ToolbarStyle -> IO ()) -> IO (ConnectId self)+onPopupContextMenu :: ToolbarClass self => self -> (Int -> Int -> Int -> IO Bool) -> IO (ConnectId self)+afterPopupContextMenu :: ToolbarClass self => self -> (Int -> Int -> Int -> IO Bool) -> IO (ConnectId self)++module Graphics.UI.Gtk.Abstract.Container+data Container+instance ContainerClass Container+instance GObjectClass Container+instance ObjectClass Container+instance WidgetClass Container+class WidgetClass o => ContainerClass o+instance ContainerClass AboutDialog+instance ContainerClass Alignment+instance ContainerClass AspectFrame+instance ContainerClass Bin+instance ContainerClass Box+instance ContainerClass Button+instance ContainerClass ButtonBox+instance ContainerClass CList+instance ContainerClass CTree+instance ContainerClass CheckButton+instance ContainerClass CheckMenuItem+instance ContainerClass ColorButton+instance ContainerClass ColorSelection+instance ContainerClass ColorSelectionDialog+instance ContainerClass Combo+instance ContainerClass ComboBox+instance ContainerClass ComboBoxEntry+instance ContainerClass Container+instance ContainerClass Dialog+instance ContainerClass EventBox+instance ContainerClass Expander+instance ContainerClass FileChooserButton+instance ContainerClass FileChooserDialog+instance ContainerClass FileChooserWidget+instance ContainerClass FileSelection+instance ContainerClass Fixed+instance ContainerClass FontButton+instance ContainerClass FontSelection+instance ContainerClass FontSelectionDialog+instance ContainerClass Frame+instance ContainerClass GammaCurve+instance ContainerClass HBox+instance ContainerClass HButtonBox+instance ContainerClass HPaned+instance ContainerClass HandleBox+instance ContainerClass IconView+instance ContainerClass ImageMenuItem+instance ContainerClass InputDialog+instance ContainerClass Item+instance ContainerClass Layout+instance ContainerClass List+instance ContainerClass ListItem+instance ContainerClass Menu+instance ContainerClass MenuBar+instance ContainerClass MenuItem+instance ContainerClass MenuShell+instance ContainerClass MenuToolButton+instance ContainerClass MessageDialog+instance ContainerClass MozEmbed+instance ContainerClass Notebook+instance ContainerClass OptionMenu+instance ContainerClass Paned+instance ContainerClass Plug+instance ContainerClass RadioButton+instance ContainerClass RadioMenuItem+instance ContainerClass RadioToolButton+instance ContainerClass ScrolledWindow+instance ContainerClass SeparatorMenuItem+instance ContainerClass SeparatorToolItem+instance ContainerClass Socket+instance ContainerClass SourceView+instance ContainerClass Statusbar+instance ContainerClass Table+instance ContainerClass TearoffMenuItem+instance ContainerClass TextView+instance ContainerClass ToggleButton+instance ContainerClass ToggleToolButton+instance ContainerClass ToolButton+instance ContainerClass ToolItem+instance ContainerClass Toolbar+instance ContainerClass TreeView+instance ContainerClass VBox+instance ContainerClass VButtonBox+instance ContainerClass VPaned+instance ContainerClass Viewport+instance ContainerClass Window+castToContainer :: GObjectClass obj => obj -> Container+toContainer :: ContainerClass o => o -> Container+type ContainerForeachCB = Widget -> IO ()+data ResizeMode+ResizeParent :: ResizeMode+ResizeQueue :: ResizeMode+ResizeImmediate :: ResizeMode+instance Enum ResizeMode+instance Eq ResizeMode+containerAdd :: (ContainerClass self, WidgetClass widget) => self -> widget -> IO ()+containerRemove :: (ContainerClass self, WidgetClass widget) => self -> widget -> IO ()+containerForeach :: ContainerClass self => self -> ContainerForeachCB -> IO ()+containerForall :: ContainerClass self => self -> ContainerForeachCB -> IO ()+containerGetChildren :: ContainerClass self => self -> IO [Widget]+data DirectionType+DirTabForward :: DirectionType+DirTabBackward :: DirectionType+DirUp :: DirectionType+DirDown :: DirectionType+DirLeft :: DirectionType+DirRight :: DirectionType+instance Enum DirectionType+instance Eq DirectionType+containerSetFocusChild :: (ContainerClass self, WidgetClass child) => self -> child -> IO ()+containerSetFocusChain :: ContainerClass self => self -> [Widget] -> IO ()+containerGetFocusChain :: ContainerClass self => self -> IO (Maybe [Widget])+containerUnsetFocusChain :: ContainerClass self => self -> IO ()+containerSetFocusVAdjustment :: ContainerClass self => self -> Adjustment -> IO ()+containerGetFocusVAdjustment :: ContainerClass self => self -> IO (Maybe Adjustment)+containerSetFocusHAdjustment :: ContainerClass self => self -> Adjustment -> IO ()+containerGetFocusHAdjustment :: ContainerClass self => self -> IO (Maybe Adjustment)+containerResizeChildren :: ContainerClass self => self -> IO ()+containerSetBorderWidth :: ContainerClass self => self -> Int -> IO ()+containerGetBorderWidth :: ContainerClass self => self -> IO Int+containerGetResizeMode :: ContainerClass self => self -> IO ResizeMode+containerSetResizeMode :: ContainerClass self => self -> ResizeMode -> IO ()+containerResizeMode :: ContainerClass self => Attr self ResizeMode+containerBorderWidth :: ContainerClass self => Attr self Int+containerChild :: (ContainerClass self, WidgetClass widget) => WriteAttr self widget+containerFocusHAdjustment :: ContainerClass self => ReadWriteAttr self (Maybe Adjustment) Adjustment+containerFocusVAdjustment :: ContainerClass self => ReadWriteAttr self (Maybe Adjustment) Adjustment+onAdd :: ContainerClass self => self -> (Widget -> IO ()) -> IO (ConnectId self)+afterAdd :: ContainerClass self => self -> (Widget -> IO ()) -> IO (ConnectId self)+onCheckResize :: ContainerClass self => self -> IO () -> IO (ConnectId self)+afterCheckResize :: ContainerClass self => self -> IO () -> IO (ConnectId self)+onFocus :: ContainerClass con => con -> (DirectionType -> IO DirectionType) -> IO (ConnectId con)+afterFocus :: ContainerClass con => con -> (DirectionType -> IO DirectionType) -> IO (ConnectId con)+onRemove :: ContainerClass self => self -> (Widget -> IO ()) -> IO (ConnectId self)+afterRemove :: ContainerClass self => self -> (Widget -> IO ()) -> IO (ConnectId self)+onSetFocusChild :: ContainerClass self => self -> (Widget -> IO ()) -> IO (ConnectId self)+afterSetFocusChild :: ContainerClass self => self -> (Widget -> IO ()) -> IO (ConnectId self)++module Graphics.UI.Gtk.MenuComboToolbar.Combo+data Combo+instance BoxClass Combo+instance ComboClass Combo+instance ContainerClass Combo+instance GObjectClass Combo+instance HBoxClass Combo+instance ObjectClass Combo+instance WidgetClass Combo+class HBoxClass o => ComboClass o+instance ComboClass Combo+castToCombo :: GObjectClass obj => obj -> Combo+toCombo :: ComboClass o => o -> Combo+comboNew :: IO Combo+comboSetPopdownStrings :: ComboClass self => self -> [String] -> IO ()+comboSetValueInList :: ComboClass self => self -> Bool -> Bool -> IO ()+comboSetUseArrows :: ComboClass self => self -> Bool -> IO ()+comboSetUseArrowsAlways :: ComboClass self => self -> Bool -> IO ()+comboSetCaseSensitive :: ComboClass self => self -> Bool -> IO ()+comboDisableActivate :: ComboClass self => self -> IO ()+comboEnableArrowKeys :: ComboClass self => Attr self Bool+comboEnableArrowsAlways :: ComboClass self => Attr self Bool+comboCaseSensitive :: ComboClass self => Attr self Bool+comboAllowEmpty :: ComboClass self => Attr self Bool+comboValueInList :: ComboClass self => Attr self Bool++module Graphics.UI.Gtk.Abstract.ButtonBox+data ButtonBox+instance BoxClass ButtonBox+instance ButtonBoxClass ButtonBox+instance ContainerClass ButtonBox+instance GObjectClass ButtonBox+instance ObjectClass ButtonBox+instance WidgetClass ButtonBox+class BoxClass o => ButtonBoxClass o+instance ButtonBoxClass ButtonBox+instance ButtonBoxClass HButtonBox+instance ButtonBoxClass VButtonBox+castToButtonBox :: GObjectClass obj => obj -> ButtonBox+toButtonBox :: ButtonBoxClass o => o -> ButtonBox+data ButtonBoxStyle+ButtonboxDefaultStyle :: ButtonBoxStyle+ButtonboxSpread :: ButtonBoxStyle+ButtonboxEdge :: ButtonBoxStyle+ButtonboxStart :: ButtonBoxStyle+ButtonboxEnd :: ButtonBoxStyle+instance Enum ButtonBoxStyle+instance Eq ButtonBoxStyle+buttonBoxGetLayout :: ButtonBoxClass self => self -> IO ButtonBoxStyle+buttonBoxSetLayout :: ButtonBoxClass self => self -> ButtonBoxStyle -> IO ()+buttonBoxSetChildSecondary :: (ButtonBoxClass self, WidgetClass child) => self -> child -> Bool -> IO ()+buttonBoxGetChildSecondary :: (ButtonBoxClass self, WidgetClass child) => self -> child -> IO Bool+buttonBoxLayoutStyle :: ButtonBoxClass self => Attr self ButtonBoxStyle+buttonBoxChildSecondary :: (ButtonBoxClass self, WidgetClass child) => child -> Attr self Bool++module Graphics.UI.Gtk.Abstract.Box+data Box+instance BoxClass Box+instance ContainerClass Box+instance GObjectClass Box+instance ObjectClass Box+instance WidgetClass Box+class ContainerClass o => BoxClass o+instance BoxClass Box+instance BoxClass ButtonBox+instance BoxClass ColorSelection+instance BoxClass Combo+instance BoxClass FileChooserButton+instance BoxClass FileChooserWidget+instance BoxClass FontSelection+instance BoxClass GammaCurve+instance BoxClass HBox+instance BoxClass HButtonBox+instance BoxClass Statusbar+instance BoxClass VBox+instance BoxClass VButtonBox+castToBox :: GObjectClass obj => obj -> Box+toBox :: BoxClass o => o -> Box+data Packing+PackRepel :: Packing+PackGrow :: Packing+PackNatural :: Packing+instance Enum Packing+instance Eq Packing+boxPackStart :: (BoxClass self, WidgetClass child) => self -> child -> Packing -> Int -> IO ()+boxPackEnd :: (BoxClass self, WidgetClass child) => self -> child -> Packing -> Int -> IO ()+boxPackStartDefaults :: (BoxClass self, WidgetClass widget) => self -> widget -> IO ()+boxPackEndDefaults :: (BoxClass self, WidgetClass widget) => self -> widget -> IO ()+boxGetHomogeneous :: BoxClass self => self -> IO Bool+boxSetHomogeneous :: BoxClass self => self -> Bool -> IO ()+boxGetSpacing :: BoxClass self => self -> IO Int+boxSetSpacing :: BoxClass self => self -> Int -> IO ()+boxReorderChild :: (BoxClass self, WidgetClass child) => self -> child -> Int -> IO ()+boxQueryChildPacking :: (BoxClass self, WidgetClass child) => self -> child -> IO (Packing, Int, PackType)+boxSetChildPacking :: (BoxClass self, WidgetClass child) => self -> child -> Packing -> Int -> PackType -> IO ()+boxSpacing :: BoxClass self => Attr self Int+boxHomogeneous :: BoxClass self => Attr self Bool+boxChildPacking :: (BoxClass self, WidgetClass child) => child -> Attr self Packing+boxChildPadding :: (BoxClass self, WidgetClass child) => child -> Attr self Int+boxChildPackType :: (BoxClass self, WidgetClass child) => child -> Attr self PackType+boxChildPosition :: (BoxClass self, WidgetClass child) => child -> Attr self Int++module Graphics.UI.Gtk.Abstract.Bin+data Bin+instance BinClass Bin+instance ContainerClass Bin+instance GObjectClass Bin+instance ObjectClass Bin+instance WidgetClass Bin+class ContainerClass o => BinClass o+instance BinClass AboutDialog+instance BinClass Alignment+instance BinClass AspectFrame+instance BinClass Bin+instance BinClass Button+instance BinClass CheckButton+instance BinClass CheckMenuItem+instance BinClass ColorButton+instance BinClass ColorSelectionDialog+instance BinClass ComboBox+instance BinClass ComboBoxEntry+instance BinClass Dialog+instance BinClass EventBox+instance BinClass Expander+instance BinClass FileChooserDialog+instance BinClass FileSelection+instance BinClass FontButton+instance BinClass FontSelectionDialog+instance BinClass Frame+instance BinClass HandleBox+instance BinClass ImageMenuItem+instance BinClass InputDialog+instance BinClass Item+instance BinClass ListItem+instance BinClass MenuItem+instance BinClass MenuToolButton+instance BinClass MessageDialog+instance BinClass MozEmbed+instance BinClass OptionMenu+instance BinClass Plug+instance BinClass RadioButton+instance BinClass RadioMenuItem+instance BinClass RadioToolButton+instance BinClass ScrolledWindow+instance BinClass SeparatorMenuItem+instance BinClass SeparatorToolItem+instance BinClass TearoffMenuItem+instance BinClass ToggleButton+instance BinClass ToggleToolButton+instance BinClass ToolButton+instance BinClass ToolItem+instance BinClass Viewport+instance BinClass Window+castToBin :: GObjectClass obj => obj -> Bin+toBin :: BinClass o => o -> Bin+binGetChild :: BinClass self => self -> IO (Maybe Widget)++module Graphics.Rendering.Cairo.Matrix+data Matrix+Matrix :: Double -> Double -> Double -> Double -> Double -> Double -> Matrix+instance Eq Matrix+instance Num Matrix+instance Show Matrix+instance Storable Matrix+type MatrixPtr = Ptr Matrix+identity :: Matrix+translate :: Double -> Double -> Matrix -> Matrix+scale :: Double -> Double -> Matrix -> Matrix+rotate :: Double -> Matrix -> Matrix+transformDistance :: Matrix -> (Double, Double) -> (Double, Double)+transformPoint :: Matrix -> (Double, Double) -> (Double, Double)+scalarMultiply :: Double -> Matrix -> Matrix+adjoint :: Matrix -> Matrix+invert :: Matrix -> Matrix++module Graphics.Rendering.Cairo+renderWith :: MonadIO m => Surface -> Render a -> m a+save :: Render ()+restore :: Render ()+status :: Render Status+withTargetSurface :: (Surface -> Render a) -> Render a+setSourceRGB :: Double -> Double -> Double -> Render ()+setSourceRGBA :: Double -> Double -> Double -> Double -> Render ()+setSource :: Pattern -> Render ()+setSourceSurface :: Surface -> Double -> Double -> Render ()+getSource :: Render Pattern+setAntialias :: Antialias -> Render ()+setDash :: [Double] -> Double -> Render ()+setFillRule :: FillRule -> Render ()+getFillRule :: Render FillRule+setLineCap :: LineCap -> Render ()+getLineCap :: Render LineCap+setLineJoin :: LineJoin -> Render ()+getLineJoin :: Render LineJoin+setLineWidth :: Double -> Render ()+getLineWidth :: Render Double+setMiterLimit :: Double -> Render ()+getMiterLimit :: Render Double+setOperator :: Operator -> Render ()+getOperator :: Render Operator+setTolerance :: Double -> Render ()+getTolerance :: Render Double+clip :: Render ()+clipPreserve :: Render ()+resetClip :: Render ()+fill :: Render ()+fillPreserve :: Render ()+fillExtents :: Render (Double, Double, Double, Double)+inFill :: Double -> Double -> Render Bool+mask :: Pattern -> Render ()+maskSurface :: Surface -> Double -> Double -> Render ()+paint :: Render ()+paintWithAlpha :: Double -> Render ()+stroke :: Render ()+strokePreserve :: Render ()+strokeExtents :: Render (Double, Double, Double, Double)+inStroke :: Double -> Double -> Render Bool+copyPage :: Render ()+showPage :: Render ()+getCurrentPoint :: Render (Double, Double)+newPath :: Render ()+closePath :: Render ()+arc :: Double -> Double -> Double -> Double -> Double -> Render ()+arcNegative :: Double -> Double -> Double -> Double -> Double -> Render ()+curveTo :: Double -> Double -> Double -> Double -> Double -> Double -> Render ()+lineTo :: Double -> Double -> Render ()+moveTo :: Double -> Double -> Render ()+rectangle :: Double -> Double -> Double -> Double -> Render ()+textPath :: String -> Render ()+relCurveTo :: Double -> Double -> Double -> Double -> Double -> Double -> Render ()+relLineTo :: Double -> Double -> Render ()+relMoveTo :: Double -> Double -> Render ()+withRGBPattern :: Double -> Double -> Double -> (Pattern -> Render a) -> Render a+withRGBAPattern :: Double -> Double -> Double -> Double -> (Pattern -> Render a) -> Render a+withPatternForSurface :: Surface -> (Pattern -> Render a) -> Render a+withLinearPattern :: Double -> Double -> Double -> Double -> (Pattern -> Render a) -> Render a+withRadialPattern :: Double -> Double -> Double -> Double -> Double -> Double -> (Pattern -> Render a) -> Render a+patternAddColorStopRGB :: Pattern -> Double -> Double -> Double -> Double -> Render ()+patternAddColorStopRGBA :: Pattern -> Double -> Double -> Double -> Double -> Double -> Render ()+patternSetMatrix :: Pattern -> Matrix -> Render ()+patternGetMatrix :: Pattern -> Render Matrix+patternSetExtend :: Pattern -> Extend -> Render ()+patternGetExtend :: Pattern -> Render Extend+patternSetFilter :: Pattern -> Filter -> Render ()+patternGetFilter :: Pattern -> Render Filter+translate :: Double -> Double -> Render ()+scale :: Double -> Double -> Render ()+rotate :: Double -> Render ()+transform :: Matrix -> Render ()+setMatrix :: Matrix -> Render ()+getMatrix :: Render Matrix+identityMatrix :: Render ()+userToDevice :: Double -> Double -> Render (Double, Double)+userToDeviceDistance :: Double -> Double -> Render (Double, Double)+deviceToUser :: Double -> Double -> Render (Double, Double)+deviceToUserDistance :: Double -> Double -> Render (Double, Double)+selectFontFace :: String -> FontSlant -> FontWeight -> Render ()+setFontSize :: Double -> Render ()+setFontMatrix :: Matrix -> Render ()+getFontMatrix :: Render Matrix+showText :: String -> Render ()+fontExtents :: Render FontExtents+textExtents :: String -> Render TextExtents+fontOptionsCreate :: Render FontOptions+fontOptionsCopy :: FontOptions -> Render FontOptions+fontOptionsMerge :: FontOptions -> FontOptions -> Render ()+fontOptionsHash :: FontOptions -> Render Int+fontOptionsEqual :: FontOptions -> FontOptions -> Render Bool+fontOptionsSetAntialias :: FontOptions -> Antialias -> Render ()+fontOptionsGetAntialias :: FontOptions -> Render Antialias+fontOptionsSetSubpixelOrder :: FontOptions -> SubpixelOrder -> Render ()+fontOptionsGetSubpixelOrder :: FontOptions -> Render SubpixelOrder+fontOptionsSetHintStyle :: FontOptions -> HintStyle -> Render ()+fontOptionsGetHintStyle :: FontOptions -> Render HintStyle+fontOptionsSetHintMetrics :: FontOptions -> HintMetrics -> Render ()+fontOptionsGetHintMetrics :: FontOptions -> Render HintMetrics+withSimilarSurface :: Surface -> Content -> Int -> Int -> (Surface -> IO a) -> IO a+renderWithSimilarSurface :: Content -> Int -> Int -> (Surface -> Render a) -> Render a+surfaceGetFontOptions :: Surface -> Render FontOptions+surfaceMarkDirty :: Surface -> Render ()+surfaceMarkDirtyRectangle :: Surface -> Int -> Int -> Int -> Int -> Render ()+surfaceSetDeviceOffset :: Surface -> Double -> Double -> Render ()+withImageSurface :: Format -> Int -> Int -> (Surface -> IO a) -> IO a+imageSurfaceGetWidth :: Surface -> Render Int+imageSurfaceGetHeight :: Surface -> Render Int+withImageSurfaceFromPNG :: FilePath -> (Surface -> IO a) -> IO a+surfaceWriteToPNG :: Surface -> FilePath -> IO ()+version :: Int+versionString :: String+data Matrix+instance Eq Matrix+instance Num Matrix+instance Show Matrix+instance Storable Matrix+data Surface+data Pattern+data Status+StatusSuccess :: Status+StatusNoMemory :: Status+StatusInvalidRestore :: Status+StatusInvalidPopGroup :: Status+StatusNoCurrentPoint :: Status+StatusInvalidMatrix :: Status+StatusInvalidStatus :: Status+StatusNullPointer :: Status+StatusInvalidString :: Status+StatusInvalidPathData :: Status+StatusReadError :: Status+StatusWriteError :: Status+StatusSurfaceFinished :: Status+StatusSurfaceTypeMismatch :: Status+StatusPatternTypeMismatch :: Status+StatusInvalidContent :: Status+StatusInvalidFormat :: Status+StatusInvalidVisual :: Status+StatusFileNotFound :: Status+StatusInvalidDash :: Status+instance Enum Status+instance Eq Status+data Operator+OperatorClear :: Operator+OperatorSource :: Operator+OperatorOver :: Operator+OperatorIn :: Operator+OperatorOut :: Operator+OperatorAtop :: Operator+OperatorDest :: Operator+OperatorDestOver :: Operator+OperatorDestIn :: Operator+OperatorDestOut :: Operator+OperatorDestAtop :: Operator+OperatorXor :: Operator+OperatorAdd :: Operator+OperatorSaturate :: Operator+instance Enum Operator+data Antialias+AntialiasDefault :: Antialias+AntialiasNone :: Antialias+AntialiasGray :: Antialias+AntialiasSubpixel :: Antialias+instance Enum Antialias+data FillRule+FillRuleWinding :: FillRule+FillRuleEvenOdd :: FillRule+instance Enum FillRule+data LineCap+LineCapButt :: LineCap+LineCapRound :: LineCap+LineCapSquare :: LineCap+instance Enum LineCap+data LineJoin+LineJoinMiter :: LineJoin+LineJoinRound :: LineJoin+LineJoinBevel :: LineJoin+instance Enum LineJoin+data ScaledFont+data FontFace+data Glyph+data TextExtents+TextExtents :: Double -> Double -> Double -> Double -> Double -> Double -> TextExtents+textExtentsXbearing :: TextExtents -> Double+textExtentsYbearing :: TextExtents -> Double+textExtentsWidth :: TextExtents -> Double+textExtentsHeight :: TextExtents -> Double+textExtentsXadvance :: TextExtents -> Double+textExtentsYadvance :: TextExtents -> Double+instance Storable TextExtents+data FontExtents+FontExtents :: Double -> Double -> Double -> Double -> Double -> FontExtents+fontExtentsAscent :: FontExtents -> Double+fontExtentsDescent :: FontExtents -> Double+fontExtentsHeight :: FontExtents -> Double+fontExtentsMaxXadvance :: FontExtents -> Double+fontExtentsMaxYadvance :: FontExtents -> Double+instance Storable FontExtents+data FontSlant+FontSlantNormal :: FontSlant+FontSlantItalic :: FontSlant+FontSlantOblique :: FontSlant+instance Enum FontSlant+data FontWeight+FontWeightNormal :: FontWeight+FontWeightBold :: FontWeight+instance Enum FontWeight+data SubpixelOrder+SubpixelOrderDefault :: SubpixelOrder+SubpixelOrderRgb :: SubpixelOrder+SubpixelOrderBgr :: SubpixelOrder+SubpixelOrderVrgb :: SubpixelOrder+SubpixelOrderVbgr :: SubpixelOrder+instance Enum SubpixelOrder+data HintStyle+HintStyleDefault :: HintStyle+HintStyleNone :: HintStyle+HintStyleSlight :: HintStyle+HintStyleMedium :: HintStyle+HintStyleFull :: HintStyle+instance Enum HintStyle+data HintMetrics+HintMetricsDefault :: HintMetrics+HintMetricsOff :: HintMetrics+HintMetricsOn :: HintMetrics+instance Enum HintMetrics+data FontOptions+data Path+data Content+ContentColor :: Content+ContentAlpha :: Content+ContentColorAlpha :: Content+instance Enum Content+data Format+FormatARGB32 :: Format+FormatRGB24 :: Format+FormatA8 :: Format+FormatA1 :: Format+instance Enum Format+data Extend+ExtendNone :: Extend+ExtendRepeat :: Extend+ExtendReflect :: Extend+instance Enum Extend+data Filter+FilterFast :: Filter+FilterGood :: Filter+FilterBest :: Filter+FilterNearest :: Filter+FilterBilinear :: Filter+FilterGaussian :: Filter+instance Enum Filter++module Graphics.UI.Gtk.Cairo+cairoFontMapNew :: IO FontMap+cairoFontMapSetResolution :: Double -> FontMap -> IO ()+cairoFontMapGetResolution :: FontMap -> IO Double+cairoCreateContext :: Maybe FontMap -> IO PangoContext+cairoContextSetResolution :: PangoContext -> Double -> IO ()+cairoContextGetResolution :: PangoContext -> IO Double+cairoContextSetFontOptions :: PangoContext -> FontOptions -> IO ()+cairoContextGetFontOptions :: PangoContext -> IO FontOptions+renderWithDrawable :: DrawableClass drawable => drawable -> Render a -> IO a+setSourceColor :: Color -> Render ()+setSourcePixbuf :: Pixbuf -> Double -> Double -> Render ()+region :: Region -> Render ()+updateContext :: PangoContext -> Render ()+createLayout :: String -> Render PangoLayout+updateLayout :: PangoLayout -> Render ()+showGlyphString :: GlyphItem -> Render ()+showLayoutLine :: LayoutLine -> Render ()+showLayout :: PangoLayout -> Render ()+glyphStringPath :: GlyphItem -> Render ()+layoutLinePath :: LayoutLine -> Render ()+layoutPath :: PangoLayout -> Render ()++module Graphics.UI.Gtk++module Graphics.UI.Gtk.Mogul.NewWidget+newTextBuffer :: Maybe TextTagTable -> IO TextBuffer+newLabel :: Maybe String -> IO Label+newNamedLabel :: WidgetName -> Maybe String -> IO Label+newAccelLabel :: String -> IO AccelLabel+newNamedAccelLabel :: WidgetName -> String -> IO AccelLabel+newArrow :: ArrowType -> ShadowType -> IO Arrow+newNamedArrow :: WidgetName -> ArrowType -> ShadowType -> IO Arrow+newImageFromFile :: FilePath -> IO Image+newNamedImageFromFile :: WidgetName -> FilePath -> IO Image+newAlignment :: Float -> Float -> Float -> Float -> IO Alignment+newNamedAlignment :: WidgetName -> Float -> Float -> Float -> Float -> IO Alignment+newFrame :: IO Frame+newNamedFrame :: WidgetName -> IO Frame+newAspectFrame :: Float -> Float -> Maybe Float -> IO AspectFrame+newNamedAspectFrame :: WidgetName -> Float -> Float -> Maybe Float -> IO AspectFrame+newButton :: IO Button+newNamedButton :: WidgetName -> IO Button+newButtonWithLabel :: String -> IO Button+newNamedButtonWithLabel :: WidgetName -> String -> IO Button+newButtonWithMnemonic :: String -> IO Button+newNamedButtonWithMnemonic :: WidgetName -> String -> IO Button+newButtonFromStock :: String -> IO Button+newNamedButtonFromStock :: WidgetName -> String -> IO Button+newToggleButton :: IO ToggleButton+newNamedToggleButton :: WidgetName -> IO ToggleButton+newToggleButtonWithLabel :: String -> IO ToggleButton+newNamedToggleButtonWithLabel :: WidgetName -> String -> IO ToggleButton+newCheckButton :: IO CheckButton+newNamedCheckButton :: WidgetName -> IO CheckButton+newCheckButtonWithLabel :: String -> IO CheckButton+newNamedCheckButtonWithLabel :: WidgetName -> String -> IO CheckButton+newCheckButtonWithMnemonic :: String -> IO CheckButton+newNamedCheckButtonWithMnemonic :: WidgetName -> String -> IO CheckButton+newRadioButton :: IO RadioButton+newNamedRadioButton :: WidgetName -> IO RadioButton+newRadioButtonWithLabel :: String -> IO RadioButton+newNamedRadioButtonWithLabel :: WidgetName -> String -> IO RadioButton+newRadioButtonJoinGroup :: RadioButton -> IO RadioButton+newNamedRadioButtonJoinGroup :: WidgetName -> RadioButton -> IO RadioButton+newRadioButtonJoinGroupWithLabel :: RadioButton -> String -> IO RadioButton+newNamedRadioButtonJoinGroupWithLabel :: WidgetName -> RadioButton -> String -> IO RadioButton+newOptionMenu :: IO OptionMenu+newNamedOptionMenu :: WidgetName -> IO OptionMenu+newMenuItem :: IO MenuItem+newNamedMenuItem :: WidgetName -> IO MenuItem+newMenuItemWithLabel :: String -> IO MenuItem+newNamedMenuItemWithLabel :: WidgetName -> String -> IO MenuItem+newCheckMenuItem :: IO CheckMenuItem+newNamedCheckMenuItem :: WidgetName -> IO CheckMenuItem+newCheckMenuItemWithLabel :: String -> IO CheckMenuItem+newNamedCheckMenuItemWithLabel :: WidgetName -> String -> IO CheckMenuItem+newRadioMenuItem :: IO RadioMenuItem+newNamedRadioMenuItem :: WidgetName -> IO RadioMenuItem+newRadioMenuItemWithLabel :: String -> IO RadioMenuItem+newNamedRadioMenuItemWithLabel :: WidgetName -> String -> IO RadioMenuItem+newRadioMenuItemJoinGroup :: RadioMenuItem -> IO RadioMenuItem+newNamedRadioMenuItemJoinGroup :: WidgetName -> RadioMenuItem -> IO RadioMenuItem+newRadioMenuItemJoinGroupWithLabel :: RadioMenuItem -> String -> IO RadioMenuItem+newNamedRadioMenuItemJoinGroupWithLabel :: WidgetName -> RadioMenuItem -> String -> IO RadioMenuItem+newTearoffMenuItem :: IO TearoffMenuItem+newNamedTearoffMenuItem :: WidgetName -> IO TearoffMenuItem+newWindow :: IO Window+newNamedWindow :: WidgetName -> IO Window+newDialog :: IO Dialog+newNamedDialog :: WidgetName -> IO Dialog+newEventBox :: IO EventBox+newNamedEventBox :: WidgetName -> IO EventBox+newHandleBox :: IO HandleBox+newNamedHandleBox :: WidgetName -> IO HandleBox+newScrolledWindow :: Maybe Adjustment -> Maybe Adjustment -> IO ScrolledWindow+newNamedScrolledWindow :: WidgetName -> Maybe Adjustment -> Maybe Adjustment -> IO ScrolledWindow+newViewport :: Adjustment -> Adjustment -> IO Viewport+newNamedViewport :: WidgetName -> Adjustment -> Adjustment -> IO Viewport+newVBox :: Bool -> Int -> IO VBox+newNamedVBox :: WidgetName -> Bool -> Int -> IO VBox+newHBox :: Bool -> Int -> IO HBox+newNamedHBox :: WidgetName -> Bool -> Int -> IO HBox+newCombo :: IO Combo+newNamedCombo :: WidgetName -> IO Combo+newStatusbar :: IO Statusbar+newNamedStatusbar :: WidgetName -> IO Statusbar+newHPaned :: IO HPaned+newNamedHPaned :: WidgetName -> IO HPaned+newVPaned :: IO VPaned+newNamedVPaned :: WidgetName -> IO VPaned+newLayout :: Maybe Adjustment -> Maybe Adjustment -> IO Layout+newNamedLayout :: WidgetName -> Maybe Adjustment -> Maybe Adjustment -> IO Layout+newMenu :: IO Menu+newNamedMenu :: WidgetName -> IO Menu+newMenuBar :: IO MenuBar+newNamedMenuBar :: WidgetName -> IO MenuBar+newNotebook :: IO Notebook+newNamedNotebook :: WidgetName -> IO Notebook+newTable :: Int -> Int -> Bool -> IO Table+newNamedTable :: WidgetName -> Int -> Int -> Bool -> IO Table+newTextView :: IO TextView+newNamedTextView :: WidgetName -> IO TextView+newToolbar :: IO Toolbar+newNamedToolbar :: WidgetName -> IO Toolbar+newCalendar :: IO Calendar+newNamedCalendar :: WidgetName -> IO Calendar+newEntry :: IO Entry+newNamedEntry :: WidgetName -> IO Entry+newSpinButton :: Adjustment -> Double -> Int -> IO SpinButton+newNamedSpinButton :: String -> Adjustment -> Double -> Int -> IO SpinButton+newSpinButtonWithRange :: Double -> Double -> Double -> IO SpinButton+newNamedSpinButtonWithRange :: WidgetName -> Double -> Double -> Double -> IO SpinButton+newHScale :: Adjustment -> IO HScale+newNamedHScale :: WidgetName -> Adjustment -> IO HScale+newVScale :: Adjustment -> IO VScale+newNamedVScale :: WidgetName -> Adjustment -> IO VScale+newHScrollbar :: Adjustment -> IO HScrollbar+newNamedHScrollbar :: WidgetName -> Adjustment -> IO HScrollbar+newVScrollbar :: Adjustment -> IO VScrollbar+newNamedVScrollbar :: WidgetName -> Adjustment -> IO VScrollbar+newHSeparator :: IO HSeparator+newNamedHSeparator :: WidgetName -> IO HSeparator+newVSeparator :: IO VSeparator+newNamedVSeparator :: WidgetName -> IO VSeparator+newProgressBar :: IO ProgressBar+newNamedProgressBar :: WidgetName -> IO ProgressBar+newAdjustment :: Double -> Double -> Double -> Double -> Double -> Double -> IO Adjustment+newTooltips :: IO Tooltips+newTreeView :: TreeModelClass tm => tm -> IO TreeView+newNamedTreeView :: TreeModelClass tm => WidgetName -> tm -> IO TreeView+newTreeViewWithModel :: TreeModelClass tm => tm -> IO TreeView+newNamedTreeViewWithModel :: TreeModelClass tm => WidgetName -> tm -> IO TreeView+newTreeViewColumn :: IO TreeViewColumn+newIconFactory :: IO IconFactory++module Graphics.UI.Gtk.Mogul.MDialog+assureDialog :: String -> (Dialog -> IO ()) -> (Dialog -> IO ()) -> IO ()++module Graphics.UI.Gtk.Mogul.TreeList+data ListSkel+emptyListSkel :: IO ListSkel+listSkelAddAttribute :: CellRendererClass cr => ListSkel -> Attribute cr argTy -> IO (Association cr, TreeIter -> IO argTy, TreeIter -> argTy -> IO ())+newListStore :: ListSkel -> IO ListStore+data TreeSkel+emptyTreeSkel :: IO TreeSkel+treeSkelAddAttribute :: CellRendererClass r => TreeSkel -> Attribute r argTy -> IO (Association r, TreeIter -> IO argTy, TreeIter -> argTy -> IO ())+newTreeStore :: TreeSkel -> IO TreeStore+data Association cr+data Renderer cr+treeViewColumnNewText :: TreeViewColumn -> Bool -> Bool -> IO (Renderer CellRendererText)+treeViewColumnNewPixbuf :: TreeViewColumn -> Bool -> Bool -> IO (Renderer CellRendererPixbuf)+treeViewColumnNewToggle :: TreeViewColumn -> Bool -> Bool -> IO (Renderer CellRendererToggle)+treeViewColumnAssociate :: CellRendererClass r => Renderer r -> [Association r] -> IO ()+cellRendererSetAttribute :: CellRendererClass cr => Renderer cr -> Attribute cr val -> val -> IO ()+cellRendererGetAttribute :: CellRendererClass cr => Renderer cr -> Attribute cr val -> IO val+onEdited :: TreeModelClass tm => Renderer CellRendererText -> tm -> (TreeIter -> String -> IO ()) -> IO (ConnectId CellRendererText)+afterEdited :: TreeModelClass tm => Renderer CellRendererText -> tm -> (TreeIter -> String -> IO ()) -> IO (ConnectId CellRendererText)++module Graphics.UI.Gtk.Mogul+
scripts/hoogle/src/Web/res/prefix.inc view
@@ -6,13 +6,47 @@ 		<link type="text/css" rel="stylesheet" href="res/hoogle.css" />
 
 		<script type="text/javascript">
-		function on_load()
-		{
-			document.getElementById('txt').focus();
-		}
+function addHoogle()
+{
+	addEngine('hoogle','png','Programming','4691');
+}
+
+function addEngine(name,ext,cat,pid)
+{
+  if ((typeof window.sidebar == "object") && (typeof window.sidebar.addSearchEngine == "function")) {
+    window.sidebar.addSearchEngine(
+      "http://mycroft.mozdev.org/install.php/" + pid + "/" + name + ".src",
+      "http://mycroft.mozdev.org/install.php/" + pid + "/" + name + "."+ ext, name, cat );
+  } else {
+    alert("You will need a browser which supports Sherlock to install this plugin.");
+  }
+}
+
+function on_load()
+{
+	document.getElementById('txt').focus();
+}
 		</script>
 	</head>
 	<body onload="on_load()" id="answers">
+
+<table id="header">
+	<tr>
+		<td style="text-align:left;">
+			<a href="http://www.haskell.org/">haskell.org</a>
+		</td>
+		<td style="text-align:right;">
+			<!--[if IE]>
+			<div style="display:none;">
+			<![endif]-->
+			<a href="javascript:addHoogle()">Firefox plugin</a> |
+			<!--[if IE]>
+			</div>
+			<![endif]-->
+			<a href="http://www.haskell.org/haskellwiki/Hoogle/Tutorial">Tutorial</a> |
+			<a href="http://www.haskell.org/haskellwiki/Hoogle">Manual</a>
+		</td>
+</table>
 
 <div id="logo">
 	<a href=".">
+ scripts/hoogle/src/Web/res/prefix_gtk.inc view
@@ -0,0 +1,65 @@+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+	<head>
+		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+		<title>$ - Hoogle</title>
+		<link type="text/css" rel="stylesheet" href="res/hoogle.css" />
+
+		<script type="text/javascript">
+function addHoogle()
+{
+	addEngine('hoogle','png','Programming','4691');
+}
+
+function addEngine(name,ext,cat,pid)
+{
+  if ((typeof window.sidebar == "object") && (typeof window.sidebar.addSearchEngine == "function")) {
+    window.sidebar.addSearchEngine(
+      "http://mycroft.mozdev.org/install.php/" + pid + "/" + name + ".src",
+      "http://mycroft.mozdev.org/install.php/" + pid + "/" + name + "."+ ext, name, cat );
+  } else {
+    alert("You will need a browser which supports Sherlock to install this plugin.");
+  }
+}
+
+function on_load()
+{
+	document.getElementById('txt').focus();
+}
+		</script>
+	</head>
+	<body onload="on_load()" id="answers">
+
+<table id="header">
+	<tr>
+		<td style="text-align:left;">
+			<a href="http://www.haskell.org/">haskell.org</a>
+		</td>
+		<td style="text-align:right;">
+			<!--[if IE]>
+			<div style="display:none;">
+			<![endif]-->
+			<a href="javascript:addHoogle()">Firefox plugin</a> |
+			<!--[if IE]>
+			</div>
+			<![endif]-->
+			<a href="http://www.haskell.org/haskellwiki/Hoogle/Tutorial">Tutorial</a> |
+			<a href="http://www.haskell.org/haskellwiki/Hoogle">Manual</a>
+		</td>
+</table>
+
+<div id="logo" style="vertical-align: middle">
+	<a href=".">
+		<img src="res/hoogle_small.png" alt="Hoogle" />
+	</a>
+	<a href="http://www.haskell.org/gtk2hs/">Gtk2Hs:</a> 
+</div>
+
+<form action="?" method="get">
+	<div>
+		<input type="hidden" name="package" value="gtk" />
+		<input name="q" id="txt" type="text" style="width:300px;margin-right:5px;" value="$" />
+		<input style="padding-left:15px;padding-right:15px;" type="submit" value="Search" />
+	</div>
+</form>
+
scripts/hoogle/src/Web/res/suffix.inc view
@@ -1,7 +1,5 @@ <p id="footer">
 	&copy; <a href="http://www.cs.york.ac.uk/~ndm/">Neil Mitchell</a> 2004-2006
-	&nbsp; - &nbsp; <a href="http://www.haskell.org/haskellwiki/Hoogle">wiki</a>
-	&nbsp; - &nbsp; <a href="http://www.cs.york.ac.uk/~ndm/contact.php">email me</a>
 </p>
 
 	</body>
scripts/hoogle/web/download.htm view
@@ -4,6 +4,25 @@ 		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
 		<link href="res/hoogle.css" rel="stylesheet" type="text/css" />
 		<title>Hoogle - Download</title>
+
+<script type="text/javascript">
+function addHoogle()
+{
+	addEngine('hoogle','png','Programming','4691');
+}
+
+function addEngine(name,ext,cat,pid)
+{
+  if ((typeof window.sidebar == "object") && (typeof window.sidebar.addSearchEngine == "function")) {
+    window.sidebar.addSearchEngine(
+      "http://mycroft.mozdev.org/install.php/" + pid + "/" + name + ".src",
+      "http://mycroft.mozdev.org/install.php/" + pid + "/" + name + "."+ ext, name, cat );
+  } else {
+    alert("You will need a browser which supports Sherlock to install this plugin.");
+  }
+}
+</script>
+
 	</head>
 	<body id="down">
 
@@ -17,6 +36,12 @@ 
 <p>
 	Various aspects of this project will be available for download, as well as for use online. In the future this section will contain links to the downloads, however currently they are changing rapidly, so if you want a copy email me, or get <a href="developers.htm">the source</a>.
+</p>
+
+<h2>Firefox Plugin</h2>
+
+<p>
+	A <a href="http://www.mozilla.com/firefox/">Firefox</a> plugin by <a href="http://www.cs.york.ac.uk/~miked/">Mike Dodds</a> is available, to install <a href="javascript:addHoogle()">click here</a>.
 </p>
 
 	</body>
scripts/hoogle/web/res/hoogle.css view
@@ -4,8 +4,8 @@ 
 body {
 	margin: 0px;
-	padding: 10px;
 	font-family: sans-serif;
+	padding: 3px;
 }
 
 a img {
@@ -16,8 +16,30 @@ 	background-color: #ffb;
 }
 
+/********************************************************************
+*  THE TOP
+*/
 
+#header {
+	width: 100%;
+	font-size: 11pt;
+}
+
+#header a {
+	text-decoration: none;
+}
+
+
 /********************************************************************
+*  THE BOTTOM
+*/
+#footer {
+	text-align: center;
+	font-size: 10pt;
+}
+
+
+/********************************************************************
 *  HEADING SEARCH
 */
 
@@ -70,105 +92,7 @@ 	padding-left: 5px;
 }
 
-
-
 /********************************************************************
-*  COLORS AND ICONS
-*/
-
-#help h1	{background-color: blue;}
-#about h1	{background-color: green;}
-#down h1	{background-color: #f60;}
-#dev h1		{background-color: red;}
-#acad h1	{background-color: purple;}
-#nodocs h1	{background-color: black;}
-
-
-/********************************************************************
-*  BUTTONS
-*/
-
-#buttons {
-	text-align: right;
-	width: 100px;
-	vertical-align: top;
-}
-#buttons a {
-	text-align: left;
-	display: block;
-	width: 100px;
-	height: 32px;
-	border: 1px solid red;
-	margin: 5px;
-	padding-left: 45px;
-
-	background-image: url(icons.png);
-	background-position: 0px 0px;
-	background-repeat: no-repeat;
-	background-color: white;
-
-	text-decoration: none;
-	font-weight: bold;
-	font-size: 12pt;
-	padding-top: 12px;
-}
-
-#buttons a:hover {
-	background-color: white
-}
-
-#buttons #help {
-	color: blue;
-	border-color: blue;
-	background-position: 0px 0px;
-}
-
-#buttons #about {
-	color: green;
-	border-color: green;
-	background-position: 0px -56px;
-}
-
-#buttons #down {
-	color: #f60;
-	border-color: #f60;
-	background-position: 0px -113px;
-}
-
-#buttons #dev {
-	color: red;
-	border-color: red;
-	background-position: 0px -170px;
-}
-
-#buttons #acad {
-	color: purple;
-	border-color: purple;
-	background-position: 0px -227px;
-}
-
-#buttons #haskell {
-	color: #35807E;
-	border-color: #35807E;
-	background-image: url(haskell_icon.png);
-	background-position: center left;
-}
-
-
-/********************************************************************
-*  COPYRIGHT
-*/
-#footer {
-	text-align: center;
-	font-size: 10pt;
-}
-
-#answers #footer {
-	background-color: #eee;
-	margin-top: 25px;
-}
-
-/********************************************************************
 *  RESULTS
 */
 
@@ -227,18 +151,6 @@ .c5{background-color: #fcf;}
 .c6{background-color: #cff;}
 
-
-
-#example {
-	margin-top: 40px;
-	border: 2px solid #cc0;
-	background-color: #ffc;
-	text-align: left;
-	margin-left: 30%;
-	margin-right: 30%;
-	font-size: 10pt;
-	padding: 3px;
-}
 
 #suggest, #lambdabot {
 	padding: 0px;
+ scripts/vim/run view
@@ -0,0 +1,21 @@+#!/bin/sh++# Copyright (c) 2006 Don Stewart - http://www.cse.unsw.edu.au/~dons+# adapted by Gareth Smith+# GPL version 2 or later (see http://www.gnu.org/copyleft/gpl.html)++#+# A shell script to be called from vim, to use the awsesome power of haskell+# string processing in everyday editing.+#+# Select the line you want to edit, and in vim, type:+#       !!run+#+# (Assuming your lambdabot is installed in $HOME/lambdabot) it will+# run the line as a haskell expression.+#++DECL=`cat`+cd $HOME/lambdabot+echo "run $DECL" | ./lambdabot 2> /dev/null | sed '$d;/Irc/d;s/lambdabot> //'+
+ scripts/vim/runwith view
@@ -0,0 +1,32 @@+#!/bin/sh++# Copyright (c) 2006 Don Stewart - http://www.cse.unsw.edu.au/~dons+# adapted by Gareth Smith+# GPL version 2 or later (see http://www.gnu.org/copyleft/gpl.html)++#+# A shell script to be called from vim, to use the awsesome power of haskell+# string processing in everyday editing.+#+# Select the line you want to edit, and in vim, type:+#       !!runwith f+#+# where f :: (Show a) => String -> a+#+# (Assuming your lambdabot is installed in $HOME/lambdabot) it will+# replace the line with (f line)+#+# Hint: If you find yourself using a particular function a lot, use:+#       !!bot let+# to define it in lambdabot's local namespace.+#+# Isn't perfect yet - I'd like it if for functions f :: String -> String, that+# the returned String didn't have to pass through the show function, so we+# didn't get extraneous quote marks. For now, you can s/"//g them away though+# :)+#++DECL=`cat`+cd $HOME/lambdabot+echo "run $* \"$DECL\"" | ./lambdabot 2> /dev/null | sed '$d;/Irc/d;s/lambdabot> //'+
+ testsuite/Makefile view
@@ -0,0 +1,13 @@+HC_OPTS=        -fasm -O2 -fth -fglasgow-exts -i..+PP=             ./logpp+GHC=            ghc $(HC_OPTS) --make -pgmF $(PP) -F -threaded++all: run-utests++.PHONY: run-utests+run-utests: +	$(GHC) -o $@ UnitTestsMain.hs++.PHONY: clean+clean:+	rm -f *.o *.hi $(BINS) run-utests
+ testsuite/README view
@@ -0,0 +1,1 @@+Add tests to Tests.hs. Should be fairly obvious.
+ testsuite/TestFramework.hs view
@@ -0,0 +1,208 @@+module TestFramework (++  assert_, assertEqual_, assertEqual2_, assertNotNull_, assertNull_,+  assertSeqEqual_,+  assertLambdabot_,++  tests, random, io80,++  HU.Test(..), runTestTT++) where++import Data.Char+import IO ( stderr )+import List ( (\\) )+import Language.Haskell.TH+import qualified Test.HUnit as HU+import System.Random hiding (random)+import Test.QuickCheck++import Lib.Process+import System.Directory+import qualified Control.Exception as E++type Location = (String, Int)++showLoc :: Location -> String+showLoc (f,n) = f ++ ":" ++ show n++assert_ :: Location -> Bool -> HU.Assertion+assert_ loc False = HU.assertFailure ("assert failed at " ++ showLoc loc)+assert_ loc True = return ()++-- lb+assertLambdabot_ :: Location -> String -> String -> HU.Assertion+assertLambdabot_ loc src expected = do+    actual <- echo src++    if expected /= actual+       then HU.assertFailure (msg actual)+       else return ()++    where msg a = "assertEqual failed at " ++ showLoc loc ++ +                "\n expected: " ++ show expected ++ "\n but got:  " ++ show a++assertEqual_ :: (Eq a, Show a) => Location -> a -> a -> HU.Assertion+assertEqual_ loc expected actual =++    if expected /= actual+       then HU.assertFailure msg+       else return ()++    where msg = "assertEqual failed at " ++ showLoc loc ++ +                "\n expected: " ++ show expected ++ "\n but got:  " ++ show actual++assertEqual2_ :: Eq a => Location -> a -> a -> HU.Assertion+assertEqual2_ loc expected actual = +    if expected /= actual+       then HU.assertFailure ("assertEqual2' failed at " ++ showLoc loc)+       else return ()++assertSeqEqual_ :: (Eq a, Show a) => Location -> [a] -> [a] -> HU.Assertion+assertSeqEqual_ loc expected actual = +    let ne = length expected+        na = length actual+        in case () of+            _| ne /= na ->+                 HU.assertFailure ("assertSeqEqual failed at " ++ showLoc loc+                                   ++ "\n expected length: " ++ show ne+                                   ++ "\n actual length: " ++ show na)+             | not (unorderedEq expected actual) ->+                 HU.assertFailure ("assertSeqEqual failed at " ++ showLoc loc+                                   ++ "\n expected: " ++ show expected+                                   ++ "\n actual: " ++ show actual)+             | otherwise -> return ()+    where unorderedEq l1 l2 = +              null (l1 \\ l2) && null (l2 \\ l1)+              ++assertNotNull_ :: Location -> [a] -> HU.Assertion+assertNotNull_ loc [] = HU.assertFailure ("assertNotNull failed at " ++ showLoc loc)+assertNotNull_ _ (_:_) = return ()++assertNull_ :: Location -> [a] -> HU.Assertion+assertNull_ loc (_:_) = HU.assertFailure ("assertNull failed at " ++ showLoc loc)+assertNull_ loc [] = return ()+++tests :: String -> Q [Dec] -> Q [Dec]+tests name decs = +    do decs' <- decs+       let ts = collectTests decs'+       e <- [| HU.TestLabel name (HU.TestList $(listE (map mkExp ts))) |]+       let lete = LetE decs' e+           suiteDec = ValD (VarP (mkName name)) (NormalB lete) []+           resDecs = [suiteDec]+       --runIO $ putStrLn (pprint resDecs)+       return resDecs+    where+    collectTests :: [Dec] -> [Name]+    collectTests [] = []+    collectTests (ValD (VarP name) _ _ : rest) +        | isTestName (nameBase name) = name : collectTests rest+    collectTests (_ : rest) = collectTests rest+    isTestName ('t':'e':'s':'t':_) = True+    isTestName _ = False+    mkExp :: Name -> Q Exp+    mkExp name = +        let s = nameBase name+            in [| HU.TestLabel s (HU.TestCase $(varE name)) |]+++-- We use our own test runner, because HUnit print test paths a bit unreadable:+-- If a test list contains a named tests, then HUnit prints `i:n' where i+-- is the index of the named tests and n is the name.++{-+`runTestText` executes a test, processing each report line according+to the given reporting scheme.  The reporting scheme's state is+threaded through calls to the reporting scheme's function and finally+returned, along with final count values.+-}+                                               +runTestText :: HU.PutText st -> HU.Test -> IO (HU.Counts, st)+runTestText (HU.PutText put us) t = do+  put allTestsStr True us+  (counts, us') <- HU.performTest reportStart reportError reportFailure us t+  us'' <- put (HU.showCounts counts) True us'+  return (counts, us'')+ where+  allTestsStr = unlines ("All tests:" :+                         map (\p -> "  " ++ showPath p) (HU.testCasePaths t))+  reportStart ss us = put (HU.showCounts (HU.counts ss)) False us+  reportError   = reportProblem "Error:"   "Error in:   "+  reportFailure = reportProblem "Failure:" "Failure in: "+  reportProblem p0 p1 msg ss us = put line True us+   where line  = "### " ++ kind ++ path' ++ '\n' : msg+         kind  = if null path' then p0 else p1+         path' = showPath (HU.path ss)++++{-+`showPath` converts a test case path to a string, separating adjacent+elements by ':'.  An element of the path is quoted (as with `show`)+when there is potential ambiguity.+-}++showPath :: HU.Path -> String+showPath [] = ""+showPath nodes = foldr1 f (map showNode (filterNodes (reverse nodes)))+ where f a b = a ++ ":" ++ b+       showNode (HU.ListItem n) = show n+       showNode (HU.Label label) = safe label (show label)+       safe s ss = if ':' `elem` s || "\"" ++ s ++ "\"" /= ss then ss else s+       filterNodes (HU.ListItem _ : l@(HU.Label _) : rest) = +           l : filterNodes rest+       filterNodes [] = []+       filterNodes (x:rest) = x : filterNodes rest++{-+`runTestTT` provides the "standard" text-based test controller.+Reporting is made to standard error, and progress reports are+included.  For possible programmatic use, the final counts are+returned.  The "TT" in the name suggests "Text-based reporting to the+Terminal".+-}++runTestTT :: HU.Test -> IO HU.Counts+runTestTT t = do (counts, 0) <- runTestText (HU.putTextToHandle stderr True) t+                 return counts++lambdabot     = "./lambdabot"+lambdabotHome = ".."++-- run the lambdabot+echo :: String -> IO String+echo cmd = E.handle (\e -> return (show e)) $ do+    p <- getCurrentDirectory+    setCurrentDirectory lambdabotHome+    let s = cmd ++ "\n"+    v <- eval lambdabot s clean+    setCurrentDirectory p+    return v+ where+    clean s = let f = drop 11 . reverse+              in case f (f s) of+                    [] -> []+                    x  -> init x++    eval :: FilePath -> String -> (String -> String) -> IO String+    eval binary src scrub = do+        (out,_,_) <- popen binary [] (Just src)+        return ( scrub out )++random :: Arbitrary a => IO a+random = do+    g <- getStdGen+    return $ generate 1000 g (arbitrary :: Arbitrary a => Gen a)++io80 :: IO String -> IO String+io80 f = take 80 `fmap` f++instance Arbitrary Char where+    -- filters ctrl chars, and chops lines too remember!+    arbitrary     = elements $ ['a'..'z'] ++ ['A' .. 'Z'] ++ ['0' .. '9']+    coarbitrary c = variant (ord c `rem` 4)+
+ testsuite/Tests.hs view
@@ -0,0 +1,50 @@+module Tests where++import Control.Monad+import TestFramework++-- number of tests to run+n    = 10++run f = mapM_ (const f) [1..n]++------------------------------------------------------------------------+--+-- Test the dummy plugin+--+$(tests "dummyPlugin" [d|++ testDummy = lb "dummy" "dummy"+ testEval  = lb "eval"  ""++ testId= run $ do+            s <- io80 random+            lb ("id " ++ s) (" " ++ s)++ testBug = lb "bug" "http://hackage.haskell.org/trac/ghc/newticket?type=bug"++ |])++------------------------------------------------------------------------+--+-- Test the Where plugin+--++$(tests "wherePlugin" [d|+    testWhere   = lb "where ghc" "http://haskell.org/ghc"+    testWhat    = lb "where ghc" "http://haskell.org/ghc"+    testUrl     = lb "where ghc" "http://haskell.org/ghc"+ |] )++------------------------------------------------------------------------+--+-- Test the Source plugin+--++$(tests "sourcePlugin" [d|+    testSource  = lb "source foldr" $ unlines+        [ "foldr k z xs = go xs"+        ,"    where go []     = z"+        ,"          go (y:ys) = y `k` go ys"]++ |] )
+ testsuite/UnitTestsMain.hs view
@@ -0,0 +1,11 @@+module Main where++import TestFramework+import Tests++allTests = TestList+    [ dummyPlugin+    , wherePlugin+    ]++main = runTestTT allTests
+ testsuite/VariableExpansion.hs view
@@ -0,0 +1,90 @@+module VariableExpansion (expand) where++import Language.Haskell.TH++data Token1 = LitChar Char+           | ShowVar1 String+           | StrVar1 String+             deriving (Eq, Show)++data Token2 = LitStr String+           | ShowVar2 String+           | StrVar2 String+             deriving (Eq, Show)++splitAtElem :: Eq a => [a] -> a -> ([a], [a])+splitAtElem l e = splitAtPred l (e ==)++-- splitAtPred [1,2,3,4] (==3)+--   ==> ([1,2],[3,4])+splitAtPred :: [a] -> (a -> Bool) -> ([a], [a])+splitAtPred (x:xs) p+    | p x        = ([], x:xs)+    | otherwise  = let (a, b) = splitAtPred xs p+                       in (x:a, b)+splitAtPred [] _ = ([], [])++parse :: String -> Q [Token1]+parse ('$':'$':s) = do l <- parse s+                       return (LitChar '$' : l)+parse ('%':'%':s) = do l <- parse s+                       return (LitChar '%' : l)+parse ('$':'{':s) = do (name, restToks) <- parseVar s+                       return (ShowVar1 name : restToks)+parse ('%':'{':s) = do (name, restToks) <- parseVar s+                       return (StrVar1 name : restToks)+parse ('$':_:_)   = fail "Error parsing string to expand"+parse ('%':_:_)   = fail "Error parsing string to expand"+parse (c:s)       = do l <- parse s+                       return (LitChar c : l)+parse []          = return []++parseVar :: [Char] -> Q ([Char], [Token1])+parseVar s =+    case splitAtElem s '}' of+      (_, []) -> fail "Error parsing string to expand"+      (name, '}':rest) -> do l <- parse rest+                             return (name, l)+      _       -> fail "Error parsing string to expand"+++token1ToToken2 :: [Token1] -> [Token2]+token1ToToken2 [] = []+token1ToToken2 toks = +    let (chars, rest) = splitAtPred toks (\t -> case t of+                                                  ShowVar1 _ -> True+                                                  StrVar1 _  -> True+                                                  _          -> False)+        (vars, rest') = splitAtPred rest (\t -> case t of+                                                  LitChar _ -> True+                                                  _         -> False)+        s = map (\t -> case t of LitChar c -> c; _ -> error "token1ToToken2:s") chars+        vars' = map (\t -> case t of+                             ShowVar1 v -> ShowVar2 v+                             StrVar1 v  -> StrVar2 v+                             _          -> error "token1ToToken2") vars+        in (if s /= "" then [LitStr s] else []) ++ vars' ++ +           token1ToToken2 rest'+++expand :: String -> ExpQ+expand s =+    do tokens <- parse s+       --runIO $ putStrLn ("parsing ok: " ++ show tokens)+       let tokens2 = token1ToToken2 tokens+       --runIO $ putStrLn ("tokens2: " ++ show tokens2)+       exps <- sequence $ map toExp tokens2+       conc <- [| (++) |]+       return $ foldr +                  (\l r -> InfixE (Just l) conc (Just r))+                  (LitE (StringL ""))+                  exps+    where toExp (LitStr s')   = litE (StringL s')+          toExp (ShowVar2 s') = [| show $(varE (mkName s')) |]+          toExp (StrVar2 s')  = varE (mkName s')+++-- Local Variables: **+-- indent-tabs-mode: nil **+-- tab-width: 4 **+-- End: **
+ testsuite/logpp view
@@ -0,0 +1,13 @@+#!/bin/sh++origName=$1+inName=$2+outName=$3+macros=`dirname $0`/macros.m4++if [ -z "origName" -o -z "$inName" -o -z "$outName" ] ; then+    echo "Usage: $0 original-filename input-filename output-filename"+    exit 1+fi++exec /usr/bin/m4 -s "-D__orig_file__=\"$origName\"" "-D__TOPLEVEL_DIRECTORY__=\"`pwd`\"" "$macros" "$inName" > "$outName"
+ testsuite/logpp.in view
@@ -0,0 +1,13 @@+#!/bin/sh++origName=$1+inName=$2+outName=$3+macros=`dirname $0`/macros.m4++if [ -z "origName" -o -z "$inName" -o -z "$outName" ] ; then+    echo "Usage: $0 original-filename input-filename output-filename"+    exit 1+fi++exec @WithM4@ -s "-D__orig_file__=\"$origName\"" "-D__TOPLEVEL_DIRECTORY__=\"`pwd`\"" "$macros" "$inName" > "$outName"
+ testsuite/macros.m4 view
@@ -0,0 +1,16 @@+define(SRC_LOC_, (`__orig_file__', `__line__'))+define(debug, (debug_ `SRC_LOC_'))dnl+define(info, (info_ `SRC_LOC_'))dnl+define(warn, (warn_ `SRC_LOC_'))dnl+define(fatal, (fatal_ `SRC_LOC_'))dnl+define(niceError, (niceError_ `SRC_LOC_'))dnl+define(dtrace, (dtrace_ `SRC_LOC_'))dnl+define(assert, (assert_ `SRC_LOC_'))dnl+define(assertEqual, (assertEqual_ `SRC_LOC_'))dnl+define(lb, (assertLambdabot_ `SRC_LOC_'))dnl+define(assertEqual2, (assertEqual2_ `SRC_LOC_'))dnl+define(assertSeqEqual, (assertSeqEqual_ `SRC_LOC_'))dnl+define(assertNull, (assertNull_ `SRC_LOC_'))dnl+define(assertNotNull, (assertNotNull_ `SRC_LOC_'))dnl+changequote(,)dnl+changecom(",")dnl