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

[ bsd3, lenses-----, library ] [ Propose Tags ]

This module, Lens.Simple, just re-exports the main modules from Russell O'Connor's lens-family 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. The idea is just to make a sort of low-powered, minimal-dependency lens-family equivalent of

import Control.Lens

namely:

import Lens.Simple

Check it out, it's even one character shorter!

As an illustration of the power of even these elementary combinators, note that the pong example from the lens library requires only this abbreviating change of imports. If you care to make that program more complicated, you might at some point need the unfathomably more sophisticated material in Control.Lens. Because lens-family accords as far as possible, with Control.Lens, within its more limited sphere, a change of imports will often be all that is necessary to begin using them.

It is rarely necessary to exceed the materials exported here when using the lenses and quasi-lenses exported by e.g. pipes-bytestring or pipes-group. It is simplify the use of such that this module was originally intended.

Note that 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 lose the concomitant opaque error messages about Field1 s t a b etc.


[Skip to Readme]

Modules

[Index]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0, 0.1.0.1, 0.1.0.2, 0.1.0.3, 0.1.0.4, 0.1.0.5, 0.1.0.6, 0.1.0.7, 0.1.0.8, 0.1.0.9
Dependencies base (>=4 && <5), lens-family (>=1.2 && <1.3), lens-family-core (>=1.2 && <1.3), lens-family-th (>=0.4 && <0.5) [details]
License BSD-3-Clause
Copyright Copyright (C) 2012,2013,2014 Russell O'Connor, 2014 michaelt
Author michaelt
Maintainer what_is_it_to_do_anything@yahoo.com
Category Lenses
Home page https://github.com/michaelt/lens-simple
Source repo head: git clone https://github.com/michaelt/lens-simple
Uploaded by MichaelThompson at 2015-06-09T01:19:03Z
Distributions
Reverse Dependencies 8 direct, 44 indirect [details]
Downloads 8577 total (26 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for lens-simple-0.1.0.3

[back to package description]

lens-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.