From 20846e8dddb61eed64100b4f21b4b493b5005eac Mon Sep 17 00:00:00 2001 From: Andrea Rossato Date: Thu, 12 Jul 2007 23:56:15 +0200 Subject: removed the Show instance requirement for plugins darcs-hash:20070712215615-d6583-463ad3d9d1282fd1f129f34f405c66e0795962fd.gz --- Plugins/HelloWorld.hs | 6 +++--- Runnable.hs | 6 ++---- Runnable.hs-boot | 4 ++-- 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 "Hello World!!" 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 + diff --git a/XMobar.hs b/XMobar.hs index 593c7cb..7da3bd3 100644 --- a/XMobar.hs +++ b/XMobar.hs @@ -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 -- cgit v1.2.3