diff options
| author | Ryan Trinkle <ryan@trinkle.org> | 2021-05-20 23:11:10 -0400 | 
|---|---|---|
| committer | Ryan Trinkle <ryan@trinkle.org> | 2021-05-22 08:43:39 -0400 | 
| commit | 9af7e4149a9b986ce127f809ef830a7c8e0318ec (patch) | |
| tree | 377e4f495f5a72cbf1905b346e3ea39428fa3be6 /src/Xmobar | |
| parent | 0a673d104f1107e366b8ab8a0024e29c2762f1d4 (diff) | |
| download | xmobar-9af7e4149a9b986ce127f809ef830a7c8e0318ec.tar.gz xmobar-9af7e4149a9b986ce127f809ef830a7c8e0318ec.tar.bz2 | |
Add show instances for several types so that configs can be generated programmatically
Diffstat (limited to 'src/Xmobar')
| -rw-r--r-- | src/Xmobar/Config/Types.hs | 8 | ||||
| -rw-r--r-- | src/Xmobar/Run/Runnable.hs | 2 | ||||
| -rw-r--r-- | src/Xmobar/Run/Runnable.hs-boot | 1 | 
3 files changed, 6 insertions, 5 deletions
| diff --git a/src/Xmobar/Config/Types.hs b/src/Xmobar/Config/Types.hs index d59c993..8d78f33 100644 --- a/src/Xmobar/Config/Types.hs +++ b/src/Xmobar/Config/Types.hs @@ -65,7 +65,7 @@ data Config =                                      --   right text alignment             , template :: String     -- ^ The output template             , verbose :: Bool        -- ^ Emit additional debug messages -           } deriving (Read) +           } deriving (Read, Show)  data XPosition = Top                 | TopW Align Int @@ -77,9 +77,9 @@ data XPosition = Top                 | BottomSize Align Int Int                 | Static {xpos, ypos, width, height :: Int}                 | OnScreen Int XPosition -                 deriving ( Read, Eq ) +                 deriving ( Read, Show, Eq ) -data Align = L | R | C deriving ( Read, Eq ) +data Align = L | R | C deriving ( Read, Show, Eq )  data Border = NoBorder              | TopB @@ -88,4 +88,4 @@ data Border = NoBorder              | TopBM Int              | BottomBM Int              | FullBM Int -              deriving ( Read, Eq ) +              deriving ( Read, Show, Eq ) diff --git a/src/Xmobar/Run/Runnable.hs b/src/Xmobar/Run/Runnable.hs index 068a05b..f89f901 100644 --- a/src/Xmobar/Run/Runnable.hs +++ b/src/Xmobar/Run/Runnable.hs @@ -34,7 +34,7 @@ instance Exec Runnable where       trigger (Run a) = trigger a  instance Show Runnable where -    show (Run x) = show x +    show (Run x) = "Run " ++ show x  instance Read Runnable where      readPrec = readRunnable diff --git a/src/Xmobar/Run/Runnable.hs-boot b/src/Xmobar/Run/Runnable.hs-boot index 1cd1688..0d4b827 100644 --- a/src/Xmobar/Run/Runnable.hs-boot +++ b/src/Xmobar/Run/Runnable.hs-boot @@ -4,5 +4,6 @@ import Xmobar.Run.Exec  data Runnable = forall r . (Exec r,Read r,Show r) => Run r +instance Show Runnable  instance Read Runnable  instance Exec Runnable | 
