]> Git — Sourcephile - comptalang.git/blob - lib/Hcompta/Model/Filter.hs
Modif : Format.Ledger.Write.Error_invalid_{day => date}.
[comptalang.git] / lib / Hcompta / Model / Filter.hs
1 {-# LANGUAGE DeriveDataTypeable #-}
2 module Hcompta.Model.Filter where
3
4 import Data.Data
5 import Data.Typeable ()
6
7 import qualified Hcompta.Model.Account as Account ()
8 import Hcompta.Model.Account (Account)
9 import qualified Hcompta.Model.Amount as Amount ()
10 import Hcompta.Model.Amount (Amount)
11 import qualified Hcompta.Model.Date as Date
12
13 -- * The 'Filter' type
14
15 data Filter
16 = Account Comp_String Account
17 | Account_Tag Comp_String String (Maybe (Comp_String, String))
18 | Amount Comp_Num Comp_Num_Absolute Amount
19 | And Filter Filter
20 | Any
21 | Balance Comp_Num Comp_Num_Absolute Amount
22 | Date Date.Span
23 | Depth Comp_Num Int
24 | Description Comp_String String
25 | None
26 | Not Filter
27 | Or Filter Filter
28 | Real Bool
29 | Status Bool
30 -- | Tag Comp_String Tag.Name (Maybe (Comp_String, Tag.Value))
31 | Unit Comp_String String
32 deriving (Data, Eq, Show, Typeable)
33
34 data Comp_Num
35 = Comp_Num_Lt
36 | Comp_Num_Lt_Eq
37 | Comp_Num_Gt
38 | Comp_Num_Gt_Eq
39 | Comp_Num_Eq
40 deriving (Data, Eq, Show, Typeable)
41
42 type Comp_Num_Absolute
43 = Bool
44
45 data Comp_String
46 = Comp_String_Eq
47 | Comp_String_Regexp
48 deriving (Data, Eq, Show, Typeable)