- Added
_Wrapped
support forNonEmpty
.
filepath
1.4 support- Removed
Control.Monad.Primitive.Lens
and shed theprimitive
dependency. - Add missing
_WithIndex
instances fromkeys
package - Much more code is inferred
Safe
rather thanTrustworthy
. - Documented the difference between
unsafeSingular
andsingular
. folding
now produces an actualFold
.- Cleaned up builds for GHC 7.10 to get rid of redundant import warnings.
- When built with
profunctors
4.4 on GHC 7.8+ we no longer need to useunsafeCoerce
at all! This drastically reduces the level of trust involved in the way we have optimizedlens
. - Added
fusing
. This optimizes longLens
chains, by enfocing a form offmap
fusion based on the Yoneda lemma. This is particularly effective at making faster lenses the definition is recursive or complex enough that it cannot be inlined. - Added
confusing
. This optimizes longTraversal
chains. As withfusing
it is best used when the definition for theTraversal
chain in question is recursive or complex enough that it cannot be inlined, but the implementation is much more confusing. - Remove deprecated stuff:
Control.Lens.Loupe
,headOf
,makeFieldsWith
,strippingPrefix
,strippingSuffix
- Added
Cons
andSnoc
instances forNonEmpty
- Removed
Data.List.Split.Lens
module - Reimplemented
bytestring
traversals to avoid internal modules - Added
gplate
, an implementation ofplate
for any type implementingGeneric
- Strictness revisited
- Add
generateLazyPatterns
configuration flag tomakeLenses
rules. - Make the default
makeLenses
behavior to generate STRICT optics - Add strict variants of
_1
.._9
named_1'
.._9'
- Add
- Generalized some combinators in
Data.Vector.Generic.Lens
and addedconverted
- Migrated
Control.Lens.Action
tolens-action
. - Added
Data.Vector.Generic.Lens.vectorIx
function for indexing vectors with onlyVector
constraint. - Added
Field1
andField2
instances forData.Functor.Product.Product
. - Removed the "typeclass synonym"
Gettable
. - Added new flag to
makeLenses
,generateUpdateableOptics
, which allows the generation of onlyGetter
s andFold
s. This feature is intended to be used when the constructors are hidden behind validating, "smart" constructors. - Fixed Template Haskell name generation when using GHC 7.10
- Fixed Template Haskell generation of classes methods where field types used existential quantification
- Compatibility with
base
4.8 [Edit: this turned out to not work for the final release of GHC 7.10]
- Reduced
Review
to two arguments, likeGetter
. - Added
abbreviatedFields
to permitmakeFieldsWith
to be invoked with an argument that lets it act like it did pre-4.5 and accept arbitrary common prefixes.
- Provide access to the typename in
lensRules
naming function. makeFields
camelcasing rules now properly support types with camelcasing.MyType
with fieldmyTypeFieldA
generatesfieldA
now. Previously the prefix ignore capitalization and the field would need to be namedmytypeFieldA
.makeClassy
works on types even when none of the fields would generate optics.- Added
Monad
,MonadReader
,MonadPlus
andBind
instances forReifiedMonadicFold
- Added missing fixity declarations on many operators.
- Migrated
Codec.Compression.Zlib.Lens
tozlib-lens
package.
text
1.2.0.0 support- Remove the use of the TemplateHaskell extension from the library to enable lens to be used on stage1 cross-compilers
- Restore previous default of
makeFields
using the camel case field namer.
- Internals of Template Haskell code generation rewritten. makeLenses, makeClassy, and makeFields have been unified into the same generator.
- TH generated single constructor Lens use irrefutable pattern matching to enable construction starting with undefined.
- TH generated traverals unify their field arguments (type synonyms not currently expanded) enabling exotic traversals to be generated.
- Added instances for
Text
toData.Aeson.Lens
- Reimplemented
makePrisms
, adding support formakeClassyPrisms
, infix constructrs generate periods (.) prefixed prisms. - Added
Choice
toReview
so thatPrism
is a proper subtype ofReview
- Migrated
Data.Aeson.Lens
tolens-aeson
package. - Fixed
GHC.Generics.Lens.tinplate
behavior on single-field data types and empty data types.
semigroupoids
4.2 support
contravariant
1.0 support
- Added
bytewise
toData.Bits
- Switched the "direction" of the
Iso
argument toau
to match the order generated bymakePrisms
andmakeLenses
. - Removed
makeIsos
in favor ofmakePrisms
andmakeLenses
. Each of these functions will constructIso
s when appropriate. - Removed
declareIsos
in favor ofdeclarePrisms
anddeclareLenses
. Each of these functions will constructIso
s when appropriate. - Added
matching
for type-changing matches withPrism
s. - Added
withPrism
for recovering the functions passed toprism
. - Added
negated
, the isomorphism for thenegate
function.
- Added
_Text
isomorphisms to make the proper use with(#)
more obvious and fit newer convention. - Added
Wrapped
instances forVector
types - Resolved issue #439. The various
Prism
s for string-like types inData.Aeson.Lens
are now law-abidingPrism
s "up to quotient." - Added
selfIndex
. - Support
attoparsec
0.12.
- When used with
exceptions
0.4,throwingM
will permit use with a mereMonadThrow
.
- Generalized the types of
mapping
,bimapping
,contramapping
,dimapping
,lmapping
,rmapping
to support changing theFunctor
,Bifunctor
,Contravariant
, andProfunctor
respectively. - Compatibility with
free
4.6
- Added
Plated
instances for various free monad variants. - Compatibility with GHC HEAD (7.9+)
- Removed dependency on
constraints
. It was used in a pre-release version of 4.0 but never made it into 4.0, but the dependency had remained around complicating builds for GHC 7.4.
makeLenses
attempt to make the accessors it can under existential quantification.- Added
(&~)
. - Experimental support for parallel builds on GHC 7.8 with
cabal install lens -fj
. Due to at last one known issue with GHC, it isn't recommended to use this option when rebuilding lens, as a race condition on at least one platform has been seen in the wild. - Added
RoleAnnotations
for GHC 7.8.1. These rule out a few user-accessible bottoms that could be caused by creative abuse of the newCoercible
machinery. However, there was nounsafeCoerce
exposed. - Removed some impossible cases that required unwritable instances from the example doctypes.
- Added
bimapping
toControl.Lens.Iso
- Restored correct behavior of
makePrism
on types with a single constructor. makeLenses
now generatesGetter
s andFold
s on universally quantified fields.
- Made
declareFields
work again.
- Fixed random segfaulting when using
foldMapBy
.
- Properly bundled the modules needed for the properties test suite into the tarball for hackage.
- Typo fixes
- Exporting
Rewrapping
fromControl.Lens.Wrapped
. - Removed the dependency on
cpphs
.
- Added
nearly
toControl.Lens.Prism
. - Added
Control.Lens.Empty
, exporting_Empty
. - We now require
DefaultSignatures
. - Added
failing
andifailing
toControl.Lens.Traversal
. - Changed the signature of
Data.List.Split.Lens.condensing
due to the addition ofDropBlankFields
toData.List.Split.CondensePolicy
insplit
. - Simplified
Each
,Ixed
, andContains
. They are no longer indexed. The previous design was actively getting in the way of user-defined instances. - Replaced more of our home-grown types with standard ones. They had previously been defined to help make more intelligible error messages, but when we switched to using
(Contravariant f, Functor f)
instead of(Gettable f)
, these ceased to really help. Now you can define even morelens
-compatible types (e.g.Getter
andFold
) without depending onlens
.- Replaced the use of
Accessor
withConst
. - Replaced the use of
Mutator
withIdentity
. - Replaced the use of
Reviewed
withTagged
.
- Replaced the use of
- Removed the deprecated
Control.Lens.Simple
module. - Repurposed
Control.Lens.Combinators
to re-exportControl.Lens
sans any operators; previous residents rehomed toControl.Lens.Lens
. - Added
Control.Lens.Operators
to export just the operators. Varying your import styles between these supports many qualified usage scenarios. - Simplified
Cons
andSnoc
. Now they must be aPrism
. - Simplified
Contains
. This necessitated losing many instancs ofContains
, but makes it much easier and more consistent to use and instantiate. - Simplified the various
AsFoo
types inControl.Exception.Lens
- Simplified the types in
System.IO.Error.Lens
. - Merged
lens-aeson
intolens
. - We're exiling
Control.Lens.Zipper
to a separate package. This will let the design for it iterate faster and let us explore the trade-offs between the 3.8 style and the 3.9 style of zippers. - Generalized
alongside
,inside
,both
. - Switched to a new
Typeable
version ofreflection
for the harder combinators inControl.Exception.Lens
. This enables us to comply with GHC 7.7's ban on hand-writtenTypeable
instances. - Added a
_Show
Prism
. - Added
Control.Lens.Extras
for the combinator names we don't have the gall to claim outright, but which are consistent with the rest. - Renamed the constructors for
ReifiedLens
, etc. to just be the name of their base type. - Added many many missing instances for
ReifiedFold
andReifiedGetter
. This permits things likerunFold ((,) <$> Fold (traverse._1) <*> Fold (traverse._2))
to be aFold
andReifiedFold
can be used as aMonad
,Profunctor
, etc. - Many performance optimizations.
- Switched to
exceptions
fromMonadCatchIO-transformers
- Added types for working with
RelevantFold
andRelevantTraversal
. These are aFold
orTraversal
that always has at least one target. SinceApply
isn't a superclass ofApplicative
, you occasionally need to convert between them, but it lets you more readily work with less unsafety. - Changed
unwrapping
andwrapping
to have the same constructor-oriented order as aPrism
and renamed them t_Wrapping
and_Unwrapping
respectively. - Drastically changed the way
_Wrapping
and_Unwrapping
are built to get much better inference. - There are about 15,000 lines of patches over the last year, so I'm sure we missed a few big changes.
- Compatibility with
base
4.7
- Compatibility with
text
1.0
- Switched to
bifunctors
,comonad
,profunctors
, andsemigroupoids
4.0.
- Generalized signatures for
throwing
andthrowingM
.
- 'condensingPolicy' was updated to work with 'split' 0.2.2
- Bumped dependency on
generic-deriving
again.
- Bumped dependency on
generic-deriving
to enable building on GHC HEAD.
- Updated the field guide image to link to imgur. Sadly the overview haddock and the haddocks are not generated in the same directory, so the haddock hook for copying the image only works locally.
- Changed
Getting
to take 3 arguments instead of 5. If you need the old behavior for portability you can useOverloaded (Accessor r) s t a b
instead ofGetting r s t a b
and it'll work consistently back through the last few releases. - Added
involuted
toControl.Lens.Iso
. - Factored out a common
reversed
definition from all the various forms of it around the library and placed it inControl.Lens.Iso
. - Added
binary
,octal
,decimal
andhex
toNumeric.Lens
. - Added
sans
toControl.Lens.At
. - Improved interoperability:
- Reimplemented
Gettable
as an alias forContravariant
andFunctor
together to deriveGetter
andFold
. This means you can now implement aGetter
orFold
with only a Haskell 98 dependency (contravariant
). - Removed
Reviewable
. We now useBifunctor
andProfunctor
together to deriveReview
. This means you can now implement aReview
with Haskell 98 dependencies (profunctors
andbifunctors
). - These changes enables more types to be defined without incurring a dependency on the
lens
package.
- Reimplemented
- Fixes to dependencies and pragmas.
- Fixed an issue with
DefaultSignatures
being used outside of the appropriate#ifdef
that caused compilation issues on GHC 7.0.2. - Generalized the signature of
prism'
- Added
\_Void
andonly
toControl.Lens.Prism
anddevoid
toControl.Lens.Lens
. - Added
\_Nothing
toControl.Lens.Prism
. - Added
devoid
andunited
toControl.Lens.Lens
.
- Fixed more sporadic issues in doctests, caused by carrying flags from
$setup
between modules.
- Renamed
strippingPrefix
toprefixed
,strippingSuffix
tosuffixed
. Left the old names as deprecated aliases. - Fixed issues with the test suite caused by
doctests
carrying flags from the$setup
block between modules. - Benchmarks now use
generic-deriving
rather thanghc-prim
directly, like the rest of the package. - Added
Generics.Deriving.Lens
, which is now simply re-exported fromGHC.Generics.Lens
.
- Added
strippingSuffix
andstripSuffix
toData.Data.Lens
- Added
unpackedBytes
andunpackedChars
toData.ByteString.*.Lens
- Added
unpacked
toData.Text.*.Lens
- Added
(#)
as an infix form ofreview
to ease using aPrism
like a smart constructor inControl.Lens.Review
.
- Added a notion of
Handleable(handler, handler_)
toControl.Exception.Lens
to facilitate constructing aHandler
from an arbitraryFold
orPrism
. - Added a notion of
Handler
andcatches
to andControl.Monad.Error.Lens
to mirror theControl.Exception
andControl.Monad.CatchIO
constructions. - Added additional doctests and documentation.
- Improved error messages and support for types with arguments in
makeFields
.
- Fixed a bug in
makeFields
in hierarchical modules.
- Fixed an issue with running the
doctests
test suite when an older version ofsemigroups
is installed.
- Overall:
- Replaced each of the different
SimpleFoo
type aliases withFoo'
throughout. The variousSimple
aliases can still be found inControl.Lens.Simple
but are now deprecated. - Made sweeping changes to
Iso
andPrism
andIndexed
lenses internally. They are now based onprofunctors
. This affects how you useindexed
in the resulting code and dramatically changed the meaning ofOverloaded
. - Generalized combinators to pass through indices unmodified wherever possible and added indexed variants to existing combinators. There are hundreds of these changes and they would swamp this list.
- Replaced each of the different
Control.Exception.Lens
- This module was created to add combinators and prisms that make it possible to work with GHC's extensible exceptions and monad transformer stacks more easily. There are knock-on changes in
Data.Dynamic.Lens
,System.Exit.Lens
, andSystem.IO.Error.Lens
.
- This module was created to add combinators and prisms that make it possible to work with GHC's extensible exceptions and monad transformer stacks more easily. There are knock-on changes in
Control.Lens.At
- Moved
At(at)
andContains(contains)
and factored outIxed(ix)
. - Deprecated
_at
andresultAt
. - Removed various
ordinal
andix
combinators, which are subsumed byIxed(ix)
.
- Moved
Control.Lens.Cons
- Consoldiated the various
_head
,_tail
,_init
and_last
traversals that were scattered around the place into a pair ofCons
andSnoc
classes that provide_Cons
and_Snoc
prisms respectively, and combinators that build on top.
- Consoldiated the various
Control.Lens.Each
- Generalized the signature of
Each
to permit it to provide anIndexedSetter
for((->) e)
. Each
now uses anIndex
type family that is shared withAt
,Ixed
andContains
to indicate these operations are related.
- Generalized the signature of
Control.Lens.Equality
- Added as a stronger form of
Iso
that can be used to safely cast. - Added the adverb
simply
, which can be used to simplify the types of most combinators in the library so they only take a simple lens, simple traversal, etc as their first argument instead. e.g.simply view
forcesa ~ b
,s ~ t
in the argument toview
.
- Added as a stronger form of
Control.Lens.Fold
- Added
foldr1Of'
andfoldl1Of'
. - Added
has
andhasn't
.
- Added
Control.Lens.Indexed
- The various indexed combinators for each type were distributed to their respective modules. This module grew to encompass the remaining index-specifics.
- Added
index
andindices
, and removediwhere
andiwhereOf
. Useitraversed.indices even
andbar.indices (>3)
instead.
Control.Lens.Internal
- This module was exploded into more manageable component modules.
Control.Lens.Iso
Strict(strict)
is now aSimple Iso
.- Added
magma
andimagma
which can be used to provide a 'debugging view' of aTraversal
.
Control.Lens.Lens
- Restructuring split this module out from
Control.Lens.Type
and merged the contentsControl.Lens.IndexedLens
.
- Restructuring split this module out from
Control.Lens.Level
- This module was created to provide the breadth-first-search Traversals
levels
andilevels
which can be used to do (optionally depth-limited) breadth-first searches through arbitrary traversals reaching all leaves at finite depth in finite time. To use these in full accordance with the laws you should restrict yourself to commutative operations and finite containers, but they are useful even in the absence of these properties.
- This module was created to provide the breadth-first-search Traversals
Control.Lens.Loupe
- In the interest of consistency, the
Loupe
alias has been deprecated in favor ofALens
. Loupe
(andALens
) are now defined in terms ofPretext
rather thanContext
. This permits them to be cloned at a reduced cost reducing the call forReifiedLens
.
- In the interest of consistency, the
Control.Lens.Operators
- Added this module for users who insist on qualified use, but want access to the operators. They can
import qualified Control.Lens as Lens
andimport Control.Lens.Operators
unqualified.
- Added this module for users who insist on qualified use, but want access to the operators. They can
Control.Lens.Prism
- Added
prism'
to constructSimplePrism
s.
- Added
Control.Lens.Reified
- Consolidated the various
ReifiedFoo
definitions into one module.
- Consolidated the various
Control.Lens.Representable
- This module was removed. Its functionality may be split out into a separate package, but currently the
linear
package exports is ownLinear.Core
module to provide this functionality. It was taking lots of useful names for little functionality and didn't feel like the rest of the API.
- This module was removed. Its functionality may be split out into a separate package, but currently the
Control.Lens.Review
- This module now factors the
review
functionality out ofPrism
and exposesunto
, which is toreview
whatto
is toview
.
- This module now factors the
Control.Lens.Setter
- Added
contramapped
andargument
for mapping over inputs.
- Added
Control.Lens.Simple
- Removed the infix lens aliases and repurposed the module to house the now deprecated
SimpleFoo
type aliases, which were replaced universally withFoo'
.
- Removed the infix lens aliases and repurposed the module to house the now deprecated
Control.Lens.TH
makeLenses
now generatesLens'
andTraversal'
where appropriate- Added
makePrisms
as a generalizedmakeIso
that automatically generates aPrism
for each constructor.makePrisms
generates names with an_Foo
convention. This was consolidated upon throughout the library to reduce namespace conflicts between prisms and lenses. - Added
makeFields
, which generates classes for each individual field in a data type. - Added
makeWrapped
, which automatically generates aWrapped
instance for a newtype.
Control.Lens.Type
- This module was repurposed to provide a single home for all the standard lens-like type aliases used when producing lenses. You still need to go to their respective modules to find the types for consuming lens-likes if you want to generate your own lens combinators
Control.Lens.Wrapped
- Added
wrapped'
andunwrapped'
for scenarios where you need the help with type inference.
- Added
Control.Lens.Zipper
- Converted
Zipper
to walk a magma based on the original structure and to use indices from indexed traversals when restoring from tape. This also means that when zipping around within a balanced structure with ascending keysmoveTo
can operate in logarithmic time, but required changing theZipper
type to add the index type.
- Converted
Data.Bits.Lens
- Added
byteAt
.
- Added
Data.ByteString.Lens
Data.ByteString.Lazy.Lens
now usesInt64
-based indexing.- The
Traversal
for strictByteStrings
now construct a balanced tree up to a given grain size. This permits zipper based seeking to operate in logarithmic time and speeds up many traversals.
Numeric.Lens
- Created.
base
shows and reads integers at base-2 through base-36.integral
can be used as a safefromInteger
/toInteger
.
- Created.
- Fixed an issue with the
Complex
Each
instance.
- Fixed an errant
LANGUAGE
pragma
- Backported the API for
ALens
andALens'
to supportsnap
builds on old platforms.
- Removed my intra-package dependency upper bounds for my own packages. In particular this enables us to work with
semigroups
0.9. - Switched to
transformers-compat
to avoid having unbuilding modules at the top of the documentation, and to ease 3rd party compatibility. - Updated
Setup.lhs
to be compatible with Cabal 1.17
- Bug fix for
Magnify
. It was missing functional dependencies to determine itsk
parameter fromm
orn
.
- Made the doctest test suite hide all but the exact versions of packages used to build this package to avoid problems with complicated user environments.
- Removed doctests based on
:t
as they are fragile and break across GHC versions. - Fixed GHC 7.0.4 compatibility by guarding
DefaultSignatures
inControl.Lens.Each
.
- Removed tests that will (likely) fail in the presence of
hashable
1.2
- Added
preuse
,preuses
toControl.Lens.Fold
- Added
Each(each)
toControl.Lens.Each
for indexed traversal of potentially monomorphic containers. - Added
indexing64
andtraversed64
for help with large containers. - Generalized the type signature of
choosing
. - Exported
unwrapped
fromControl.Lens.Wrapped
. - Support for
hashable
1.2 - Added
(??)
toControl.Lens.Combinators
.
- Fixed flagging for Safe Haskell.
- Fixed examples.
- Cleaned up the statement of the Prism laws.
- Corrected bounds for hashable.
- Fixed compatibility with Haskell Platform 2011.4.0.0 -- you may have to install with --constraint="transformers = 0.2.2.0" to avoid getting new mtl and transformer versions installed.
- Renamed
Projection
toPrism
. - Implemented a complete redesign of the way
Iso
andPrism
are handled internally. AnyIso
can now be used as aPrism
. - The
isos
combinator is no longer required.iso
can now be used to construct anIso
. - Changes to the signature of
from
andunder
were necessitated by the new design. - Added
Control.Lens.Wrapped
providing a canonical isomorphism for newtypes. - Repurposed
ala
to be closer to the original design innewtype
, but addedau
andalaf
. - Added
_magnitude
,_phase
and_conjugate
toData.Complex.Lens
. Renamed other lenses for consistency:_realPart
,_imagPart
,_polar
. - Promoted
_left
and_right
to prisms and moved them toControl.Lens.Prism
. - Generalized
view
andviews
to subsume the old functionality ofperuse
andperuses
. - Generalized
review
andreviews
to both return aMonadReader
and to work on aProjection
. - Added
view'
/views'
anduse'
/uses'
forSimple
access to the environment/state. - Added
set'
, aSimple
version ofset
. - Added
reuse
:use
::review
:view
andreuses
:uses
::reviews
:views
for working aProjection
from the currentMonadState
. - Removed many isomorphisms for various newtypes.
_const
,identity
,_sum
, etc. Usewrapping Const
,wrapping Identity
, etc. - Removed
Data.Monoid.Lens
now that its newtypes are instances ofWrapped
, exporting the (<>=
)-variants fromControl.Lens.*
. - Renamed
via
tocloneIso
for consistency. - Moved
Indexed(..)
toControl.Lens.Classes
. - Renamed
index
toindexed
to reduce conflicts with third-party libraries. - Added
curried
anduncurried
toControl.Lens.Iso
. - Added
Strict(strict)
for ad hoc overloading of conversions between strict and lazy variants ofByteString
andText
. - Bug fixes for
tugTo
andjerkTo
. - These no longer traverse in the wrong direction:
scanl1Of
,scanr1Of
,mapAccumLOf
, andmapAccumROf
. - Added
anon
toControl.Lens.Iso
. - Generalized the types of the
Control.Lens.Zipper
combinators to work with other MonadPlus instances. - Added
withins
toControl.Lens.Zipper
now that they can work better with []. - Added
singular
andunsafeSingular
toControl.Lens.Traversal
to assert aTraversal
is aLens
, aFold
is aGetter
or aMonadicFold
is anAction
. - Generalized
sequenceAOf_
's type to matchsequenceA_
. - Renamed
up
/down
/left
/right
toupward
/downward
/leftward
/rightward
to reduce conflicts -- in particular withControl.Arrow
. - Readded
leftmost
andrightmost
due to the verbosity offarthest leftward
/farthest rightward
. - Added
preview
/previews
/firstOf
and deprecatedheadOf
. - Added
iview
/iviews
/iuse
/iuses
toControl.Lens.IndexedGetter
. - We've generalized the type of Bazaar and provided generalized variants of
partsOf
, etc. that used it.
- Added support for
test-framework
0.8
- Added support for
test-framework
0.7
- Added more explicit dependencies to the doctest suite.
- Disabled the 'expected failure' quickcheck tests that occasionally would fail with internal QuickCheck errors.
- Added explicit dependency on containers and unordered-containers to the doctest suite
- Added
upon
(along with variants of it) toData.Data.Lens
, which can be used to generate aTraversal
from a field accessor or any function that returns, unmodified, a single field that would be visited bytemplate
. - Added some missing
examples/
files to the distribution. - Renamed
Data.Bits.Lens.traverseBits
tobits
. - Removed
(^!?)
, which was an alias for(^?!)
. - Removed the need for
Trustworthy
by changing the implementation ofcoerce
forBazaarT
. - Moved BazaarT to
Control.Lens.Internal
. - Added
(<&>)
toControl.Lens.Combinators
. element
andelementOf
are now indexed traversals rather than lenses and have moved toControl.Lens.IndexedTraversal
. This both fixes their former partiality and lets you use chain indexed combinators with them.- Added
elements
andelementsOf
as indexed traversals for ordinal indexing into regular traversals that generalizeelement
andelementOf
. - Renamed
Data.Complex.Lens.traverseComplex
tocomplex
. - Changed
Data.Complex.Lens.polarize
to aSimple Iso
, due to theRealFloat
constraint causing inference problems. - Renamed
traverseLeft
andtraverseRight
to_left
and_right
respectively. - Renamed
traverseSlice
,traverseFrom
, andtraverseTo
inData.Sequence.Lens
tosliced
,slicedFrom
, andslicedTo
respectively. - Renamed
traverseAt
to_at
inControl.Lens.IndexedTraversal
. - Renamed
traverseArray
to_array
inData.Array.Lens
. - Renamed and made the combinators in
Control.Lens.Zipper
more compositional to reduce third-party naming conflicts down to justleft
andright
. - Renamed
&=
and|=
to.&.=
and.|.=
for consistency, mutatis mutandis their related operations. - Added a
Plated
instances forLanguage.Haskell.TH
types. - Renamed
atIndex
andatIndices
inData.Vector.Lens
andData.Vector.Generic.Lens
toordinal
andordinals
to matchData.Sequence.Lens
- Improved SafeHaskell inference.
- Fixed a potential SafeHaskell issue where a user could use
undefined
to deriveunsafeCoerce
. You now have to import an explicitly Unsafe module and create an instance ofTrustworthy
for your type to cause this behavior, so if you do, it's on your head, not mine. :) - Renamed
EvilBazaar
toBazaarT
. - Moved a lot of internals around. Most notably,
Gettable
,Settable
andEffective
have moved toControl.Lens.Classes
. - Exposed
partsOf'
andunsafePartsOf'
inControl.Lens.Traversal
to reduce reliance onBazaarT
inControl.Lens.Zipper
- Renamed
(%)
to(&)
and(^%)
to(^&)
. This avoids the conflict withData.Ratio
, which was our highest priority conflict with a third party library. - Switched to a more liberal type for
ignored
- Removed some "
isplitting
" bad combinators fromControl.Lens.IndexedFold
. - Made
indexed
,taking
, anddropping
andelementOf
lazier and capable of dealing with infinite traversals and infinite folds. - Improved
Indexing
to support infinite traversals and folds. - Removed some of the more redundant combinators from
Control.Lens.Plated
, which already had existing aliases in the rest of the traversal API. - Moved
partsOf
,holesOf
, andelementOf
intoControl.Lens.Traversal
. - Renamed
query
toperuse
andqueries
toperuses
. These are much less contentious names, both containuse
in their name for analogy touse
anduses
and the word is about reading. - Simpler
simple
. - Added
enum
andnon
toControl.Lens.Iso
. - Added
(^?!)
toControl.Lens.Fold
for unsafe access to the head of aFold
. - Changed
_head
,_tail
,_init
and_last
to traversals inData.List.Lens
andData.Sequence.Lens
. - Eliminated
traverseHead
,traverseTail
,traverseInit
andtraverseLast
. partsOf
andunsafePartsOf
can now also be applied to aFold
yielding aGetter
or to aMonadicFold
yielding anAction
.
- Redefined
simple
and moved it toControl.Lens.Iso
. Instead of usingsimple l
you can now composel.simple
orsimple.l
providing more nuanced control and a more compositional API. - Moved the various
foo#
combinators used to emit cleaner core into an unexported module,Control.Lens.Unsafe
. This removesMagicHash
from the public API. - Removed the
bazaar#
andrunBazaar#
coercions that caused issues on GHC HEAD. - Changed the default definition of
plate
touniplate
fromignored
. - Added
Data.Vector.Lens
and instances forData.Vector
. - Added support for the
split
package, which is now part of the Haskell platform. - Removed redundant
Data.List.traverseList
. Useitraversed
ortraverse
instead. - Moved
(:<->)
toControl.Lens.Simple
. - Fixed a bug in
Control.Lens.TH
that was causingmakeIso
not to work. - Added
lifted
toControl.Lens.Setter
for mapping over monads. - Added
beside
toControl.Lens.Traversal
. - Removed the operators from
Data.List.Lens
, they broke the overall pattern of the rest of the API, and were terrible clutter. - Fixed a bug that caused
resultAt
to give wrong answers most of the time. - Changed
resultAt
to anIndexedLens
and moved it toControl.Lens.IndexedLens
- Changed
ignored
to anIndexedTraversal
and moved it toControl.Lens.IndexedTraversal
- We've relinquished the name
value
.
- Made
elementOf
lazier and moved it fromControl.Lens.Traversal
toControl.Lens.Plated
. - Made
holesOf
andpartsOf
lazier to deal with infinite structures. - Resolved issue #75. We now generate nicer core for most
Setter
andFold
operations, and some others. - Made lenses for field access like
_1
,_2
, etc. lazier. - Added
Control.Lens.Loupe
, which provides a limited form ofLens
that can be read from and written to and which can compose with other lenses, but can also be returned in a list or as a monadic result, but cannot be used directly for most combinators without cloning it first. It is easier to compose than aReifiedLens
, but slightly slower. - Moved (
:=>
) and (:->
) intoControl.Lens.Simple
, which is not exported byControl.Lens
by default to reduce name conflicts with third party libraries.
- Simplified the type of
filtered
, so that it can be composed with other folds rather than be parameterized on one. Included the caveat that the newfiltered
is still not a legalTraversal
, despite seeming to compose like one. - Renamed
ifiltered
toifiltering
, and while it still must take an indexed lens-like as an argument, I included a similar caveat about the result not being a legalIndexedLens
when given anIndexedLens
. The function was renamed because its signature no longer lined up with the newfiltered
and the gerundive '-ing' suffix has come to indicate an operator that transformers another lens/traversal/etc. into a new one. - Added
taking
anddropping
toControl.Lens.Traversal
.
- Alpha-renamed all combinators to a new scheme. Instead of
Foo a b c d
, they now followFoo s t a b
. This means that you don't need to alpha rename everything in your head to work through the examples, simplifies exposition, and uses s and t for common state monad parameters. Thanks go to Shachaf Ben-Kiki for the grunt work of slogging through hundreds of definitions by hand and with regular expressions! - Restored lenses to
Trustworthy
status so they can be used with Safe Haskell once more.
- Fixed a bug in
rights1
andlefts1
inControl.Lens.Zipper
which would cause them to loop forever when given a 0 offset.
- Added
?~
,<?~
,?=
and<?=
toControl.Lens.Setter
for setting the target(s) of a Lens toJust
a value. They are particularly useful when combined withat
.
- Refined the behavior of
substType
inControl.Lens.TH
to match the behavior oftypeVarsEx
when moving under binders.
- Added
generateSignatures
option toControl.Lens.TH
to allow the end user to disable the generation of type signatures for the template-haskell generated lenses. This lets the user supply hand-written haddocks and more restricted signatures.
- Added
Control.Lens.Type.simple
.
- Added
Control.Lens.Zipper
. - Added
<<~
, a version of<~
that supports chaining assignment. - Added
:->
,:=>
, and:<->
as type operator aliases forSimple Lens
,Simple Traversal
, andSimple Iso
respectively.
- Added
<<%~
,<<.~
,<<%=
and<<.=
for accessing the old values targeted by aLens
(or a summary of those targeted by aTraversal
) - Renamed
|>
to%
, as%~
is the lensed version of%
, and moved it toControl.Lens.Getter
along with a version^%
with tighter precedence that can be interleaved with^.
- Upgraded to
doctest
0.9, which lets us factor out common$setup
for our doctests - Renamed
merged
tochoosing
. Added a simplerchosen
operation to mirrorboth
. - Added
Control.Lens.Projection
- Renamed
traverseException
toexception
andtraverseDynamic
todynamic
, upgrading them to useProjection
. makeClassy
now places each generatedLens
orTraversal
inside the class it constructs when possible. This makes it possible for users to just exportHasFoo(..)
, rather than have to enumerate each lens in the export list. It can only do that if it creates the class. If thecreateClass
flag is disabled, then it will default to the old behavior.- Added
performs
toControl.Lens.Action
to mirrorviews
inControl.Lens.Getter
.
- Restored compatibility with GHC 7.2. This required a major version bump due to making some MPTC-based default signatures conditional.
- Added the missing
Control.Lens.Combinators
to exported-modules! Its absence was causing it not to be included on hackage.
- Generalized the signature of
Getting
,Acting
andIndexedGetting
to help out with the common user code scenario of needing to read and then write to change types. - Documentation cleanup and additional examples.
- Renamed
au
toala
, introducing further incompatibility with thenewtype
package, but reducing confusion. - Removed need for
Data.Map.Lens
andData.IntMap.Lens
by addingTraverseMin
andTraverseMax
toControl.Lens.IndexedTraversal
. - Flipped fixity of
~:
and<~:
- Added
++~
,++=
,<++~
and<++=
to Data.List.Lens in response to popular demand. - Added
|>
,<$!>
and<$!
toControl.Lens.Combinators
, which exports combinators that are often useful in lens-based code, but that don't strictly involve lenses. - Added an HUnit-based test suite by @orenbenkiki
- Fixed bugs in
Traversal
code-generation.
- Added build option
-f-inlining
to facilitate building with the various TH 2.8 versions used by GHC 7.6 and HEAD. - Added build option
-f-template-haskell
for testing without template haskell. (Users should be able to assume TH is enabled; use this only for testing!) - Added support for generating a
Traversal
rather than aLens
when multiple fields map to the same name or some constructors are missing a field. - Removed
_
from the lens names inSystem.FilePath.Lens
. - Added
iwhere
,withIndices
,withIndicesOf
,indices
andindicesOf
to ease work with indexed traversals - Added
assign
as an alias for(.=)
inControl.Lens.Setter
. - Added
~:
,=:
,<~:
and<=:
toData.List.Lens
- Added
Control.Lens.Plated
, a port of Neil Mitchell'suniplate
that can be used on anyTraversal
. - Added
Data.Data.Lens
with smart traversals that know how to avoid traversing parts of a structure that can't contain a given type. - Added
Data.Typeable.Lens
with_cast
and_gcast
liketraverseData
- Renamed
IndexedStore
toContext
now that it is used in user-visible locations, and since I also use it asuniplate
's notion of a context. - Renamed
Kleene
toBazaar
-- "a bazaar contains a bunch of stores." - Added
Comonad
instances forContext
andBazaar
, so we can use stores directly as the notion of an editable context in uniplate - Compatibility with both sets of template haskell quirks for GHC 7.6.1-rc1 and the GHC 7.6.1 development head.
- Renamed
children
tobranches
inData.Tree.Lens
. - Added
At
andContains
toControl.Lens.IndexedLens
. - Added
FunctorWithIndex
,FoldableWithIndex
, andTraversableWithIndex
underControl.Lens.WithIndex
- Added support for
unordered-containers
.
- GHC 7.6.1 development HEAD compatibility (but broke 7.6.1-rc1)
- Haddock cleanup
- Added the indexed
Kleene
store toControl.Lens.Internal
- Moved
Gettable
,Accessor
,Settable
andMutator
toControl.Lens.Internal
- Added
cloneTraversal
toControl.Lens.Traversal
- Renamed
clone
tocloneLens
inControl.Lens.Type
- Generalized the type of
zoom
to subsumefocus
. - Removed
Focus(..)
fromControl.Lens.Type
. - Factored out
Control.Lens.Isomorphic
. - Moved many private types to
Control.Lens.Internal
- Added
conFields
toLanguage.Haskell.TH.Lens
. - Added
System.FilePath.Lens
.
- Added missing
{-# INLINE #-}
pragmas - Renamed
meanwhile
tothroughout
inControl.Parallel.Strategies.Lens
- Added
Magnify
toControl.Lens.Getter
. - Added
Zoom
toControl.Lens.Type
.
- Added
<&=
,<&~
,<|=
, and<|~
- Moved
<>~
,<<>~
,<>=
, and<<>=
toData.Monoid.Lens
- Template Haskell now uses eager binding to avoid adding dependencies.
- Renamed
adjust
toover
- Added
au
,auf
andunder
- Added
Data.Monoid.Lens
- Increased lower dependency bound on
mtl
for cleaner installation.