HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulequickcheck-classes-base-0.6.2.0Haskell2010

Test.QuickCheck.Classes.Base.IsList

This module provides property tests for functions that operate on list-like data types. If your data type is fully polymorphic in its element type, is it recommended that you use foldableLaws and traversableLaws from Test.QuickCheck.Classes. However, if your list-like data type is either monomorphic in its element type (like Text or ByteString) or if it requires a typeclass constraint on its element (like Data.Vector.Unboxed), the properties provided here can be helpful for testing that your functions have the expected behavior. All properties in this module require your data type to have an IsList instance.

  • 16 values
valueisListLaws
  1. :: (IsList a, Show a, Show (Item a), Arbitrary a, Arbitrary (Item a), Eq a)
  2. => Proxy a
  3. -> Laws
#

Tests the following properties:

Partial Isomorphism

fromList . toList ≡ id

Length Preservation

fromList xs ≡ fromListN (length xs) xs

Note: This property test is only available when using base-4.7 or newer.