lens-family-simple: simplified import of lens-family

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain] [Publish]

Warnings:

This module, Lens.Simple, just re-exports the main modules from Russell O'Connor's lens-family-core package, the original van Laarhoven lens library. Lens.Simple also re-exports makeLenses and other TH incantations from Dan Burton's associated lens-family-th. All other dependencies are ghc boot libraries.

The idea is just to make a lens-family equivalent of import Control.Lens -- namely, import Lens.Simple.

As an illustration, note that the exemplary pong module from the lens repository compiles with only this change of imports. When one day the need arises for the unfathomably more sophisticated material in Control.Lens, the opposite change of imports will tend be all that is necessary to begin using them.

There are caveats, of course. The zoom exported here does not use MonadState from mtl but is specialized to Control.Monad.Trans.State.Strict Many of the other lenses and combinators are a bit more specialized than their Control.Lens equivalents: for example, _1 and _2 are here familiarly specialized to act just on real Haskell pairs; with the loss of abstraction we also of course abbreviate the error messages.


[Skip to Readme]

Properties

Versions 0.1.0.0
Change log None available
Dependencies base (>=4 && <5), lens-family-core (>=1.2 && <1.3), lens-family-th (>=0.4 && <0.5) [details]
License BSD-3-Clause
Author Michael Thompson
Maintainer what_is_it_to_do_anything@yahoo.com
Category Lenses
Home page https://github.com/michaelt/lens-family-simple
Uploaded by MichaelThompson at 2015-05-06T04:03:14Z

Modules

[Index]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


Readme for lens-family-simple-0.1.0.0

[back to package description]

lens-family-simple

This just re-exports the combinators and elementary lenses and traversals from the original 'van Laarhoven' lens library, Russell O'Connor's lens-family package, including Lens.Family.State.Strict, and the corresponding TH module from Dan Burton's lens-family-th so you can makeLenses and makeTraversals automatically.

lens-family has a inexplicably complex structure and distinctly unpleasant module names. This omnibus module is mostly just intended to simplify imports for use with pipes and associated pipes libraries. The special quasi-lenses that pervade these libraries frequently require, at a minimum, that some version of view/(^.), overand zoom should be in scope.

The only non-ghc-boot library lens-family and lens-family-th require is mtl.

The naming in lens-family is more or less uniform with the more powerful and elaborate lens library, so it can be dropped in favor of lens should the more advanced combinators become become necessary. The pong example from the lens/examples in the repository of the lens library is included here as an illustration of the strength of lens-families + lens-families-th and their coherence with the nomenclature of the Control.Lens. Nothing was needed but the change of imports.