/usr/share/doc/libghc-lens-doc/html/Data-Complex-Lens.html is in libghc-lens-doc 4.14-2.
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 25 | <!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.Complex.Lens</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script src="file:///usr/share/javascript/mathjax/MathJax.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_Data-Complex-Lens.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Data-Complex-Lens.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">lens-4.14: Lenses, Folds and Traversals</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Copyright</th><td>(C) 2012-16 Edward Kmett</td></tr><tr><th>License</th><td>BSD-style (see the file LICENSE)</td></tr><tr><th>Maintainer</th><td>Edward Kmett <ekmett@gmail.com></td></tr><tr><th>Stability</th><td>experimental</td></tr><tr><th>Portability</th><td>non-portable</td></tr><tr><th>Safe Haskell</th><td>None</td></tr><tr><th>Language</th><td>Haskell98</td></tr></table><p class="caption">Data.Complex.Lens</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Pattern Synonyms</a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>Lenses and traversals for complex numbers</p></div></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"><a href="#v:_realPart">_realPart</a> :: <a href="Control-Lens-Type.html#t:Lens-39-">Lens'</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Complex.html#t:Complex">Complex</a> a) a</li><li class="src short"><a href="#v:_imagPart">_imagPart</a> :: <a href="Control-Lens-Type.html#t:Lens-39-">Lens'</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Complex.html#t:Complex">Complex</a> a) a</li><li class="src short"><a href="#v:_polar">_polar</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Prelude.html#t:RealFloat">RealFloat</a> a => <a href="Control-Lens-Type.html#t:Iso-39-">Iso'</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Complex.html#t:Complex">Complex</a> a) (a, a)</li><li class="src short"><a href="#v:_magnitude">_magnitude</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Prelude.html#t:RealFloat">RealFloat</a> a => <a href="Control-Lens-Type.html#t:Lens-39-">Lens'</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Complex.html#t:Complex">Complex</a> a) a</li><li class="src short"><a href="#v:_phase">_phase</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Prelude.html#t:RealFloat">RealFloat</a> a => <a href="Control-Lens-Type.html#t:Lens-39-">Lens'</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Complex.html#t:Complex">Complex</a> a) a</li><li class="src short"><a href="#v:_conjugate">_conjugate</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Prelude.html#t:RealFloat">RealFloat</a> a => <a href="Control-Lens-Type.html#t:Iso-39-">Iso'</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Complex.html#t:Complex">Complex</a> a) (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Complex.html#t:Complex">Complex</a> a)</li><li class="src short"><span class="keyword">pattern</span> <a href="#v:Polar">Polar</a> :: <span class="keyword">forall</span> t. <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Prelude.html#t:RealFloat">RealFloat</a> t => t -> t -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Complex.html#t:Complex">Complex</a> t</li><li class="src short"><span class="keyword">pattern</span> <a href="#v:Real">Real</a> :: <span class="keyword">forall</span> a. (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Prelude.html#t:Num">Num</a> a, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Eq.html#t:Eq">Eq</a> a) => a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Complex.html#t:Complex">Complex</a> a</li><li class="src short"><span class="keyword">pattern</span> <a href="#v:Imaginary">Imaginary</a> :: <span class="keyword">forall</span> a. (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Prelude.html#t:Num">Num</a> a, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Eq.html#t:Eq">Eq</a> a) => a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Complex.html#t:Complex">Complex</a> a</li><li class="src short"><span class="keyword">pattern</span> <a href="#v:Conjugate">Conjugate</a> :: <span class="keyword">forall</span> a. <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Prelude.html#t:Num">Num</a> a => <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Complex.html#t:Complex">Complex</a> a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Complex.html#t:Complex">Complex</a> a</li></ul></div><div id="interface"><h1>Documentation</h1><div class="top"><p class="src"><a id="v:_realPart" class="def">_realPart</a> :: <a href="Control-Lens-Type.html#t:Lens-39-">Lens'</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Complex.html#t:Complex">Complex</a> a) a <a href="src/Data-Complex-Lens.html#_realPart" class="link">Source</a> <a href="#v:_realPart" class="selflink">#</a></p><div class="doc"><p>Access the <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Complex.html#v:realPart">realPart</a></code> of a <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Complex.html#t:Complex">Complex</a></code> number.</p><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>(a :+ b)^._realPart
</code></strong>a
</pre><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>a :+ b & _realPart *~ 2
</code></strong>a * 2 :+ b
</pre><pre><code><a href="Data-Complex-Lens.html#v:_realPart">_realPart</a></code> :: <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Functor.html#t:Functor">Functor</a></code> f => (a -> f a) -> <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Complex.html#t:Complex">Complex</a></code> a -> f (<code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Complex.html#t:Complex">Complex</a></code> a)</pre></div></div><div class="top"><p class="src"><a id="v:_imagPart" class="def">_imagPart</a> :: <a href="Control-Lens-Type.html#t:Lens-39-">Lens'</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Complex.html#t:Complex">Complex</a> a) a <a href="src/Data-Complex-Lens.html#_imagPart" class="link">Source</a> <a href="#v:_imagPart" class="selflink">#</a></p><div class="doc"><p>Access the <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Complex.html#v:imagPart">imagPart</a></code> of a <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Complex.html#t:Complex">Complex</a></code> number.</p><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>(a :+ b)^._imagPart
</code></strong>b
</pre><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>a :+ b & _imagPart *~ 2
</code></strong>a :+ b * 2
</pre><pre><code><a href="Data-Complex-Lens.html#v:_imagPart">_imagPart</a></code> :: <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Functor.html#t:Functor">Functor</a></code> f => (a -> f a) -> <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Complex.html#t:Complex">Complex</a></code> a -> f (<code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Complex.html#t:Complex">Complex</a></code> a)</pre></div></div><div class="top"><p class="src"><a id="v:_polar" class="def">_polar</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Prelude.html#t:RealFloat">RealFloat</a> a => <a href="Control-Lens-Type.html#t:Iso-39-">Iso'</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Complex.html#t:Complex">Complex</a> a) (a, a) <a href="src/Data-Complex-Lens.html#_polar" class="link">Source</a> <a href="#v:_polar" class="selflink">#</a></p><div class="doc"><p>This isn't <em>quite</em> a legal <code><a href="Control-Lens-Type.html#t:Lens">Lens</a></code>. Notably the</p><pre><code><a href="Control-Lens-Getter.html#v:view">view</a></code> l (<code><a href="Control-Lens-Setter.html#v:set">set</a></code> l b a) = b</pre><p>law is violated when you set a <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Complex.html#v:polar">polar</a></code> value with 0 <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Complex.html#v:magnitude">magnitude</a></code> and non-zero
<code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Complex.html#v:phase">phase</a></code> as the <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Complex.html#v:phase">phase</a></code> information is lost, or with a negative <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Complex.html#v:magnitude">magnitude</a></code>
which flips the <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Complex.html#v:phase">phase</a></code> and retains a positive <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Complex.html#v:magnitude">magnitude</a></code>. So don't do
that!</p><p>Otherwise, this is a perfectly cromulent <code><a href="Control-Lens-Type.html#t:Lens">Lens</a></code>.</p></div></div><div class="top"><p class="src"><a id="v:_magnitude" class="def">_magnitude</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Prelude.html#t:RealFloat">RealFloat</a> a => <a href="Control-Lens-Type.html#t:Lens-39-">Lens'</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Complex.html#t:Complex">Complex</a> a) a <a href="src/Data-Complex-Lens.html#_magnitude" class="link">Source</a> <a href="#v:_magnitude" class="selflink">#</a></p><div class="doc"><p>Access the <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Complex.html#v:magnitude">magnitude</a></code> of a <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Complex.html#t:Complex">Complex</a></code> number.</p><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>(10.0 :+ 20.0) & _magnitude *~ 2
</code></strong>20.0 :+ 40.0
</pre><p>This isn't <em>quite</em> a legal <code><a href="Control-Lens-Type.html#t:Lens">Lens</a></code>. Notably the</p><pre><code><a href="Control-Lens-Getter.html#v:view">view</a></code> l (<code><a href="Control-Lens-Setter.html#v:set">set</a></code> l b a) = b</pre><p>law is violated when you set a negative <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Complex.html#v:magnitude">magnitude</a></code>. This flips the <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Complex.html#v:phase">phase</a></code>
and retains a positive <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Complex.html#v:magnitude">magnitude</a></code>. So don't do that!</p><p>Otherwise, this is a perfectly cromulent <code><a href="Control-Lens-Type.html#t:Lens">Lens</a></code>.</p><p>Setting the <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Complex.html#v:magnitude">magnitude</a></code> of a zero <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Complex.html#t:Complex">Complex</a></code> number assumes the <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Complex.html#v:phase">phase</a></code> is 0.</p></div></div><div class="top"><p class="src"><a id="v:_phase" class="def">_phase</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Prelude.html#t:RealFloat">RealFloat</a> a => <a href="Control-Lens-Type.html#t:Lens-39-">Lens'</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Complex.html#t:Complex">Complex</a> a) a <a href="src/Data-Complex-Lens.html#_phase" class="link">Source</a> <a href="#v:_phase" class="selflink">#</a></p><div class="doc"><p>Access the <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Complex.html#v:phase">phase</a></code> of a <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Complex.html#t:Complex">Complex</a></code> number.</p><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>(mkPolar 10 (2-pi) & _phase +~ pi & view _phase) ~~ 2
</code></strong>True
</pre><p>This isn't <em>quite</em> a legal <code><a href="Control-Lens-Type.html#t:Lens">Lens</a></code>. Notably the</p><pre><code><a href="Control-Lens-Getter.html#v:view">view</a></code> l (<code><a href="Control-Lens-Setter.html#v:set">set</a></code> l b a) = b</pre><p>law is violated when you set a <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Complex.html#v:phase">phase</a></code> outside the range <code>(-<code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Numeric.html#v:pi">pi</a></code>, <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Numeric.html#v:pi">pi</a></code>]</code>.
The phase is always in that range when queried. So don't do that!</p><p>Otherwise, this is a perfectly cromulent <code><a href="Control-Lens-Type.html#t:Lens">Lens</a></code>.</p></div></div><div class="top"><p class="src"><a id="v:_conjugate" class="def">_conjugate</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Prelude.html#t:RealFloat">RealFloat</a> a => <a href="Control-Lens-Type.html#t:Iso-39-">Iso'</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Complex.html#t:Complex">Complex</a> a) (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Complex.html#t:Complex">Complex</a> a) <a href="src/Data-Complex-Lens.html#_conjugate" class="link">Source</a> <a href="#v:_conjugate" class="selflink">#</a></p><div class="doc"><p>Access the <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Complex.html#v:conjugate">conjugate</a></code> of a <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Complex.html#t:Complex">Complex</a></code> number.</p><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>(2.0 :+ 3.0) & _conjugate . _imagPart -~ 1
</code></strong>2.0 :+ 4.0
</pre><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>(mkPolar 10.0 2.0 ^. _conjugate . _phase) ~~ (-2.0)
</code></strong>True
</pre></div></div><h1 id="g:1">Pattern Synonyms</h1><div class="top"><p class="src"><span class="keyword">pattern</span> <a id="v:Polar" class="def">Polar</a> :: <span class="keyword">forall</span> t. <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Prelude.html#t:RealFloat">RealFloat</a> t => t -> t -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Complex.html#t:Complex">Complex</a> t <a href="src/Data-Complex-Lens.html#Polar" class="link">Source</a> <a href="#v:Polar" class="selflink">#</a></p></div><div class="top"><p class="src"><span class="keyword">pattern</span> <a id="v:Real" class="def">Real</a> :: <span class="keyword">forall</span> a. (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Prelude.html#t:Num">Num</a> a, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Eq.html#t:Eq">Eq</a> a) => a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Complex.html#t:Complex">Complex</a> a <a href="src/Data-Complex-Lens.html#Real" class="link">Source</a> <a href="#v:Real" class="selflink">#</a></p></div><div class="top"><p class="src"><span class="keyword">pattern</span> <a id="v:Imaginary" class="def">Imaginary</a> :: <span class="keyword">forall</span> a. (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Prelude.html#t:Num">Num</a> a, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Eq.html#t:Eq">Eq</a> a) => a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Complex.html#t:Complex">Complex</a> a <a href="src/Data-Complex-Lens.html#Imaginary" class="link">Source</a> <a href="#v:Imaginary" class="selflink">#</a></p></div><div class="top"><p class="src"><span class="keyword">pattern</span> <a id="v:Conjugate" class="def">Conjugate</a> :: <span class="keyword">forall</span> a. <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Prelude.html#t:Num">Num</a> a => <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Complex.html#t:Complex">Complex</a> a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Complex.html#t:Complex">Complex</a> a <a href="src/Data-Complex-Lens.html#Conjugate" class="link">Source</a> <a href="#v:Conjugate" class="selflink">#</a></p></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.17.2</p></div></body></html>
|