Skip to content

Commit bbb7000

Browse files
committed
Convert: m clean-up
1 parent 5b0d3fc commit bbb7000

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/Nix/Convert.hs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,10 @@ instance ( Convertible e t f m
139139
)
140140
=> FromValue a m (Deeper (NValue t f m)) where
141141

142+
fromValueMay :: Deeper (NValue t f m) -> m (Maybe a)
142143
fromValueMay (Deeper v) =
143144
free
144-
((fromValueMay . Deeper) <=< force)
145+
((fromValueMay . Deeper) <=< force) -- these places are complex in types
145146
(fromValueMay . Deeper)
146147
=<< demand v
147148

@@ -217,7 +218,7 @@ instance ( Convertible e t f m
217218
\case
218219
NVStr' ns -> pure $ pure ns
219220
NVPath' p ->
220-
(\path -> pure $ mkNixStringWithSingletonContext path (StringContext path DirectPath)) . fromString . coerce <$>
221+
(\path -> pure $ (`mkNixStringWithSingletonContext` (`StringContext` DirectPath) path) path ) . fromString . coerce <$>
221222
addPath p
222223
NVSet' _ s ->
223224
maybe
@@ -369,7 +370,7 @@ instance ( Convertible e t f m
369370

370371
instance Convertible e t f m
371372
=> ToValue () m (NValue' t f m (NValue t f m)) where
372-
toValue _ = pure $ nvNull'
373+
toValue = const $ pure nvNull'
373374

374375
instance Convertible e t f m
375376
=> ToValue Bool m (NValue' t f m (NValue t f m)) where
@@ -478,7 +479,7 @@ instance Convertible e t f m
478479
]
479480

480481
instance Convertible e t f m => ToValue () m (NExprF (NValue t f m)) where
481-
toValue _ = pure . NConstant $ NNull
482+
toValue = const . pure . NConstant $ NNull
482483

483484
instance Convertible e t f m => ToValue Bool m (NExprF (NValue t f m)) where
484485
toValue = pure . NConstant . NBool

0 commit comments

Comments
 (0)