liquidhaskell-0.8.0.2: Liquid Types for Haskell

Safe HaskellNone
LanguageHaskell98

Test.Target.Testable

Synopsis

Documentation

test :: Testable f => f -> SpecType -> Target Result Source #

Test that a function inhabits the given refinement type by enumerating valid inputs and calling the function on the inputs.

class (AllHave Targetable (Args f), Targetable (Res f), AllHave Show (Args f)) => Testable f Source #

A class of functions that Target can test. A function is Testable iff all of its component types are Targetable and all of its argument types are Showable.

You should never have to define a new Testable instance.

Minimal complete definition

queryArgs, decodeArgs, apply, mkExprs

Instances

(Targetable a, (~) [*] (Args a) ([] *), (~) * (Res a) a) => Testable a Source # 

Methods

queryArgs :: a -> Int -> SpecType -> Target [Symbol]

decodeArgs :: a -> [Symbol] -> [SpecType] -> Target (HList (Args a))

apply :: a -> HList (Args a) -> Res a

mkExprs :: a -> [Symbol] -> HList (Args a) -> [(Symbol, Expr)]

(Show a, Targetable a, Testable b) => Testable (a -> b) Source # 

Methods

queryArgs :: (a -> b) -> Int -> SpecType -> Target [Symbol]

decodeArgs :: (a -> b) -> [Symbol] -> [SpecType] -> Target (HList (Args (a -> b)))

apply :: (a -> b) -> HList (Args (a -> b)) -> Res (a -> b)

mkExprs :: (a -> b) -> [Symbol] -> HList (Args (a -> b)) -> [(Symbol, Expr)]