This file is indexed.

/usr/share/doc/libghc-missingh-doc/html/System-Path-NameManip.html is in libghc-missingh-doc 1.4.0.1-2build3.

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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<!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.Path.NameManip</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-Path-NameManip.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/System-Path-NameManip.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">MissingH-1.4.0.1: Large utility library</p></div><div id="content"><div id="module-header"><table class="info"><tr><th valign="top">Copyright</th><td>Copyright (C) 2004 Volker Wysk</td></tr><tr><th>License</th><td>BSD3</td></tr><tr><th>Maintainer</th><td>John Goerzen &lt;jgoerzen@complete.org&gt;</td></tr><tr><th>Stability</th><td>provisional</td></tr><tr><th>Portability</th><td>portable</td></tr><tr><th>Safe Haskell</th><td>Safe</td></tr><tr><th>Language</th><td>Haskell98</td></tr></table><p class="caption">System.Path.NameManip</p></div><div id="description"><p class="caption">Description</p><div class="doc"><p>Low-level path name manipulations.</p><p>Written by Volker Wysk</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:slice_path">slice_path</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -&gt; [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>]</li><li class="src short"><a href="#v:unslice_path">unslice_path</a> :: [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>] -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></li><li class="src short"><a href="#v:normalise_path">normalise_path</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></li><li class="src short"><a href="#v:slice_filename">slice_filename</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -&gt; [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>]</li><li class="src short"><a href="#v:slice_filename-39-">slice_filename'</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -&gt; [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>]</li><li class="src short"><a href="#v:unslice_filename">unslice_filename</a> :: [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>] -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></li><li class="src short"><a href="#v:split_path">split_path</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>)</li><li class="src short"><a href="#v:dir_part">dir_part</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></li><li class="src short"><a href="#v:filename_part">filename_part</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></li><li class="src short"><a href="#v:unsplit_path">unsplit_path</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>) -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></li><li class="src short"><a href="#v:split_filename">split_filename</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>)</li><li class="src short"><a href="#v:split_filename-39-">split_filename'</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>)</li><li class="src short"><a href="#v:unsplit_filename">unsplit_filename</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>) -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></li><li class="src short"><a href="#v:split3">split3</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>)</li><li class="src short"><a href="#v:unsplit3">unsplit3</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>) -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></li><li class="src short"><a href="#v:test_suffix">test_suffix</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></li><li class="src short"><a href="#v:absolute_path">absolute_path</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></li><li class="src short"><a href="#v:absolute_path_by">absolute_path_by</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></li><li class="src short"><a href="#v:absolute_path-39-">absolute_path'</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></li><li class="src short"><a href="#v:guess_dotdot_comps">guess_dotdot_comps</a> :: [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>] -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</a> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>]</li><li class="src short"><a href="#v:guess_dotdot">guess_dotdot</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></li></ul></div><div id="interface"><h1>Documentation</h1><div class="top"><p class="src"><a id="v:slice_path" class="def">slice_path</a> <a href="src/System-Path-NameManip.html#slice_path" class="link">Source</a> <a href="#v:slice_path" class="selflink">#</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></td><td class="doc"><p>The path to be broken to components.</p></td></tr><tr><td class="src">-&gt; [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>]</td><td class="doc"><p>List of path components.</p></td></tr></table></div><div class="doc"><p>Split a path in components. Repeated &quot;<code>/</code>&quot; characters don't lead to empty
components. &quot;<code>.</code>&quot; path components are removed. If the path is absolute, the first component
will start with &quot;<code>/</code>&quot;. &quot;<code>..</code>&quot; components are left intact. They can't be simply
removed, because the preceding component might be a symlink. In this case,
<code>realpath</code> is probably what you need.</p><p>The case that the path is empty, is probably an error. However, it is
treated like &quot;<code>.</code>&quot;, yielding an empty path components list.</p><p>Examples:</p><pre>slice_path &quot;/&quot;        = [&quot;/&quot;]
slice_path &quot;/foo/bar&quot; = [&quot;/foo&quot;,&quot;bar&quot;]
slice_path &quot;..//./&quot;   = [&quot;..&quot;]
slice_path &quot;.&quot;        = []</pre><p>See <code><a href="System-Path-NameManip.html#v:unslice_path">unslice_path</a></code>, <code>realpath</code>, <code>realpath_s</code>.</p></div></div><div class="top"><p class="src"><a id="v:unslice_path" class="def">unslice_path</a> <a href="src/System-Path-NameManip.html#unslice_path" class="link">Source</a> <a href="#v:unslice_path" class="selflink">#</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>]</td><td class="doc"><p>List of path components</p></td></tr><tr><td class="src">-&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></td><td class="doc"><p>The path which consists of the supplied path components</p></td></tr></table></div><div class="doc"><p>Form a path from path components. This isn't the inverse
of <code><a href="System-Path-NameManip.html#v:slice_path">slice_path</a></code>, since <code><code><a href="System-Path-NameManip.html#v:unslice_path">unslice_path</a></code> . <code><a href="System-Path-NameManip.html#v:slice_path">slice_path</a></code></code>
normalises the path.</p><p>See <code><a href="System-Path-NameManip.html#v:slice_path">slice_path</a></code>.</p></div></div><div class="top"><p class="src"><a id="v:normalise_path" class="def">normalise_path</a> <a href="src/System-Path-NameManip.html#normalise_path" class="link">Source</a> <a href="#v:normalise_path" class="selflink">#</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></td><td class="doc"><p>Path to be normalised</p></td></tr><tr><td class="src">-&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></td><td class="doc"><p>Path in normalised form</p></td></tr></table></div><div class="doc"><p>Normalise a path. This is done by reducing repeated <code>/</code> characters to one, and removing
<code>.</code> path components. <code>..</code> path components are left intact, because of possible symlinks.</p><pre><code><a href="System-Path-NameManip.html#v:normalise_path">normalise_path</a></code> = <code><a href="System-Path-NameManip.html#v:unslice_path">unslice_path</a></code> . <code><a href="System-Path-NameManip.html#v:slice_path">slice_path</a></code></pre></div></div><div class="top"><p class="src"><a id="v:slice_filename" class="def">slice_filename</a> <a href="src/System-Path-NameManip.html#slice_filename" class="link">Source</a> <a href="#v:slice_filename" class="selflink">#</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></td><td class="doc"><p>Path</p></td></tr><tr><td class="src">-&gt; [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>]</td><td class="doc"><p>List of components the file name is made up of</p></td></tr></table></div><div class="doc"><p>Split a file name in components. This are the base file name and the
suffixes, which are separated by dots. If the name starts with a dot, it is
regarded as part of the base name. The result is a list of file name
components. The filename may be a path. In this case, everything up to the
last path component will be returned as part of the base file name. The
path gets normalised thereby.</p><p>No empty suffixes are returned. If the file name contains several
consecutive dots, they are regared as part of the preceding file name
component.</p><p>Concateneting the name components and adding dots, reproduces the
original name, with a normalised path:
<code>concat . intersperse &quot;.&quot; . <code><a href="System-Path-NameManip.html#v:slice_filename">slice_filename</a></code> == <code>normalise</code></code>.</p><p>Note that the last path component might be &quot;<code>..</code>&quot;. Then it is not
possible to deduce the refered directory's name from the path. An IO
action for getting the real path is then necessary.</p><p>Examples:</p><pre><code><a href="System-Path-NameManip.html#v:slice_filename">slice_filename</a></code> &quot;a.b//./.foo.tar.gz&quot; == [&quot;a.b/.foo&quot;,&quot;tar&quot;,&quot;gz&quot;]
<code><a href="System-Path-NameManip.html#v:slice_filename">slice_filename</a></code> &quot;.x..y.&quot;             == [&quot;.x.&quot;, &quot;y.&quot;]
</pre><p>See <code><a href="System-Path-NameManip.html#v:unslice_filename">unslice_filename</a></code>, <code>slice_filename'</code>.</p></div></div><div class="top"><p class="src"><a id="v:slice_filename-39-" class="def">slice_filename'</a> <a href="src/System-Path-NameManip.html#slice_filename%27" class="link">Source</a> <a href="#v:slice_filename-39-" class="selflink">#</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></td><td class="doc"><p>File name without path</p></td></tr><tr><td class="src">-&gt; [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>]</td><td class="doc"><p>List of components the file name is made up of</p></td></tr></table></div><div class="doc"><p>This is a variant of <code><a href="System-Path-NameManip.html#v:slice_filename">slice_filename</a></code>. It is like <code><a href="System-Path-NameManip.html#v:slice_filename">slice_filename</a></code>, except for
being more efficient, and the filename must not contain any preceding path,
since this case isn't considered.</p><p>See <code><a href="System-Path-NameManip.html#v:slice_filename">slice_filename</a></code>, <code><a href="System-Path-NameManip.html#v:unslice_filename">unslice_filename</a></code>.</p></div></div><div class="top"><p class="src"><a id="v:unslice_filename" class="def">unslice_filename</a> <a href="src/System-Path-NameManip.html#unslice_filename" class="link">Source</a> <a href="#v:unslice_filename" class="selflink">#</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>]</td><td class="doc"><p>List of file name components</p></td></tr><tr><td class="src">-&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></td><td class="doc"><p>Name of the file which consists of the supplied components</p></td></tr></table></div><div class="doc"><p>Form file name from file name components, interspersing dots. This is
the inverse of <code><a href="System-Path-NameManip.html#v:slice_filename">slice_filename</a></code>, except for normalisation of any path.</p><pre>unslice_filename = concat . intersperse &quot;.&quot;</pre><p>See <code><a href="System-Path-NameManip.html#v:slice_filename">slice_filename</a></code>.</p></div></div><div class="top"><p class="src"><a id="v:split_path" class="def">split_path</a> <a href="src/System-Path-NameManip.html#split_path" class="link">Source</a> <a href="#v:split_path" class="selflink">#</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></td><td class="doc"><p>Path to be split</p></td></tr><tr><td class="src">-&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>)</td><td class="doc"><p>Directory and file name components of the path. The directory path is normalized.</p></td></tr></table></div><div class="doc"><p>Split a path in directory and file name. Only in the case that the
supplied path is empty, both parts are empty strings. Otherwise, <code>&quot;.&quot;</code> is filled in
for the corresponding part, if necessary. Unless the path is empty,
concatenating the returned path and file name components with a slash in
between, makes a valid path to the file.</p><p><code>split_path</code> splits off the last path component. This
isn't the same as the text after the last <code>/</code>.</p><p>Note that the last path component might be <code>&quot;..&quot;</code>. Then it is not
possible to deduce the refered directory's name from the path. Then an IO
action for getting the real path is necessary.</p><p>Examples:</p><pre>split_path &quot;/a/b/c&quot;      == (&quot;/a/b&quot;, &quot;c&quot;)
split_path &quot;foo&quot;         == (&quot;.&quot;, &quot;foo&quot;)
split_path &quot;foo/bar&quot;     == (&quot;foo&quot;, &quot;bar&quot;)
split_path &quot;foo/..&quot;      == (&quot;foo&quot;, &quot;..&quot;)
split_path &quot;.&quot;           == (&quot;.&quot;, &quot;.&quot;)
split_path &quot;&quot;            == (&quot;&quot;, &quot;&quot;)
split_path &quot;/foo&quot;        == (&quot;/&quot;, &quot;foo&quot;)
split_path &quot;foo/&quot;        == (&quot;.&quot;, &quot;foo&quot;)
split_path &quot;foo/.&quot;       == (&quot;.&quot;, &quot;foo&quot;)
split_path &quot;foo///./bar&quot; == (&quot;foo&quot;, &quot;bar&quot;)</pre><p>See <code><a href="System-Path-NameManip.html#v:slice_path">slice_path</a></code>.</p></div></div><div class="top"><p class="src"><a id="v:dir_part" class="def">dir_part</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> <a href="src/System-Path-NameManip.html#dir_part" class="link">Source</a> <a href="#v:dir_part" class="selflink">#</a></p><div class="doc"><p>Get the directory part of a path.</p><pre>dir_part = fst . split_path</pre><p>See <code><a href="System-Path-NameManip.html#v:split_path">split_path</a></code>.</p></div></div><div class="top"><p class="src"><a id="v:filename_part" class="def">filename_part</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> <a href="src/System-Path-NameManip.html#filename_part" class="link">Source</a> <a href="#v:filename_part" class="selflink">#</a></p><div class="doc"><p>Get the last path component of a path.</p><pre>filename_part = snd . split_path</pre><p>Examples:</p><pre>filename_part &quot;foo/bar&quot; == &quot;bar&quot;
filename_part &quot;.&quot;       == &quot;.&quot;</pre><p>See <code><a href="System-Path-NameManip.html#v:split_path">split_path</a></code>.</p></div></div><div class="top"><p class="src"><a id="v:unsplit_path" class="def">unsplit_path</a> <a href="src/System-Path-NameManip.html#unsplit_path" class="link">Source</a> <a href="#v:unsplit_path" class="selflink">#</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>)</td><td class="doc"><p>Directory and file name</p></td></tr><tr><td class="src">-&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></td><td class="doc"><p>Path formed from the directory and file name parts</p></td></tr></table></div><div class="doc"><p>Inverse of <code><a href="System-Path-NameManip.html#v:split_path">split_path</a></code>, except for normalisation.</p><p>This concatenates two paths, and takes care of <code>&quot;.&quot;</code> and empty paths. When the two components are the result of <code>split_path</code>, then <code>unsplit_path</code>
creates a normalised path. It is best documented by its definition:</p><pre>unsplit_path (&quot;.&quot;, &quot;&quot;) = &quot;.&quot;
unsplit_path (&quot;&quot;, &quot;.&quot;) = &quot;.&quot;
unsplit_path (&quot;.&quot;, q)  = q
unsplit_path (&quot;&quot;, q)   = q
unsplit_path (p, &quot;&quot;)   = p
unsplit_path (p, &quot;.&quot;)  = p
unsplit_path (p, q)    = p ++ &quot;/&quot; ++ q</pre><p>Examples:</p><pre>unsplit_path (&quot;&quot;, &quot;&quot;)     == &quot;&quot;
unsplit_path (&quot;.&quot;, &quot;&quot;)    == &quot;.&quot;
unsplit_path (&quot;.&quot;, &quot;.&quot;)   == &quot;.&quot;
unsplit_path (&quot;foo&quot;, &quot;.&quot;) == &quot;foo&quot;</pre><p>See <code><a href="System-Path-NameManip.html#v:split_path">split_path</a></code>.</p></div></div><div class="top"><p class="src"><a id="v:split_filename" class="def">split_filename</a> <a href="src/System-Path-NameManip.html#split_filename" class="link">Source</a> <a href="#v:split_filename" class="selflink">#</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></td><td class="doc"><p>Path including the file name to be split</p></td></tr><tr><td class="src">-&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>)</td><td class="doc"><p>The normalised path with the file prefix, and the file suffix.</p></td></tr></table></div><div class="doc"><p>Split a file name in prefix and suffix. If there isn't any suffix in
the file name, then return an empty suffix. A dot at the beginning or at
the end is not regarded as introducing a suffix.</p><p>The last path component is what is being split. This isn't the same as
splitting the string at the last dot. For instance, if the file name
doesn't contain any dot, dots in previous path component's aren't mistaken
as introducing suffixes.</p><p>The path part is returned in normalised form. This means, <code>&quot;.&quot;</code> components
are removed, and multiple &quot;<code>/</code>&quot;s are reduced to one.</p><p>Note that there isn't any plausibility check performed on the suffix. If the file name doesn't have a suffix, but happens to contain a dot, then this
dot is mistaken as introducing a suffix.</p><p>Examples:</p><pre>split_filename &quot;path/to/foo.bar&quot;                             = (&quot;path/to/foo&quot;,&quot;bar&quot;)
split_filename &quot;path/to/foo&quot;                                 = (&quot;path/to/foo&quot;,&quot;&quot;)
split_filename &quot;/path.to/foo&quot;                                = (&quot;/path.to/foo&quot;,&quot;&quot;)
split_filename &quot;a///./x&quot;                                     = (&quot;a/x&quot;,&quot;&quot;)
split_filename &quot;dir.suffix/./&quot;                               = (&quot;dir&quot;,&quot;suffix&quot;)
split_filename &quot;Photographie, Das 20. Jahrhundert (300 dpi)&quot; = (&quot;Photographie, Das 20&quot;, &quot; Jahrhundert (300 dpi)&quot;)</pre><p>See <code><a href="System-Path-NameManip.html#v:slice_path">slice_path</a></code>, 'split_filename\''</p></div></div><div class="top"><p class="src"><a id="v:split_filename-39-" class="def">split_filename'</a> <a href="src/System-Path-NameManip.html#split_filename%27" class="link">Source</a> <a href="#v:split_filename-39-" class="selflink">#</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></td><td class="doc"><p>Filename to be split</p></td></tr><tr><td class="src">-&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>)</td><td class="doc"><p>Base name and the last suffix</p></td></tr></table></div><div class="doc"><p>Variant of <code><a href="System-Path-NameManip.html#v:split_filename">split_filename</a></code>. This is a more efficient version
of <code><a href="System-Path-NameManip.html#v:split_filename">split_filename</a></code>, for the case that you know the string is
is a pure file name without any slashes.</p><p>See <code><a href="System-Path-NameManip.html#v:split_filename">split_filename</a></code>.</p></div></div><div class="top"><p class="src"><a id="v:unsplit_filename" class="def">unsplit_filename</a> <a href="src/System-Path-NameManip.html#unsplit_filename" class="link">Source</a> <a href="#v:unsplit_filename" class="selflink">#</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>)</td><td class="doc"><p>File name prefix and suffix</p></td></tr><tr><td class="src">-&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></td><td class="doc"><p>Path</p></td></tr></table></div><div class="doc"><p>Inverse of <code><a href="System-Path-NameManip.html#v:split_filename">split_filename</a></code>. Concatenate prefix and suffix, adding
a dot in between, iff the suffix is not empty. The path part of the prefix is
normalised.</p><p>See <code><a href="System-Path-NameManip.html#v:split_filename">split_filename</a></code>.</p></div></div><div class="top"><p class="src"><a id="v:split3" class="def">split3</a> <a href="src/System-Path-NameManip.html#split3" class="link">Source</a> <a href="#v:split3" class="selflink">#</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></td><td class="doc"><p>Path to split</p></td></tr><tr><td class="src">-&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>)</td><td class="doc"><p>Directory part, base file name part and suffix part</p></td></tr></table></div><div class="doc"><p>Split a path in directory, base file name and suffix.</p></div></div><div class="top"><p class="src"><a id="v:unsplit3" class="def">unsplit3</a> <a href="src/System-Path-NameManip.html#unsplit3" class="link">Source</a> <a href="#v:unsplit3" class="selflink">#</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>)</td><td class="doc"><p>Directory part, base file name part and suffix part</p></td></tr><tr><td class="src">-&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></td><td class="doc"><p>Path consisting of dir, base and suffix</p></td></tr></table></div><div class="doc"><p>Form path from directory, base file name and suffix parts.</p></div></div><div class="top"><p class="src"><a id="v:test_suffix" class="def">test_suffix</a> <a href="src/System-Path-NameManip.html#test_suffix" class="link">Source</a> <a href="#v:test_suffix" class="selflink">#</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></td><td class="doc"><p>Suffix to split off</p></td></tr><tr><td class="src">-&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></td><td class="doc"><p>Path to test</p></td></tr><tr><td class="src">-&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></td><td class="doc"><p>Prefix without the suffix or <code>Nothing</code></p></td></tr></table></div><div class="doc"><p>Test a path for a specific suffix and split it off.</p><p>If the path ends with the suffix, then the result is <code>Just
prefix</code>, where <code>prefix</code> is the normalised path
without the suffix. Otherwise it's <code>Nothing</code>.</p></div></div><div class="top"><p class="src"><a id="v:absolute_path" class="def">absolute_path</a> <a href="src/System-Path-NameManip.html#absolute_path" class="link">Source</a> <a href="#v:absolute_path" class="selflink">#</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></td><td class="doc"><p>The path to be made absolute</p></td></tr><tr><td class="src">-&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></td><td class="doc"><p>Absulte path</p></td></tr></table></div><div class="doc"><p>Make a path absolute, using the current working directory.</p><p>This makes a relative path absolute with respect to the current
working directory. An absolute path is returned unmodified.</p><p>The current working directory is determined with <code>getCurrentDirectory</code>
which means that symbolic links in it are expanded and the path is
normalised. This is different from <code>pwd</code>.</p></div></div><div class="top"><p class="src"><a id="v:absolute_path_by" class="def">absolute_path_by</a> <a href="src/System-Path-NameManip.html#absolute_path_by" class="link">Source</a> <a href="#v:absolute_path_by" class="selflink">#</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></td><td class="doc"><p>The directory relative to which the path is made absolute</p></td></tr><tr><td class="src">-&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></td><td class="doc"><p>The path to be made absolute</p></td></tr><tr><td class="src">-&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></td><td class="doc"><p>Absolute path</p></td></tr></table></div><div class="doc"><p>Make a path absolute.</p><p>This makes a relative path absolute with respect to a specified
directory. An absolute path is returned unmodified.</p></div></div><div class="top"><p class="src"><a id="v:absolute_path-39-" class="def">absolute_path'</a> <a href="src/System-Path-NameManip.html#absolute_path%27" class="link">Source</a> <a href="#v:absolute_path-39-" class="selflink">#</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></td><td class="doc"><p>The path to be made absolute</p></td></tr><tr><td class="src">-&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></td><td class="doc"><p>The directory relative to which the path is made absolute</p></td></tr><tr><td class="src">-&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></td><td class="doc"><p>Absolute path</p></td></tr></table></div><div class="doc"><p>Make a path absolute.</p><p>This makes a relative path absolute with respect to a specified
directory. An absolute path is returned unmodified.</p><p>The order of the arguments can be confusing. You should rather use <code><a href="System-Path-NameManip.html#v:absolute_path_by">absolute_path_by</a></code>. <code>absolute_path'</code> is included for backwards compatibility.</p></div></div><div class="top"><p class="src"><a id="v:guess_dotdot_comps" class="def">guess_dotdot_comps</a> <a href="src/System-Path-NameManip.html#guess_dotdot_comps" class="link">Source</a> <a href="#v:guess_dotdot_comps" class="selflink">#</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>]</td><td class="doc"><p>List of path components</p></td></tr><tr><td class="src">-&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</a> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a>]</td><td class="doc"><p>In case the path could be transformed, the <code>&quot;..&quot;</code>-component free list of path components.</p></td></tr></table></div><div class="doc"><p>Guess the <code>&quot;..&quot;</code>-component free form of a path, specified as a list of path components, by syntactically removing them, along with the preceding
   path components. This will produce
   erroneous results when the path contains symlinks. If the path contains leading <code>&quot;..&quot;</code> components, or more <code>&quot;..&quot;</code> components than preceeding normal
   components, then the <code>&quot;..&quot;</code> components can't be normalised away. In this case, the result is <code>Nothing</code>.</p></div></div><div class="top"><p class="src"><a id="v:guess_dotdot" class="def">guess_dotdot</a> <a href="src/System-Path-NameManip.html#guess_dotdot" class="link">Source</a> <a href="#v:guess_dotdot" class="selflink">#</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></td><td class="doc"><p>Path to be normalised</p></td></tr><tr><td class="src">-&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a></td><td class="doc"><p>In case the path could be transformed, the normalised, <code>&quot;..&quot;</code>-component free form of the path.</p></td></tr></table></div><div class="doc"><p>Guess the <code>&quot;..&quot;</code>-component free, normalised form of a path. The transformation is purely syntactic. <code>&quot;..&quot;</code> path components will be removed, along
   with their preceding path components. This will produce
   erroneous results when the path contains symlinks. If the path contains leading <code>&quot;..&quot;</code> components, or more <code>&quot;..&quot;</code> components than preceeding normal
   components, then the <code>&quot;..&quot;</code> components can't be normalised away. In this case, the result is <code>Nothing</code>.</p><pre>guess_dotdot = fmap unslice_path . guess_dotdot_comps . slice_path</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>