-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Spoon's utilities. Simple testing and nice looking error reporting. -- -- Spoon's utilities. Simple testing and nice looking error reporting. @package spoonutil @version 0.0.1 -- | Pretty printing for spoons. module Text.Pretty -- | Pretty printer class Pretty p pretty' :: Pretty p => p -> Int -> ShowS -- | Space before a pretty printed line pspace :: Int -> ShowS -- | Pretty print! pretty :: Pretty p => p -> String -- | Pretty print a list, putting two newlines between each element. -- (Paragraph layout) pretty_list_nl' :: Pretty p => [p] -> Int -> ShowS -- | Pretty print a list, putting spaces between each element. pretty_list_sp' :: Pretty p => [p] -> Int -> ShowS -- | Pretty print a list pretty_list' :: Pretty p => [p] -> Int -> ShowS nl :: ShowS instance Pretty String -- | Nice looking errors. module Error.Report -- | A nice looking error data Error -- | Error text PrettyError :: p -> Error ErrorMessage :: [Error] -> Error NoRaise :: [Error] -> Error -- | A class for things which can be turned into error reports class ErrorReport err report :: ErrorReport err => err -> Error -- | Create a new error new_error :: Pretty p => p -> Error -- | An empty error empty_error :: Error -- | Add a line to the start of the error (This appears further up the -- error report) error_line :: Pretty p => p -> Error -> Error -- | Add a number of lines to the start of the error error_lines :: Pretty p => [p] -> Error -> Error -- | Create a new error section (This appears further up, and with fewer -- tabs than the rest of the report) error_section :: Error -> Error -- | Combine multiple errors into one report error_join :: [Error] -> Error -- | There was an error because the software was broken broken :: String -> String -> String -> [String] -> Error -> a instance Typeable Error instance ErrorReport ParseError instance ErrorReport String instance Pretty Error instance Exception Error instance Show Error -- | Spoon's test utility! Simple testing for spoons. module Test.Simple -- | Test all source files in a stage of the testing process. test_all :: (ErrorReport a, Show b) => String -> (FilePath -> String -> Either a b) -> IO () -- | Test a source file. test :: (ErrorReport a, Show b) => String -> (FilePath -> String -> Either a b) -> Bool -> FilePath -> IO () -- | Test all source files in a stage of the testing process. test_all_IO :: (ErrorReport a, Show b) => String -> (FilePath -> String -> IO (Either a b)) -> IO () -- | Test a source file. test_IO :: (ErrorReport a, Show b) => String -> (FilePath -> String -> IO (Either a b)) -> Bool -> FilePath -> IO ()