Skip to content

Commit 1e0f50a

Browse files
Update fourmolu.yaml
Co-authored-by: Alexey Kuleshevich <[email protected]>
1 parent b1a1328 commit 1e0f50a

26 files changed

+1279
-1279
lines changed

examples/Constrained/Examples/Fold.hs

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ oddSpec = explainSpec ["odd via (y+y+1)"] $
2525
(\eval -> pure (div (eval oddx - 1) 2))
2626
(\ [var|y|] -> [assert $ oddx ==. y + y + 1])
2727

28-
evenSpec
29-
:: forall n
30-
. (NumLike n, Integral n)
31-
=> Specification n
28+
evenSpec ::
29+
forall n.
30+
(NumLike n, Integral n) =>
31+
Specification n
3232
evenSpec = explainSpec ["even via (x+x)"] $
3333
constrained $ \ [var|evenx|] ->
3434
exists
@@ -130,14 +130,14 @@ pickProp = do
130130
No msgs -> pure $ counterexample ("predicate " ++ nam ++ "\n" ++ unlines msgs) False
131131

132132
-- | Build properties about calls to 'genListWithSize'
133-
testFoldSpec
134-
:: forall a
135-
. Foldy a
136-
=> Specification Integer
137-
-> Specification a
138-
-> Specification a
139-
-> Outcome
140-
-> Gen Property
133+
testFoldSpec ::
134+
forall a.
135+
Foldy a =>
136+
Specification Integer ->
137+
Specification a ->
138+
Specification a ->
139+
Outcome ->
140+
Gen Property
141141
testFoldSpec size elemSpec total outcome = do
142142
ans <- genFromGenT $ inspect $ genSizedList size elemSpec total
143143
let callString = parensList ["GenListWithSize", show size, fst (predSpecPair elemSpec), show total]
@@ -153,29 +153,29 @@ testFoldSpec size elemSpec total outcome = do
153153
(GenError xs, Succeed) -> pure $ counterexample (succeeds xs) False
154154

155155
-- | Generate a property from a call to 'pickAll'. We can test for success or failure using 'outcome'
156-
sumProp
157-
:: (Integral t, Random t, HasSpec t)
158-
=> t
159-
-> t
160-
-> Specification t
161-
-> t
162-
-> Int
163-
-> Outcome
164-
-> Gen Property
156+
sumProp ::
157+
(Integral t, Random t, HasSpec t) =>
158+
t ->
159+
t ->
160+
Specification t ->
161+
t ->
162+
Int ->
163+
Outcome ->
164+
Gen Property
165165
sumProp smallest largest spec total count outcome = sumProp2 smallest largest (predSpecPair spec) total count outcome
166166

167167
-- | Like SumProp, but instead of using a (Specification fn n) for the element predicate
168168
-- It uses an explicit pair of a (String, n -> Bool). This means we can test things
169169
-- using any Haskell function.
170-
sumProp2
171-
:: (Show t, Integral t, Random t)
172-
=> t
173-
-> t
174-
-> (String, t -> Bool)
175-
-> t
176-
-> Int
177-
-> Outcome
178-
-> Gen Property
170+
sumProp2 ::
171+
(Show t, Integral t, Random t) =>
172+
t ->
173+
t ->
174+
(String, t -> Bool) ->
175+
t ->
176+
Int ->
177+
Outcome ->
178+
Gen Property
179179
sumProp2 smallest largest spec total count outcome = do
180180
(_, ans) <- pickAll smallest largest spec total count (Cost 0)
181181
let callString = parensList ["pickAll", show smallest, (fst spec), show total, show count]

examples/Constrained/Examples/ManualExamples.hs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -241,12 +241,12 @@ ex19 :: Specification (Maybe Bool)
241241
ex19 = constrained $ \mb -> onCon @"Just" mb (\x -> x ==. lit False)
242242

243243
data Dimensions where
244-
Dimensions
245-
:: { length :: Int
246-
, width :: Int
247-
, depth :: Int
248-
}
249-
-> Dimensions
244+
Dimensions ::
245+
{ length :: Int
246+
, width :: Int
247+
, depth :: Int
248+
} ->
249+
Dimensions
250250
deriving (Ord, Eq, Show, Generic)
251251

252252
instance HasSimpleRep Dimensions

examples/Constrained/Examples/MapMember.hs

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ import Test.QuickCheck hiding (forAll)
1010
-- ===============================================
1111
-- Three Strategies that work
1212

13-
mapMemberA
14-
:: (Ord k, IsNormalType k, IsNormalType v, HasSpec k, HasSpec v)
15-
=> Map k v
16-
-> Term k
17-
-> Term v
18-
-> Pred
13+
mapMemberA ::
14+
(Ord k, IsNormalType k, IsNormalType v, HasSpec k, HasSpec v) =>
15+
Map k v ->
16+
Term k ->
17+
Term v ->
18+
Pred
1919
mapMemberA m key val =
2020
And
2121
[ assert $ member_ key (dom_ (lit m))
@@ -27,24 +27,24 @@ mapMemberA m key val =
2727
(branch $ \x -> assert $ val ==. x)
2828
]
2929

30-
mapMemberB
31-
:: (Ord k, IsNormalType v, HasSpec k, HasSpec v, IsNormalType v, IsNormalType k)
32-
=> Map k v
33-
-> Term k
34-
-> Term v
35-
-> Pred
30+
mapMemberB ::
31+
(Ord k, IsNormalType v, HasSpec k, HasSpec v, IsNormalType v, IsNormalType k) =>
32+
Map k v ->
33+
Term k ->
34+
Term v ->
35+
Pred
3636
mapMemberB m key val =
3737
And
3838
[ assert $ member_ key (dom_ (lit m))
3939
, assert $ just_ val ==. lookup_ key (lit m)
4040
]
4141

42-
mapMemberC
43-
:: (Ord k, HasSpec k, HasSpec v, IsNormalType v, IsNormalType v, IsNormalType k)
44-
=> Map k v
45-
-> Term k
46-
-> Term v
47-
-> Pred
42+
mapMemberC ::
43+
(Ord k, HasSpec k, HasSpec v, IsNormalType v, IsNormalType v, IsNormalType k) =>
44+
Map k v ->
45+
Term k ->
46+
Term v ->
47+
Pred
4848
mapMemberC m key val =
4949
And
5050
[ assert $ member_ key (dom_ (lit m))
@@ -54,12 +54,12 @@ mapMemberC m key val =
5454
-- ===============================================
5555
-- Two Strategies that don't work
5656

57-
mapMemberBad1
58-
:: (Ord k, HasSpec k, HasSpec v, IsNormalType v, IsNormalType k)
59-
=> Term [(k, v)]
60-
-> Term k
61-
-> Term v
62-
-> Pred
57+
mapMemberBad1 ::
58+
(Ord k, HasSpec k, HasSpec v, IsNormalType v, IsNormalType k) =>
59+
Term [(k, v)] ->
60+
Term k ->
61+
Term v ->
62+
Pred
6363
mapMemberBad1 m key val =
6464
And
6565
[ dependsOn key m
@@ -68,12 +68,12 @@ mapMemberBad1 m key val =
6868
, assert $ elem_ (pair_ key val) m
6969
]
7070

71-
mapMemberBad2
72-
:: (Ord k, HasSpec k, HasSpec v, IsNormalType v, IsNormalType k)
73-
=> Map k v
74-
-> Term k
75-
-> Term v
76-
-> Pred
71+
mapMemberBad2 ::
72+
(Ord k, HasSpec k, HasSpec v, IsNormalType v, IsNormalType k) =>
73+
Map k v ->
74+
Term k ->
75+
Term v ->
76+
Pred
7777
mapMemberBad2 m key val =
7878
satisfies
7979
(pair_ key val)

examples/Constrained/Examples/Set.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ maybeSpec = constrained $ \ms ->
8686
(branch $ \_ -> False)
8787
(branch $ \y -> 0 <=. y)
8888

89-
eitherSetSpec
90-
:: Specification (Set (Either Int Int), Set (Either Int Int), Set (Either Int Int))
89+
eitherSetSpec ::
90+
Specification (Set (Either Int Int), Set (Either Int Int), Set (Either Int Int))
9191
eitherSetSpec = constrained' $ \es as bs ->
9292
[ assert $ es ==. (as <> bs)
9393
, forAll as $ \a ->

fourmolu.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
indentation: 2
2-
function-arrows: leading
2+
function-arrows: trailing
33
comma-style: leading
44
import-export-style: diff-friendly
55
indent-wheres: true

src/Constrained/API.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,10 +211,10 @@ length_ = sizeOf_
211211
infixr 2 ||.
212212

213213
-- | Another name for `or_`
214-
(||.)
215-
:: Term Bool
216-
-> Term Bool
217-
-> Term Bool
214+
(||.) ::
215+
Term Bool ->
216+
Term Bool ->
217+
Term Bool
218218
(||.) = or_
219219

220220
infixr 5 ++.

0 commit comments

Comments
 (0)