Skip to content

Commit b2269d3

Browse files
Separate generation out of TheKnot and move internal testing out of
Properties + get rid of a bunch of unnecessary language pragmas
1 parent 8ea8d1e commit b2269d3

File tree

37 files changed

+1687
-1859
lines changed

37 files changed

+1687
-1859
lines changed

libs/cardano-ledger-conformance/src/Test/Cardano/Ledger/Conformance/ExecSpecRule/Core.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import Cardano.Ledger.Core (Era, EraRule, eraProtVerLow)
3333
import qualified Constrained.API as CV2 (HasSpec, Specification, genFromSpec, genFromSpecT)
3434
import Constrained.GenT (GE (..), GenMode (..))
3535
import qualified Constrained.GenT as CV1 (runGenT)
36-
import Constrained.TheKnot (shrinkWithSpec, simplifySpec)
36+
import Constrained.Generation (shrinkWithSpec, simplifySpec)
3737
import Control.Monad.Cont (ContT (..))
3838
import Control.Monad.Trans (MonadTrans (..))
3939
import Control.State.Transition.Extended (STS (..))

libs/cardano-ledger-test/src/Test/Cardano/Ledger/STS.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import Cardano.Ledger.Conway.Core
1818
import Cardano.Ledger.Credential (Credential)
1919
import Cardano.Ledger.Shelley.Rules hiding (epochNo, slotNo)
2020
import Constrained.API hiding (forAll)
21-
import Constrained.TheKnot (shrinkWithSpec)
21+
import Constrained.Generation (shrinkWithSpec)
2222
import Control.Monad.Reader
2323
import Control.State.Transition.Extended
2424
import qualified Data.List.NonEmpty as NE

libs/constrained-generators/constrained-generators.cabal

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ library
3636
Constrained.Examples.Tree
3737
Constrained.FunctionSymbol
3838
Constrained.GenT
39+
Constrained.Generation
3940
Constrained.Generic
4041
Constrained.Graph
4142
Constrained.List
@@ -48,6 +49,7 @@ library
4849
Constrained.Spec.Tree
4950
Constrained.SumList
5051
Constrained.Syntax
52+
Constrained.Test
5153
Constrained.TheKnot
5254
Constrained.TypeErrors
5355

@@ -76,7 +78,7 @@ test-suite constrained
7678
type: exitcode-stdio-1.0
7779
main-is: Tests.hs
7880
hs-source-dirs: test
79-
other-modules: Constrained.Test
81+
other-modules: Constrained.Tests
8082
default-language: Haskell2010
8183
ghc-options:
8284
-Wall

libs/constrained-generators/src/Constrained/API.hs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
{-# LANGUAGE MonoLocalBinds #-}
21
{-# LANGUAGE PatternSynonyms #-}
3-
{-# LANGUAGE ScopedTypeVariables #-}
4-
{-# LANGUAGE TypeApplications #-}
5-
{-# LANGUAGE ViewPatterns #-}
62

73
module Constrained.API (
84
PredD (..),
@@ -178,6 +174,7 @@ import Constrained.Conformance (
178174
)
179175
import Constrained.Core (NonEmpty ((:|)))
180176
import Constrained.FunctionSymbol
177+
import Constrained.Generation
181178
import Constrained.Generic (HasSimpleRep (..), Prod (..))
182179
import Constrained.NumOrd (
183180
MaybeBounded (..),

libs/constrained-generators/src/Constrained/AbstractSyntax.hs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
{-# LANGUAGE ConstraintKinds #-}
22
{-# LANGUAGE DataKinds #-}
3-
{-# LANGUAGE DeriveFunctor #-}
43
{-# LANGUAGE DeriveTraversable #-}
5-
{-# LANGUAGE ExistentialQuantification #-}
64
{-# LANGUAGE FlexibleContexts #-}
75
{-# LANGUAGE FlexibleInstances #-}
86
{-# LANGUAGE GADTs #-}
97
{-# LANGUAGE ImportQualifiedPost #-}
10-
{-# LANGUAGE KindSignatures #-}
118
{-# LANGUAGE LambdaCase #-}
129
{-# LANGUAGE OverloadedStrings #-}
1310
{-# LANGUAGE RankNTypes #-}

libs/constrained-generators/src/Constrained/Base.hs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,13 @@
22
{-# LANGUAGE ConstraintKinds #-}
33
{-# LANGUAGE DataKinds #-}
44
{-# LANGUAGE DefaultSignatures #-}
5-
{-# LANGUAGE DeriveFunctor #-}
6-
{-# LANGUAGE DeriveTraversable #-}
75
{-# LANGUAGE FlexibleContexts #-}
86
{-# LANGUAGE FlexibleInstances #-}
97
{-# LANGUAGE FunctionalDependencies #-}
108
{-# LANGUAGE GADTs #-}
119
{-# LANGUAGE LambdaCase #-}
1210
{-# LANGUAGE OverloadedStrings #-}
13-
{-# LANGUAGE PartialTypeSignatures #-}
1411
{-# LANGUAGE PatternSynonyms #-}
15-
{-# LANGUAGE PolyKinds #-}
16-
{-# LANGUAGE QuantifiedConstraints #-}
17-
{-# LANGUAGE RankNTypes #-}
1812
{-# LANGUAGE ScopedTypeVariables #-}
1913
{-# LANGUAGE StandaloneDeriving #-}
2014
{-# LANGUAGE TypeApplications #-}
@@ -23,7 +17,6 @@
2317
{-# LANGUAGE UndecidableInstances #-}
2418
{-# LANGUAGE UndecidableSuperClasses #-}
2519
{-# LANGUAGE ViewPatterns #-}
26-
{-# OPTIONS_GHC -Wno-unticked-promoted-constructors #-}
2720

2821
-- | This module contains the most basic parts the implementation. Essentially
2922
-- everything to define Specification, HasSpec, HasSimpleRep, Term, Pred, and the Syntax,

libs/constrained-generators/src/Constrained/Conformance.hs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,8 @@
1-
{-# LANGUAGE AllowAmbiguousTypes #-}
2-
{-# LANGUAGE BangPatterns #-}
3-
{-# LANGUAGE DataKinds #-}
4-
{-# LANGUAGE FlexibleContexts #-}
51
{-# LANGUAGE FlexibleInstances #-}
6-
{-# LANGUAGE GADTs #-}
72
{-# LANGUAGE LambdaCase #-}
8-
{-# LANGUAGE MultiParamTypeClasses #-}
9-
{-# LANGUAGE OverloadedStrings #-}
103
{-# LANGUAGE PatternSynonyms #-}
11-
{-# LANGUAGE QuantifiedConstraints #-}
12-
{-# LANGUAGE RankNTypes #-}
134
{-# LANGUAGE ScopedTypeVariables #-}
14-
{-# LANGUAGE StandaloneDeriving #-}
155
{-# LANGUAGE TypeApplications #-}
16-
{-# LANGUAGE TypeFamilies #-}
17-
{-# LANGUAGE TypeOperators #-}
18-
{-# LANGUAGE UndecidableInstances #-}
19-
{-# LANGUAGE ViewPatterns #-}
206
-- Semigroup (Specification a), Monoid (Specification a)
217
{-# OPTIONS_GHC -Wno-orphans #-}
228

libs/constrained-generators/src/Constrained/Core.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
{-# LANGUAGE ConstraintKinds #-}
21
{-# LANGUAGE FlexibleInstances #-}
32
{-# LANGUAGE GADTs #-}
43
{-# LANGUAGE ImportQualifiedPost #-}

libs/constrained-generators/src/Constrained/DependencyInjection.hs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,5 @@
1-
{-# LANGUAGE ConstraintKinds #-}
21
{-# LANGUAGE DataKinds #-}
3-
{-# LANGUAGE DeriveFunctor #-}
4-
{-# LANGUAGE DeriveTraversable #-}
5-
{-# LANGUAGE ExistentialQuantification #-}
6-
{-# LANGUAGE FlexibleContexts #-}
7-
{-# LANGUAGE FlexibleInstances #-}
8-
{-# LANGUAGE GADTs #-}
9-
{-# LANGUAGE ImportQualifiedPost #-}
10-
{-# LANGUAGE KindSignatures #-}
11-
{-# LANGUAGE LambdaCase #-}
12-
{-# LANGUAGE OverloadedStrings #-}
13-
{-# LANGUAGE RankNTypes #-}
14-
{-# LANGUAGE ScopedTypeVariables #-}
15-
{-# LANGUAGE StandaloneDeriving #-}
16-
{-# LANGUAGE TypeApplications #-}
172
{-# LANGUAGE TypeFamilies #-}
18-
{-# LANGUAGE UndecidableInstances #-}
193

204
module Constrained.DependencyInjection where
215

libs/constrained-generators/src/Constrained/Examples/Basic.hs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
{-# LANGUAGE DeriveGeneric #-}
2-
{-# LANGUAGE FlexibleContexts #-}
3-
{-# LANGUAGE FlexibleInstances #-}
42
{-# LANGUAGE ImportQualifiedPost #-}
5-
{-# LANGUAGE MultiParamTypeClasses #-}
63
{-# LANGUAGE QuasiQuotes #-}
74
{-# LANGUAGE ScopedTypeVariables #-}
8-
{-# LANGUAGE TemplateHaskell #-}
9-
{-# LANGUAGE UndecidableInstances #-}
105
{-# LANGUAGE ViewPatterns #-}
116

127
module Constrained.Examples.Basic where

libs/constrained-generators/src/Constrained/Examples/CheatSheet.hs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
{-# LANGUAGE DeriveGeneric #-}
2-
{-# LANGUAGE FlexibleContexts #-}
3-
{-# LANGUAGE FlexibleInstances #-}
42
{-# LANGUAGE ImportQualifiedPost #-}
5-
{-# LANGUAGE MultiParamTypeClasses #-}
63
{-# LANGUAGE QuasiQuotes #-}
7-
{-# LANGUAGE UndecidableInstances #-}
84
{-# LANGUAGE ViewPatterns #-}
95

106
module Constrained.Examples.CheatSheet where

libs/constrained-generators/src/Constrained/Examples/Fold.hs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
{-# LANGUAGE ConstraintKinds #-}
2-
{-# LANGUAGE FlexibleContexts #-}
3-
{-# LANGUAGE MonoLocalBinds #-}
41
{-# LANGUAGE QuasiQuotes #-}
52
{-# LANGUAGE ScopedTypeVariables #-}
63
{-# LANGUAGE TypeFamilies #-}

libs/constrained-generators/src/Constrained/Examples/List.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{-# LANGUAGE ConstraintKinds #-}
2-
{-# LANGUAGE FlexibleContexts #-}
32
{-# LANGUAGE MonoLocalBinds #-}
43
{-# LANGUAGE QuasiQuotes #-}
54
{-# LANGUAGE ViewPatterns #-}

libs/constrained-generators/src/Constrained/Examples/Map.hs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
1-
{-# LANGUAGE DeriveGeneric #-}
2-
{-# LANGUAGE FlexibleContexts #-}
3-
{-# LANGUAGE FlexibleInstances #-}
41
{-# LANGUAGE ImportQualifiedPost #-}
5-
{-# LANGUAGE MultiParamTypeClasses #-}
62
{-# LANGUAGE QuasiQuotes #-}
7-
{-# LANGUAGE UndecidableInstances #-}
83
{-# LANGUAGE ViewPatterns #-}
94

105
module Constrained.Examples.Map where

libs/constrained-generators/src/Constrained/Examples/MapMember.hs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
{-# LANGUAGE GADTs #-}
2-
{-# LANGUAGE QuasiQuotes #-}
3-
{-# LANGUAGE ViewPatterns #-}
4-
51
module Constrained.Examples.MapMember where
62

73
import Constrained.API

libs/constrained-generators/src/Constrained/Examples/Set.hs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
{-# LANGUAGE DeriveGeneric #-}
2-
{-# LANGUAGE FlexibleContexts #-}
32
{-# LANGUAGE FlexibleInstances #-}
43
{-# LANGUAGE MultiParamTypeClasses #-}
54
{-# LANGUAGE TypeFamilies #-}
6-
{-# LANGUAGE UndecidableInstances #-}
75

86
module Constrained.Examples.Set where
97

libs/constrained-generators/src/Constrained/Examples/Tree.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{-# LANGUAGE DataKinds #-}
22
{-# LANGUAGE TypeApplications #-}
3-
{-# LANGUAGE TypeOperators #-}
43

54
module Constrained.Examples.Tree where
65

libs/constrained-generators/src/Constrained/FunctionSymbol.hs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
{-# LANGUAGE DataKinds #-}
2-
{-# LANGUAGE ExistentialQuantification #-}
32
{-# LANGUAGE GADTs #-}
4-
{-# LANGUAGE KindSignatures #-}
53
{-# LANGUAGE PolyKinds #-}
64
{-# LANGUAGE ScopedTypeVariables #-}
75
{-# LANGUAGE TypeApplications #-}

libs/constrained-generators/src/Constrained/GenT.hs

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,9 @@
1-
{-# LANGUAGE AllowAmbiguousTypes #-}
21
{-# LANGUAGE BangPatterns #-}
3-
{-# LANGUAGE ConstraintKinds #-}
4-
{-# LANGUAGE DataKinds #-}
5-
{-# LANGUAGE DefaultSignatures #-}
62
{-# LANGUAGE DeriveFunctor #-}
7-
{-# LANGUAGE DerivingStrategies #-}
8-
{-# LANGUAGE DerivingVia #-}
9-
{-# LANGUAGE EmptyCase #-}
10-
{-# LANGUAGE FlexibleContexts #-}
11-
{-# LANGUAGE FlexibleInstances #-}
12-
{-# LANGUAGE FunctionalDependencies #-}
13-
{-# LANGUAGE GADTs #-}
14-
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
153
{-# LANGUAGE ImportQualifiedPost #-}
16-
{-# LANGUAGE LambdaCase #-}
17-
{-# LANGUAGE MultiParamTypeClasses #-}
18-
{-# LANGUAGE OverloadedStrings #-}
19-
{-# LANGUAGE PatternSynonyms #-}
20-
{-# LANGUAGE QuantifiedConstraints #-}
214
{-# LANGUAGE RankNTypes #-}
225
{-# LANGUAGE ScopedTypeVariables #-}
23-
{-# LANGUAGE StandaloneDeriving #-}
24-
{-# LANGUAGE TupleSections #-}
256
{-# LANGUAGE TypeApplications #-}
26-
{-# LANGUAGE TypeFamilies #-}
27-
{-# LANGUAGE TypeOperators #-}
28-
{-# LANGUAGE UndecidableInstances #-}
29-
{-# LANGUAGE ViewPatterns #-}
307
-- NOTE: this is for `split` vs. `splitGen` that we haven't had
318
-- time to fix in `QuickCheck`.
329
{-# OPTIONS_GHC -Wno-deprecations #-}

0 commit comments

Comments
 (0)