MyNixOS website logo
Description

Lambdabot is a development tool and advanced IRC bot.

Lambdabot is an IRC bot written over several years by those on the #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.

About Lambdabot

Lambdabot is an IRC bot written over several years by those on the Libera's (formerly freenode's) #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 v1-install lambdabot
hoogle data

or, using v2 commands:

cabal v2-install lambdabot hoogle misfortune mueval unlambda dice
hoogle data
cabal v2-install --lib lambdabot-trusted random mtl show

The second command fetches the data for Lambdabot's @hoogle command, which is a thin wrapper around the 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

Metadata

Version

5.3.1.2

License

Unknown

Maintainers (1)

Executables (1)

  • bin/lambdabot

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows

Related (1)