{-# LANGUAGE NoMonomorphismRestriction #-} {-# LANGUAGE UndecidableInstances #-} -- | Symantics. module Hcompta.LCC.Sym ( module Hcompta.LCC.Sym , module Hcompta.LCC.Sym.Account , module Hcompta.LCC.Sym.Addable , module Hcompta.LCC.Sym.Amount , module Hcompta.LCC.Sym.Balance , module Hcompta.LCC.Sym.Chart , module Hcompta.LCC.Sym.Compta , module Hcompta.LCC.Sym.Date , module Hcompta.LCC.Sym.FileSystem , module Hcompta.LCC.Sym.Journal , module Hcompta.LCC.Sym.Negable , module Hcompta.LCC.Sym.Posting , module Hcompta.LCC.Sym.Quantity , module Hcompta.LCC.Sym.Subable , module Hcompta.LCC.Sym.Sumable , module Hcompta.LCC.Sym.Transaction , module Hcompta.LCC.Sym.Unit , module Hcompta.LCC.Sym.Zeroable , module Hcompta.LCC.Sym.Zipper ) where import Language.Symantic (type (++)) import qualified Language.Symantic.Lib as Sym import Hcompta.LCC.Sym.Account import Hcompta.LCC.Sym.Addable import Hcompta.LCC.Sym.Amount import Hcompta.LCC.Sym.Balance import Hcompta.LCC.Sym.Chart import Hcompta.LCC.Sym.Compta import Hcompta.LCC.Sym.Date import Hcompta.LCC.Sym.FileSystem import Hcompta.LCC.Sym.Journal import Hcompta.LCC.Sym.Negable import Hcompta.LCC.Sym.Posting import Hcompta.LCC.Sym.Quantity import Hcompta.LCC.Sym.Subable import Hcompta.LCC.Sym.Sumable import Hcompta.LCC.Sym.Transaction import Hcompta.LCC.Sym.Unit import Hcompta.LCC.Sym.Zeroable import Hcompta.LCC.Sym.Zipper import qualified Hcompta.LCC.Account as LCC import qualified Hcompta.LCC.Amount as LCC import qualified Hcompta.LCC.Balance as LCC import qualified Hcompta.LCC.Chart as LCC import qualified Hcompta.LCC.Compta as LCC import qualified Hcompta.LCC.IO as LCC import qualified Hcompta.LCC.Journal as LCC import qualified Hcompta.LCC.Posting as LCC import qualified Hcompta.LCC.Source as LCC import qualified Hcompta.LCC.Transaction as LCC import qualified Hcompta as H import Control.Applicative (Applicative, Alternative) import Control.Monad (Monad) import Data.Bool (Bool) import Data.Either (Either(..)) import Data.Eq (Eq) import Data.Foldable (Foldable) import Data.Functor (Functor) import Data.List.NonEmpty (NonEmpty(..)) import Data.Map.Strict (Map) import Data.Maybe (Maybe) import Data.MonoTraversable (MonoFunctor, MonoFoldable) import Data.Monoid (Monoid) import Data.NonNull (NonNull) import Data.Ord (Ord) import Data.Proxy import Data.Semigroup (Semigroup) import Data.Sequences (SemiSequence, IsSequence) import Data.Text (Text) import Data.Traversable (Traversable) import Data.TreeMap.Strict.Zipper (Zipper) import Prelude (Integer) import System.IO (IO) import Text.Show (Show) type SS = Proxy (LCC.Compta SRC SS') ': SS' type SRC = LCC.Source (NonEmpty LCC.SourcePos) SS' type SS' = [ Proxy (->) , Proxy (,) , Proxy Alternative , Proxy Applicative , Proxy Bool , Proxy Either , Proxy Eq , Proxy Foldable , Proxy Functor , Proxy H.Addable , Proxy H.Negable , Proxy H.Subable , Proxy H.Zeroable , Proxy H.Sumable , Proxy IsSequence , Proxy LCC.Account , Proxy LCC.Amounts , Proxy LCC.Balance , Proxy LCC.Chart , Proxy LCC.Date , Proxy LCC.Journal , Proxy LCC.PathFile , Proxy LCC.Posting , Proxy LCC.Quantity , Proxy LCC.Transaction , Proxy LCC.Unit , Proxy Map , Proxy Maybe , Proxy MonoFoldable , Proxy MonoFunctor , Proxy Monad , Proxy Monoid , Proxy NonNull , Proxy Ord , Proxy Semigroup , Proxy SemiSequence , Proxy Show , Proxy Traversable , Proxy Zipper ] type CS = [ Proxy Sym.Element , Proxy Integer , Proxy Text , Proxy IO ] ++ SS {- data Error_App cs = Error_App_not_applicable | Error_App_type_mismatch (Sym.EType cs) (Sym.EType cs) deriving (Eq, Show) app :: Sym.Inj_TyConst cs (->) => Sym.ETermClosed cs is -> Sym.ETermClosed cs is -> Either (Error_App cs) (Sym.ETermClosed cs is) app (Sym.ETermClosed ty_f (Sym.TermClosed te_f)) (Sym.ETermClosed ty_a (Sym.TermClosed te_a)) = case ty_f of ty_fun Sym.:$ ty_arg Sym.:$ ty_res | Just Refl <- Sym.kind_of ty_fun `Sym.eq_skind` (Sym.kind::Sym.SKind (Kind.Type -> Kind.Type -> Kind.Type)) , Just Refl <- ty_fun `Sym.eq_Type` Sym.ty @(->) -> case ty_arg `Sym.eq_Type` ty_a of Just Refl -> Right $ Sym.ETermClosed ty_res $ Sym.TermClosed $ te_f Sym..$ te_a Nothing -> Left $ Error_App_type_mismatch (Sym.EType ty_arg) (Sym.EType ty_a) _ -> Left $ Error_App_not_applicable feed_args :: Sym.TermAVT src -> [Sym.TermAVT src] -> Sym.TermAVT src feed_args te as = go te as where go f [] = f go f (x:xs) = case f `app` x of Right f' -> f' `go` as Left _err -> f `go` xs -} {- type SRC = () x0 :: IO ( ( Either (P.ParseError Char P.Dec) (S.Either [At SRC (Error_Compta SRC)] (CanonFile, Journal [Transaction])) , Context_Read SRC [Transaction] ) , Context_Sym SRC SS ) x0 = readJournal @SS "./Hcompta/LCC/Journal/02.jnl" (:) y0 -- :: CF (P.ParsecT P.Dec Text m) a :: ( m ~ S.StateT (Context_Read j) (S.StateT (Context_Sym cs is) IO) , is ~ Ifaces , cs ~ Sym.TyConsts_of_Ifaces is -- , e ~ P.ParseError Char P.Dec ) => CF (P.ParsecT P.Dec Text m) ( Sym.Term_Name , Either (At (Sym.Error_Term Meta cs is)) (Sym.ETerm cs is) ) y0 = g_term -}