summaryrefslogtreecommitdiffhomepage
path: root/Runnable.hs
diff options
context:
space:
mode:
authorAndrea Rossato <andrea.rossato@ing.unitn.it>2007-09-27 19:27:51 +0200
committerAndrea Rossato <andrea.rossato@ing.unitn.it>2007-09-27 19:27:51 +0200
commit9a575fec544c2ded3fff5016375c7b532c41b5f3 (patch)
tree0db1f09e2ecfcf0863c5b15030991a88933c63fc /Runnable.hs
parent4ca69461831cd4d4a5296f24eb15e29d849cbaf5 (diff)
downloadxmobar-9a575fec544c2ded3fff5016375c7b532c41b5f3.tar.gz
xmobar-9a575fec544c2ded3fff5016375c7b532c41b5f3.tar.bz2
Updated Runnable to the new API - added Show instance
darcs-hash:20070927172751-d6583-09727fed3afdcd51e573f8d34237612fcc60a0f7.gz
Diffstat (limited to 'Runnable.hs')
-rw-r--r--Runnable.hs11
1 files changed, 7 insertions, 4 deletions
diff --git a/Runnable.hs b/Runnable.hs
index c51d173..bc78198 100644
--- a/Runnable.hs
+++ b/Runnable.hs
@@ -27,13 +27,16 @@ import Text.ParserCombinators.ReadPrec
import Config (runnableTypes)
import Commands
-data Runnable = forall r . (Exec r, Read r) => Run r
+data Runnable = forall r . (Exec r, Read r, Show r) => Run r
instance Exec Runnable where
- run (Run a) = run a
- rate (Run a) = rate a
+ start (Run a) = start a
+ rate (Run a) = rate a
alias (Run a) = alias a
+instance Show Runnable where
+ show (Run x) = show x
+
instance Read Runnable where
readPrec = readRunnable
@@ -44,7 +47,7 @@ class ReadAsAnyOf ts ex where
instance ReadAsAnyOf () ex where
readAsAnyOf ~() = mzero
-instance (Read t, Exec t, ReadAsAnyOf ts Runnable) => ReadAsAnyOf (t,ts) Runnable where
+instance (Show t, 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)) }