packages feed

lambdabot 5.0 → 5.0.1

raw patch · 4 files changed

+99/−10 lines, 4 filesdep ~lambdabot-coredep ~lambdabot-haskell-pluginsdep ~lambdabot-irc-plugins

Dependency ranges changed: lambdabot-core, lambdabot-haskell-plugins, lambdabot-irc-plugins, lambdabot-misc-plugins, lambdabot-novelty-plugins, lambdabot-reference-plugins, lambdabot-social-plugins

Files

+ Changelog view
@@ -0,0 +1,4 @@+lambdabot 5.0.1+	* update to monad-control-1.0+	* if ./State/ exists, then state files are stored there even if a+	  corresponding file exists in ~/.lambdabot/State
+ README.md view
@@ -0,0 +1,78 @@+# About Lambdabot++Lambdabot is an IRC bot written over several years by those on the Freenode+`#haskell` IRC channel.++It operates as a command line tool, embedded in an editor, embedded in GHCi,+via internet relay chat and on the web.++## Installation++The easiest way to install `lambdabot` is from hackage, by the following+commands:++    cabal install --constraint 'transformers installed' lambdabot djinn+    hoogle data++The second command fetches the data for Lambdabot's `@hoogle` command, which+is a thin wrapper around the [`hoogle`](https://www.haskell.org/hoogle/)+command line tool. Invoking `lambdabot` will (hopefully) display a+`lambdabot>` prompt.++It is also possible to install lambdabot in a sandbox. In that case, use+`cabal exec lambdabot` to launch lambdabot.++## Files++Some lambdabot modules maintain state. The state is stored in `./State/`+if that directory exits; otherwise, it will end up on `~/.lambdabot/State/`.+State files of particular interest are:++ * `Pristine.hs` and `L.hs`: Environment for running Haskell code.+   The command `@let` adds new definitions to `L.hs`, whereas `@undefine`+   copies `Pristine.hs` to `L.hs`.+ * `offlinerc`: This file contains a history of commands typed into+   lambdabot's tty interface.++## Customization++The state file `Pristine.hs` defines the environment in which Haskell code+is run. To customize lambdabot's modules, unpack the lambdabot package++    cabal unpack lambdabot; cd lambdabot-<version>++You can then edit `src/Modules.hs` to configure the loaded modules.++## Using Lambdabot++Lambdabot has a number of modules, most of which provide several commands.+Type `@listmodules` to obtain a list of module names, and then+`@list <module>` to list a module's commands. Executing `@help command`+displays a short description of the command.++The following sample session demonstrates some useful lambdabot commands.++    lambdabot> > sum [1..10]+     55+    lambdabot> @let foo = 42+    lambdabot> > product [1..foo]+     1405006117752879898543142606244511569936384000000000+    lambdabot> @undefine+        Not in scope:‘foo’+        Perhaps you meant ‘Data.Traversable.for’ (imported from Data.Traversable)+    lambdabot> @type map+    (a -> b) -> [a] -> [b]+    lambdabot> @djinn (b -> c) -> (a -> b) -> a -> c+    f a b c = a (b c)+    lambdabot> @pl \x y z -> y z x+    flip flip+    lambdabot> @unpl flip flip+    (\ b c f -> c f b)+    lambdabot> @undo do x <- step1; step2; step3+    step1 >>= \ x -> step2 >> step3++## Further Information++- [lambdabot](https://github.com/lambdabot/lambdabot) on github+- [lambdabot](https://wiki.haskell.org/Lambdabot) on the Haskell wiki (outdated)+- [GOA: GHCI integration](https://wiki.haskell.org/GHC/GHCi#GHCi_on_Acid) (Haskell Wiki)
lambdabot.cabal view
@@ -1,5 +1,5 @@ name:                   lambdabot-version:                5.0+version:                5.0.1  license:                GPL license-file:           LICENSE@@ -29,6 +29,8 @@                         scripts/vim/run                         scripts/vim/runwith                         scripts/vim/typeOf+                        Changelog+                        README.md  data-files:             scripts/online.rc,                         State/haddock,@@ -47,10 +49,10 @@    ghc-options:          -Wall -threaded   build-depends:        base                         >= 3 && < 5,-                        lambdabot-core               >= 5 && < 5.1,-                        lambdabot-haskell-plugins    >= 5 && < 5.1,-                        lambdabot-irc-plugins        >= 5 && < 5.1,-                        lambdabot-misc-plugins       >= 5 && < 5.1,-                        lambdabot-novelty-plugins    >= 5 && < 5.1,-                        lambdabot-reference-plugins  >= 5 && < 5.1,-                        lambdabot-social-plugins     >= 5 && < 5.1+                        lambdabot-core               >= 5.0.1 && < 5.1,+                        lambdabot-haskell-plugins    >= 5.0.1 && < 5.1,+                        lambdabot-irc-plugins        >= 5.0.1 && < 5.1,+                        lambdabot-misc-plugins       >= 5.0.1 && < 5.1,+                        lambdabot-novelty-plugins    >= 5.0.1 && < 5.1,+                        lambdabot-reference-plugins  >= 5.0.1 && < 5.1,+                        lambdabot-social-plugins     >= 5.0.1 && < 5.1
src/Main.hs view
@@ -6,6 +6,7 @@ import Lambdabot.Main import Lambdabot.Plugin.Haskell import Modules      (modulesInfo)+import Paths_lambdabot (getDataDir)  import Control.Applicative import Control.Monad@@ -68,8 +69,12 @@ main = do     (config, nonOpts, errors) <- getOpt Permute flags <$> getArgs     when (not (null errors && null nonOpts)) (usage errors)-    exitWith =<< lambdabotMain modulesInfo =<< sequence config+    config' <- sequence config+    dir <- getDataDir+    exitWith =<< lambdabotMain modulesInfo ([dataDir :=> dir] ++ config')  -- special online target for ghci use online :: [String] -> IO ()-online strs = void (lambdabotMain modulesInfo [onStartupCmds :=> strs])+online strs = do+    dir <- getDataDir+    void (lambdabotMain modulesInfo [dataDir :=> dir, onStartupCmds :=> strs])