Coder Social home page Coder Social logo

jutaro / purescript-quickcheck Goto Github PK

View Code? Open in Web Editor NEW

This project forked from purescript/purescript-quickcheck

0.0 3.0 0.0 209 KB

A very basic implementation of QuickCheck in PureScript

License: MIT License

JavaScript 7.32% PureScript 92.68%

purescript-quickcheck's Introduction

Module Documentation

Module Test.QuickCheck

Arbitrary

class Arbitrary t where
  arbitrary :: Gen t

CoArbitrary

class CoArbitrary t where
  coarbitrary :: forall r. t -> Gen r -> Gen r

Result

data Result
  = Success 
  | Failed String

showResult

instance showResult :: Show Result

(<?>)

(<?>) :: Boolean -> String -> Result

arbChar

instance arbChar :: Arbitrary S.Char

coarbChar

instance coarbChar :: CoArbitrary S.Char

arbNumber

instance arbNumber :: Arbitrary Number

coarbNumber

instance coarbNumber :: CoArbitrary Number

arbBoolean

instance arbBoolean :: Arbitrary Boolean

coarbBoolean

instance coarbBoolean :: CoArbitrary Boolean

arbString

instance arbString :: Arbitrary String

coarbString

instance coarbString :: CoArbitrary String

AlphaNumString

newtype AlphaNumString
  = AlphaNumString String

arbAlphaNumString

instance arbAlphaNumString :: Arbitrary AlphaNumString

coarbAlphaNumString

instance coarbAlphaNumString :: CoArbitrary AlphaNumString

arbTuple

instance arbTuple :: (Arbitrary a, Arbitrary b) => Arbitrary (Tuple a b)

coarbTuple

instance coarbTuple :: (CoArbitrary a, CoArbitrary b) => CoArbitrary (Tuple a b)

arbEither

instance arbEither :: (Arbitrary a, Arbitrary b) => Arbitrary (Either a b)

coarbEither

instance coarbEither :: (CoArbitrary a, CoArbitrary b) => CoArbitrary (Either a b)

arbMaybe

instance arbMaybe :: (Arbitrary a) => Arbitrary (Maybe a)

coarbMaybe

instance coarbMaybe :: (CoArbitrary a) => CoArbitrary (Maybe a)

arbFunction

instance arbFunction :: (CoArbitrary a, Arbitrary b) => Arbitrary (a -> b)

coarbFunction

instance coarbFunction :: (Arbitrary a, CoArbitrary b) => CoArbitrary (a -> b)

arbArray

instance arbArray :: (Arbitrary a) => Arbitrary [a]

coarbArray

instance coarbArray :: (CoArbitrary a) => CoArbitrary [a]

Testable

class Testable prop where
  test :: prop -> Gen Result

testableResult

instance testableResult :: Testable Result

testableBoolean

instance testableBoolean :: Testable Boolean

testableFunction

instance testableFunction :: (Arbitrary t, Testable prop) => Testable (t -> prop)

quickCheckPure

quickCheckPure :: forall prop. (Testable prop) => Number -> Number -> prop -> [Result]

QC

type QC a = forall eff. Eff (err :: Exception, random :: Random, trace :: Trace | eff) a

quickCheck'

quickCheck' :: forall prop. (Testable prop) => Number -> prop -> QC Unit

quickCheck

quickCheck :: forall prop. (Testable prop) => prop -> QC Unit

(===)

(===) :: forall a b. (Eq a, Show a) => a -> a -> Result

Self-documenting equality assertion

(/==)

(/==) :: forall a b. (Eq a, Show a) => a -> a -> Result

Self-documenting inequality assertion

Module Test.QuickCheck.Gen

LCG

type LCG = Number

Size

type Size = Number

GenState

type GenState = { size :: Size, newSeed :: LCG }

GenOut

type GenOut a = { value :: a, state :: GenState }

Gen

data Gen a

repeatable

repeatable :: forall a b. (a -> Gen b) -> Gen (a -> b)

stateful

stateful :: forall a. (GenState -> Gen a) -> Gen a

variant

variant :: forall a. LCG -> Gen a -> Gen a

sized

sized :: forall a. (Size -> Gen a) -> Gen a

resize

resize :: forall a. Size -> Gen a -> Gen a

choose

choose :: Number -> Number -> Gen Number

chooseInt

chooseInt :: Number -> Number -> Gen Number

oneOf

oneOf :: forall a. Gen a -> [Gen a] -> Gen a

frequency

frequency :: forall a. Tuple Number (Gen a) -> [Tuple Number (Gen a)] -> Gen a

arrayOf

arrayOf :: forall a. Gen a -> Gen [a]

arrayOf1

arrayOf1 :: forall a. Gen a -> Gen (Tuple a [a])

vectorOf

vectorOf :: forall a. Number -> Gen a -> Gen [a]

elements

elements :: forall a. a -> [a] -> Gen a

runGen

runGen :: forall a. Gen a -> GenState -> GenOut a

evalGen

evalGen :: forall a. Gen a -> GenState -> a

showSample'

showSample' :: forall r a. (Show a) => Size -> Gen a -> Eff (trace :: Trace | r) Unit

showSample

showSample :: forall r a. (Show a) => Gen a -> Eff (trace :: Trace | r) Unit

uniform

uniform :: Gen Number

perturbGen

perturbGen :: forall a. Number -> Gen a -> Gen a

functorGen

instance functorGen :: Functor Gen

applyGen

instance applyGen :: Apply Gen

applicativeGen

instance applicativeGen :: Applicative Gen

bindGen

instance bindGen :: Bind Gen

monadGen

instance monadGen :: Monad Gen

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.