]> Git — Sourcephile - comptalang.git/blob - lcc/Hcompta/LCC/Sym.hs
Rewrite hcompta-lcc to use symantic-grammar.
[comptalang.git] / lcc / Hcompta / LCC / Sym.hs
1 -- | Symantics.
2 module Hcompta.LCC.Sym
3 ( module Hcompta.LCC.Sym
4 , module Hcompta.LCC.Sym.Account
5 , module Hcompta.LCC.Sym.Addable
6 , module Hcompta.LCC.Sym.Amount
7 , module Hcompta.LCC.Sym.FileSystem
8 , module Hcompta.LCC.Sym.Journal
9 , module Hcompta.LCC.Sym.Negable
10 , module Hcompta.LCC.Sym.Posting
11 , module Hcompta.LCC.Sym.Quantity
12 , module Hcompta.LCC.Sym.Subable
13 , module Hcompta.LCC.Sym.Transaction
14 , module Hcompta.LCC.Sym.Unit
15 , module Hcompta.LCC.Sym.Zipper
16 ) where
17
18 import Hcompta.LCC.Sym.Account
19 import Hcompta.LCC.Sym.Addable
20 import Hcompta.LCC.Sym.Amount
21 import Hcompta.LCC.Sym.Date
22 import Hcompta.LCC.Sym.FileSystem
23 import Hcompta.LCC.Sym.Journal
24 import Hcompta.LCC.Sym.Negable
25 import Hcompta.LCC.Sym.Posting
26 import Hcompta.LCC.Sym.Quantity
27 import Hcompta.LCC.Sym.Subable
28 import Hcompta.LCC.Sym.Transaction
29 import Hcompta.LCC.Sym.Unit
30 import Hcompta.LCC.Sym.Zipper
31
32 import Hcompta.LCC.Account (Account)
33 import Hcompta.LCC.Amount (Amounts, Quantity, Unit)
34 import Hcompta.LCC.Journal (Journal, PathFile)
35 import Hcompta.LCC.Posting (Posting, Date)
36 import Hcompta.LCC.Transaction (Transaction)
37 import Hcompta.Quantity (Addable, Negable, Subable)
38
39 import Control.Applicative (Alternative)
40 import Data.Bool (Bool)
41 import Data.Either (Either)
42 import Data.Foldable (Foldable)
43 import Data.NonNull (NonNull)
44 import Data.Proxy
45 import Data.Traversable (Traversable)
46 import Data.TreeMap.Strict.Zipper (Zipper)
47 import Data.Map.Strict (Map)
48 import Language.Symantic as Sym
49 import Text.Show (Show)
50
51 type Ifaces =
52 [ Proxy (->)
53 , Proxy Account
54 , Proxy Addable
55 , Proxy Alternative
56 , Proxy Amounts
57 , Proxy Bool
58 , Proxy Date
59 , Proxy Either
60 , Proxy Foldable
61 , Proxy Journal
62 , Proxy Map
63 , Proxy Negable
64 , Proxy NonNull
65 , Proxy PathFile
66 , Proxy Posting
67 , Proxy Quantity
68 , Proxy Show
69 , Proxy Subable
70 , Proxy Transaction
71 , Proxy Traversable
72 , Proxy Unit
73 , Proxy Zipper
74 ]
75
76 type TyConsts
77 = Sym.TyConsts_of_Ifaces Ifaces
78
79 {-
80 x0
81 :: ( is ~ Ifaces
82 , cs ~ Sym.TyConsts_of_Ifaces is )
83 => IO ( ( Either (P.ParseError Char P.Dec)
84 (S.Either [At (Error_Journal cs is)] (CanonFile, Journal [Transaction]))
85 , Context_Read [Transaction] )
86 , Context_Sym cs is )
87 x0 = read_file "./Hcompta/LCC/Journal/02.jnl" $ read $
88 g_journal (Proxy @Ifaces) (:)
89
90 y0
91 -- :: CF (P.ParsecT P.Dec Text m) a
92 :: ( m ~ S.StateT (Context_Read j) (S.StateT (Context_Sym cs is) IO)
93 , is ~ Ifaces
94 , cs ~ Sym.TyConsts_of_Ifaces is
95 -- , e ~ P.ParseError Char P.Dec
96 )
97 => CF (P.ParsecT P.Dec Text m)
98 ( Sym.Term_Name
99 , Either (At (Sym.Error_Term Meta cs is))
100 (Sym.ETerm cs is) )
101 y0 = g_term
102 -}