HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulequickcheck-unicode-1.0.1.0Haskell98

Test.QuickCheck.Unicode

QuickCheck Generator and shrink functions for testing software that uses Unicode data.

The default Arbitrary instance for the Char type intentionally generates only ASCII values. This can lead to a false sense of security in cases where Unicode compliance is required, as encodings that span multiple bytes or code units will simply not be exercised at all.

This module deliberately avoids using the text and bytestring packages to avoid pulling in extra dependencies.

  • 1 type
  • 14 values

Newtype wrapper for convenience

2 declarations
newtypenewtype Unicode a
#

A wrapper for Char and String, for which the Arbitrary instance generates full-Unicode characters.

Instances6Eq, Ord, Read, Show, Arbitrary
  • Eq a => Eq (Unicode a)Defined in quickcheck-unicode-1.0.1.0 · Test.QuickCheck.Unicode
  • Ord a => Ord (Unicode a)Defined in quickcheck-unicode-1.0.1.0 · Test.QuickCheck.Unicode
  • Read a => Read (Unicode a)Defined in quickcheck-unicode-1.0.1.0 · Test.QuickCheck.Unicode
  • Show a => Show (Unicode a)Defined in quickcheck-unicode-1.0.1.0 · Test.QuickCheck.Unicode
  • Arbitrary (Unicode Char)Defined in quickcheck-unicode-1.0.1.0 · Test.QuickCheck.Unicode
  • Arbitrary (Unicode [Char])Defined in quickcheck-unicode-1.0.1.0 · Test.QuickCheck.Unicode

Generators

3 declarations
valuechar :: Gen Char
#

Generate a Unicode code point. This has a much larger range than the default Arbitrary instance for Char.

Helpers

valuelist :: Gen a -> Gen [a]
#

Generate a list of values.

valuelist1 :: Gen a -> Gen [a]
#

Generate a non-empty list of values.

Basic generators

valueplanes :: [(Int, Gen Int)]
#

A weighted list of generators that favours ASCII characters, followed by planes 0 and 1.

Predicates

1 declaration

Shrinking functions

1 declaration