-- | Read the value of a file flag.
runFlagFile :: F.FlagSpec -> Experiment String
runFlagFile (F.FlagSpec { F.long = k }) = flagValue k >>= \flagv ->
  case flagv of F.FFile s -> return s
                _         -> error $ printf "BUG: Flag '%s' is not a file." k

-- | Declare a dependency on a directory command line flag. Directory flags are 
-- only satisfied when they refer to directories that exist. (To accept
-- a directory that does not exist, use a string flag.)
runFlagFile :: F.FlagSpec -> Experiment String
runFlagFile (F.FlagSpec { F.long = k }) = flagValue k >>= \flagv ->
  case flagv of F.FFile s -> return s
                _         -> error $ printf "BUG: Flag '%s' is not a file." k

-- | Declare a dependency on a directory command line flag. Directory flags are 
-- only satisfied when they refer to directories that exist. (To accept
-- a directory that does not exist, use a string flag.)
runFlagFile (F.FlagSpec { F.long = k }) = flagValue k >>= \flagv ->
  case flagv of F.FFile s -> return s
                _         -> error $ printf "BUG: Flag '%s' is not a file." k

-- | Declare a dependency on a directory command line flag. Directory flags are 
-- only satisfied when they refer to directories that exist. (To accept
-- a directory that does not exist, use a string flag.)