Nix/Convert.hs: fuse functors in one case of fromValueMay
fmap (fmap (, p)) $ fmap (sequence) $ traverse fromValueMay s fmap (fmap (, p)) . fmap (sequence) $ traverse fromValueMay s | (fmap f . fmap g) => fmap (f . g) fmap (fmap (, p) . (sequence)) $ traverse fromValueMay s | fmap => <$> fmap (, p) . sequence <$> $ traverse fromValueMay s
This commit is contained in:
parent
85a098bfd5
commit
23b143478b
|
@ -246,7 +246,7 @@ instance ( Convertible e t f m
|
||||||
=> FromValue (AttrSet a, AttrSet SourcePos) m
|
=> FromValue (AttrSet a, AttrSet SourcePos) m
|
||||||
(Deeper (NValue' t f m (NValue t f m))) where
|
(Deeper (NValue' t f m (NValue t f m))) where
|
||||||
fromValueMay = \case
|
fromValueMay = \case
|
||||||
Deeper (NVSet' s p) -> fmap (, p) <$> sequence <$> traverse fromValueMay s
|
Deeper (NVSet' s p) -> fmap (, p) . sequence <$> traverse fromValueMay s
|
||||||
_ -> pure Nothing
|
_ -> pure Nothing
|
||||||
fromValue v = fromValueMay v >>= \case
|
fromValue v = fromValueMay v >>= \case
|
||||||
Just b -> pure b
|
Just b -> pure b
|
||||||
|
|
Loading…
Reference in a new issue