Index | index by Group | index by Distribution | index by Vendor | index by creation date | index by Name | Mirrors | Help | Search |
Name: ghc-lens | Distribution: openSUSE:Factory:zSystems |
Version: 5.3.3 | Vendor: openSUSE |
Release: 1.2 | Build date: Sat Dec 28 17:38:55 2024 |
Group: Unspecified | Build host: reproducible |
Size: 10332780 | Source RPM: ghc-lens-5.3.3-1.2.src.rpm |
Packager: https://bugs.opensuse.org | |
Url: https://hackage.haskell.org/package/lens | |
Summary: Lenses, Folds and Traversals |
This package comes "Batteries Included" with many useful lenses for the types commonly used from the Haskell Platform, and with tools for automatically generating lenses and isomorphisms for user-supplied data types. The combinators in 'Control.Lens' provide a highly generic toolbox for composing families of getters, folds, isomorphisms, traversals, setters and lenses and their indexed variants. An overview, with a large number of examples can be found in the <https://github.com/ekmett/lens#lens-lenses-folds-and-traversals README>. An introductory video on the style of code used in this library by Simon Peyton Jones is available from <https://archive.org/details/lenses-compositional-data-access-and-manipulation-simon-peyton-jones-at-haskell- Internet Archive>. A video on how to use lenses and how they are constructed is available on <http://youtu.be/cefnmjtAolY?hd=1 youtube>. Slides for that second talk can be obtained from <http://comonad.com/haskell/Lenses-Folds-and-Traversals-NYC.pdf comonad.com>. More information on the care and feeding of lenses, including a brief tutorial and motivation for their types can be found on the <https://github.com/ekmett/lens/wiki lens wiki>. A small game of 'pong' and other more complex examples that manage their state using lenses can be found in the <https://github.com/ekmett/lens/blob/master/examples/ example folder>. /Lenses, Folds and Traversals/ With some signatures simplified, the core of the hierarchy of lens-like constructions looks like: <<http://i.imgur.com/ALlbPRa.png>> <https://raw.githubusercontent.com/ekmett/lens/master/images/Hierarchy.png (Local Copy)> You can compose any two elements of the hierarchy above using '(.)' from the 'Prelude', and you can use any element of the hierarchy as any type it linked to above it. The result is their lowest upper bound in the hierarchy (or an error if that bound doesn't exist). For instance: * You can use any 'Traversal' as a 'Fold' or as a 'Setter'. * The composition of a 'Traversal' and a 'Getter' yields a 'Fold'. /Minimizing Dependencies/ If you want to provide lenses and traversals for your own types in your own libraries, then you can do so without incurring a dependency on this (or any other) lens package at all. /e.g./ for a data type: > data Foo a = Foo Int Int a You can define lenses such as > -- bar :: Lens' (Foo a) Int > bar :: Functor f => (Int -> f Int) -> Foo a -> f (Foo a) > bar f (Foo a b c) = fmap (a' -> Foo a' b c) (f a) > -- quux :: Lens (Foo a) (Foo b) a b > quux :: Functor f => (a -> f b) -> Foo a -> f (Foo b) > quux f (Foo a b c) = fmap (Foo a b) (f c) without the need to use any type that isn't already defined in the 'Prelude'. And you can define a traversal of multiple fields with 'Control.Applicative.Applicative': > -- traverseBarAndBaz :: Traversal' (Foo a) Int > traverseBarAndBaz :: Applicative f => (Int -> f Int) -> Foo a -> f (Foo a) > traverseBarAndBaz f (Foo a b c) = Foo <$> f a <*> f b <*> pure c What is provided in this library is a number of stock lenses and traversals for common haskell types, a wide array of combinators for working them, and more exotic functionality, (/e.g./ getters, setters, indexed folds, isomorphisms).
BSD-2-Clause
* Sat Dec 28 2024 Peter Simons <[email protected]> - Update lens to version 5.3.3. 5.3.3 [2024.12.28] - ----------------- * Add `makeFieldsId`, which generates overloaded field accessors using the same names as the underlying fields. This is intended for use with the `NoFieldSelectors` and `DuplicateRecordFields` language extensions. Also add `classIdFields :: LensRules` and `classIdNamer :: FieldNamer`, both of which use the same naming rules as `makeFieldsId`. * Update the `Prism`s in `Language.Haskell.TH.Lens` to reflect additions to `template-haskell-2.23.0.0`: * Add an `_OrP` `Prism` for the `Pat` data type. * Add `_ForallE`, `_ForallVisE`, and `_ConstrainedE` `Prism`s for the `Exp` data type. * Fri Jul 05 2024 Peter Simons <[email protected]> - Update lens to version 5.3.2 revision 2. 5.3.2 [2024.05.12] - ----------------- * Define the following lenses that perform an operation and result the old result: * `(<<<>:~)` (prepend to the front via `(<>)` and return the old result) * `(<<<|~)` (prepend to the front via `(<|)` and return the old result) * `(<<|>~)` (append to the back via `(|>)` and return the old result) Each of these also has a variant that end with `=` instead of `~` (e.g., `(<<<>:=)`) for working in a `MonadState` setting. * Re-export `(<>:~)`, `(<<>:~)`, `(<|~)`, `(<<|~)`, `(|>~)`, and `(<|>~)` (as well as their variants which end with `=` instead of `~`, and their variants which return the old result) from `Control.Lens.Operators`. 5.3.1 [2024.05.05] - ----------------- * Add a `Magnify` instance for the CPS variant of `RWST` when building with `mtl-2.3` or later. 5.3 [2024.05.04] - --------------- * Allow building with GHC 9.10. * Update the `Prism`s in `Language.Haskell.TH.Lens` to reflect additions to `template-haskell-2.22.0.0`: * The `_InfixD` `Prism` now focuses on `(Fixity, NamespaceSpecifier, Name)` when building with `template-haskell-2.22.0.0` or later. * Add `Prism`s for the newly introduced `NamespaceSpecifier` data type. * Add `_TypeP` and `_InvisP` `Prism`s for the `Pat` data type. * Add a `_TypeE` `Prism` for the `Exp` data type. * Add a `_SCCP` `Prism` for the `Pragma` data type. * Add the following `Setter`s for prepending and appending elements: * `(<>:~)`: prepend an element to the front via `(<>)`. * `(<<>:~)`: prepend an element to the front via `(<>)` and return the result. * `(<|~)`: cons an element to the front via `(<|)`. * `(<<|~)`: cons an element to the front via `(<|)` and return the result. * `(|>~)`: snoc an element to the back via `(|>)`. * `(<|>~)`: snoc an element to the back via `(|>)` and return the result. Each of these also has a variant that end with `=` instead of `~` (e.g., `(<>:=)`) for working in a `MonadState` setting. * Tue Apr 30 2024 Peter Simons <[email protected]> - Update lens to version 5.2.3 revision 5. Upstream has revised the Cabal build instructions on Hackage. * Fri Apr 05 2024 Peter Simons <[email protected]> - Update lens to version 5.2.3 revision 4. Upstream has revised the Cabal build instructions on Hackage. * Sun Mar 17 2024 Peter Simons <[email protected]> - Update lens to version 5.2.3 revision 3. Upstream has revised the Cabal build instructions on Hackage. * Sat Sep 30 2023 Peter Simons <[email protected]> - Update lens to version 5.2.3 revision 2. Upstream has revised the Cabal build instructions on Hackage. * Sun Aug 27 2023 Peter Simons <[email protected]> - Update lens to version 5.2.3 revision 1. 5.2.3 [2023.08.24] - ----------------- * Allow building with GHC 9.8. * Add new `Prism`s to `Language.Haskell.TH.Lens` to reflect recent additions to `template-haskell`: * `_GetFieldE` and `_ProjectionE` `Prism`s for the `Exp` data type, whose corresponding data constructors were introduced in `template-haskell-2.18.*`. * `_TypedBracketE` and `_TypedSpliceE` `Prism`s for the `Exp` data type, whose corresponding data constructors were introduced in `template-haskell-2.21.*`. * `_BndrReq` and `_BndrInvis` `Prism`s for the `BndrVis` data type, which was added in `template-haskell-2.21.*`. * Add a `generateRecordSyntax` option to `Control.Lens.TH`, which controls whether to generate lenses using record update syntax or not. By default, this option is disabled. * Fix a bug in which the `declare*` Template Haskell functions would fail if a data type's field has a type that is defined in the same Template Haskell quotation. * Add `altOf`, which collects targets into any `Alternative`. * Mon Jul 10 2023 Peter Simons <[email protected]> - Update lens to version 5.2.2 revision 1. Upstream has revised the Cabal build instructions on Hackage. * Thu Mar 30 2023 Peter Simons <[email protected]> - Updated spec file to conform with ghc-rpm-macros-2.5.2. * Sat Mar 18 2023 Peter Simons <[email protected]> - Update lens to version 5.2.2. 5.2.2 [2023.03.18] - ----------------- * Fix a bug in which calling `ix i` (where `i` is a negative number) on `Text` or `ByteString` would return the `Just` the first character instead of returning `Nothing`. * Wed Mar 15 2023 Peter Simons <[email protected]> - Update lens to version 5.2.1 revision 3. Upstream has revised the Cabal build instructions on Hackage. * Sun Mar 12 2023 Peter Simons <[email protected]> - Update lens to version 5.2.1 revision 2. Upstream has revised the Cabal build instructions on Hackage. * Tue Feb 28 2023 Peter Simons <[email protected]> - Update lens to version 5.2.1. 5.2.1 [2023.02.27] - ----------------- * Allow building with GHC 9.6. * Allow building with GHC backends where `HTYPE_SIG_ATOMIC_T` is not defined, such as the WASM backend. * Support building with `th-abstraction-0.5.*`. * Define `_TypeDataD` in `Language.Haskell.TH.Lens` when building with `template-haskell-2.20.0.0` (GHC 9.6) or later. * Thu Aug 11 2022 Peter Simons <[email protected]> - Update lens to version 5.2. 5.2 [2022.08.11] - --------------- * Allow building with GHC 9.4. * The type of `universeOf` has changed: ```diff - universeOf :: Getting [a] a a -> a -> [a] +universeOf :: Getting (Endo [a]) a a -> a -> [a] ``` In many cases, using `Endo [a]` over `[a]` improves performance. Most call sites to `universeOf` will not be affected by this change, although you may need to update your code if you define your own combinators in terms of `universeOf`. * Allow `makeWrapped` to accept the names of data constructors. This way, `makeWrapped` can be used with data family instances, much like other functions in `Control.Lens.TH`. * Define `_OpaqueP`, `_DefaultD`, `_LamCasesE`, `_PromotedInfixT`, and `_PromotedUInfixT` in `Language.Haskell.TH.Lens` when building with `template-haskell-2.19.0.0` (GHC 9.4) or later. * Tue Jun 21 2022 Peter Simons <[email protected]> - Update lens to version 5.1.1 revision 1. Upstream has revised the Cabal build instructions on Hackage. * Tue May 17 2022 Peter Simons <[email protected]> - Update lens to version 5.1.1. 5.1.1 [2022.05.17] - ----------------- * Add `Data.HashSet.Lens.hashMap`, an `Iso` between a `HashSet a` and a `HashMap a ()`. * Allow building with `transformers-0.6.*` and `mtl-2.3.*`. Note that `lens` no longer defines `Zoom` instances for `ErrorT` or `ListT` when building with `mtl-2.3` or later. This is because `MonadState` is a superclass of `Zoom`, and the `MonadState` instances for `ErrorT` and `ListT` were removed in `mtl-2.3`. Be watchful of this if you build `lens` with `mtl-2.3` (or later) combined with an older version of `transformers` (pre-`0.6`) that defines `ErrorT` or `ListT`.
/usr/lib64/ghc-9.10.1/lib/libHSlens-5.3.3-LNI0cjIg6YZAUtOskQakOK-ghc9.10.1.so /usr/share/licenses/ghc-lens /usr/share/licenses/ghc-lens/LICENSE
Generated by rpm2html 1.8.1
Fabrice Bellet, Wed Jan 29 02:28:24 2025