1-----------------------------------------------------------------------------
2-- |
3-- Module      :  Data.List.Lens
4-- Copyright   :  (C) 2012-16 Edward Kmett
5-- License     :  BSD-style (see the file LICENSE)
6-- Maintainer  :  Edward Kmett <ekmett@gmail.com>
7-- Stability   :  provisional
8-- Portability :  portable
9--
10-- A few extra names that didn't make it into Control.Lens.
11--
12----------------------------------------------------------------------------
13module Control.Lens.Extras
14  ( is
15  , module Data.Data.Lens
16  ) where
17
18import Control.Lens
19import Data.Data.Lens
20
21-- $setup
22-- >>> import Control.Lens
23-- >>> import Numeric.Lens (hex)
24
25-- | Check to see if this 'Prism' matches.
26--
27-- >>> is _Left (Right 12)
28-- False
29--
30-- >>> is hex "3f79"
31-- True
32is :: APrism s t a b -> s -> Bool
33is k = not . isn't k
34{-# INLINE is #-}
35