toolshed-0.17.0.2: Ill-defined library.

Safe HaskellSafe
LanguageHaskell2010

ToolShed.Test.ReversibleIO

Contents

Description

AUTHOR
Dr. Alistair Ward
DESCRIPTION
  • Facilitates testing of custom implementations of Read & Show.
  • CAVEAT: it doesn't actually do any IO.

Synopsis

Functions

Predicates

isReversible :: (Eq r, Read r, Show r) => r -> Bool Source #

Checks that composing read & show is equivalent to the identity.

readPrependedWhiteSpace :: (Eq r, Read r, Show r) => r -> Bool Source #

Checks whether read can skip prepended white space; isReversible is a prerequisite.

readTrailingGarbage Source #

Arguments

:: (Eq a, Read a, Show a) 
=> (Char -> Bool)

Whether a character of garbage might reasonably be confused with valid data, & therefore should be dropped.

-> a

The datum to be written & read.

-> String

The text to follow the written datum.

-> Bool 

Checks whether read both copes with garbage following the valid input-data, & leaves it unchanged.