This file is indexed.

/usr/share/doc/libghc-hakyll-doc/html/Hakyll-Core-Identifier-Pattern.html is in libghc-hakyll-doc 4.4.3.0-1build1.

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
<!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>Hakyll.Core.Identifier.Pattern</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_Hakyll-Core-Identifier-Pattern.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Hakyll-Core-Identifier-Pattern.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">hakyll-4.4.3.0: A static website compiler library</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Safe Haskell</th><td>None</td></tr></table><p class="caption">Hakyll.Core.Identifier.Pattern</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">The pattern type
</a></li><li><a href="#g:2">Creating patterns
</a></li><li><a href="#g:3">Composing patterns
</a></li><li><a href="#g:4">Applying patterns
</a></li><li><a href="#g:5">Capturing strings
</a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>As <code><a href="Hakyll-Core-Identifier.html#t:Identifier">Identifier</a></code> is used to specify a single item, a <code><a href="Hakyll-Core-Identifier-Pattern.html#t:Pattern">Pattern</a></code> is used to
 specify a list of items.
</p><p>In most cases, globs are used for patterns.
</p><p>A very simple pattern of such a pattern is <code>&quot;foo/bar&quot;</code>. This pattern will
 only match the exact <code>foo/bar</code> identifier.
</p><p>To match more than one identifier, there are different captures that one can
 use:
</p><ul><li> <code>&quot;*&quot;</code>: matches at most one element of an identifier;
</li><li> <code>&quot;**&quot;</code>: matches one or more elements of an identifier.
</li></ul><p>Some examples:
</p><ul><li> <code>&quot;foo/*&quot;</code> will match <code>&quot;foo/bar&quot;</code> and <code>&quot;foo/foo&quot;</code>, but not
   <code>&quot;foo/bar/qux&quot;</code>;
</li><li> <code>&quot;**&quot;</code> will match any identifier;
</li><li> <code>&quot;foo/**&quot;</code> will match <code>&quot;foo/bar&quot;</code> and <code>&quot;foo/bar/qux&quot;</code>, but not
   <code>&quot;bar/foo&quot;</code>;
</li><li> <code>&quot;foo/*.html&quot;</code> will match all HTML files in the <code>&quot;foo/&quot;</code> directory.
</li></ul><p>The <code><a href="Hakyll-Core-Identifier-Pattern.html#v:capture">capture</a></code> function allows the user to get access to the elements captured
 by the capture elements in the pattern.
</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"><span class="keyword">data</span>  <a href="#t:Pattern">Pattern</a> </li><li class="src short"><a href="#v:fromGlob">fromGlob</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a> -&gt; <a href="Hakyll-Core-Identifier-Pattern.html#t:Pattern">Pattern</a></li><li class="src short"><a href="#v:fromList">fromList</a> :: [<a href="Hakyll-Core-Identifier.html#t:Identifier">Identifier</a>] -&gt; <a href="Hakyll-Core-Identifier-Pattern.html#t:Pattern">Pattern</a></li><li class="src short"><a href="#v:fromRegex">fromRegex</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a> -&gt; <a href="Hakyll-Core-Identifier-Pattern.html#t:Pattern">Pattern</a></li><li class="src short"><a href="#v:fromVersion">fromVersion</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a> -&gt; <a href="Hakyll-Core-Identifier-Pattern.html#t:Pattern">Pattern</a></li><li class="src short"><a href="#v:hasVersion">hasVersion</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a> -&gt; <a href="Hakyll-Core-Identifier-Pattern.html#t:Pattern">Pattern</a></li><li class="src short"><a href="#v:hasNoVersion">hasNoVersion</a> :: <a href="Hakyll-Core-Identifier-Pattern.html#t:Pattern">Pattern</a></li><li class="src short"><a href="#v:.-38--38-.">(.&amp;&amp;.)</a> :: <a href="Hakyll-Core-Identifier-Pattern.html#t:Pattern">Pattern</a> -&gt; <a href="Hakyll-Core-Identifier-Pattern.html#t:Pattern">Pattern</a> -&gt; <a href="Hakyll-Core-Identifier-Pattern.html#t:Pattern">Pattern</a></li><li class="src short"><a href="#v:.-124--124-.">(.||.)</a> :: <a href="Hakyll-Core-Identifier-Pattern.html#t:Pattern">Pattern</a> -&gt; <a href="Hakyll-Core-Identifier-Pattern.html#t:Pattern">Pattern</a> -&gt; <a href="Hakyll-Core-Identifier-Pattern.html#t:Pattern">Pattern</a></li><li class="src short"><a href="#v:complement">complement</a> :: <a href="Hakyll-Core-Identifier-Pattern.html#t:Pattern">Pattern</a> -&gt; <a href="Hakyll-Core-Identifier-Pattern.html#t:Pattern">Pattern</a></li><li class="src short"><a href="#v:matches">matches</a> :: <a href="Hakyll-Core-Identifier-Pattern.html#t:Pattern">Pattern</a> -&gt; <a href="Hakyll-Core-Identifier.html#t:Identifier">Identifier</a> -&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:filterMatches">filterMatches</a> :: <a href="Hakyll-Core-Identifier-Pattern.html#t:Pattern">Pattern</a> -&gt; [<a href="Hakyll-Core-Identifier.html#t:Identifier">Identifier</a>] -&gt; [<a href="Hakyll-Core-Identifier.html#t:Identifier">Identifier</a>]</li><li class="src short"><a href="#v:capture">capture</a> :: <a href="Hakyll-Core-Identifier-Pattern.html#t:Pattern">Pattern</a> -&gt; <a href="Hakyll-Core-Identifier.html#t:Identifier">Identifier</a> -&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> [<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a>]</li><li class="src short"><a href="#v:fromCapture">fromCapture</a> :: <a href="Hakyll-Core-Identifier-Pattern.html#t:Pattern">Pattern</a> -&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a> -&gt; <a href="Hakyll-Core-Identifier.html#t:Identifier">Identifier</a></li><li class="src short"><a href="#v:fromCaptures">fromCaptures</a> :: <a href="Hakyll-Core-Identifier-Pattern.html#t:Pattern">Pattern</a> -&gt; [<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a>] -&gt; <a href="Hakyll-Core-Identifier.html#t:Identifier">Identifier</a></li></ul></div><div id="interface"><h1 id="g:1">The pattern type
</h1><div class="top"><p class="src"><span class="keyword">data</span>  <a name="t:Pattern" class="def">Pattern</a>  <a href="src/Hakyll-Core-Identifier-Pattern.html#Pattern" class="link">Source</a></p><div class="doc"><p>Type that allows matching on identifiers
</p></div><div class="subs instances"><p id="control.i:Pattern" class="caption collapser" onclick="toggleSection('i:Pattern')">Instances</p><div id="section.i:Pattern" class="show"><table><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Text-Show.html#t:Show">Show</a> <a href="Hakyll-Core-Identifier-Pattern.html#t:Pattern">Pattern</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:IsString">IsString</a> <a href="Hakyll-Core-Identifier-Pattern.html#t:Pattern">Pattern</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Monoid.html#t:Monoid">Monoid</a> <a href="Hakyll-Core-Identifier-Pattern.html#t:Pattern">Pattern</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/binary-0.5.1.1/Data-Binary.html#t:Binary">Binary</a> <a href="Hakyll-Core-Identifier-Pattern.html#t:Pattern">Pattern</a></td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><h1 id="g:2">Creating patterns
</h1><div class="top"><p class="src"><a name="v:fromGlob" class="def">fromGlob</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a> -&gt; <a href="Hakyll-Core-Identifier-Pattern.html#t:Pattern">Pattern</a><a href="src/Hakyll-Core-Identifier-Pattern.html#fromGlob" class="link">Source</a></p><div class="doc"><p>Parse a pattern from a string
</p></div></div><div class="top"><p class="src"><a name="v:fromList" class="def">fromList</a> :: [<a href="Hakyll-Core-Identifier.html#t:Identifier">Identifier</a>] -&gt; <a href="Hakyll-Core-Identifier-Pattern.html#t:Pattern">Pattern</a><a href="src/Hakyll-Core-Identifier-Pattern.html#fromList" class="link">Source</a></p><div class="doc"><p>Create a <code><a href="Hakyll-Core-Identifier-Pattern.html#t:Pattern">Pattern</a></code> from a list of <code><a href="Hakyll-Core-Identifier.html#t:Identifier">Identifier</a></code>s it should match.
</p><p><em>Warning</em>: use this carefully with <code><a href="Hakyll-Core-Identifier-Pattern.html#v:hasNoVersion">hasNoVersion</a></code> and <code><a href="Hakyll-Core-Identifier-Pattern.html#v:hasVersion">hasVersion</a></code>. The
 <code><a href="Hakyll-Core-Identifier.html#t:Identifier">Identifier</a></code>s in the list <em>already</em> have versions assigned, and the pattern
 will then only match the intersection of both versions.
</p><p>A more concrete example,
</p><pre> fromList [&quot;foo.markdown&quot;] .&amp;&amp;. hasVersion &quot;pdf&quot;
</pre><p>will not match anything! The <code><a href="foo-markdown.html">foo.markdown</a></code> <code><a href="Hakyll-Core-Identifier.html#t:Identifier">Identifier</a></code> has no version
 assigned, so the LHS of <code><a href="Hakyll-Core-Identifier-Pattern.html#v:.-38--38-.">.&amp;&amp;.</a></code> will only match this <code><a href="Hakyll-Core-Identifier.html#t:Identifier">Identifier</a></code> with no
 version. The RHS only matches <code><a href="Hakyll-Core-Identifier.html#t:Identifier">Identifier</a></code>s with version set to <code><a href="pdf.html">pdf</a></code> --
 hence, this pattern matches nothing.
</p><p>The correct way to use this is:
</p><pre> fromList $ map (setVersion $ Just &quot;pdf&quot;) [&quot;foo.markdown&quot;]
</pre></div></div><div class="top"><p class="src"><a name="v:fromRegex" class="def">fromRegex</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a> -&gt; <a href="Hakyll-Core-Identifier-Pattern.html#t:Pattern">Pattern</a><a href="src/Hakyll-Core-Identifier-Pattern.html#fromRegex" class="link">Source</a></p><div class="doc"><p>Create a <code><a href="Hakyll-Core-Identifier-Pattern.html#t:Pattern">Pattern</a></code> from a regex
</p><p>Example:
</p><pre> regex &quot;^foo/[^x]*$
</pre></div></div><div class="top"><p class="src"><a name="v:fromVersion" class="def">fromVersion</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a> -&gt; <a href="Hakyll-Core-Identifier-Pattern.html#t:Pattern">Pattern</a><a href="src/Hakyll-Core-Identifier-Pattern.html#fromVersion" class="link">Source</a></p><div class="doc"><p>Create a pattern which matches all items with the given version.
</p></div></div><div class="top"><p class="src"><a name="v:hasVersion" class="def">hasVersion</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a> -&gt; <a href="Hakyll-Core-Identifier-Pattern.html#t:Pattern">Pattern</a><a href="src/Hakyll-Core-Identifier-Pattern.html#hasVersion" class="link">Source</a></p><div class="doc"><p>Specify a version, e.g.
</p><pre> &quot;foo/*.markdown&quot; .&amp;&amp;. hasVersion &quot;pdf&quot;
</pre></div></div><div class="top"><p class="src"><a name="v:hasNoVersion" class="def">hasNoVersion</a> :: <a href="Hakyll-Core-Identifier-Pattern.html#t:Pattern">Pattern</a><a href="src/Hakyll-Core-Identifier-Pattern.html#hasNoVersion" class="link">Source</a></p><div class="doc"><p>Match only if the identifier has no version set, e.g.
</p><pre> &quot;foo/*.markdown&quot; .&amp;&amp;. hasNoVersion
</pre></div></div><h1 id="g:3">Composing patterns
</h1><div class="top"><p class="src"><a name="v:.-38--38-." class="def">(.&amp;&amp;.)</a> :: <a href="Hakyll-Core-Identifier-Pattern.html#t:Pattern">Pattern</a> -&gt; <a href="Hakyll-Core-Identifier-Pattern.html#t:Pattern">Pattern</a> -&gt; <a href="Hakyll-Core-Identifier-Pattern.html#t:Pattern">Pattern</a><a href="src/Hakyll-Core-Identifier-Pattern.html#.%26%26." class="link">Source</a></p><div class="doc"><p><code><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Bool.html#v:-38--38-">&amp;&amp;</a></code> for patterns: the given identifier must match both subterms
</p></div></div><div class="top"><p class="src"><a name="v:.-124--124-." class="def">(.||.)</a> :: <a href="Hakyll-Core-Identifier-Pattern.html#t:Pattern">Pattern</a> -&gt; <a href="Hakyll-Core-Identifier-Pattern.html#t:Pattern">Pattern</a> -&gt; <a href="Hakyll-Core-Identifier-Pattern.html#t:Pattern">Pattern</a><a href="src/Hakyll-Core-Identifier-Pattern.html#.%7C%7C." class="link">Source</a></p><div class="doc"><p><code><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Bool.html#v:-124--124-">||</a></code> for patterns: the given identifier must match any subterm
</p></div></div><div class="top"><p class="src"><a name="v:complement" class="def">complement</a> :: <a href="Hakyll-Core-Identifier-Pattern.html#t:Pattern">Pattern</a> -&gt; <a href="Hakyll-Core-Identifier-Pattern.html#t:Pattern">Pattern</a><a href="src/Hakyll-Core-Identifier-Pattern.html#complement" class="link">Source</a></p><div class="doc"><p>Inverts a pattern, e.g.
</p><pre> complement &quot;foo/bar.html&quot;
</pre><p>will match <em>anything</em> except <code>&quot;foo/bar.html&quot;</code>
</p></div></div><h1 id="g:4">Applying patterns
</h1><div class="top"><p class="src"><a name="v:matches" class="def">matches</a> :: <a href="Hakyll-Core-Identifier-Pattern.html#t:Pattern">Pattern</a> -&gt; <a href="Hakyll-Core-Identifier.html#t:Identifier">Identifier</a> -&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Bool.html#t:Bool">Bool</a><a href="src/Hakyll-Core-Identifier-Pattern.html#matches" class="link">Source</a></p><div class="doc"><p>Check if an identifier matches a pattern
</p></div></div><div class="top"><p class="src"><a name="v:filterMatches" class="def">filterMatches</a> :: <a href="Hakyll-Core-Identifier-Pattern.html#t:Pattern">Pattern</a> -&gt; [<a href="Hakyll-Core-Identifier.html#t:Identifier">Identifier</a>] -&gt; [<a href="Hakyll-Core-Identifier.html#t:Identifier">Identifier</a>]<a href="src/Hakyll-Core-Identifier-Pattern.html#filterMatches" class="link">Source</a></p><div class="doc"><p>Given a list of identifiers, retain only those who match the given pattern
</p></div></div><h1 id="g:5">Capturing strings
</h1><div class="top"><p class="src"><a name="v:capture" class="def">capture</a> :: <a href="Hakyll-Core-Identifier-Pattern.html#t:Pattern">Pattern</a> -&gt; <a href="Hakyll-Core-Identifier.html#t:Identifier">Identifier</a> -&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> [<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a>]<a href="src/Hakyll-Core-Identifier-Pattern.html#capture" class="link">Source</a></p><div class="doc"><p>Match a glob against a pattern, generating a list of captures
</p></div></div><div class="top"><p class="src"><a name="v:fromCapture" class="def">fromCapture</a> :: <a href="Hakyll-Core-Identifier-Pattern.html#t:Pattern">Pattern</a> -&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a> -&gt; <a href="Hakyll-Core-Identifier.html#t:Identifier">Identifier</a><a href="src/Hakyll-Core-Identifier-Pattern.html#fromCapture" class="link">Source</a></p><div class="doc"><p>Create an identifier from a pattern by filling in the captures with a given
 string
</p><p>Example:
</p><pre> fromCapture (fromGlob &quot;tags/*&quot;) &quot;foo&quot;
</pre><p>Result:
</p><pre> &quot;tags/foo&quot;
</pre></div></div><div class="top"><p class="src"><a name="v:fromCaptures" class="def">fromCaptures</a> :: <a href="Hakyll-Core-Identifier-Pattern.html#t:Pattern">Pattern</a> -&gt; [<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a>] -&gt; <a href="Hakyll-Core-Identifier.html#t:Identifier">Identifier</a><a href="src/Hakyll-Core-Identifier-Pattern.html#fromCaptures" class="link">Source</a></p><div class="doc"><p>Create an identifier from a pattern by filling in the captures with the
 given list of strings
</p></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.13.2</p></div></body></html>