module Optics.Operators.Unsafe
( (^?!)
)
where
import Data.Maybe (fromMaybe)
import GHC.Stack (HasCallStack)
import Optics.AffineFold
import Optics.Optic
import Optics.Operators
(^?!) :: (HasCallStack, Is k An_AffineFold) => s -> Optic' k is s a -> a
s
s ^?! :: forall (k :: OpticKind) (s :: OpticKind) (is :: IxList)
(a :: OpticKind).
(HasCallStack, Is k An_AffineFold) =>
s -> Optic' k is s a -> a
^?! Optic' k is s a
o = forall (a :: OpticKind). a -> Maybe a -> a
fromMaybe (forall a. HasCallStack => [Char] -> a
error [Char]
"(^?!): empty affine fold") (s
s forall (k :: OpticKind) (s :: OpticKind) (is :: IxList)
(a :: OpticKind).
Is k An_AffineFold =>
s -> Optic' k is s a -> Maybe a
^? Optic' k is s a
o)
{-# INLINE (^?!) #-}
infixl 8 ^?!