module Optics.Core.Extras
  (
    is
  )
  where

import Data.Maybe

import Optics.Optic
import Optics.AffineFold

-- | Check to see if this 'AffineFold' matches.
--
-- >>> is _Just Nothing
-- False
--
-- @since 0.4.1
is :: Is k An_AffineFold => Optic' k is s a -> s -> Bool
is :: forall (k :: OpticKind) (is :: IxList) (s :: OpticKind)
       (a :: OpticKind).
Is k An_AffineFold =>
Optic' k is s a -> s -> Bool
is Optic' k is s a
k s
s = forall (a :: OpticKind). Maybe a -> Bool
isJust (forall (k :: OpticKind) (is :: IxList) (s :: OpticKind)
       (a :: OpticKind).
Is k An_AffineFold =>
Optic' k is s a -> s -> Maybe a
preview Optic' k is s a
k s
s)
{-# INLINE is #-}

-- $setup
-- >>> import Optics.Core