Skip to content

Commit 586a35f

Browse files
Remove some minor cruft
1 parent afb58d6 commit 586a35f

File tree

4 files changed

+4
-12
lines changed

4 files changed

+4
-12
lines changed

src/Constrained/Base.hs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ module Constrained.Base (
7272
-- * Building `Pred`, `Specification`, `Term` etc.
7373
bind,
7474
name,
75-
named,
7675

7776
-- * TODO: documentme
7877
propagateSpec,
@@ -772,12 +771,6 @@ name :: String -> Term a -> Term a
772771
name nh (V (Var i _)) = V (Var i nh)
773772
name _ _ = error "applying name to non-var thing! Shame on you!"
774773

775-
-- | Give a Term a nameHint, if its a Var, and doesn't already have one,
776-
-- otherwise return the Term unchanged.
777-
named :: String -> Term a -> Term a
778-
named nh t@(V (Var i x)) = if x /= "v" then t else V (Var i nh)
779-
named _ t = t
780-
781774
-- | Create a `Binder` with a fresh variable, used in e.g. `constrained`
782775
bind :: (HasSpec a, IsPred p) => (Term a -> p) -> Binder a
783776
bind bodyf = newv :-> bodyPred

src/Constrained/Generation.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ module Constrained.Generation (
5151
pattern SumSpec,
5252
) where
5353

54-
-- import Debug.Trace
5554
import Constrained.AbstractSyntax
5655
import Constrained.Base
5756
import Constrained.Conformance

src/Constrained/Spec/Map.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,6 @@ instance
186186
n <- genFromSpecT size'
187187
let go 0 _ m = pure m
188188
go n' kvs' m = do
189-
-- mkv <- tryGenT $ genFromSpecT kvs'
190189
mkv <- inspect $ genFromSpecT kvs'
191190
case mkv of
192191
Result (k, v) ->

src/Constrained/Syntax.hs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ reify t f body =
211211
, Explain (pure ("reify " ++ show t ++ " somef $")) $ toPred (body x)
212212
]
213213

214+
-- | Like `reify` but provide a @[`var`| ... |]@-style name explicitly
214215
reifyWithName ::
215216
( HasSpec a
216217
, HasSpec b
@@ -222,9 +223,9 @@ reifyWithName ::
222223
(Term b -> p) ->
223224
Pred
224225
reifyWithName nam t f body =
225-
exists (\eval -> pure $ f (eval t)) $ \x ->
226-
[ reifies (named nam x) t f
227-
, Explain (pure ("reify " ++ show t ++ " somef $")) $ toPred (body (named nam x))
226+
exists (\eval -> pure $ f (eval t)) $ \(name nam -> x) ->
227+
[ reifies x t f
228+
, Explain (pure ("reify " ++ show t ++ " somef $")) $ toPred (body x)
228229
]
229230

230231
-- | Like `suchThat` for constraints

0 commit comments

Comments
 (0)