AAI-0.1.0.0: 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.

type ErrorHandler = String -> IO () Source

A simple error handling function.

route :: (Command a, Router a) => ErrorHandler -> [a] -> [String] -> IO () Source

Route a specific instruction to a command.