-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Data type modifiers for property based testing -- -- Property based testing libraries such as QuickCheck tend to include -- type modifiers. Most of them are used to quantify over subsets of a -- type. For example a property on non-empty lists: -- --
--   prop_tail_length (NonEmpty xs) = length (tail xs) == length xs - 1
--   
-- -- This library is intended to supply these modifiers to be used by -- testing libraries, in an effort to make properties more portable -- between testing frameworks. -- -- For every modifier there is also an access function that converts to -- the underlying type, which enables point-free style properties as -- such: -- --
--   prop_tail_length2 = (> 0) . length . nonEmpty
--   
@package testing-type-modifiers @version 0.1.0.0 -- | Type modifiers for writing properties that quantify over commonly used -- subsets of standard types. | | Currently there are only a few -- modifiers, more will be added. module Data.Modifiers -- | A type of non empty lists such that nonEmpty xs /= [] . newtype NonEmpty a NonEmpty :: [a] -> NonEmpty a [nonEmpty] :: NonEmpty a -> [a] mkNonEmpty :: a -> [a] -> NonEmpty a -- | A type of natural numbers such that nat a >= 0 . newtype Nat a Nat :: a -> Nat a [nat] :: Nat a -> a -- | A type of non-zero integers such that nonZero a /= 0 . newtype NonZero a NonZero :: a -> NonZero a [nonZero] :: NonZero a -> a -- | Any unicode character. Should contain all values of the Char type. newtype Unicode Unicode :: Char -> Unicode [unicode] :: Unicode -> Char -- | Access function for unicode strings. unicodes :: [Unicode] -> String -- | Printable ASCII characters. newtype Printable Printable :: Char -> Printable [printable] :: Printable -> Char -- | Access function for printable ASCII strings printables :: [Printable] -> String instance GHC.Show.Show Data.Modifiers.Printable instance GHC.Classes.Ord Data.Modifiers.Unicode instance GHC.Classes.Eq Data.Modifiers.Unicode instance GHC.Show.Show Data.Modifiers.Unicode instance GHC.Show.Show a => GHC.Show.Show (Data.Modifiers.NonEmpty a) instance GHC.Classes.Ord a => GHC.Classes.Ord (Data.Modifiers.NonZero a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Data.Modifiers.NonZero a) instance GHC.Show.Show a => GHC.Show.Show (Data.Modifiers.NonZero a) instance GHC.Classes.Ord a => GHC.Classes.Ord (Data.Modifiers.Nat a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Data.Modifiers.Nat a) instance GHC.Show.Show a => GHC.Show.Show (Data.Modifiers.Nat a)