The marvin package

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.



A framework for writing portable chat bots. Inspired by hubot.

The best way to get started with this library is with the documentation on readthedocs:

When upgrading to a new version also be aware of the potential breaking changes, listed here:

[Skip to ReadMe]


Versions0.0.1, 0.0.2, 0.0.3, 0.0.4, 0.0.5, 0.0.6, 0.0.7, 0.0.8, 0.0.9, 0.1.0, 0.1.1, 0.1.2, 0.1.3, 0.1.4, 0.1.5, 0.2.0, 0.2.1, 0.2.2, 0.2.3, 0.3
Dependenciesaeson (>=0.11 && <1.3), base (>=4.7 && <5), bytestring (>=0.10), conduit (>=1.2), configurator (>=0.3), deepseq (==1.*), directory (>=1.2), filepath (>=1.4), hashable (>=1.0), haskeline (>=0.7 && <1), http-client (>=0.4 && <0.6), http-client-tls (>=0.2 && <0.4), http-types (>=0.8 && <1.0), irc-conduit (>=0.2), lens (==4.*), lifted-async (>=0.8), lifted-base (>=0.2), marvin (>=0.1), marvin-interpolate (>=1.0), monad-control (==1.*), monad-logger (>=0.3), monad-loops (>=0.4), mtl (>=2.2 && <3), mustache (>=2.0), network-uri (>=2.6), optparse-applicative (>=0.11 && <1), random (>=1.0), stm (>=2.0), text (>=1.0), text-icu (>=0.6 && <0.8), time (==1.*), transformers (>=0.4), transformers-base (==0.4.*), unordered-containers (>=0.2), vector (>=0.11 && <1), wai (==3.*), warp (==3.*), warp-tls (==3.*), websockets (>=0.9), wreq (>=0.4 && <0.6), wuss (>=1.0) [details]
Copyright© 2016, 2017 Justus Adam
AuthorJustus Adam
Home page
Bug tracker
Source repositoryhead: git clone
Executablesmarvin-init, marvin-pp
UploadedFri Apr 21 11:27:28 UTC 2017 by justus



Maintainers' corner

For package maintainers and hackage trustees

Readme for marvin-0.3

Marvin, the paranoid bot (β stage)

Travis Hackage

Marvin is an attempt to combine the ease of use of hubot with the typesafety and easy syntax of Haskell and the performance gains from compiled languages.

Installing and using marvin

The verbose documentation can be found on readthedocs It should hopefully answer all your questions.

Installation instructions are on this documentation page.


A teaser

module MyScript where

import Marvin.Prelude

script :: IsAdapter a => ScriptInit a
script = defineScript "my-script" $ do
    hear "sudo (.+)" $ do
        match <- getMatch

        reply $(isL "All right, i'll do #{match !! 1}")
    respond "repeat" $ do
        message <- getMessage

        send $(isL "You wrote #{message}")
    respond "what is in file ([\\w\\._/-]+)\\??" $ do
        match <- getMatch 
        let file = match !! 1

        contents <- liftIO $ readFile file

        send contents
    respond "upload file ([\\w\\._/-]+)" $ do
        [_, filepath] <- getMatch
        chan <- getChannel
        f <- sendFile filepath
        case res of
            Left err -> reporter $(isL "Failed to share file: #{err}")
            Right _  -> reporter "File successfully uploaded"
    enterIn "random" $ do
        user <- getUser
        send $(isL "Hello #{user^.username} welcome to the random channel!")
    fileSharedIn "announcements" $ do
        file <- getFile
        safeFileToDir file "shared-files"

Testing and Talking

There's a slack channel where you can ask questions or play around with a test instance of marvin.

It's currently invite-only, so send me an email if you would like to join.


Any kind of contribution is very welcome.

Issues and errors

If you are a marvin user, please report any error, issues, or improvement suggestions to the issue section or write me an email.


I welcome anybody who tests marvin by deploying it. Especially testing different adapters is a huge help.


If you want to hack on marvin, feel free to do so and send me your changes as pull requests.

Current hot places to get started: