Skip to content

Commit 1df1400

Browse files
committed
Standard: instance MonadValueF: switch implementations to MonadValue
1 parent ac17af6 commit 1df1400

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

src/Nix/Standard.hs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -267,21 +267,15 @@ instance
267267
)
268268
-> StdValue m
269269
-> m r
270-
demandF f v =
271-
free
272-
(f <=< demand <=< force)
273-
(const $ f v)
274-
v
270+
demandF f = f <=< demand
275271

276272
informF
277273
:: ( m (StdValue m)
278274
-> m (StdValue m)
279275
)
280276
-> StdValue m
281277
-> m (StdValue m)
282-
-- 2021-02-27: NOTE: Switch to `further` and `inform`. Probably just informF f = f <=< inform
283-
informF f (Pure t) = Pure <$> furtherF f t
284-
informF f (Free v) = Free <$> bindNValue' id (informF f) v
278+
informF f = f . inform
285279

286280

287281
{------------------------------------------------------------------------}

src/Nix/Type/Infer.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ instance Monad m => MonadValueF (Judgment s) (InferT s m) where
436436
)
437437
-> Judgment s
438438
-> InferT s m (Judgment s)
439-
informF f j = f $ pure j
439+
informF f = f . pure
440440

441441
{-
442442
instance MonadInfer m

0 commit comments

Comments
 (0)