<commit_before>{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE LiberalTypeSynonyms #-}
-----------------------------------------------------------------------------
-- |
-- Module      :  Control.Lens
-- Copyright   :  (C) 2012 <NAME>
-- License     :  BSD-style (see the file LICENSE)
-- Maintainer  :  <NAME> <<EMAIL>>
-- Stability   :  provisional
-- Portability :  Rank2Types
--
-- This package provides lens families, setters, getters, traversals and folds that
-- can all be composed automatically with each other (and other lenses from
-- other van Laarhoven lens libraries) using @(.)@ from Prelude, while
-- reducing the complexity of the API.
--
-- For a longer description and motivation of why you should care about lens families,
-- see <http://comonad.com/reader/2012/mirrored-lenses/>.
--
-- Note: If you merely want your library to /provide/ lenses you may not
-- have to actually import /any/ lens library. For, say, a
-- @'Simple' 'Lens' Bar Foo@, just export a function with the signature:
--
-- > foo :: Functor f => (Foo -> f Foo) -> Bar -> f Bar
--
-- and then you can compose it with other lenses with @(.)@ without needing
-- anything from this library at all.
--
-- Usage:
--
-- You can derive lenses automatically for many data types:
--
-- > import Control.Lens.TH
-- > data Foo a = Foo { _fooArgs :: [String], _fooValue :: a }
-- > makeLenses ''Foo
--
-- This defines the following lenses:
--
-- > fooArgs :: Simple Lens (Foo a) [String]
-- > fooValue :: Lens (Foo a) (Foo b) a b
--
-- The combinators here have unusually specific type signatures, so for
-- particularly tricky ones, I've tried to list the simpler type signatures
-- you might want to pretend the combinators have.
--
----------------------------------------------------------------------------
module Control.Lens
  (
  -- * Lenses
    Lens
  , LensLike
  , Traversal
  , Simple

  -- ** Constructing Lenses
  , lens
  , iso

  -- * Traversing and Lensing
  , (%%~), (%%=)
  , Focus(..)
  , traverseOf, forOf, sequenceAOf
  , mapMOf, forMOf, sequenceOf
  , transposeOf

  -- ** Common Lenses
  , valueAt, valueAtInt
  , contains, containsInt
  , bitAt
  , resultAt
  , identity
  , real, imaginary, polarize
  , _1, _2

  -- * Setters
  , Setter
  , sets
  , mapped

  -- ** Setting Values
  , adjust
  , set
  , (^~), (+~), (-~), (*~), (//~), (||~), (&&~), (|~), (&~), (%~)

  -- ** Setting State
  , (^=), (+=), (-=), (*=), (//=), (||=), (&&=), (|=), (&=), (%=)

  -- * Getters and Folds

  -- ** Getters
  , Getter, to

  -- ** Folds
  , Fold
  , folded
  , filtered
  , reversed

  -- ** Getting and Folding
  , Getting
  , view, views
  , (^.), (^$)
  , access
  , foldMapOf, foldOf
  , foldrOf,   foldlOf
  , foldrOf',  foldlOf'
  , foldr1Of,  foldl1Of
  , foldrMOf,  foldlMOf
  , toListOf
  , anyOf, allOf
  , andOf, orOf
  , productOf, sumOf
  , traverseOf_, forOf_, sequenceAOf_
  , mapMOf_, forMOf_, sequenceOf_
  , asumOf, msumOf
  , concatMapOf, concatOf
  , elemOf, notElemOf
  , lengthOf
  , nullOf
  , maximumOf, minimumOf
  , maximumByOf, minimumByOf
  , findOf

  -- * Common Traversals
  , traverseNothing
  , traverseLeft, traverseRight
  , traverseValueAt, traverseValueAtInt
  , traverseHead, traverseTail
  , traverseLast, traverseInit
  , TraverseByteString(..)
  , TraverseText(..)
  , TraverseValueAtMin(..)<commit_msg>shuffled folds for pedagogical reasons<commit_after>{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE LiberalTypeSynonyms #-}
-----------------------------------------------------------------------------
-- |
-- Module      :  Control.Lens
-- Copyright   :  (C) 2012 <NAME>
-- License     :  BSD-style (see the file LICENSE)
-- Maintainer  :  <NAME> <<EMAIL>>
-- Stability   :  provisional
-- Portability :  Rank2Types
--
-- This package provides lens families, setters, getters, traversals and folds that
-- can all be composed automatically with each other (and other lenses from
-- other van Laarhoven lens libraries) using @(.)@ from Prelude, while
-- reducing the complexity of the API.
--
-- For a longer description and motivation of why you should care about lens families,
-- see <http://comonad.com/reader/2012/mirrored-lenses/>.
--
-- Note: If you merely want your library to /provide/ lenses you may not
-- have to actually import /any/ lens library. For, say, a
-- @'Simple' 'Lens' Bar Foo@, just export a function with the signature:
--
-- > foo :: Functor f => (Foo -> f Foo) -> Bar -> f Bar
--
-- and then you can compose it with other lenses with @(.)@ without needing
-- anything from this library at all.
--
-- Usage:
--
-- You can derive lenses automatically for many data types:
--
-- > import Control.Lens.TH
-- > data Foo a = Foo { _fooArgs :: [String], _fooValue :: a }
-- > makeLenses ''Foo
--
-- This defines the following lenses:
--
-- > fooArgs :: Simple Lens (Foo a) [String]
-- > fooValue :: Lens (Foo a) (Foo b) a b
--
-- The combinators here have unusually specific type signatures, so for
-- particularly tricky ones, I've tried to list the simpler type signatures
-- you might want to pretend the combinators have.
--
----------------------------------------------------------------------------
module Control.Lens
  (
  -- * Lenses
    Lens
  , LensLike
  , Traversal
  , Simple

  -- ** Constructing Lenses
  , lens
  , iso

  -- * Traversing and Lensing
  , (%%~), (%%=)
  , Focus(..)
  , traverseOf, forOf, sequenceAOf
  , mapMOf, forMOf, sequenceOf
  , transposeOf

  -- ** Common Lenses
  , valueAt, valueAtInt
  , contains, containsInt
  , bitAt
  , resultAt
  , identity
  , real, imaginary, polarize
  , _1, _2

  -- * Setters
  , Setter
  , sets
  , mapped

  -- ** Setting Values
  , adjust
  , set
  , (^~), (+~), (-~), (*~), (//~), (||~), (&&~), (|~), (&~), (%~)

  -- ** Setting State
  , (^=), (+=), (-=), (*=), (//=), (||=), (&&=), (|=), (&=), (%=)

  -- * Getters and Folds

  -- ** Getters
  , Getter, to

  -- ** Folds
  , Fold
  , folded
  , filtered
  , reversed

  -- ** Getting and Folding
  , Getting
  , view, views
  , (^.), (^$)
  , access
  , foldMapOf, foldOf
  , foldrOf,   foldlOf
  , toListOf
  , anyOf, allOf
  , andOf, orOf
  , productOf, sumOf
  , traverseOf_, forOf_, sequenceAOf_
  , mapMOf_, forMOf_, sequenceOf_
  , asumOf, msumOf
  , concatMapOf, concatOf
  , elemOf, notElemOf
  , lengthOf
  , nullOf
  , maximumOf, minimumOf
  , maximumByOf, minimumByOf
  , findOf
  , foldrOf',  foldlOf'
  , foldr1Of,  foldl1Of
  , foldrMOf,  foldlMOf

  -- * Common Traversals
  , traverseNothing
  , traverseLeft, traverseRight
  , traverseValueAt, traverseValueAtInt
  , traverseHead, traverseTail
  , traverseLast, traverseInit
  , TraverseByteString(..)
  , TraverseText(..)
  , TraverseValueAtMin(..)
{'fraction_non_alphanumeric': 0.1942908384396951, 'fraction_numerical': 0.004184725751008818, 'mean_word_length': 2.344327836081959, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5032802', 'n_tokens_mistral': 2323, 'n_tokens_neox': 2174, 'n_words': 649}