testCommands :: TestConfig -> [ProcCommand] -> ([ProcCommand] -> [[Response]] -> [(String,Bool)]) -> IO (Maybe TestError)
testCommands c t f = do
      r <- (fmap (Right . snd)$ runProcessM c$ runProcs t
                ) `catch` \e -> return$ Left (t,[],show (e :: IOException))
      case r of
        Left err -> return$ Just err
        Right rss -> let res = f t rss
                      in if all snd res then return Nothing 
                           else return$ Just (t,rss,"failed props: " ++ show (map fst (filter (not . snd) res)))


-- | Shrinking operations that are available to reduce a command sequence.
testCommands :: TestConfig -> [ProcCommand] -> ([ProcCommand] -> [[Response]] -> [(String,Bool)]) -> IO (Maybe TestError)
testCommands c t f = do
      r <- (fmap (Right . snd)$ runProcessM c$ runProcs t
                ) `catch` \e -> return$ Left (t,[],show (e :: IOException))
      case r of
        Left err -> return$ Just err
        Right rss -> let res = f t rss
                      in if all snd res then return Nothing 
                           else return$ Just (t,rss,"failed props: " ++ show (map fst (filter (not . snd) res)))


-- | Shrinking operations that are available to reduce a command sequence.
testCommands c t f = do
      r <- (fmap (Right . snd)$ runProcessM c$ runProcs t
                ) `catch` \e -> return$ Left (t,[],show (e :: IOException))
      case r of
        Left err -> return$ Just err
        Right rss -> let res = f t rss
                      in if all snd res then return Nothing 
                           else return$ Just (t,rss,"failed props: " ++ show (map fst (filter (not . snd) res)))


-- | Shrinking operations that are available to reduce a command sequence.