-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Helper to build generators with Text.StringRandom -- -- Define a generator of Text that matches regular expressions. This -- package is useful for creating Arbitrary instances of Text type -- restricted by newtype. @package quickcheck-string-random @version 0.1.4.2 -- | A text generator that generates a string that matches a regular -- expression. -- --
-- -- import qualified Test.QuickCheck as QC -- import Test.QuickCheck.StringRandom (matchRegexp) -- -- prop_generateDigit :: QC.Property -- prop_generateDigit = QC.forAll (matchRegexp "\d") $ digit -> ... -- -- -- or -- -- newtype Upper = Upper Text.Text deriving (Eq, Show) -- -- instance QC.Arbitrary Upper where -- arbitrary = Upper $ matchRegexp "[A-Z]" -- -- prop_generateUpper :: Upper -> Bool -- prop_generateUpper (Upper upper) = ... ---- -- The shrink function has not been defined yet. module Test.QuickCheck.StringRandom -- | The 'matchRegexp pat' defines a generator that produces a text that | -- matches a regular expression pat matchRegexp :: Text -> Gen Text