speculate-0.4.0: bench/arithficial.hs
import Test.Speculate
-- How well does this tool performs on artificial operators
f :: Num a => a -> a -> a
f x y = x*17+23
g :: Num a => a -> a -> a
g x y = 42
h :: Num a => a -> a -> a
h x y = y*13+19
main :: IO ()
main = speculate args
{ instances = [reifyInstances int]
, constants =
[ hole int
, showConstant (0::Int)
, constant "id" $ id -:> int
, constant "+" $ (+) -:> int
, constant "f" $ f -:> int
, constant "g" $ g -:> int
, constant "h" $ h -:> int
]
}