@@ -62,6 +62,7 @@ module Control.Lens.SemiIso (
66 -- * Semi-isos for numbers.
67 -- * Semi-isos for numbers.
67 _Negative,
68 _Negative,
@@ -187,6 +188,12 @@ exact x = semiIso f g
187 g y | x == y = Right ()
188 g y | x == y = Right ()
188 | otherwise = Left "exact: not equal"
189 | otherwise = Left "exact: not equal"
191+-- | Like 'filtered' but checks the predicate in both ways.
192+bifiltered :: (a -> Bool) -> SemiIso' a a
193+bifiltered p = semiIso check check
194+ where check x | p x = Right x
195+ | otherwise = Left "bifiltered: predicate failed"
190_Negative :: Num a => SemiIso' a a
197_Negative :: Num a => SemiIso' a a
191_Negative = undefined
198_Negative = undefined