module Test.Speculate
( speculate
, Args (..)
, args
, Expr
, constant
, showConstant
, hole
, foreground
, background
, Instances
, reifyInstances
, reifyEq
, reifyOrd
, reifyEqOrd
, reifyListable
, reifyName
, mkEq
, mkOrd
, mkOrdLessEqual
, mkListable
, mkNameWith
, Name (..)
, report
, getArgs
, module Test.LeanCheck
, module Test.LeanCheck.Utils
, module Data.Typeable
)
where
import Data.Typeable
import Test.LeanCheck
import Test.LeanCheck.Utils
import Test.Speculate.Expr
( Expr
, hole
, Instances
, reifyInstances
, reifyEq
, reifyOrd
, reifyEqOrd
, reifyListable
, reifyName
, mkEq
, mkOrd
, mkOrdLessEqual
, mkListable
, mkNameWith
, Name (..)
)
import Test.Speculate.Args
( Args (..)
, args
, getArgs
, constant
, showConstant
, foreground
, background
, processArgs
, prepareArgs
, HelpFormat (..)
, helpText
, showHelp
)
import Test.Speculate.Report (report)
speculate :: Args -> IO ()
speculate :: Args -> IO ()
speculate Args
args = do
Args
as <- Mode Args -> IO Args
forall a. Mode a -> IO a
processArgs (Args -> Mode Args
prepareArgs Args
args)
if Args -> Bool
showHelp Args
as
then [Text] -> IO ()
forall a. Show a => a -> IO ()
print ([Text] -> IO ()) -> [Text] -> IO ()
forall a b. (a -> b) -> a -> b
$ [String] -> HelpFormat -> Mode Args -> [Text]
forall a. [String] -> HelpFormat -> Mode a -> [Text]
helpText [] HelpFormat
HelpFormatDefault (Args -> Mode Args
prepareArgs Args
args)
else Args -> IO ()
report Args
as