Skip to content

Commit 5b6ccb3

Browse files
simplify Spec.List
1 parent a9e4dba commit 5b6ccb3

File tree

1 file changed

+18
-11
lines changed
  • libs/constrained-generators/src/Constrained/Spec

1 file changed

+18
-11
lines changed

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

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,24 @@
1919
{-# LANGUAGE OverloadedStrings #-}
2020
{-# OPTIONS_GHC -Wno-orphans #-}
2121

22-
module Constrained.Spec.List where
22+
module Constrained.Spec.List
23+
( ListSpec(..)
24+
, ListW(..)
25+
, ElemW(..)
26+
, pattern Elem
27+
, append_
28+
, singletonList_
29+
, elem_
30+
, sum_
31+
, foldMap_
32+
, Foldy(..)
33+
, FoldSpec(..)
34+
, preMapFoldSpec
35+
, toPredsFoldSpec
36+
, adds
37+
, conformsToFoldSpec
38+
, combineFoldSpec
39+
) where
2340

2441
import Constrained.TheKnot
2542
import Constrained.AbstractSyntax
@@ -377,12 +394,6 @@ append_ = appTerm AppendW
377394

378395
-- Fun types for lists and their helper functions
379396

380-
appendFn :: HasSpec a => Fun '[[a], [a]] [a]
381-
appendFn = Fun AppendW
382-
383-
singletonListFn :: forall a. HasSpec a => Fun '[a] [a]
384-
singletonListFn = Fun SingletonListW
385-
386397
foldMapFn :: forall a b. (HasSpec a, Foldy b) => Fun '[a] b -> Fun '[[a]] b
387398
foldMapFn f = Fun (FoldMapW f)
388399

@@ -605,10 +616,6 @@ genFromFold must (simplifySpec -> size) elemS fun@(Fun fn) foldS
605616
$ mapM (genInverse fun elemS) results0
606617
pureGen $ shuffle $ must ++ results
607618

608-
addFun :: NumLike n => Fun '[n, n] n
609-
addFun = Fun AddW
610-
611-
612619
instance Sized [a] where
613620
sizeOf = toInteger . length
614621
liftSizeSpec spec cant = typeSpec (ListSpec Nothing mempty (TypeSpec spec cant) TrueSpec NoFold)

0 commit comments

Comments
 (0)