Skip to content

Commit bb6e583

Browse files
committed
Nix.Normal: rename opaque(,->Val), indicate that it is literal
1 parent 4ddc011 commit bb6e583

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ Breaking:
3838

3939
* `Nix.Normal`
4040
* add `thunkVal` literal & use it where appropriate `{deThunk, removeEffects}`
41+
* rename `opaque(,->Val)`, indicate that it is a literal.
4142

4243

4344

src/Nix/Normal.hs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,9 @@ normalForm_
140140
-> m ()
141141
normalForm_ t = void $ normalizeValue t
142142

143+
opaqueVal :: Applicative f => NValue t f m
144+
opaqueVal = nvStr $ makeNixStringWithoutContext "<cycle>"
145+
143146
-- | Detect cycles & stub them.
144147
stubCycles
145148
:: forall t f m
@@ -161,7 +164,8 @@ stubCycles =
161164
)
162165
Free
163166
where
164-
Free (NValue' cyc) = opaque
167+
Free (NValue' cyc) = opaqueVal
168+
165169
thunkVal :: Applicative f => NValue t f m
166170
thunkVal = nvStr $ makeNixStringWithoutContext "<thunk>"
167171

@@ -176,9 +180,6 @@ removeEffects =
176180
(\ t f -> f =<< queryM (pure thunkVal) t)
177181
(fmap Free . sequenceNValue' id)
178182

179-
opaque :: Applicative f => NValue t f m
180-
opaque = nvStr $ makeNixStringWithoutContext "<cycle>"
181-
182183
dethunk
183184
:: (MonadThunk t m (NValue t f m), MonadDataContext f m)
184185
=> t

0 commit comments

Comments
 (0)