diff options
| author | Andrea Rossato <andrea.rossato@ing.unitn.it> | 2007-07-12 23:56:15 +0200 | 
|---|---|---|
| committer | Andrea Rossato <andrea.rossato@ing.unitn.it> | 2007-07-12 23:56:15 +0200 | 
| commit | 20846e8dddb61eed64100b4f21b4b493b5005eac (patch) | |
| tree | 602c5e36ec8bacf5c12082ff708a59e768fcc039 | |
| parent | 1126dd15b8e25aa4d72cb8efc269abb2e1136481 (diff) | |
| download | xmobar-20846e8dddb61eed64100b4f21b4b493b5005eac.tar.gz xmobar-20846e8dddb61eed64100b4f21b4b493b5005eac.tar.bz2 | |
removed the Show instance requirement for plugins
darcs-hash:20070712215615-d6583-463ad3d9d1282fd1f129f34f405c66e0795962fd.gz
| -rw-r--r-- | Plugins/HelloWorld.hs | 6 | ||||
| -rw-r--r-- | Runnable.hs | 6 | ||||
| -rw-r--r-- | Runnable.hs-boot | 4 | ||||
| -rw-r--r-- | XMobar.hs | 2 | 
4 files changed, 8 insertions, 10 deletions
| diff --git a/Plugins/HelloWorld.hs b/Plugins/HelloWorld.hs index 2b52506..8e68713 100644 --- a/Plugins/HelloWorld.hs +++ b/Plugins/HelloWorld.hs @@ -16,10 +16,10 @@ module Plugins.HelloWorld where  import Commands -data Plugin = HelloWorld -    deriving (Show, Read) +data HelloWorld = HelloWorld +    deriving (Read) -instance Exec Plugin where +instance Exec HelloWorld where      run HelloWorld = return "<fc=red>Hello World!!</fc>"      rate HelloWorld = 1000      alias HelloWorld = "helloWorld" diff --git a/Runnable.hs b/Runnable.hs index 9191697..2f55e7f 100644 --- a/Runnable.hs +++ b/Runnable.hs @@ -26,10 +26,8 @@ import Text.ParserCombinators.ReadPrec  import Config (runnableTypes)  import Commands -data Runnable = forall r . (Exec r,Show r, Read r) => Run r +data Runnable = forall r . (Exec r, Read r) => Run r -instance Show Runnable where -    show (Run a) = "Run " ++ show a  instance Exec Runnable where       run (Run a) = run a @@ -46,7 +44,7 @@ class ReadAsAnyOf ts ex where  instance ReadAsAnyOf () ex where       readAsAnyOf ~() = mzero -instance (Read t, Show t, Exec t, ReadAsAnyOf ts Runnable) => ReadAsAnyOf (t,ts) Runnable where  +instance (Read t, Exec t, ReadAsAnyOf ts Runnable) => ReadAsAnyOf (t,ts) Runnable where       readAsAnyOf ~(t,ts) = r t `mplus` readAsAnyOf ts                where r ty = do { m <- readPrec; return (Run (m `asTypeOf` ty)) } diff --git a/Runnable.hs-boot b/Runnable.hs-boot index 90dbe81..bef4e39 100644 --- a/Runnable.hs-boot +++ b/Runnable.hs-boot @@ -2,10 +2,10 @@  module Runnable where  import Commands -data Runnable = forall r . (Exec r,Show r, Read r) => Run r +data Runnable = forall r . (Exec r,Read r) => Run r  instance Read Runnable  instance Exec Runnable -instance Show Runnable + @@ -181,7 +181,7 @@ execCommand c com =  runCommandLoop :: MVar String -> Config -> (Runnable,String,String) -> IO ()  runCommandLoop var conf c@(com,s,ss) -    | show com == "" =  +    | alias com == "" =           do modifyMVar_ var (\_ -> return $ "Could not parse the template")             tenthSeconds (refresh conf)             runCommandLoop var conf c | 
