]> Git — Sourcephile - comptalang.git/blob - lib/Hcompta/Model/Filter.hs
Correction : Lib.Parsec : détection et propagation des erreurs.
[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 import qualified Hcompta.Model.Transaction.Tag as Tag
13
14 -- * The 'Filter' type
15
16 data Filter
17 = Account Comp_String Account
18 | Account_Tag Comp_String String (Maybe (Comp_String, String))
19 | Amount Comp_Num Comp_Num_Absolute Amount
20 | And Filter Filter
21 | Any
22 | Balance Comp_Num Comp_Num_Absolute Amount
23 | Date Date.Span
24 | Depth Comp_Num Int
25 | Description Comp_String String
26 | None
27 | Not Filter
28 | Or Filter Filter
29 | Real Bool
30 | Status Bool
31 | Tag Comp_String Tag.Name (Maybe (Comp_String, Tag.Value))
32 | Unit Comp_String String
33 deriving (Data, Eq, Show, Typeable)
34
35 data Comp_Num
36 = Comp_Num_Lt
37 | Comp_Num_Lt_Eq
38 | Comp_Num_Gt
39 | Comp_Num_Gt_Eq
40 | Comp_Num_Eq
41 deriving (Data, Eq, Show, Typeable)
42
43 type Comp_Num_Absolute
44 = Bool
45
46 data Comp_String
47 = Comp_String_Eq
48 | Comp_String_Regexp
49 deriving (Data, Eq, Show, Typeable)
50