    -- | Support for quotes
    module Lambdabot.Plugin.Novelty.Slap (slapPlugin) where

    import Lambdabot.Plugin
    import Lambdabot.Util

    type Slap = ModuleT () LB

    slapPlugin :: Module ()
    slapPlugin :: Module ()
    slapPlugin = Module ()
    forall st. Module st
    newModule
        { moduleCmds :: ModuleT () LB [Command (ModuleT () LB)]
    moduleCmds = [Command (ModuleT () LB)]
    -> ModuleT () LB [Command (ModuleT () LB)]
    forall (m :: * -> *) a. Monad m => a -> m a
    return
            [ (String -> Command Identity
    command "slap")
                { aliases :: [String]
    aliases = ["smack"]
                , help :: Cmd (ModuleT () LB) ()
    help = String -> Cmd (ModuleT () LB) ()
    forall (m :: * -> *). Monad m => String -> Cmd m ()
    say "slap <nick>. Slap someone amusingly."
                , process :: String -> Cmd (ModuleT () LB) ()
    process = String -> Cmd (ModuleT () LB) ()
    slap
                }
            ]
        }

    ------------------------------------------------------------------------

    slap :: String -> Cmd Slap ()
    slap :: String -> Cmd (ModuleT () LB) ()
    slap "me" = do
        String
    target <- Nick -> Cmd (ModuleT () LB) String
    forall (m :: * -> *). Monad m => Nick -> Cmd m String
    showNick (Nick -> Cmd (ModuleT () LB) String)
    -> Cmd (ModuleT () LB) Nick -> Cmd (ModuleT () LB) String
    forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
    =<< Cmd (ModuleT () LB) Nick
    forall (m :: * -> *). Monad m => Cmd m Nick
    getSender
        String -> Cmd (ModuleT () LB) ()
    slapRandom String
    target
    slap "yourself" = do
        String
    target <- Nick -> Cmd (ModuleT () LB) String
    forall (m :: * -> *). Monad m => Nick -> Cmd m String
    showNick (Nick -> Cmd (ModuleT () LB) String)
    -> Cmd (ModuleT () LB) Nick -> Cmd (ModuleT () LB) String
    forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
    =<< Cmd (ModuleT () LB) Nick
    forall (m :: * -> *). Monad m => Cmd m Nick
    getLambdabotName
        String -> Cmd (ModuleT () LB) ()
    slapRandom String
    target
    slap target :: String
    target =
        String -> Cmd (ModuleT () LB) ()
    slapRandom String
    target

    slapRandom :: String -> Cmd Slap ()
    slapRandom :: String -> Cmd (ModuleT () LB) ()
    slapRandom tgt :: String
    tgt = String -> Cmd (ModuleT () LB) ()
    forall (m :: * -> *). Monad m => String -> Cmd m ()
    say (String -> Cmd (ModuleT () LB) ())
    -> ((String -> String) -> String)
    -> (String -> String)
    -> Cmd (ModuleT () LB) ()
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . ((String -> String) -> String -> String
    forall a b. (a -> b) -> a -> b
    $ String
    tgt) ((String -> String) -> Cmd (ModuleT () LB) ())
    -> Cmd (ModuleT () LB) (String -> String) -> Cmd (ModuleT () LB) ()
    forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
    =<< [String -> String] -> Cmd (ModuleT () LB) (String -> String)
    forall (m :: * -> *) a. MonadIO m => [a] -> m a
    random [String -> String]
    slapList

    slapList :: [String -> String]
    slapList :: [String -> String]
    slapList =
        [(\x :: String
    x -> "/me slaps " String -> String -> String
    forall a. [a] -> [a] -> [a]
    ++ String
    x)
        ,(\x :: String
    x -> "/me smacks " String -> String -> String
    forall a. [a] -> [a] -> [a]
    ++ String
    x String -> String -> String
    forall a. [a] -> [a] -> [a]
    ++ " about with a large trout")
        ,(\x :: String
    x -> "/me beats up " String -> String -> String
    forall a. [a] -> [a] -> [a]
    ++ String
    x)
        ,(\x :: String
    x -> "/me pokes " String -> String -> String
    forall a. [a] -> [a] -> [a]
    ++ String
    x String -> String -> String
    forall a. [a] -> [a] -> [a]
    ++ " in the eye")
        ,(\x :: String
    x -> "why on earth would I slap " String -> String -> String
    forall a. [a] -> [a] -> [a]
    ++ String
    x String -> String -> String
    forall a. [a] -> [a] -> [a]
    ++ "?")
        ,(\x :: String
    x -> "*SMACK*, *SLAM*, take that " String -> String -> String
    forall a. [a] -> [a] -> [a]
    ++ String
    x String -> String -> String
    forall a. [a] -> [a] -> [a]
    ++ "!")
        ,(\_ -> "/me activates her slap-o-matic...")
        ,(\x :: String
    x -> "/me orders her trained monkeys to punch " String -> String -> String
    forall a. [a] -> [a] -> [a]
    ++ String
    x)
        ,(\x :: String
    x -> "/me smashes a lamp on " String -> String -> String
    forall a. [a] -> [a] -> [a]
    ++ String -> String
    possesiveForm String
    x String -> String -> String
    forall a. [a] -> [a] -> [a]
    ++ " head")
        ,(\x :: String
    x -> "/me hits " String -> String -> String
    forall a. [a] -> [a] -> [a]
    ++ String
    x String -> String -> String
    forall a. [a] -> [a] -> [a]
    ++ " with a hammer, so they breaks into a thousand pieces")
        ,(\x :: String
    x -> "/me throws some pointy lambdas at " String -> String -> String
    forall a. [a] -> [a] -> [a]
    ++ String
    x)
        ,(\x :: String
    x -> "/me loves " String -> String -> String
    forall a. [a] -> [a] -> [a]
    ++ String
    x String -> String -> String
    forall a. [a] -> [a] -> [a]
    ++ ", so no slapping")
        ,(\x :: String
    x -> "/me would never hurt " String -> String -> String
    forall a. [a] -> [a] -> [a]
    ++ String
    x String -> String -> String
    forall a. [a] -> [a] -> [a]
    ++ "!")
        ,(\x :: String
    x -> "go slap " String -> String -> String
    forall a. [a] -> [a] -> [a]
    ++ String
    x String -> String -> String
    forall a. [a] -> [a] -> [a]
    ++ " yourself")
        ,(\_ -> "I won't; I want to go get some cookies instead.")
        ,(\x :: String
    x -> "I'd rather not; " String -> String -> String
    forall a. [a] -> [a] -> [a]
    ++ String
    x String -> String -> String
    forall a. [a] -> [a] -> [a]
    ++ " looks rather dangerous.")
        ,(\_ -> "I don't perform such side effects on command!")
        ,(\_ -> "stop telling me what to do")
        ,(\x :: String
    x -> "/me clobbers " String -> String -> String
    forall a. [a] -> [a] -> [a]
    ++ String
    x String -> String -> String
    forall a. [a] -> [a] -> [a]
    ++ " with an untyped language")
        ,(\x :: String
    x -> "/me pulls " String -> String -> String
    forall a. [a] -> [a] -> [a]
    ++ String
    x String -> String -> String
    forall a. [a] -> [a] -> [a]
    ++ " through the Evil Mangler")
        ,(\x :: String
    x -> "/me secretly deletes " String -> String -> String
    forall a. [a] -> [a] -> [a]
    ++ String -> String
    possesiveForm String
    x String -> String -> String
    forall a. [a] -> [a] -> [a]
    ++ " source code")
        ,(\x :: String
    x -> "/me places her fist firmly on " String -> String -> String
    forall a. [a] -> [a] -> [a]
    ++ String -> String
    possesiveForm String
    x String -> String -> String
    forall a. [a] -> [a] -> [a]
    ++ " jaw")
        ,(\x :: String
    x -> "/me locks up " String -> String -> String
    forall a. [a] -> [a] -> [a]
    ++ String
    x String -> String -> String
    forall a. [a] -> [a] -> [a]
    ++ " in a Monad")
        ,(\x :: String
    x -> "/me submits " String -> String -> String
    forall a. [a] -> [a] -> [a]
    ++ String -> String
    possesiveForm String
    x String -> String -> String
    forall a. [a] -> [a] -> [a]
    ++ " email address to a dozen spam lists")
        ,(\x :: String
    x -> "/me moulds " String -> String -> String
    forall a. [a] -> [a] -> [a]
    ++ String
    x String -> String -> String
    forall a. [a] -> [a] -> [a]
    ++ " into a delicous cookie, and places it in her oven")
        ,(\_ -> "/me will count to five...")
        ,(\x :: String
    x -> "/me jabs " String -> String -> String
    forall a. [a] -> [a] -> [a]
    ++ String
    x String -> String -> String
    forall a. [a] -> [a] -> [a]
    ++ " with a C pointer")
        ,(\x :: String
    x -> "/me is overcome by a sudden desire to hurt " String -> String -> String
    forall a. [a] -> [a] -> [a]
    ++ String
    x)
        ,(\x :: String
    x -> "/me karate-chops " String -> String -> String
    forall a. [a] -> [a] -> [a]
    ++ String
    x String -> String -> String
    forall a. [a] -> [a] -> [a]
    ++ " into two equally sized halves")
        ,(\x :: String
    x -> "Come on, let's all slap " String -> String -> String
    forall a. [a] -> [a] -> [a]
    ++ String
    x)
        ,(\x :: String
    x -> "/me pushes " String -> String -> String
    forall a. [a] -> [a] -> [a]
    ++ String
    x String -> String -> String
    forall a. [a] -> [a] -> [a]
    ++ " from his chair")
        ,(\x :: String
    x -> "/me hits " String -> String -> String
    forall a. [a] -> [a] -> [a]
    ++ String
    x String -> String -> String
    forall a. [a] -> [a] -> [a]
    ++ " with an assortment of kitchen utensils")
        ,(\x :: String
    x -> "/me slaps " String -> String -> String
    forall a. [a] -> [a] -> [a]
    ++ String
    x String -> String -> String
    forall a. [a] -> [a] -> [a]
    ++ " with a slab of concrete")
        ,(\x :: String
    x -> "/me puts on her slapping gloves, and slaps " String -> String -> String
    forall a. [a] -> [a] -> [a]
    ++ String
    x)
        ,(\x :: String
    x -> "/me decomposes " String -> String -> String
    forall a. [a] -> [a] -> [a]
    ++ String
    x String -> String -> String
    forall a. [a] -> [a] -> [a]
    ++ " into several parts using the Banach-Tarski theorem and reassembles them to get two copies of " String -> String -> String
    forall a. [a] -> [a] -> [a]
    ++ String
    x String -> String -> String
    forall a. [a] -> [a] -> [a]
    ++ "!")
        ]

    -- | The possesive form of a name, "x's"
    possesiveForm :: String -> String
    possesiveForm :: String -> String
    possesiveForm [] = []
    possesiveForm x :: String
    x
     | String -> Char
    forall a. [a] -> a
    last String
    x Char -> Char -> Bool
    forall a. Eq a => a -> a -> Bool
    == 's' = String
    x String -> String -> String
    forall a. [a] -> [a] -> [a]
    ++ "'"
     | Bool
    otherwise     = String
    x String -> String -> String
    forall a. [a] -> [a] -> [a]
    ++ "'s"