Skip to content

export laws sans Arbitrary #35

@matthewleon

Description

@matthewleon

It should be possible to support quickchecking laws without making use of Arbitrary. Here is an example for Semigroup:

checkSemigroupGen
    eff s
  . Semigroup s
   Eq s
   Gen s
   QC eff Unit
checkSemigroupGen gen = do

  log "Checking 'Associativity' law for Semigroup"
  quickCheck' 1000 $ associativity <$> gen <*> gen <*> gen

  where

  associativity  s  s  s  Boolean
  associativity x y z = ((x <> y) <> z) == (x <> (y <> z))

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions