This file is indexed.

/usr/share/doc/libghc-hledger-lib-doc/html/Hledger-Query.html is in libghc-hledger-lib-doc 0.26-3build2.

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
<!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>Hledger.Query</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_Hledger-Query.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Hledger-Query.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">hledger-lib-0.26: Core data types, parsers and utilities for the hledger accounting tool.</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Safe Haskell</th><td>None</td></tr><tr><th>Language</th><td>Haskell2010</td></tr></table><p class="caption">Hledger.Query</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Query and QueryOpt</a></li><li><a href="#g:2">parsing</a></li><li><a href="#g:3">accessors</a></li><li><a href="#g:4">matching</a></li><li><a href="#g:5">tests</a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>A general query system for matching things (accounts, postings,
transactions..)  by various criteria, and a parser for query expressions.</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:Query">Query</a><ul class="subs"><li>= <a href="#v:Any">Any</a></li><li>| <a href="#v:None">None</a></li><li>| <a href="#v:Not">Not</a> <a href="Hledger-Query.html#t:Query">Query</a></li><li>| <a href="#v:Or">Or</a> [<a href="Hledger-Query.html#t:Query">Query</a>]</li><li>| <a href="#v:And">And</a> [<a href="Hledger-Query.html#t:Query">Query</a>]</li><li>| <a href="#v:Code">Code</a> <a href="Hledger-Utils-Regex.html#t:Regexp">Regexp</a></li><li>| <a href="#v:Desc">Desc</a> <a href="Hledger-Utils-Regex.html#t:Regexp">Regexp</a></li><li>| <a href="#v:Acct">Acct</a> <a href="Hledger-Utils-Regex.html#t:Regexp">Regexp</a></li><li>| <a href="#v:Date">Date</a> <a href="Hledger-Data-Types.html#t:DateSpan">DateSpan</a></li><li>| <a href="#v:Date2">Date2</a> <a href="Hledger-Data-Types.html#t:DateSpan">DateSpan</a></li><li>| <a href="#v:Status">Status</a> <a href="Hledger-Data-Types.html#t:ClearedStatus">ClearedStatus</a></li><li>| <a href="#v:Real">Real</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a></li><li>| <a href="#v:Amt">Amt</a> OrdPlus <a href="Hledger-Data-Types.html#t:Quantity">Quantity</a></li><li>| <a href="#v:Sym">Sym</a> <a href="Hledger-Utils-Regex.html#t:Regexp">Regexp</a></li><li>| <a href="#v:Empty">Empty</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a></li><li>| <a href="#v:Depth">Depth</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Int.html#t:Int">Int</a></li><li>| <a href="#v:Tag">Tag</a> <a href="Hledger-Utils-Regex.html#t:Regexp">Regexp</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Hledger-Utils-Regex.html#t:Regexp">Regexp</a>)</li></ul></li><li class="src short"><span class="keyword">data</span> <a href="#t:QueryOpt">QueryOpt</a><ul class="subs"><li>= <a href="#v:QueryOptInAcctOnly">QueryOptInAcctOnly</a> <a href="Hledger-Data-Types.html#t:AccountName">AccountName</a></li><li>| <a href="#v:QueryOptInAcct">QueryOptInAcct</a> <a href="Hledger-Data-Types.html#t:AccountName">AccountName</a></li></ul></li><li class="src short"><a href="#v:parseQuery">parseQuery</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/time-1.5.0.1/Data-Time-Calendar.html#t:Day">Day</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a> -&gt; (<a href="Hledger-Query.html#t:Query">Query</a>, [<a href="Hledger-Query.html#t:QueryOpt">QueryOpt</a>])</li><li class="src short"><a href="#v:simplifyQuery">simplifyQuery</a> :: <a href="Hledger-Query.html#t:Query">Query</a> -&gt; <a href="Hledger-Query.html#t:Query">Query</a></li><li class="src short"><a href="#v:filterQuery">filterQuery</a> :: (<a href="Hledger-Query.html#t:Query">Query</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a>) -&gt; <a href="Hledger-Query.html#t:Query">Query</a> -&gt; <a href="Hledger-Query.html#t:Query">Query</a></li><li class="src short"><a href="#v:queryIsNull">queryIsNull</a> :: <a href="Hledger-Query.html#t:Query">Query</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:queryIsAcct">queryIsAcct</a> :: <a href="Hledger-Query.html#t:Query">Query</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:queryIsDepth">queryIsDepth</a> :: <a href="Hledger-Query.html#t:Query">Query</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:queryIsDate">queryIsDate</a> :: <a href="Hledger-Query.html#t:Query">Query</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:queryIsDate2">queryIsDate2</a> :: <a href="Hledger-Query.html#t:Query">Query</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:queryIsDateOrDate2">queryIsDateOrDate2</a> :: <a href="Hledger-Query.html#t:Query">Query</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:queryIsStartDateOnly">queryIsStartDateOnly</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a> -&gt; <a href="Hledger-Query.html#t:Query">Query</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:queryIsSym">queryIsSym</a> :: <a href="Hledger-Query.html#t:Query">Query</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:queryStartDate">queryStartDate</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a> -&gt; <a href="Hledger-Query.html#t:Query">Query</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/time-1.5.0.1/Data-Time-Calendar.html#t:Day">Day</a></li><li class="src short"><a href="#v:queryEndDate">queryEndDate</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a> -&gt; <a href="Hledger-Query.html#t:Query">Query</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/time-1.5.0.1/Data-Time-Calendar.html#t:Day">Day</a></li><li class="src short"><a href="#v:queryDateSpan">queryDateSpan</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a> -&gt; <a href="Hledger-Query.html#t:Query">Query</a> -&gt; <a href="Hledger-Data-Types.html#t:DateSpan">DateSpan</a></li><li class="src short"><a href="#v:queryDateSpan-39-">queryDateSpan'</a> :: <a href="Hledger-Query.html#t:Query">Query</a> -&gt; <a href="Hledger-Data-Types.html#t:DateSpan">DateSpan</a></li><li class="src short"><a href="#v:queryDepth">queryDepth</a> :: <a href="Hledger-Query.html#t:Query">Query</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Int.html#t:Int">Int</a></li><li class="src short"><a href="#v:inAccount">inAccount</a> :: [<a href="Hledger-Query.html#t:QueryOpt">QueryOpt</a>] -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="Hledger-Data-Types.html#t:AccountName">AccountName</a>, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a>)</li><li class="src short"><a href="#v:inAccountQuery">inAccountQuery</a> :: [<a href="Hledger-Query.html#t:QueryOpt">QueryOpt</a>] -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Hledger-Query.html#t:Query">Query</a></li><li class="src short"><a href="#v:matchesTransaction">matchesTransaction</a> :: <a href="Hledger-Query.html#t:Query">Query</a> -&gt; <a href="Hledger-Data-Types.html#t:Transaction">Transaction</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:matchesPosting">matchesPosting</a> :: <a href="Hledger-Query.html#t:Query">Query</a> -&gt; <a href="Hledger-Data-Types.html#t:Posting">Posting</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:matchesAccount">matchesAccount</a> :: <a href="Hledger-Query.html#t:Query">Query</a> -&gt; <a href="Hledger-Data-Types.html#t:AccountName">AccountName</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:matchesMixedAmount">matchesMixedAmount</a> :: <a href="Hledger-Query.html#t:Query">Query</a> -&gt; <a href="Hledger-Data-Types.html#t:MixedAmount">MixedAmount</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:matchesAmount">matchesAmount</a> :: <a href="Hledger-Query.html#t:Query">Query</a> -&gt; <a href="Hledger-Data-Types.html#t:Amount">Amount</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:words-39--39-">words''</a> :: [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a>] -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a> -&gt; [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a>]</li><li class="src short"><a href="#v:tests_Hledger_Query">tests_Hledger_Query</a> :: <a href="file:///usr/share/doc/libghc-hunit-doc/html/Test-HUnit-Base.html#t:Test">Test</a></li></ul></div><div id="interface"><h1 id="g:1">Query and QueryOpt</h1><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:Query" class="def">Query</a> <a href="src/Hledger-Query.html#Query" class="link">Source</a></p><div class="doc"><p>A query is a composition of search criteria, which can be used to
 match postings, transactions, accounts and more.</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:Any" class="def">Any</a></td><td class="doc"><p>always match</p></td></tr><tr><td class="src"><a name="v:None" class="def">None</a></td><td class="doc"><p>never match</p></td></tr><tr><td class="src"><a name="v:Not" class="def">Not</a> <a href="Hledger-Query.html#t:Query">Query</a></td><td class="doc"><p>negate this match</p></td></tr><tr><td class="src"><a name="v:Or" class="def">Or</a> [<a href="Hledger-Query.html#t:Query">Query</a>]</td><td class="doc"><p>match if any of these match</p></td></tr><tr><td class="src"><a name="v:And" class="def">And</a> [<a href="Hledger-Query.html#t:Query">Query</a>]</td><td class="doc"><p>match if all of these match</p></td></tr><tr><td class="src"><a name="v:Code" class="def">Code</a> <a href="Hledger-Utils-Regex.html#t:Regexp">Regexp</a></td><td class="doc"><p>match if code matches this regexp</p></td></tr><tr><td class="src"><a name="v:Desc" class="def">Desc</a> <a href="Hledger-Utils-Regex.html#t:Regexp">Regexp</a></td><td class="doc"><p>match if description matches this regexp</p></td></tr><tr><td class="src"><a name="v:Acct" class="def">Acct</a> <a href="Hledger-Utils-Regex.html#t:Regexp">Regexp</a></td><td class="doc"><p>match postings whose account matches this regexp</p></td></tr><tr><td class="src"><a name="v:Date" class="def">Date</a> <a href="Hledger-Data-Types.html#t:DateSpan">DateSpan</a></td><td class="doc"><p>match if primary date in this date span</p></td></tr><tr><td class="src"><a name="v:Date2" class="def">Date2</a> <a href="Hledger-Data-Types.html#t:DateSpan">DateSpan</a></td><td class="doc"><p>match if secondary date in this date span</p></td></tr><tr><td class="src"><a name="v:Status" class="def">Status</a> <a href="Hledger-Data-Types.html#t:ClearedStatus">ClearedStatus</a></td><td class="doc"><p>match txns/postings with this cleared status (Status Uncleared matches all states except cleared)</p></td></tr><tr><td class="src"><a name="v:Real" class="def">Real</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a></td><td class="doc"><p>match if &quot;realness&quot; (involves a real non-virtual account ?) has this value</p></td></tr><tr><td class="src"><a name="v:Amt" class="def">Amt</a> OrdPlus <a href="Hledger-Data-Types.html#t:Quantity">Quantity</a></td><td class="doc"><p>match if the amount's numeric quantity is less than<em>greater than</em>equal to/unsignedly equal to some value</p></td></tr><tr><td class="src"><a name="v:Sym" class="def">Sym</a> <a href="Hledger-Utils-Regex.html#t:Regexp">Regexp</a></td><td class="doc"><p>match if the entire commodity symbol is matched by this regexp</p></td></tr><tr><td class="src"><a name="v:Empty" class="def">Empty</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a></td><td class="doc"><p>if true, show zero-amount postings/accounts which are usually not shown
   more of a query option than a query criteria ?</p></td></tr><tr><td class="src"><a name="v:Depth" class="def">Depth</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Int.html#t:Int">Int</a></td><td class="doc"><p>match if account depth is less than or equal to this value</p></td></tr><tr><td class="src"><a name="v:Tag" class="def">Tag</a> <a href="Hledger-Utils-Regex.html#t:Regexp">Regexp</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Hledger-Utils-Regex.html#t:Regexp">Regexp</a>)</td><td class="doc"><p>match if a tag's name, and optionally its value, is matched by these respective regexps
 matching the regexp if provided, exists</p></td></tr></table></div><div class="subs instances"><p id="control.i:Query" class="caption collapser" onclick="toggleSection('i:Query')">Instances</p><div id="section.i:Query" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Eq.html#t:Eq">Eq</a> <a href="Hledger-Query.html#t:Query">Query</a></span> <a href="src/Hledger-Query.html#line-84" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Data.html#t:Data">Data</a> <a href="Hledger-Query.html#t:Query">Query</a></span> <a href="src/Hledger-Query.html#line-84" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Text-Show.html#t:Show">Show</a> <a href="Hledger-Query.html#t:Query">Query</a></span> <a href="src/Hledger-Query.html#line-87" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:QueryOpt" class="def">QueryOpt</a> <a href="src/Hledger-Query.html#QueryOpt" class="link">Source</a></p><div class="doc"><p>A query option changes a query's/report's behaviour and output in some way.</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:QueryOptInAcctOnly" class="def">QueryOptInAcctOnly</a> <a href="Hledger-Data-Types.html#t:AccountName">AccountName</a></td><td class="doc"><p>show an account register focussed on this account</p></td></tr><tr><td class="src"><a name="v:QueryOptInAcct" class="def">QueryOptInAcct</a> <a href="Hledger-Data-Types.html#t:AccountName">AccountName</a></td><td class="doc"><p>as above but include sub-accounts in the account register
 | QueryOptCostBasis      -- ^ show amounts converted to cost where possible
 | QueryOptDate2  -- ^ show secondary dates instead of primary dates</p></td></tr></table></div><div class="subs instances"><p id="control.i:QueryOpt" class="caption collapser" onclick="toggleSection('i:QueryOpt')">Instances</p><div id="section.i:QueryOpt" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Eq.html#t:Eq">Eq</a> <a href="Hledger-Query.html#t:QueryOpt">QueryOpt</a></span> <a href="src/Hledger-Query.html#line-111" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Data.html#t:Data">Data</a> <a href="Hledger-Query.html#t:QueryOpt">QueryOpt</a></span> <a href="src/Hledger-Query.html#line-111" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src clearfix"><span class="inst-left"><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Text-Show.html#t:Show">Show</a> <a href="Hledger-Query.html#t:QueryOpt">QueryOpt</a></span> <a href="src/Hledger-Query.html#line-111" class="link">Source</a></td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><h1 id="g:2">parsing</h1><div class="top"><p class="src"><a name="v:parseQuery" class="def">parseQuery</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/time-1.5.0.1/Data-Time-Calendar.html#t:Day">Day</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a> -&gt; (<a href="Hledger-Query.html#t:Query">Query</a>, [<a href="Hledger-Query.html#t:QueryOpt">QueryOpt</a>]) <a href="src/Hledger-Query.html#parseQuery" class="link">Source</a></p><div class="doc"><p>Convert a query expression containing zero or more space-separated
 terms to a query and zero or more query options. A query term is either:</p><ol><li><p>a search pattern, which matches on one or more fields, eg:</p><p>acct:REGEXP     - match the account name with a regular expression
 desc:REGEXP     - match the transaction description
 date:PERIODEXP  - match the date with a period expression</p></li></ol><p>The prefix indicates the field to match, or if there is no prefix
    account name is assumed.</p><ol><li><p>a query option, which modifies the reporting behaviour in some
    way. There is currently one of these, which may appear only once:</p><p>inacct:FULLACCTNAME</p></li></ol><p>The usual shell quoting rules are assumed. When a pattern contains
 whitespace, it (or the whole term including prefix) should be enclosed
 in single or double quotes.</p><p>Period expressions may contain relative dates, so a reference date is
 required to fully parse these.</p><p>Multiple terms are combined as follows:
 1. multiple account patterns are OR'd together
 2. multiple description patterns are OR'd together
 3. then all terms are AND'd together</p></div></div><div class="top"><p class="src"><a name="v:simplifyQuery" class="def">simplifyQuery</a> :: <a href="Hledger-Query.html#t:Query">Query</a> -&gt; <a href="Hledger-Query.html#t:Query">Query</a> <a href="src/Hledger-Query.html#simplifyQuery" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:filterQuery" class="def">filterQuery</a> :: (<a href="Hledger-Query.html#t:Query">Query</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a>) -&gt; <a href="Hledger-Query.html#t:Query">Query</a> -&gt; <a href="Hledger-Query.html#t:Query">Query</a> <a href="src/Hledger-Query.html#filterQuery" class="link">Source</a></p><div class="doc"><p>Remove query terms (or whole sub-expressions) not matching the given
 predicate from this query.  XXX Semantics not yet clear.</p></div></div><h1 id="g:3">accessors</h1><div class="top"><p class="src"><a name="v:queryIsNull" class="def">queryIsNull</a> :: <a href="Hledger-Query.html#t:Query">Query</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a> <a href="src/Hledger-Query.html#queryIsNull" class="link">Source</a></p><div class="doc"><p>Does this query match everything ?</p></div></div><div class="top"><p class="src"><a name="v:queryIsAcct" class="def">queryIsAcct</a> :: <a href="Hledger-Query.html#t:Query">Query</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a> <a href="src/Hledger-Query.html#queryIsAcct" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:queryIsDepth" class="def">queryIsDepth</a> :: <a href="Hledger-Query.html#t:Query">Query</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a> <a href="src/Hledger-Query.html#queryIsDepth" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:queryIsDate" class="def">queryIsDate</a> :: <a href="Hledger-Query.html#t:Query">Query</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a> <a href="src/Hledger-Query.html#queryIsDate" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:queryIsDate2" class="def">queryIsDate2</a> :: <a href="Hledger-Query.html#t:Query">Query</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a> <a href="src/Hledger-Query.html#queryIsDate2" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:queryIsDateOrDate2" class="def">queryIsDateOrDate2</a> :: <a href="Hledger-Query.html#t:Query">Query</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a> <a href="src/Hledger-Query.html#queryIsDateOrDate2" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:queryIsStartDateOnly" class="def">queryIsStartDateOnly</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a> -&gt; <a href="Hledger-Query.html#t:Query">Query</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a> <a href="src/Hledger-Query.html#queryIsStartDateOnly" class="link">Source</a></p><div class="doc"><p>Does this query specify a start date and nothing else (that would
 filter postings prior to the date) ?
 When the flag is true, look for a starting secondary date instead.</p></div></div><div class="top"><p class="src"><a name="v:queryIsSym" class="def">queryIsSym</a> :: <a href="Hledger-Query.html#t:Query">Query</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a> <a href="src/Hledger-Query.html#queryIsSym" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:queryStartDate" class="def">queryStartDate</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a> -&gt; <a href="Hledger-Query.html#t:Query">Query</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/time-1.5.0.1/Data-Time-Calendar.html#t:Day">Day</a> <a href="src/Hledger-Query.html#queryStartDate" class="link">Source</a></p><div class="doc"><p>What start date (or secondary date) does this query specify, if any ?
 For OR expressions, use the earliest of the dates. NOT is ignored.</p></div></div><div class="top"><p class="src"><a name="v:queryEndDate" class="def">queryEndDate</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a> -&gt; <a href="Hledger-Query.html#t:Query">Query</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/time-1.5.0.1/Data-Time-Calendar.html#t:Day">Day</a> <a href="src/Hledger-Query.html#queryEndDate" class="link">Source</a></p><div class="doc"><p>What end date (or secondary date) does this query specify, if any ?
 For OR expressions, use the latest of the dates. NOT is ignored.</p></div></div><div class="top"><p class="src"><a name="v:queryDateSpan" class="def">queryDateSpan</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a> -&gt; <a href="Hledger-Query.html#t:Query">Query</a> -&gt; <a href="Hledger-Data-Types.html#t:DateSpan">DateSpan</a> <a href="src/Hledger-Query.html#queryDateSpan" class="link">Source</a></p><div class="doc"><p>What date span (or secondary date span) does this query specify ?
 For OR expressions, use the widest possible span. NOT is ignored.</p></div></div><div class="top"><p class="src"><a name="v:queryDateSpan-39-" class="def">queryDateSpan'</a> :: <a href="Hledger-Query.html#t:Query">Query</a> -&gt; <a href="Hledger-Data-Types.html#t:DateSpan">DateSpan</a> <a href="src/Hledger-Query.html#queryDateSpan%27" class="link">Source</a></p><div class="doc"><p>What date span (or secondary date span) does this query specify ?
 For OR expressions, use the widest possible span. NOT is ignored.</p></div></div><div class="top"><p class="src"><a name="v:queryDepth" class="def">queryDepth</a> :: <a href="Hledger-Query.html#t:Query">Query</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Int.html#t:Int">Int</a> <a href="src/Hledger-Query.html#queryDepth" class="link">Source</a></p><div class="doc"><p>The depth limit this query specifies, or a large number if none.</p></div></div><div class="top"><p class="src"><a name="v:inAccount" class="def">inAccount</a> :: [<a href="Hledger-Query.html#t:QueryOpt">QueryOpt</a>] -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="Hledger-Data-Types.html#t:AccountName">AccountName</a>, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a>) <a href="src/Hledger-Query.html#inAccount" class="link">Source</a></p><div class="doc"><p>The account we are currently focussed on, if any, and whether subaccounts are included.
 Just looks at the first query option.</p></div></div><div class="top"><p class="src"><a name="v:inAccountQuery" class="def">inAccountQuery</a> :: [<a href="Hledger-Query.html#t:QueryOpt">QueryOpt</a>] -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Hledger-Query.html#t:Query">Query</a> <a href="src/Hledger-Query.html#inAccountQuery" class="link">Source</a></p><div class="doc"><p>A query for the account(s) we are currently focussed on, if any.
 Just looks at the first query option.</p></div></div><h1 id="g:4">matching</h1><div class="top"><p class="src"><a name="v:matchesTransaction" class="def">matchesTransaction</a> :: <a href="Hledger-Query.html#t:Query">Query</a> -&gt; <a href="Hledger-Data-Types.html#t:Transaction">Transaction</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a> <a href="src/Hledger-Query.html#matchesTransaction" class="link">Source</a></p><div class="doc"><p>Does the match expression match this transaction ?</p></div></div><div class="top"><p class="src"><a name="v:matchesPosting" class="def">matchesPosting</a> :: <a href="Hledger-Query.html#t:Query">Query</a> -&gt; <a href="Hledger-Data-Types.html#t:Posting">Posting</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a> <a href="src/Hledger-Query.html#matchesPosting" class="link">Source</a></p><div class="doc"><p>Does the match expression match this posting ?</p></div></div><div class="top"><p class="src"><a name="v:matchesAccount" class="def">matchesAccount</a> :: <a href="Hledger-Query.html#t:Query">Query</a> -&gt; <a href="Hledger-Data-Types.html#t:AccountName">AccountName</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a> <a href="src/Hledger-Query.html#matchesAccount" class="link">Source</a></p><div class="doc"><p>Does the match expression match this account ?
 A matching in: clause is also considered a match.</p></div></div><div class="top"><p class="src"><a name="v:matchesMixedAmount" class="def">matchesMixedAmount</a> :: <a href="Hledger-Query.html#t:Query">Query</a> -&gt; <a href="Hledger-Data-Types.html#t:MixedAmount">MixedAmount</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a> <a href="src/Hledger-Query.html#matchesMixedAmount" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:matchesAmount" class="def">matchesAmount</a> :: <a href="Hledger-Query.html#t:Query">Query</a> -&gt; <a href="Hledger-Data-Types.html#t:Amount">Amount</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a> <a href="src/Hledger-Query.html#matchesAmount" class="link">Source</a></p><div class="doc"><p>Does the match expression match this (simple) amount ?</p></div></div><div class="top"><p class="src"><a name="v:words-39--39-" class="def">words''</a> :: [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a>] -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a> -&gt; [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a>] <a href="src/Hledger-Query.html#words%27%27" class="link">Source</a></p><div class="doc"><p>Quote-and-prefix-aware version of words - don't split on spaces which
 are inside quotes, including quotes which may have one of the specified
 prefixes in front, and maybe an additional not: prefix in front of that.</p></div></div><h1 id="g:5">tests</h1><div class="top"><p class="src"><a name="v:tests_Hledger_Query" class="def">tests_Hledger_Query</a> :: <a href="file:///usr/share/doc/libghc-hunit-doc/html/Test-HUnit-Base.html#t:Test">Test</a> <a href="src/Hledger-Query.html#tests_Hledger_Query" class="link">Source</a></p></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.16.1</p></div></body></html>