Skip to content

Commit

Permalink
more restrictive type for foldrOf
Browse files Browse the repository at this point in the history
  • Loading branch information
ekmett committed Jan 22, 2013
1 parent 2a11a5c commit ab5df8b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Control/Lens/Fold.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1212,7 +1212,7 @@ minimumByOf l cmp = foldlOf' l mf Nothing where
-- 'findOf' :: 'Getting' ('Endo' ('Maybe' a)) s t a b -> (a -> 'Bool') -> s -> 'Maybe' a
-- 'findOf' l p = 'foldrOf' l (\a y -> if p a then 'Just' a else y) 'Nothing'
-- @
findOf :: (Corepresentable p, Comonad (Corep p)) => Accessing p (Endo (Maybe a)) s t a b -> p a Bool -> s -> Maybe a
findOf :: Conjoined p => Accessing p (Endo (Maybe a)) s t a b -> p a Bool -> s -> Maybe a
findOf l p = foldrOf l (cotabulate $ \wa y -> if corep p wa then Just (extract wa) else y) Nothing
{-# INLINE findOf #-}

Expand Down

1 comment on commit ab5df8b

@ekmett
Copy link
Owner Author

@ekmett ekmett commented on ab5df8b Jan 22, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

er findOf.

Please sign in to comment.