Changelog for lens-3.8.0.2

3.8.0.2

Fixed an issue with running the doctests test suite when an older version of semigroups is installed.

3.8

Overall:

Replaced each of the different SimpleFoo type aliases with Foo' throughout. The various Simple aliases can still be found in Control.Lens.Simple but are now deprecated.

Made sweeping changes to Iso and Prism and Indexed lenses internally. They are now based on profunctors. This affects how you use indexed in the resulting code and dramatically changed the meaning of Overloaded.

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.

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, and System.IO.Error.Lens.

Control.Lens.At

Moved At(at) and Contains(contains) and factored out Ixed(ix).

Deprecated _at and resultAt.

Removed various ordinal and ix combinators, which are subsumed by Ixed(ix).

Control.Lens.Cons

Consoldiated the various _head, _tail, _init and _last traversals that were scattered around the place into a pair of Cons and Snoc classes that provide _Cons and _Snoc prisms respectively, and combinators that build on top.

Control.Lens.Each

Generalized the signature of Each to permit it to provide an IndexedSetter for ((->) e).

Each now uses an Index type family that is shared with At, Ixed and Contains to indicate these operations are related.

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 forces a ~ b, s ~ t in the argument to view.

Control.Lens.Fold

Added foldr1Of' and foldl1Of'.

Added has and hasn't.

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 and indices, and removed iwhere and iwhereOf. Use itraversed.indices even and bar.indices (>3) instead.

Control.Lens.Internal

This module was exploded into more manageable component modules.

Control.Lens.Iso

Strict(strict) is now a Simple Iso.

Added magma and imagma which can be used to provide a 'debugging view' of a Traversal.

Control.Lens.Lens

Restructuring split this module out from Control.Lens.Type and merged the contents Control.Lens.IndexedLens.

Control.Lens.Level

This module was created to provide the breadth-first-search Traversals levels and ilevels 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.

Control.Lens.Loupe

In the interest of consistency, the Loupe alias has been deprecated in favor of ALens.

Loupe (and ALens) are now defined in terms of Pretext rather than Context. This permits them to be cloned at a reduced cost reducing the call for ReifiedLens.

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 and import Control.Lens.Operators unqualified.

Control.Lens.Prism

Added prism' to construct SimplePrisms.

Control.Lens.Reified

Consolidated the various ReifiedFoo definitions into one module.

Control.Lens.Representable

This module was removed. Its functionality may be split out into a separate package, but currently the linear package exports is own Linear.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.

Control.Lens.Review

This module now factors the review functionality out of Prism and exposes unto, which is to review what to is to view.

Control.Lens.Setter

Added contramapped and argument for mapping over inputs.

Control.Lens.Simple

Removed the infix lens aliases and repurposed the module to house the now deprecated SimpleFoo type aliases, which were replaced universally with Foo'.

Control.Lens.TH

makeLenses now generates Lens' and Traversal' where appropriate

Added makePrisms as a generalized makeIso that automatically generates a Prism 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 a Wrapped 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' and unwrapped' for scenarios where you need the help with type inference.

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 keys moveTo can operate in logarithmic time, but required changing the Zipper type to add the index type.

Data.Bits.Lens

Added byteAt.

Data.ByteString.Lens

Data.ByteString.Lazy.Lens now uses Int64-based indexing.

The Traversal for strict ByteStrings 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 safe fromInteger/toInteger.

3.7.3 [maintenance release]

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

3.7.2 [maintenance release]

Bug fix for Magnify. It was missing functional dependencies to determine its k parameter from m or n.

3.7.1.2 [maintenance release]

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.

3.6.0.1 [maintenance release]

Added upon (along with variants of it) to Data.Data.Lens, which can be used to generate a Traversal from a field accessor or any function that returns, unmodified,
a single field that would be visited by template.

Added some missing examples/ files to the distribution.

Renamed Data.Bits.Lens.traverseBits to bits.

Removed (^!?), which was an alias for (^?!).

Removed the need for Trustworthy by changing the implementation of coerce for BazaarT.

Moved BazaarT to Control.Lens.Internal.

Added (<&>) to Control.Lens.Combinators.

element and elementOf are now indexed traversals rather than lenses and have moved to Control.Lens.IndexedTraversal. This both fixes their former partiality and lets you use chain indexed combinators with them.

Added elements and elementsOf as indexed traversals for ordinal indexing into regular traversals that generalize element and elementOf.

Renamed Data.Complex.Lens.traverseComplex to complex.

Changed Data.Complex.Lens.polarize to a Simple Iso, due to the RealFloat constraint causing inference problems.

Renamed traverseLeft and traverseRight to _left and _right respectively.

Renamed traverseSlice, traverseFrom, and traverseTo in Data.Sequence.Lens to sliced, slicedFrom, and slicedTo respectively.

Renamed traverseAt to _at in Control.Lens.IndexedTraversal.

Renamed traverseArray to _array in Data.Array.Lens.

Renamed and made the combinators in Control.Lens.Zipper more compositional to reduce third-party naming conflicts down to just left and right.

Renamed &= and |= to .&.= and .|.= for consistency, mutatis mutandis their related operations.

Added a Plated instances for Language.Haskell.TH types.

Renamed atIndex and atIndices in Data.Vector.Lens and Data.Vector.Generic.Lens to ordinal and ordinals to match Data.Sequence.Lens

3.5.1

Fixed a potential SafeHaskell issue where a user could use undefined to derive unsafeCoerce. You now have to import an explicitly
Unsafe module and create an instance of Trustworthy for your type to cause this behavior, so if you do, it's on your head, not mine. :)

Renamed EvilBazaar to BazaarT.

Moved a lot of internals around. Most notably, Gettable, Settable and Effective have moved to Control.Lens.Classes.

Exposed partsOf' and unsafePartsOf' in Control.Lens.Traversal to reduce reliance on BazaarT in Control.Lens.Zipper

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 an IndexedLens and moved it to Control.Lens.IndexedLens

Changed ignored to an IndexedTraversal and moved it to Control.Lens.IndexedTraversal

We've relinquished the name value.

3.2

Made elementOf lazier and moved it from Control.Lens.Traversal to Control.Lens.Plated.

Made holesOf and partsOf lazier to deal with infinite structures.

Resolved issue #75. We now generate nicer core for most Setter and Fold operations, and some others.

Made lenses for field access like _1, _2, etc. lazier.

Added Control.Lens.Loupe, which provides a limited form of Lens 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 a ReifiedLens, but slightly slower.

Moved (:=>) and (:->) into Control.Lens.Simple, which is not exported by Control.Lens by default to reduce name conflicts with third party libraries.

3.1

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 new filtered is still not a legal Traversal, despite seeming to compose like one.

Renamed ifiltered to ifiltering, and while it still must take an indexed lens-like as an argument, I included a similar caveat about the result not being a legal IndexedLens when given an IndexedLens. The function was renamed because its signature no longer lined up with the new filtered and the gerundive '-ing' suffix has come to indicate an operator that transformers another lens/traversal/etc. into a new one.

Added taking and dropping to Control.Lens.Traversal.

3.0.6

Alpha-renamed all combinators to a new scheme. Instead of Foo a b c d, they now follow Foo 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.

3.0.5

Fixed a bug in rights1 and lefts1 in Control.Lens.Zipper which would cause them to loop forever when given a 0 offset.

3.0.4

Added ?~, <?~, ?= and <?= to Control.Lens.Setter for setting the target(s) of a Lens to Just a value. They are particularly useful when combined with at.

3.0.3

Refined the behavior of substType in Control.Lens.TH to match the behavior of typeVarsEx when moving under binders.

3.0.2

Added generateSignatures option to Control.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.

Renamed traverseException to exception and traverseDynamic to dynamic, upgrading them to use Projection.

makeClassy now places each generated Lens or Traversal inside the class it constructs when possible.
This makes it possible for users to just export HasFoo(..), rather than have to enumerate each lens in
the export list. It can only do that if it creates the class. If the createClass flag is disabled, then
it will default to the old behavior.

Added performs to Control.Lens.Action to mirror views in Control.Lens.Getter.