@@ -62,6 +62,7 @@ module Control.Lens.SemiIso (
6262 morphed,
6363 constant,
6464 exact,
65+ bifiltered,
6566
6667 -- * Semi-isos for numbers.
6768 _Negative,
@@ -187,6 +188,12 @@ exact x = semiIso f g
187188 g y | x == y = Right ()
188189 | otherwise = Left "exact: not equal"
189190
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"
196+
190197_Negative :: Num a => SemiIso' a a
191198_Negative = undefined
192199