loadHook :: Irc ()
loadHook = onBangCommand "!seen" $ do
    host        <- getHost
    channel     <- getChannel
    (sender, _) <- first toLower . breakWord <$> getBangCommandText
    r           <- withDatabase $ \db -> Sqlite.query db
        "SELECT time, text FROM seen  \
        \WHERE host = ? AND channel = ? AND sender = ?"
        (host, channel, sender)
    case r of
        -- In the database: seen
        [(time, text)] -> do
            pretty <- liftIO $ prettyTime $ IrcTime time
            writeReply $ "I last saw " <> sender <> " " <> pretty
                                       <> " saying: " <> text
        -- Not yet in the database: not seen
        _ -> writeReply $ "I ain't never seen " <> sender
loadHook :: Irc ()
loadHook = onBangCommand "!seen" $ do
    host        <- getHost
    channel     <- getChannel
    (sender, _) <- first toLower . breakWord <$> getBangCommandText
    r           <- withDatabase $ \db -> Sqlite.query db
        "SELECT time, text FROM seen  \
        \WHERE host = ? AND channel = ? AND sender = ?"
        (host, channel, sender)
    case r of
        -- In the database: seen
        [(time, text)] -> do
            pretty <- liftIO $ prettyTime $ IrcTime time
            writeReply $ "I last saw " <> sender <> " " <> pretty
                                       <> " saying: " <> text
        -- Not yet in the database: not seen
        _ -> writeReply $ "I ain't never seen " <> sender
loadHook = onBangCommand "!seen" $ do
    host        <- getHost
    channel     <- getChannel
    (sender, _) <- first toLower . breakWord <$> getBangCommandText
    r           <- withDatabase $ \db -> Sqlite.query db
        "SELECT time, text FROM seen  \
        \WHERE host = ? AND channel = ? AND sender = ?"
        (host, channel, sender)
    case r of
        -- In the database: seen
        [(time, text)] -> do
            pretty <- liftIO $ prettyTime $ IrcTime time
            writeReply $ "I last saw " <> sender <> " " <> pretty
                                       <> " saying: " <> text
        -- Not yet in the database: not seen
        _ -> writeReply $ "I ain't never seen " <> sender