packages feed

papa-0.7.0: src/Papa/Lens.hs

{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -Wall #-}

-- | All of "Control.Lens" and "Control.Lens.Extras", without the partial
-- combinators, with total @(!!)@, @fst@ and @snd@.
--
-- These are not exported, because they throw:
--
-- * @(^?!)@ and @(^\@?!)@ throw for an empty fold. Use 'preview' ('^?') and
--   'ipreview' ('^@?').
-- * @foldr1Of@, @foldl1Of@, @foldr1Of'@ and @foldl1Of'@ throw for an empty
--   fold. Use 'foldrOf' and 'foldlOf' with a seed, or 'foldMapOf' into a
--   semigroup through 'preview'.
-- * @singular@ and @unsafeSingular@ throw for a traversal with no target
--   (and @unsafeSingular@ for one with many). Use 'preview' to read, and the
--   traversal itself to write.
-- * @unsafePartsOf@, @unsafePartsOf'@, @iunsafePartsOf@ and
--   @iunsafePartsOf'@ throw when the new list is shorter than the old. Use
--   'partsOf'.
--
-- @(.>)@, @(<.)@ and @(<.>)@ are not exported either: those of
-- "Data.Functor.Apply" are, through "Papa.Semigroupoids".
module Papa.Lens (
  module P,
  (!!),
  fst,
  snd,
) where

import Control.Lens as P hiding (
  foldl1Of,
  foldl1Of',
  foldr1Of,
  foldr1Of',
  iunsafePartsOf,
  iunsafePartsOf',
  singular,
  unsafePartsOf,
  unsafePartsOf',
  unsafeSingular,
  (.>),
  (<.),
  (<.>),
  (^?!),
  (^@?!),
 )
import Control.Lens.Extras as P
import Papa.Lens.Data.List
import Papa.Lens.Data.Tuple