extrapolate-0.4.1: generalize counter-examples of test properties

Copyright(c) 2017-2019 Rudy Matela
License3-Clause BSD (see the file LICENSE)
MaintainerRudy Matela <rudy@matela.com.br>
Safe HaskellNone
LanguageHaskell2010

Test.Extrapolate.Expr

Contents

Description

This module is part of Extrapolate, a library for generalization of counter-examples.

This module re-exports functionality from Data.Express and Test.Speculate.Expr along with some extra utilities.

Synopsis

Documentation

canonicalizeUsingHoles :: Expr -> Expr Source #

Like canonicalize but uses holes for unrepeated variables.

canonicalizeUsingHolesWith :: (Expr -> [String]) -> Expr -> Expr Source #

Like canonicalizeWith but uses holes for unrepeated variables.

replaceFun :: Expr -> Expr -> Expr Source #

O(n). Replaces the function in the given Expr.

replaceFun timesE (plusE :$ one :$ two) = timesE :$ one :$ two
replaceFun absE (idE :$ one) = absE :$ one
replaceFun two (one) = two

misc re-exports

(-&&-) :: Expr -> Expr -> Expr #

The function && lifted over the Expr type.

> pp -&&- qq
p && q :: Bool
> false -&&- true
False && True :: Bool
> evalBool $ false -&&- true
False

false :: Expr #

False encoded as an Expr.

> false
False :: Bool