Skip to content

Commit

Permalink
Revert "Make quickcheck-classes usage optional (again)"
Browse files Browse the repository at this point in the history
This reverts commit 22fdeeb.
  • Loading branch information
liskin committed May 15, 2024
1 parent 22fdeeb commit 4de311b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 16 deletions.
10 changes: 0 additions & 10 deletions tests/Properties/Stack.hs
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE ScopedTypeVariables #-}

#ifdef VERSION_quickcheck_classes
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
#endif

module Properties.Stack where

Expand All @@ -15,13 +11,11 @@ import qualified XMonad.StackSet as S (filter)

import Data.Maybe

#ifdef VERSION_quickcheck_classes
import Data.Proxy
import Test.QuickCheck.Classes (
Laws (lawsTypeclass, lawsProperties), Proxy1 (Proxy1),
foldableLaws, traversableLaws,
)
#endif


-- The list returned by index should be the same length as the actual
Expand Down Expand Up @@ -65,7 +59,6 @@ prop_differentiate xs =
where _ = xs :: [Int]


#ifdef VERSION_quickcheck_classes
-- Check type class laws of 'Data.Foldable.Foldable' and 'Data.Traversable.Traversable'.
newtype TestStack a = TestStack (Stack a)
deriving (Eq, Read, Show, Foldable, Functor)
Expand All @@ -82,6 +75,3 @@ prop_laws_Stack = format (foldableLaws p) <> format (traversableLaws p)
p = Proxy :: Proxy TestStack
format laws = [ ("Stack: " <> lawsTypeclass laws <> ": " <> name, prop)
| (name, prop) <- lawsProperties laws ]
#else
prop_laws_Stack = []
#endif
7 changes: 1 addition & 6 deletions xmonad.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ flag pedantic
default: False
manual: True

flag quickcheck-classes

library
exposed-modules: XMonad
XMonad.Config
Expand Down Expand Up @@ -125,15 +123,12 @@ test-suite properties
hs-source-dirs: tests
build-depends: base
, QuickCheck >= 2
, quickcheck-classes >= 0.4.3
, X11
, containers
, xmonad
default-language: Haskell2010

if flag(quickcheck-classes)
-- quickcheck-classes or its deps conflict with template-haskell in GHC 9.10 as of 2024-05-13
build-depends: quickcheck-classes >= 0.4.3

if impl(ghc > 9.8)
ghc-options: -Wno-x-partial

Expand Down

0 comments on commit 4de311b

Please sign in to comment.