packages feed

lambdabot-trusted 5.0.1 → 5.0.2

raw patch · 3 files changed

+9/−55 lines, 3 filesdep +QuickCheck-safedep ~basePVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependencies added: QuickCheck-safe

Dependency ranges changed: base

API changes (from Hackage documentation)

- Lambdabot.Plugin.Haskell.Eval.Trusted: describeSequence :: SequenceData -> Maybe String
+ Lambdabot.Plugin.Haskell.Eval.Trusted: data Constraint :: BOX
- Lambdabot.Plugin.Haskell.Eval.Trusted: myquickcheck :: Testable prop => prop -> String
+ Lambdabot.Plugin.Haskell.Eval.Trusted: myquickcheck :: STestable prop => prop -> String

Files

lambdabot-trusted.cabal view
@@ -1,5 +1,5 @@ name:                   lambdabot-trusted-version:                5.0.1+version:                5.0.2  license:                GPL license-file:           LICENSE@@ -36,4 +36,5 @@    build-depends:        base                    >= 4.4 && < 5,                         oeis                    >= 0.3.1,+                        QuickCheck-safe         >= 0.1,                         QuickCheck              >= 2
src/Lambdabot/Plugin/Haskell/Check/ShowQ.hs view
@@ -2,51 +2,7 @@ -- Copyright date and holder unknown. module Lambdabot.Plugin.Haskell.Check.ShowQ (myquickcheck) where -import Data.List (group, intercalate, sort)-import System.IO.Unsafe (unsafePerformIO)-import Test.QuickCheck (numTests, quickCheckWithResult, stdArgs, Result(..), Testable)--myquickcheck :: Testable prop => prop -> String-myquickcheck = unsafePerformIO . myquickcheck'--myquickcheck' :: Testable prop => prop -> IO String-myquickcheck' a = tests a 0 []--tests :: (Testable prop) => prop -> Int -> [[String]] -> IO String-tests prop ntest stamps =-  do result <- quickCheckWithResult stdArgs prop-     case result of-       NoExpectedFailure{}  -> done "Arguments exhausted after" (numTests result) stamps-       GaveUp{}             -> done "Arguments exhausted after" (numTests result) stamps-       Success{}            -> done "OK, passed" (numTests result) stamps-       Failure{}            -> return $ "Falsifiable, after "-                                  ++ show ntest-                                  ++ " tests:\n"-                                  ++ reason result--done :: String -> Int -> [[String]] -> IO String-done mesg ntest stamps = return $ mesg ++ " " ++ show ntest ++ " tests" ++ table- where-  table = display-        . map entry-        . reverse-        . sort-        . map pairLength-        . group-        . sort-        . filter (not . null)-        $ stamps--  display []  = "."-  display [x] = " (" ++ x ++ ")."-  display xs  = '.' : unlines (map (++ ".") xs)--  pairLength :: [a] -> (Int, a)-  pairLength [] = (0, error "pairLength should never get an empty list")-  pairLength xss@(xs:_) = (length xss, xs)--  entry (n, xs)         = percentage n ntest-                       ++ intercalate ", " xs--  percentage n m        = show ((100 * n) `div` m) ++ "%"+import Test.QuickCheck.Safe (STestable, quickCheck, inventQCGen) +myquickcheck :: STestable prop => prop -> String+myquickcheck prop = quickCheck (inventQCGen prop) prop
src/Lambdabot/Plugin/Haskell/Eval/Trusted.hs view
@@ -1,17 +1,14 @@ {-# LANGUAGE Trustworthy #-} module Lambdabot.Plugin.Haskell.Eval.Trusted-    ( module Math.OEIS-    , module Test.QuickCheck+    ( module Test.QuickCheck.Safe     , module Lambdabot.Plugin.Haskell.Check.ShowQ     , module Lambdabot.Plugin.Haskell.Eval.Trusted+    , module GHC.Exts, Constraint     ) where -import Math.OEIS import Lambdabot.Plugin.Haskell.Check.ShowQ-import Test.QuickCheck--describeSequence :: SequenceData -> Maybe String-describeSequence = fmap description . lookupSequence+import Test.QuickCheck.Safe+import GHC.Exts (Constraint, IsList (..), IsString (..))  newtype Mu f = In { out :: f (Mu f) }