/usr/share/doc/libghc-lens-doc/html/System-FilePath-Lens.html is in libghc-lens-doc 4.15.4-1.
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 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | <!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>System.FilePath.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_System-FilePath-Lens.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/System-FilePath-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.15.4: Lenses, Folds and Traversals</p></div><div id="content"><div id="module-header"><table class="info"><tr><th valign="top">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>Rank2Types</td></tr><tr><th>Safe Haskell</th><td>Safe</td></tr><tr><th>Language</th><td>Haskell98</td></tr></table><p class="caption">System.FilePath.Lens</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Operators</a></li><li><a href="#g:2">Lenses</a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc empty"> </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:-60--47--62--126-">(</>~)</a> :: <a href="Control-Lens-Setter.html#t:ASetter">ASetter</a> s t <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a> -> s -> t</li><li class="src short"><a href="#v:-60--60--47--62--126-">(<</>~)</a> :: <a href="Control-Lens-Type.html#t:LensLike">LensLike</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/ghc-prim-0.5.0.0/GHC-Tuple.html#t:-40--44--41-">(,)</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a>) s a <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a> -> s -> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a>, a)</li><li class="src short"><a href="#v:-60--60--60--47--62--126-">(<<</>~)</a> :: <a href="Control-Lens-Type.html#t:Optical-39-">Optical'</a> (->) q (<a href="file:///usr/share/doc/ghc-doc/html/libraries/ghc-prim-0.5.0.0/GHC-Tuple.html#t:-40--44--41-">(,)</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a>) s <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a> -> q s (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a>, s)</li><li class="src short"><a href="#v:-60-.-62--126-">(<.>~)</a> :: <a href="Control-Lens-Setter.html#t:ASetter">ASetter</a> s a <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -> s -> a</li><li class="src short"><a href="#v:-60--60-.-62--126-">(<<.>~)</a> :: <a href="Control-Lens-Type.html#t:LensLike">LensLike</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/ghc-prim-0.5.0.0/GHC-Tuple.html#t:-40--44--41-">(,)</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a>) s a <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -> s -> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a>, a)</li><li class="src short"><a href="#v:-60--60--60-.-62--126-">(<<<.>~)</a> :: <a href="Control-Lens-Type.html#t:Optical-39-">Optical'</a> (->) q (<a href="file:///usr/share/doc/ghc-doc/html/libraries/ghc-prim-0.5.0.0/GHC-Tuple.html#t:-40--44--41-">(,)</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a>) s <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -> q s (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a>, s)</li><li class="src short"><a href="#v:-60--47--62--61-">(</>=)</a> :: <a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-State-Class.html#t:MonadState">MonadState</a> s m => <a href="Control-Lens-Setter.html#t:ASetter-39-">ASetter'</a> s <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a> -> m ()</li><li class="src short"><a href="#v:-60--60--47--62--61-">(<</>=)</a> :: <a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-State-Class.html#t:MonadState">MonadState</a> s m => <a href="Control-Lens-Type.html#t:LensLike-39-">LensLike'</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/ghc-prim-0.5.0.0/GHC-Tuple.html#t:-40--44--41-">(,)</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a>) s <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a> -> m <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a></li><li class="src short"><a href="#v:-60--60--60--47--62--61-">(<<</>=)</a> :: <a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-State-Class.html#t:MonadState">MonadState</a> s m => <a href="Control-Lens-Type.html#t:LensLike-39-">LensLike'</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/ghc-prim-0.5.0.0/GHC-Tuple.html#t:-40--44--41-">(,)</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a>) s <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a> -> m <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a></li><li class="src short"><a href="#v:-60-.-62--61-">(<.>=)</a> :: <a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-State-Class.html#t:MonadState">MonadState</a> s m => <a href="Control-Lens-Setter.html#t:ASetter-39-">ASetter'</a> s <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -> m ()</li><li class="src short"><a href="#v:-60--60-.-62--61-">(<<.>=)</a> :: <a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-State-Class.html#t:MonadState">MonadState</a> s m => <a href="Control-Lens-Type.html#t:LensLike-39-">LensLike'</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/ghc-prim-0.5.0.0/GHC-Tuple.html#t:-40--44--41-">(,)</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a>) s <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -> m <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a></li><li class="src short"><a href="#v:-60--60--60-.-62--61-">(<<<.>=)</a> :: <a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-State-Class.html#t:MonadState">MonadState</a> s m => <a href="Control-Lens-Type.html#t:LensLike-39-">LensLike'</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/ghc-prim-0.5.0.0/GHC-Tuple.html#t:-40--44--41-">(,)</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a>) s <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -> m <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a></li><li class="src short"><a href="#v:basename">basename</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.1.0/System-IO.html#t:FilePath">FilePath</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a></li><li class="src short"><a href="#v:directory">directory</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.1.0/System-IO.html#t:FilePath">FilePath</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a></li><li class="src short"><a href="#v:extension">extension</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.1.0/System-IO.html#t:FilePath">FilePath</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a></li><li class="src short"><a href="#v:filename">filename</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.1.0/System-IO.html#t:FilePath">FilePath</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a></li></ul></div><div id="interface"><h1 id="g:1">Operators</h1><div class="top"><p class="src"><a id="v:-60--47--62--126-" class="def">(</>~)</a> :: <a href="Control-Lens-Setter.html#t:ASetter">ASetter</a> s t <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a> -> s -> t <span class="fixity">infixr 4</span><span class="rightedge"></span> <a href="src/System-FilePath-Lens.html#%3C%2F%3E~" class="link">Source</a> <a href="#v:-60--47--62--126-" class="selflink">#</a></p><div class="doc"><p>Modify the path by adding another path.</p><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>(both </>~ "bin" $ ("hello","world")) == ("hello" </> "bin", "world" </> "bin")
</code></strong>True
</pre><pre>(<code><a href="System-FilePath-Lens.html#v:-60--47--62--126-"></>~</a></code>) :: <code><a href="Control-Lens-Type.html#t:Setter">Setter</a></code> s a <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a></code> <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a></code> -> <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a></code> -> s -> a
(<code><a href="System-FilePath-Lens.html#v:-60--47--62--126-"></>~</a></code>) :: <code><a href="Control-Lens-Type.html#t:Iso">Iso</a></code> s a <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a></code> <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a></code> -> <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a></code> -> s -> a
(<code><a href="System-FilePath-Lens.html#v:-60--47--62--126-"></>~</a></code>) :: <code><a href="Control-Lens-Type.html#t:Lens">Lens</a></code> s a <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a></code> <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a></code> -> <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a></code> -> s -> a
(<code><a href="System-FilePath-Lens.html#v:-60--47--62--126-"></>~</a></code>) :: <code><a href="Control-Lens-Type.html#t:Traversal">Traversal</a></code> s a <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a></code> <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a></code> -> <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a></code> -> s -> a
</pre></div></div><div class="top"><p class="src"><a id="v:-60--60--47--62--126-" class="def">(<</>~)</a> :: <a href="Control-Lens-Type.html#t:LensLike">LensLike</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/ghc-prim-0.5.0.0/GHC-Tuple.html#t:-40--44--41-">(,)</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a>) s a <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a> -> s -> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a>, a) <span class="fixity">infixr 4</span><span class="rightedge"></span> <a href="src/System-FilePath-Lens.html#%3C%3C%2F%3E~" class="link">Source</a> <a href="#v:-60--60--47--62--126-" class="selflink">#</a></p><div class="doc"><p>Add a path onto the end of the target of a <code><a href="Control-Lens-Type.html#t:Lens">Lens</a></code> and return the result</p><p>When you do not need the result of the operation, (<code><a href="System-FilePath-Lens.html#v:-60--47--62--126-"></>~</a></code>) is more flexible.</p></div></div><div class="top"><p class="src"><a id="v:-60--60--60--47--62--126-" class="def">(<<</>~)</a> :: <a href="Control-Lens-Type.html#t:Optical-39-">Optical'</a> (->) q (<a href="file:///usr/share/doc/ghc-doc/html/libraries/ghc-prim-0.5.0.0/GHC-Tuple.html#t:-40--44--41-">(,)</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a>) s <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a> -> q s (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a>, s) <span class="fixity">infixr 4</span><span class="rightedge"></span> <a href="src/System-FilePath-Lens.html#%3C%3C%3C%2F%3E~" class="link">Source</a> <a href="#v:-60--60--60--47--62--126-" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:-60-.-62--126-" class="def">(<.>~)</a> :: <a href="Control-Lens-Setter.html#t:ASetter">ASetter</a> s a <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -> s -> a <span class="fixity">infixr 4</span><span class="rightedge"></span> <a href="src/System-FilePath-Lens.html#%3C.%3E~" class="link">Source</a> <a href="#v:-60-.-62--126-" class="selflink">#</a></p><div class="doc"><p>Modify the path by adding an extension.</p><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>both <.>~ "txt" $ ("hello","world")
</code></strong>("hello.txt","world.txt")
</pre><pre>(<code><a href="System-FilePath-Lens.html#v:-60-.-62--126-"><.>~</a></code>) :: <code><a href="Control-Lens-Type.html#t:Setter">Setter</a></code> s a <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a></code> <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a></code> -> <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></code> -> s -> a
(<code><a href="System-FilePath-Lens.html#v:-60-.-62--126-"><.>~</a></code>) :: <code><a href="Control-Lens-Type.html#t:Iso">Iso</a></code> s a <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a></code> <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a></code> -> <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></code> -> s -> a
(<code><a href="System-FilePath-Lens.html#v:-60-.-62--126-"><.>~</a></code>) :: <code><a href="Control-Lens-Type.html#t:Lens">Lens</a></code> s a <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a></code> <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a></code> -> <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></code> -> s -> a
(<code><a href="System-FilePath-Lens.html#v:-60-.-62--126-"><.>~</a></code>) :: <code><a href="Control-Lens-Type.html#t:Traversal">Traversal</a></code> s a <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a></code> <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a></code> -> <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></code> -> s -> a
</pre></div></div><div class="top"><p class="src"><a id="v:-60--60-.-62--126-" class="def">(<<.>~)</a> :: <a href="Control-Lens-Type.html#t:LensLike">LensLike</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/ghc-prim-0.5.0.0/GHC-Tuple.html#t:-40--44--41-">(,)</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a>) s a <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -> s -> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a>, a) <span class="fixity">infixr 4</span><span class="rightedge"></span> <a href="src/System-FilePath-Lens.html#%3C%3C.%3E~" class="link">Source</a> <a href="#v:-60--60-.-62--126-" class="selflink">#</a></p><div class="doc"><p>Add an extension onto the end of the target of a <code><a href="Control-Lens-Type.html#t:Lens">Lens</a></code> and return the result</p><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>_1 <<.>~ "txt" $ ("hello","world")
</code></strong>("hello.txt",("hello.txt","world"))
</pre><p>When you do not need the result of the operation, (<code><a href="System-FilePath-Lens.html#v:-60-.-62--126-"><.>~</a></code>) is more flexible.</p></div></div><div class="top"><p class="src"><a id="v:-60--60--60-.-62--126-" class="def">(<<<.>~)</a> :: <a href="Control-Lens-Type.html#t:Optical-39-">Optical'</a> (->) q (<a href="file:///usr/share/doc/ghc-doc/html/libraries/ghc-prim-0.5.0.0/GHC-Tuple.html#t:-40--44--41-">(,)</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a>) s <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -> q s (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a>, s) <span class="fixity">infixr 4</span><span class="rightedge"></span> <a href="src/System-FilePath-Lens.html#%3C%3C%3C.%3E~" class="link">Source</a> <a href="#v:-60--60--60-.-62--126-" class="selflink">#</a></p><div class="doc"><p>Add an extension onto the end of the target of a <code><a href="Control-Lens-Type.html#t:Lens">Lens</a></code> but
return the old value</p><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>_1 <<<.>~ "txt" $ ("hello","world")
</code></strong>("hello",("hello.txt","world"))
</pre><p>When you do not need the old value, (<code><a href="System-FilePath-Lens.html#v:-60-.-62--126-"><.>~</a></code>) is more flexible.</p></div></div><div class="top"><p class="src"><a id="v:-60--47--62--61-" class="def">(</>=)</a> :: <a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-State-Class.html#t:MonadState">MonadState</a> s m => <a href="Control-Lens-Setter.html#t:ASetter-39-">ASetter'</a> s <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a> -> m () <span class="fixity">infix 4</span><span class="rightedge"></span> <a href="src/System-FilePath-Lens.html#%3C%2F%3E%3D" class="link">Source</a> <a href="#v:-60--47--62--61-" class="selflink">#</a></p><div class="doc"><p>Modify the target(s) of a <code><a href="Control-Lens-Type.html#t:Lens-39-">Lens'</a></code>, <code><a href="Control-Lens-Type.html#t:Iso-39-">Iso'</a></code>, <code><a href="Control-Lens-Type.html#t:Setter-39-">Setter'</a></code> or <code><a href="Control-Lens-Type.html#t:Traversal-39-">Traversal'</a></code> by adding a path.</p><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>execState (both </>= "bin") ("hello","world") == ("hello" </> "bin", "world" </> "bin")
</code></strong>True
</pre><pre>(<code><a href="System-FilePath-Lens.html#v:-60--47--62--61-"></>=</a></code>) :: <code><a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-State-Class.html#t:MonadState">MonadState</a></code> s m => <code><a href="Control-Lens-Type.html#t:Setter-39-">Setter'</a></code> s <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a></code> -> <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a></code> -> m ()
(<code><a href="System-FilePath-Lens.html#v:-60--47--62--61-"></>=</a></code>) :: <code><a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-State-Class.html#t:MonadState">MonadState</a></code> s m => <code><a href="Control-Lens-Type.html#t:Iso-39-">Iso'</a></code> s <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a></code> -> <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a></code> -> m ()
(<code><a href="System-FilePath-Lens.html#v:-60--47--62--61-"></>=</a></code>) :: <code><a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-State-Class.html#t:MonadState">MonadState</a></code> s m => <code><a href="Control-Lens-Type.html#t:Lens-39-">Lens'</a></code> s <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a></code> -> <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a></code> -> m ()
(<code><a href="System-FilePath-Lens.html#v:-60--47--62--61-"></>=</a></code>) :: <code><a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-State-Class.html#t:MonadState">MonadState</a></code> s m => <code><a href="Control-Lens-Type.html#t:Traversal-39-">Traversal'</a></code> s <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a></code> -> <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a></code> -> m ()
</pre></div></div><div class="top"><p class="src"><a id="v:-60--60--47--62--61-" class="def">(<</>=)</a> :: <a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-State-Class.html#t:MonadState">MonadState</a> s m => <a href="Control-Lens-Type.html#t:LensLike-39-">LensLike'</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/ghc-prim-0.5.0.0/GHC-Tuple.html#t:-40--44--41-">(,)</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a>) s <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a> -> m <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a> <span class="fixity">infix 4</span><span class="rightedge"></span> <a href="src/System-FilePath-Lens.html#%3C%3C%2F%3E%3D" class="link">Source</a> <a href="#v:-60--60--47--62--61-" class="selflink">#</a></p><div class="doc"><p>Add a path onto the end of the target of a <code><a href="Control-Lens-Type.html#t:Lens">Lens</a></code> into
your monad's state and return the result.</p><p>When you do not need the result of the operation, (<code><a href="System-FilePath-Lens.html#v:-60--47--62--61-"></>=</a></code>) is more flexible.</p></div></div><div class="top"><p class="src"><a id="v:-60--60--60--47--62--61-" class="def">(<<</>=)</a> :: <a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-State-Class.html#t:MonadState">MonadState</a> s m => <a href="Control-Lens-Type.html#t:LensLike-39-">LensLike'</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/ghc-prim-0.5.0.0/GHC-Tuple.html#t:-40--44--41-">(,)</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a>) s <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a> -> m <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a> <span class="fixity">infix 4</span><span class="rightedge"></span> <a href="src/System-FilePath-Lens.html#%3C%3C%3C%2F%3E%3D" class="link">Source</a> <a href="#v:-60--60--60--47--62--61-" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:-60-.-62--61-" class="def">(<.>=)</a> :: <a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-State-Class.html#t:MonadState">MonadState</a> s m => <a href="Control-Lens-Setter.html#t:ASetter-39-">ASetter'</a> s <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -> m () <span class="fixity">infix 4</span><span class="rightedge"></span> <a href="src/System-FilePath-Lens.html#%3C.%3E%3D" class="link">Source</a> <a href="#v:-60-.-62--61-" class="selflink">#</a></p><div class="doc"><p>Modify the target(s) of a <code><a href="Control-Lens-Type.html#t:Lens-39-">Lens'</a></code>, <code><a href="Control-Lens-Type.html#t:Iso-39-">Iso'</a></code>, <code><a href="Control-Lens-Type.html#t:Setter-39-">Setter'</a></code> or <code><a href="Control-Lens-Type.html#t:Traversal-39-">Traversal'</a></code> by adding an extension.</p><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>execState (both <.>= "txt") ("hello","world")
</code></strong>("hello.txt","world.txt")
</pre><pre>(<code><a href="System-FilePath-Lens.html#v:-60-.-62--61-"><.>=</a></code>) :: <code><a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-State-Class.html#t:MonadState">MonadState</a></code> s m => <code><a href="Control-Lens-Type.html#t:Setter-39-">Setter'</a></code> s <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a></code> -> <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></code> -> m ()
(<code><a href="System-FilePath-Lens.html#v:-60-.-62--61-"><.>=</a></code>) :: <code><a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-State-Class.html#t:MonadState">MonadState</a></code> s m => <code><a href="Control-Lens-Type.html#t:Iso-39-">Iso'</a></code> s <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a></code> -> <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></code> -> m ()
(<code><a href="System-FilePath-Lens.html#v:-60-.-62--61-"><.>=</a></code>) :: <code><a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-State-Class.html#t:MonadState">MonadState</a></code> s m => <code><a href="Control-Lens-Type.html#t:Lens-39-">Lens'</a></code> s <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a></code> -> <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></code> -> m ()
(<code><a href="System-FilePath-Lens.html#v:-60-.-62--61-"><.>=</a></code>) :: <code><a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-State-Class.html#t:MonadState">MonadState</a></code> s m => <code><a href="Control-Lens-Type.html#t:Traversal-39-">Traversal'</a></code> s <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a></code> -> <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></code> -> m ()
</pre></div></div><div class="top"><p class="src"><a id="v:-60--60-.-62--61-" class="def">(<<.>=)</a> :: <a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-State-Class.html#t:MonadState">MonadState</a> s m => <a href="Control-Lens-Type.html#t:LensLike-39-">LensLike'</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/ghc-prim-0.5.0.0/GHC-Tuple.html#t:-40--44--41-">(,)</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a>) s <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -> m <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a> <span class="fixity">infix 4</span><span class="rightedge"></span> <a href="src/System-FilePath-Lens.html#%3C%3C.%3E%3D" class="link">Source</a> <a href="#v:-60--60-.-62--61-" class="selflink">#</a></p><div class="doc"><p>Add an extension onto the end of the target of a <code><a href="Control-Lens-Type.html#t:Lens">Lens</a></code> into
your monad's state and return the result.</p><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>evalState (_1 <<.>= "txt") ("hello","world")
</code></strong>"hello.txt"
</pre><p>When you do not need the result of the operation, (<code><a href="System-FilePath-Lens.html#v:-60-.-62--61-"><.>=</a></code>) is more flexible.</p></div></div><div class="top"><p class="src"><a id="v:-60--60--60-.-62--61-" class="def">(<<<.>=)</a> :: <a href="file:///usr/share/doc/libghc-mtl-doc/html/Control-Monad-State-Class.html#t:MonadState">MonadState</a> s m => <a href="Control-Lens-Type.html#t:LensLike-39-">LensLike'</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/ghc-prim-0.5.0.0/GHC-Tuple.html#t:-40--44--41-">(,)</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a>) s <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -> m <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a> <span class="fixity">infix 4</span><span class="rightedge"></span> <a href="src/System-FilePath-Lens.html#%3C%3C%3C.%3E%3D" class="link">Source</a> <a href="#v:-60--60--60-.-62--61-" class="selflink">#</a></p></div><h1 id="g:2">Lenses</h1><div class="top"><p class="src"><a id="v:basename" class="def">basename</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.1.0/System-IO.html#t:FilePath">FilePath</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a> <a href="src/System-FilePath-Lens.html#basename" class="link">Source</a> <a href="#v:basename" class="selflink">#</a></p><div class="doc"><p>A <code><a href="Control-Lens-Type.html#t:Lens">Lens</a></code> for reading and writing to the basename</p><p>Note: This is <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#v:not">not</a></code> a legal <code><a href="Control-Lens-Type.html#t:Lens">Lens</a></code> unless the outer <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a></code> has both a directory
and filename component and the generated basenames are not null and contain no directory
separators.</p><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>(basename .~ "filename" $ "path" </> "name.png") == "path" </> "filename.png"
</code></strong>True
</pre></div></div><div class="top"><p class="src"><a id="v:directory" class="def">directory</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.1.0/System-IO.html#t:FilePath">FilePath</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a> <a href="src/System-FilePath-Lens.html#directory" class="link">Source</a> <a href="#v:directory" class="selflink">#</a></p><div class="doc"><p>A <code><a href="Control-Lens-Type.html#t:Lens">Lens</a></code> for reading and writing to the directory</p><p>Note: this is <em>not</em> a legal <code><a href="Control-Lens-Type.html#t:Lens">Lens</a></code> unless the outer <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a></code> already has a directory component,
and generated directories are not null.</p><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>(("long" </> "path" </> "name.txt") ^. directory) == "long" </> "path"
</code></strong>True
</pre></div></div><div class="top"><p class="src"><a id="v:extension" class="def">extension</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.1.0/System-IO.html#t:FilePath">FilePath</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a> <a href="src/System-FilePath-Lens.html#extension" class="link">Source</a> <a href="#v:extension" class="selflink">#</a></p><div class="doc"><p>A <code><a href="Control-Lens-Type.html#t:Lens">Lens</a></code> for reading and writing to the extension</p><p>Note: This is <em>not</em> a legal <code><a href="Control-Lens-Type.html#t:Lens">Lens</a></code>, unless you are careful to ensure that generated
extension <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a></code> components are either null or start with <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/filepath-1.4.1.1/System-FilePath.html#v:extSeparator">extSeparator</a></code>
and do not contain any internal <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/filepath-1.4.1.1/System-FilePath.html#v:extSeparator">extSeparator</a></code>s.</p><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>(extension .~ ".png" $ "path" </> "name.txt") == "path" </> "name.png"
</code></strong>True
</pre></div></div><div class="top"><p class="src"><a id="v:filename" class="def">filename</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.1.0/System-IO.html#t:FilePath">FilePath</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a> <a href="src/System-FilePath-Lens.html#filename" class="link">Source</a> <a href="#v:filename" class="selflink">#</a></p><div class="doc"><p>A <code><a href="Control-Lens-Type.html#t:Lens">Lens</a></code> for reading and writing to the full filename</p><p>Note: This is <em>not</em> a legal <code><a href="Control-Lens-Type.html#t:Lens">Lens</a></code>, unless you are careful to ensure that generated
filename <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:FilePath">FilePath</a></code> components are not null and do not contain any
elements of <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/filepath-1.4.1.1/System-FilePath.html#v:pathSeparators">pathSeparators</a></code>s.</p><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>(filename .~ "name.txt" $ "path" </> "name.png") == "path" </> "name.txt"
</code></strong>True
</pre></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.17.3</p></div></body></html>
|