lawful-classes-types-0.1.0.0: Types for lawful-classes
Copyright(c) 2023 Nicolas Trangez
LicenseApache-2.0
Maintainerikke@nicolast.be
Stabilityalpha
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.Lawful.Types

Description

Type definitions (aliases) and basic utility functions used in the lawful-classes ecosystem.

Synopsis

Core types

type Laws m = [(String, Law m)] Source #

Laws that hold for a specific Monad m.

They come with a name, and an action which may yield a Bool, denoting whether or not the law holds. It yield Nothing if the test should be discarded for the given input (when a generator is used).

type Law m = m (Maybe Bool) Source #

A single law.

See Laws.

Utilities

discard :: Applicative m => Law m Source #

Discard the current test-case.

assert :: Applicative m => Bool -> Law m Source #

Assert a given Bool value is True.