/usr/share/doc/libghc-data-lens-doc/html/Data-Lens-Common.html is in libghc-data-lens-doc 2.10.4-1build3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Data.Lens.Common</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_Data-Lens-Common.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Data-Lens-Common.html">Source</a></li><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">data-lens-2.10.4: Haskell 98 Lenses</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Safe Haskell</th><td>Safe-Inferred</td></tr></table><p class="caption">Data.Lens.Common</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Lens construction
</a></li><li><a href="#g:2">Functional API
</a></li><li><a href="#g:3">Operator API
</a></li><li><a href="#g:4">Pseudo-imperatives
</a></li><li><a href="#g:5">Stock lenses
</a></li></ul></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><span class="keyword">newtype</span> <a href="#t:Lens">Lens</a> a b = <a href="#v:Lens">Lens</a> {<ul class="subs"><li><a href="#v:runLens">runLens</a> :: a -> <a href="/usr/share/doc/libghc-comonad-doc/html/Control-Comonad-Trans-Store.html#t:Store">Store</a> b a</li></ul>}</li><li class="src short"><a href="#v:lens">lens</a> :: (a -> b) -> (b -> a -> a) -> <a href="Data-Lens-Common.html#t:Lens">Lens</a> a b</li><li class="src short"><a href="#v:iso">iso</a> :: (a -> b) -> (b -> a) -> <a href="Data-Lens-Common.html#t:Lens">Lens</a> a b</li><li class="src short"><a href="#v:getL">getL</a> :: <a href="Data-Lens-Common.html#t:Lens">Lens</a> a b -> a -> b</li><li class="src short"><a href="#v:setL">setL</a> :: <a href="Data-Lens-Common.html#t:Lens">Lens</a> a b -> b -> a -> a</li><li class="src short"><a href="#v:modL">modL</a> :: <a href="Data-Lens-Common.html#t:Lens">Lens</a> a b -> (b -> b) -> a -> a</li><li class="src short"><a href="#v:mergeL">mergeL</a> :: <a href="Data-Lens-Common.html#t:Lens">Lens</a> a c -> <a href="Data-Lens-Common.html#t:Lens">Lens</a> b c -> <a href="Data-Lens-Common.html#t:Lens">Lens</a> (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Either.html#t:Either">Either</a> a b) c</li><li class="src short"><a href="#v:-94--36-">(^$)</a> :: <a href="Data-Lens-Common.html#t:Lens">Lens</a> a b -> a -> b</li><li class="src short"><a href="#v:-94--36--33-">(^$!)</a> :: <a href="Data-Lens-Common.html#t:Lens">Lens</a> a b -> a -> b</li><li class="src short"><a href="#v:-94-.">(^.)</a> :: a -> <a href="Data-Lens-Common.html#t:Lens">Lens</a> a b -> b</li><li class="src short"><a href="#v:-94--33-">(^!)</a> :: a -> <a href="Data-Lens-Common.html#t:Lens">Lens</a> a b -> b</li><li class="src short"><a href="#v:-94--61-">(^=)</a> :: <a href="Data-Lens-Common.html#t:Lens">Lens</a> a b -> b -> a -> a</li><li class="src short"><a href="#v:-94--33--61-">(^!=)</a> :: <a href="Data-Lens-Common.html#t:Lens">Lens</a> a b -> b -> a -> a</li><li class="src short"><a href="#v:-94--37--61-">(^%=)</a> :: <a href="Data-Lens-Common.html#t:Lens">Lens</a> a b -> (b -> b) -> a -> a</li><li class="src short"><a href="#v:-94--33--37--61-">(^!%=)</a> :: <a href="Data-Lens-Common.html#t:Lens">Lens</a> a b -> (b -> b) -> a -> a</li><li class="src short"><a href="#v:-94--37--37--61-">(^%%=)</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:Functor">Functor</a> f => <a href="Data-Lens-Common.html#t:Lens">Lens</a> a b -> (b -> f b) -> a -> f a</li><li class="src short"><a href="#v:-94--43--61-">(^+=)</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Num">Num</a> b => <a href="Data-Lens-Common.html#t:Lens">Lens</a> a b -> b -> a -> a</li><li class="src short"><a href="#v:-94--33--43--61-">(^!+=)</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Num">Num</a> b => <a href="Data-Lens-Common.html#t:Lens">Lens</a> a b -> b -> a -> a</li><li class="src short"><a href="#v:-94--45--61-">(^-=)</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Num">Num</a> b => <a href="Data-Lens-Common.html#t:Lens">Lens</a> a b -> b -> a -> a</li><li class="src short"><a href="#v:-94--33--45--61-">(^!-=)</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Num">Num</a> b => <a href="Data-Lens-Common.html#t:Lens">Lens</a> a b -> b -> a -> a</li><li class="src short"><a href="#v:-94--42--61-">(^*=)</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Num">Num</a> b => <a href="Data-Lens-Common.html#t:Lens">Lens</a> a b -> b -> a -> a</li><li class="src short"><a href="#v:-94--33--42--61-">(^!*=)</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Num">Num</a> b => <a href="Data-Lens-Common.html#t:Lens">Lens</a> a b -> b -> a -> a</li><li class="src short"><a href="#v:-94--47--61-">(^/=)</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Fractional">Fractional</a> b => <a href="Data-Lens-Common.html#t:Lens">Lens</a> a b -> b -> a -> a</li><li class="src short"><a href="#v:-94--33--47--61-">(^!/=)</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Fractional">Fractional</a> b => <a href="Data-Lens-Common.html#t:Lens">Lens</a> a b -> b -> a -> a</li><li class="src short"><a href="#v:fstLens">fstLens</a> :: <a href="Data-Lens-Common.html#t:Lens">Lens</a> (a, b) a</li><li class="src short"><a href="#v:sndLens">sndLens</a> :: <a href="Data-Lens-Common.html#t:Lens">Lens</a> (a, b) b</li><li class="src short"><a href="#v:mapLens">mapLens</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Ord.html#t:Ord">Ord</a> k => k -> <a href="Data-Lens-Common.html#t:Lens">Lens</a> (<a href="/usr/share/doc/ghc-doc/html/libraries/containers-0.5.0.0/Data-Map-Lazy.html#t:Map">Map</a> k v) (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> v)</li><li class="src short"><a href="#v:intMapLens">intMapLens</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Int.html#t:Int">Int</a> -> <a href="Data-Lens-Common.html#t:Lens">Lens</a> (<a href="/usr/share/doc/ghc-doc/html/libraries/containers-0.5.0.0/Data-IntMap-Strict.html#t:IntMap">IntMap</a> v) (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> v)</li><li class="src short"><a href="#v:setLens">setLens</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Ord.html#t:Ord">Ord</a> k => k -> <a href="Data-Lens-Common.html#t:Lens">Lens</a> (<a href="/usr/share/doc/ghc-doc/html/libraries/containers-0.5.0.0/Data-Set.html#t:Set">Set</a> k) <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:intSetLens">intSetLens</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Int.html#t:Int">Int</a> -> <a href="Data-Lens-Common.html#t:Lens">Lens</a> <a href="/usr/share/doc/ghc-doc/html/libraries/containers-0.5.0.0/Data-IntSet.html#t:IntSet">IntSet</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Bool.html#t:Bool">Bool</a></li></ul></div><div id="interface"><h1>Documentation</h1><div class="top"><p class="src"><span class="keyword">newtype</span> <a name="t:Lens" class="def">Lens</a> a b <a href="src/Data-Lens-Common.html#Lens" class="link">Source</a></p><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:Lens" class="def">Lens</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><dl><dt class="src"><a name="v:runLens" class="def">runLens</a> :: a -> <a href="/usr/share/doc/libghc-comonad-doc/html/Control-Comonad-Trans-Store.html#t:Store">Store</a> b a</dt><dd class="doc empty"> </dd></dl><div class="clear"></div></div></td></tr></table></div><div class="subs instances"><p id="control.i:Lens" class="caption collapser" onclick="toggleSection('i:Lens')">Instances</p><div id="section.i:Lens" class="show"><table><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Category.html#t:Category">Category</a> <a href="Data-Lens-Common.html#t:Lens">Lens</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="/usr/share/doc/libghc-semigroupoids-doc/html/Data-Semigroupoid.html#t:Semigroupoid">Semigroupoid</a> <a href="Data-Lens-Common.html#t:Lens">Lens</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Control-Category-Product.html#t:Tensor">Tensor</a> <a href="Data-Lens-Common.html#t:Lens">Lens</a></td><td class="doc empty"> </td></tr></table></div></div></div><h1 id="g:1">Lens construction
</h1><div class="top"><p class="src"><a name="v:lens" class="def">lens</a> :: (a -> b) -> (b -> a -> a) -> <a href="Data-Lens-Common.html#t:Lens">Lens</a> a b<a href="src/Data-Lens-Common.html#lens" class="link">Source</a></p><div class="doc"><p>build a lens out of a getter and setter
</p></div></div><div class="top"><p class="src"><a name="v:iso" class="def">iso</a> :: (a -> b) -> (b -> a) -> <a href="Data-Lens-Common.html#t:Lens">Lens</a> a b<a href="src/Data-Lens-Common.html#iso" class="link">Source</a></p><div class="doc"><p>build a lens out of an isomorphism
</p></div></div><h1 id="g:2">Functional API
</h1><div class="top"><p class="src"><a name="v:getL" class="def">getL</a> :: <a href="Data-Lens-Common.html#t:Lens">Lens</a> a b -> a -> b<a href="src/Data-Lens-Common.html#getL" class="link">Source</a></p><div class="doc"><p>Gets the getter function from a lens.
</p></div></div><div class="top"><p class="src"><a name="v:setL" class="def">setL</a> :: <a href="Data-Lens-Common.html#t:Lens">Lens</a> a b -> b -> a -> a<a href="src/Data-Lens-Common.html#setL" class="link">Source</a></p><div class="doc"><p>Gets the setter function from a lens.
</p></div></div><div class="top"><p class="src"><a name="v:modL" class="def">modL</a> :: <a href="Data-Lens-Common.html#t:Lens">Lens</a> a b -> (b -> b) -> a -> a<a href="src/Data-Lens-Common.html#modL" class="link">Source</a></p><div class="doc"><p>Gets the modifier function from a lens.
</p></div></div><div class="top"><p class="src"><a name="v:mergeL" class="def">mergeL</a> :: <a href="Data-Lens-Common.html#t:Lens">Lens</a> a c -> <a href="Data-Lens-Common.html#t:Lens">Lens</a> b c -> <a href="Data-Lens-Common.html#t:Lens">Lens</a> (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Either.html#t:Either">Either</a> a b) c<a href="src/Data-Lens-Common.html#mergeL" class="link">Source</a></p></div><h1 id="g:3">Operator API
</h1><div class="top"><p class="src"><a name="v:-94--36-" class="def">(^$)</a> :: <a href="Data-Lens-Common.html#t:Lens">Lens</a> a b -> a -> b<a href="src/Data-Lens-Common.html#%5E%24" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:-94--36--33-" class="def">(^$!)</a> :: <a href="Data-Lens-Common.html#t:Lens">Lens</a> a b -> a -> b<a href="src/Data-Lens-Common.html#%5E%24%21" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:-94-." class="def">(^.)</a> :: a -> <a href="Data-Lens-Common.html#t:Lens">Lens</a> a b -> b<a href="src/Data-Lens-Common.html#%5E." class="link">Source</a></p><div class="doc"><p>functional getter, which acts like a field accessor
</p></div></div><div class="top"><p class="src"><a name="v:-94--33-" class="def">(^!)</a> :: a -> <a href="Data-Lens-Common.html#t:Lens">Lens</a> a b -> b<a href="src/Data-Lens-Common.html#%5E%21" class="link">Source</a></p><div class="doc"><p>functional getter, which acts like a field accessor
</p></div></div><div class="top"><p class="src"><a name="v:-94--61-" class="def">(^=)</a> :: <a href="Data-Lens-Common.html#t:Lens">Lens</a> a b -> b -> a -> a<a href="src/Data-Lens-Common.html#%5E%3D" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:-94--33--61-" class="def">(^!=)</a> :: <a href="Data-Lens-Common.html#t:Lens">Lens</a> a b -> b -> a -> a<a href="src/Data-Lens-Common.html#%5E%21%3D" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:-94--37--61-" class="def">(^%=)</a> :: <a href="Data-Lens-Common.html#t:Lens">Lens</a> a b -> (b -> b) -> a -> a<a href="src/Data-Lens-Common.html#%5E%25%3D" class="link">Source</a></p><div class="doc"><p>functional modify
</p></div></div><div class="top"><p class="src"><a name="v:-94--33--37--61-" class="def">(^!%=)</a> :: <a href="Data-Lens-Common.html#t:Lens">Lens</a> a b -> (b -> b) -> a -> a<a href="src/Data-Lens-Common.html#%5E%21%25%3D" class="link">Source</a></p><div class="doc"><p>functional modify
</p></div></div><div class="top"><p class="src"><a name="v:-94--37--37--61-" class="def">(^%%=)</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:Functor">Functor</a> f => <a href="Data-Lens-Common.html#t:Lens">Lens</a> a b -> (b -> f b) -> a -> f a<a href="src/Data-Lens-Common.html#%5E%25%25%3D" class="link">Source</a></p><div class="doc"><p>functorial modify
</p></div></div><h1 id="g:4">Pseudo-imperatives
</h1><div class="top"><p class="src"><a name="v:-94--43--61-" class="def">(^+=)</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Num">Num</a> b => <a href="Data-Lens-Common.html#t:Lens">Lens</a> a b -> b -> a -> a<a href="src/Data-Lens-Common.html#%5E%2B%3D" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:-94--33--43--61-" class="def">(^!+=)</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Num">Num</a> b => <a href="Data-Lens-Common.html#t:Lens">Lens</a> a b -> b -> a -> a<a href="src/Data-Lens-Common.html#%5E%21%2B%3D" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:-94--45--61-" class="def">(^-=)</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Num">Num</a> b => <a href="Data-Lens-Common.html#t:Lens">Lens</a> a b -> b -> a -> a<a href="src/Data-Lens-Common.html#%5E-%3D" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:-94--33--45--61-" class="def">(^!-=)</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Num">Num</a> b => <a href="Data-Lens-Common.html#t:Lens">Lens</a> a b -> b -> a -> a<a href="src/Data-Lens-Common.html#%5E%21-%3D" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:-94--42--61-" class="def">(^*=)</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Num">Num</a> b => <a href="Data-Lens-Common.html#t:Lens">Lens</a> a b -> b -> a -> a<a href="src/Data-Lens-Common.html#%5E%2A%3D" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:-94--33--42--61-" class="def">(^!*=)</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Num">Num</a> b => <a href="Data-Lens-Common.html#t:Lens">Lens</a> a b -> b -> a -> a<a href="src/Data-Lens-Common.html#%5E%21%2A%3D" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:-94--47--61-" class="def">(^/=)</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Fractional">Fractional</a> b => <a href="Data-Lens-Common.html#t:Lens">Lens</a> a b -> b -> a -> a<a href="src/Data-Lens-Common.html#%5E%2F%3D" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:-94--33--47--61-" class="def">(^!/=)</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Fractional">Fractional</a> b => <a href="Data-Lens-Common.html#t:Lens">Lens</a> a b -> b -> a -> a<a href="src/Data-Lens-Common.html#%5E%21%2F%3D" class="link">Source</a></p></div><h1 id="g:5">Stock lenses
</h1><div class="top"><p class="src"><a name="v:fstLens" class="def">fstLens</a> :: <a href="Data-Lens-Common.html#t:Lens">Lens</a> (a, b) a<a href="src/Data-Lens-Common.html#fstLens" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:sndLens" class="def">sndLens</a> :: <a href="Data-Lens-Common.html#t:Lens">Lens</a> (a, b) b<a href="src/Data-Lens-Common.html#sndLens" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:mapLens" class="def">mapLens</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Ord.html#t:Ord">Ord</a> k => k -> <a href="Data-Lens-Common.html#t:Lens">Lens</a> (<a href="/usr/share/doc/ghc-doc/html/libraries/containers-0.5.0.0/Data-Map-Lazy.html#t:Map">Map</a> k v) (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> v)<a href="src/Data-Lens-Common.html#mapLens" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:intMapLens" class="def">intMapLens</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Int.html#t:Int">Int</a> -> <a href="Data-Lens-Common.html#t:Lens">Lens</a> (<a href="/usr/share/doc/ghc-doc/html/libraries/containers-0.5.0.0/Data-IntMap-Strict.html#t:IntMap">IntMap</a> v) (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> v)<a href="src/Data-Lens-Common.html#intMapLens" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:setLens" class="def">setLens</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Ord.html#t:Ord">Ord</a> k => k -> <a href="Data-Lens-Common.html#t:Lens">Lens</a> (<a href="/usr/share/doc/ghc-doc/html/libraries/containers-0.5.0.0/Data-Set.html#t:Set">Set</a> k) <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Bool.html#t:Bool">Bool</a><a href="src/Data-Lens-Common.html#setLens" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:intSetLens" class="def">intSetLens</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Int.html#t:Int">Int</a> -> <a href="Data-Lens-Common.html#t:Lens">Lens</a> <a href="/usr/share/doc/ghc-doc/html/libraries/containers-0.5.0.0/Data-IntSet.html#t:IntSet">IntSet</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Bool.html#t:Bool">Bool</a><a href="src/Data-Lens-Common.html#intSetLens" class="link">Source</a></p></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.13.2</p></div></body></html>
|