From f5bbeb3242ea5dc0a471abb557dabc726ffe8877 Mon Sep 17 00:00:00 2001 From: Andrea Rossato Date: Thu, 12 Jul 2007 20:04:05 +0200 Subject: credits to Claus Reinke and removed debugging code darcs-hash:20070712180405-d6583-f02e36e3d0495316ae2672c04397e915bfff7c33.gz --- Runnable.hs | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/Runnable.hs b/Runnable.hs index 90e01af..9191697 100644 --- a/Runnable.hs +++ b/Runnable.hs @@ -1,4 +1,23 @@ {-# OPTIONS -fglasgow-exts #-} +----------------------------------------------------------------------------- +-- | +-- Module : XMobar.Runnable +-- Copyright : (c) Andrea Rossato +-- License : BSD-style (see LICENSE) +-- +-- Maintainer : Andrea Rossato +-- Stability : unstable +-- Portability : unportable +-- +-- The existential type to store the list of commands to be executed. +-- I must thank Claus Reinke for the help in understanding the mysteries of +-- reading existential types. The Read instance of Runnable must be credited to +-- him. See here: +-- http:\/\/www.haskell.org\/pipermail\/haskell-cafe\/2007-July\/028227.html +-- +----------------------------------------------------------------------------- + + module Runnable where import Control.Monad @@ -37,14 +56,3 @@ readRunnable :: ReadPrec Runnable readRunnable = prec 10 $ do Ident "Run" <- lexP parens $ readAsAnyOf runnableTypes - - --- | Reads the configuration files or quits with an error -readConfig :: FilePath -> IO Runnable -readConfig f = - do s <- readFile f - case reads s of - [(config,_)] -> return config - [] -> error ("Corrupt config file: " ++ f) - _ -> error ("Some problem occured. Aborting...") - -- cgit v1.2.3