0.3.0 • Published 4 years ago

fp-ts-laws v0.3.0

Weekly downloads
1,158
License
MIT
Repository
github
Last release
4 years ago

fp-ts type class laws for property based testing

Usage of fast-check is required.

Example

import * as laws from 'fp-ts-laws'
import * as fc from 'fast-check'

import { Semigroup } from 'fp-ts/lib/Semigroup'
import { eqString } from 'fp-ts/lib/Eq'

describe('my semigroup instance', () => {
  it('should test Semigroup laws', () => {
    const semigroupSpace: Semigroup<string> = {
      concat: (x, y) => x + ' ' + y
    }
    laws.semigroup(semigroupSpace, eqString, fc.string())
  })
})

For other examples check out the tests

0.3.0

4 years ago

0.2.1

4 years ago

0.2.0

5 years ago

0.1.0

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago