@@ -63,6 +63,7 @@ module Control.Lens.SemiIso (
6363 constant,
6464 exact,
6565 bifiltered,
66+ alwaysFailing,
6667
6768 -- * Semi-isos for numbers.
6869 _Negative,
@@ -193,6 +194,10 @@ bifiltered p = semiIso check check
193194 where check x | p x = Right x
194195 | otherwise = Left "bifiltered: predicate failed"
195196
197+-- | A semi-iso that fails in both directions.
198+alwaysFailing :: String -> SemiIso s t a b
199+alwaysFailing msg = semiIso (\_ -> Left msg) (\_ -> Left msg)
200+
196201-- | \-> Matches only negative numbers, turns it into a positive one.
197202--
198203-- \<- Matches only positive numbers, turns it into a negative one.