File tree Expand file tree Collapse file tree 1 file changed +17
-14
lines changed Expand file tree Collapse file tree 1 file changed +17
-14
lines changed Original file line number Diff line number Diff line change @@ -407,25 +407,28 @@ evalSelect aset attr =
407407 s <- aset
408408 path <- traverse evalGetterKeyName attr
409409
410- extract s path
410+ extract path s
411411
412412 where
413- extract :: v -> NonEmpty VarName -> m (Either (v , NonEmpty VarName ) (m v ))
414- extract x path@ (k :| ks) =
413+ extract :: NonEmpty VarName -> v -> m (Either (v , NonEmpty VarName ) (m v ))
414+ extract path@ (k :| ks) x =
415415 do
416416 x' <- fromValueMay x
417417
418- case x' of
419- Nothing -> pure $ Left (x, path)
420- Just (s :: AttrSet v , p :: PositionSet )
421- | Just t <- M. lookup k s ->
422- do
423- list
424- (pure . pure )
425- (\ (y : ys) -> ((`extract` (y :| ys)) =<< ))
426- ks
427- $ demand t
428- | otherwise -> Left . (, path) <$> toValue (s, p)
418+ maybe
419+ (pure $ Left (x, path))
420+ (\ (s :: AttrSet v , _ :: PositionSet ) ->
421+ maybe
422+ (pure $ Left (x, path))
423+ (list
424+ (pure . pure )
425+ (\ (y : ys) -> ((extract (y :| ys)) =<< ))
426+ ks
427+ . demand
428+ )
429+ ((`M.lookup` s) k)
430+ )
431+ x'
429432
430433-- | Evaluate a component of an attribute path in a context where we are
431434-- *retrieving* a value
You can’t perform that action at this time.
0 commit comments