AAI-0.2.0.1: Abstract Application Interface.

Safe HaskellSafe
LanguageHaskell2010

Control.Router

Description

Author : Nils bash0r Jonsson Copyright : (c) 2015 Nils bash0r Jonsson License : MIT

Maintainer : aka.bash0r@gmail.com Stability : unstable Portability : non-portable (Portability is untested.)

A simple type class implementing a simple routing table for commands.

Synopsis

Documentation

class Command a => Router a where Source

A type class describing basing routing table.

Methods

routes :: a -> String -> Bool Source

Checks if a command is routable to a specific command name.

route :: (Command a, Router a, Alternative m, Monad m) => [a] -> String -> m a Source

Route a specific instruction to a command.