clean up, use typeclass for interface, fix some nonsense, remove hardcoded values for the routing logic

This commit is contained in:
Jon Doe
2020-09-28 17:39:43 +02:00
committed by Maciej Bonin
parent 4efaff2c06
commit 34162d7ae5
6 changed files with 187 additions and 98 deletions

View File

@ -1,9 +1,8 @@
{-# LANGUAGE OverloadedStrings #-}
module Carrion.Plugin.IO.STDIO
( initPlugin,
processCommand,
testThing,
tellCommands,
myPlugName
) where
import Control.Monad.IO.Class
import Control.Monad
@ -27,7 +26,8 @@ testThing = runInputT defaultSettings loop
Just "quit" -> return ()
Just input -> do outputStrLn $ T.unpack ("Input was: " ++ T.pack input)
loop
mySignature = GenericStyleAutor "STDIO haskeline" "local" "local"
myPlugName = "STDIO haskeline"
mySignature = GenericStyleAutor myPlugName myPlugName "local"
tellCommands = [""]
stripCommandLocal c m = stripCommandPrefix' c tellCommands m mySignature