]> Git — Sourcephile - comptalang.git/blob - jcc/Hcompta/JCC/Account.hs
Adapte hcompta-cli.
[comptalang.git] / jcc / Hcompta / JCC / Account.hs
1 {-# LANGUAGE DeriveDataTypeable #-}
2 module Hcompta.JCC.Account where
3
4 import Data.Data (Data(..))
5 import Data.Eq (Eq(..))
6 import Data.List.NonEmpty (NonEmpty(..))
7 import Data.Text (Text)
8 import Data.Typeable (Typeable)
9 import Text.Show (Show)
10
11 -- import Text.Parsec..Parsec ()
12 -- import Hcompta.Lib.Regex (Regex)
13 import qualified Hcompta.Account as H
14
15 -- * Type 'Account'
16
17 type Account_Section = Text
18 type Account = NonEmpty Account_Section
19 account :: H.Account_Section Account -> [H.Account_Section Account] -> Account
20 account = (:|)
21
22 -- ** Type 'Joker'
23
24 type Account_Joker
25 = [Account_Joker_Section]
26 data Account_Joker_Section
27 = Account_Joker_Any
28 | Account_Joker_Section Text
29 deriving (Data, Eq, Show, Typeable)
30
31 -- ** Type 'Pattern'
32
33 data Account_Pattern
34 = Account_Pattern_Exact Account
35 | Account_Pattern_Joker Account_Joker
36 -- Account_Pattern_Regex Regex
37 deriving (Show, Typeable)