Commit f855392c authored by Gilles Coremans's avatar Gilles Coremans
Browse files

Remove unnecessary fromRight in test cases

parent 74576c98
......@@ -17,7 +17,7 @@ args = Args{replay=Nothing, maxSuccess=1000, maxDiscardRatio=1000000, maxSize=10
-- The type of a term does not change when a reduction step is performed
coPreservation :: Term -> Property
coPreservation te = (isRight ty) && (not $ CoI.isVal te)
==> (fromRight undefined ty) == (fromRight undefined tyStep)
==> ty == tyStep
where ty = CoI.typeOf te CoI.Nil
tyStep = (flip CoI.typeOf) CoI.Nil $ fromMaybe undefined $ CoI.stepEval te
......
module Main where
import Test.QuickCheck
import Data.Either
import Data.Maybe
......@@ -14,7 +16,7 @@ args = Args{replay=Nothing, maxSuccess=1000, maxDiscardRatio=1000000, maxSize=10
-- The type of a term does not change when a reduction step is performed
preservation :: Term -> Property
preservation te = (isRight ty) && (not $ isVal te)
==> (fromRight undefined ty) == (fromRight undefined tyStep)
==> ty == tyStep
where ty = typeOf te Nil
tyStep = (flip typeOf) Nil $ fromMaybe undefined $ stepEval te
......@@ -59,7 +61,7 @@ time :: IO a -> IO a
time action = do start <- getCPUTime
res <- action
end <- getCPUTime
printf "Average Time: %0.9f s\n" (((fromIntegral (end - start)) / 1000000000000.0) / 10.0 :: Double)
printf "Time: %0.9f s\n" (((fromIntegral (end - start)) / 1000000000000.0) :: Double)
return res
main = do let sizes = [4..11]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment