Skip to content

Commit 4ddc011

Browse files
committed
Nix.Normal: add thunkVal; use where appropriate
1 parent 369e56d commit 4ddc011

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

ChangeLog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ Breaking:
3636
=> Transform g (m a) -> Alg g (m a) -> Maybe FilePath -> Fix g -> m a
3737
```
3838

39+
* `Nix.Normal`
40+
* add `thunkVal` literal & use it where appropriate `{deThunk, removeEffects}`
3941

4042

4143

src/Nix/Normal.hs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,8 @@ stubCycles =
162162
Free
163163
where
164164
Free (NValue' cyc) = opaque
165+
thunkVal :: Applicative f => NValue t f m
166+
thunkVal = nvStr $ makeNixStringWithoutContext "<thunk>"
165167

166168
removeEffects
167169
:: (MonadThunk t m (NValue t f m), MonadDataContext f m)
@@ -171,7 +173,7 @@ removeEffects =
171173
iterNValueM
172174
id
173175
-- 2021-02-25: NOTE: Please, unflip this up the stack
174-
(\ t f -> f =<< queryM (pure opaque) t)
176+
(\ t f -> f =<< queryM (pure thunkVal) t)
175177
(fmap Free . sequenceNValue' id)
176178

177179
opaque :: Applicative f => NValue t f m
@@ -181,4 +183,4 @@ dethunk
181183
:: (MonadThunk t m (NValue t f m), MonadDataContext f m)
182184
=> t
183185
-> m (NValue t f m)
184-
dethunk = removeEffects <=< queryM (pure opaque)
186+
dethunk = removeEffects <=< queryM (pure thunkVal)

src/Nix/Render/Frame.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ renderValue
206206
-> NValue t f m
207207
-> m (Doc ann)
208208
renderValue _level _longLabel _shortLabel v = do
209-
opts :: Options <- asks (view hasLens)
209+
opts :: Options <- asks $ view hasLens
210210
bool
211211
prettyNValue
212212
prettyNValueProv

0 commit comments

Comments
 (0)