Optics.Operators.Unsafe
Description
(^?!) :: (HasCallStack, Is k An_AffineFold) => s -> Optic' k is s a -> a infixl 8 Source #
Perform an *UNSAFE* head of an affine fold assuming that it is there.
head
>>> Left 4 ^?! _Left 4
>>>
Left 4 ^?! _Left
>>> "world" ^?! ix 3 'l'
"world" ^?! ix 3
>>> [] ^?! _head *** Exception: (^?!): empty affine fold ...
[] ^?! _head
Since: 0.3