Skip to content

Commit a6e0d50

Browse files
committed
Merge pull request #20 from scott-christopher/minimumOf-fix
Fixes comparison in minimumOf
2 parents c58fde5 + c87cf26 commit a6e0d50

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Data/Lens/Fold.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ maximumOf p = foldrOf p (\a -> Just <<< maybe a (max a)) Nothing where
114114
-- | The minimum of all foci of a `Fold`, if there is any.
115115
minimumOf :: forall s t a b. (Ord a) => Fold (Endo (Maybe a)) s t a b -> s -> Maybe a
116116
minimumOf p = foldrOf p (\a -> Just <<< maybe a (min a)) Nothing where
117-
min a b = if a > b then a else b
117+
min a b = if a < b then a else b
118118

119119
-- | Find the first focus of a `Fold` that satisfies a predicate, if there is any.
120120
findOf :: forall s t a b. Fold (Endo (Maybe a)) s t a b -> (a -> Boolean) -> s -> Maybe a

0 commit comments

Comments
 (0)