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:
Anton-Latukha 2020-09-18 15:32:35 +03:00
parent 85a098bfd5
commit 23b143478b
No known key found for this signature in database
GPG Key ID: 3D84C07E91802E41
1 changed files with 1 additions and 1 deletions

View File

@ -246,7 +246,7 @@ instance ( Convertible e t f m
=> FromValue (AttrSet a, AttrSet SourcePos) m
(Deeper (NValue' t f m (NValue t f m))) where
fromValueMay = \case
Deeper (NVSet' s p) -> fmap (, p) <$> sequence <$> traverse fromValueMay s
Deeper (NVSet' s p) -> fmap (, p) . sequence <$> traverse fromValueMay s
_ -> pure Nothing
fromValue v = fromValueMay v >>= \case
Just b -> pure b