{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE TypeFamilies #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Hcompta.LCC.Account where import Control.DeepSeq (NFData(..)) import Data.Data (Data(..)) import Data.Eq (Eq(..)) -- import Data.List.NonEmpty (NonEmpty(..)) import Data.Monoid (Monoid(..)) import Data.NonNull (NonNull) import Data.Ord (Ord(..)) import Data.Semigroup (Semigroup(..)) import Data.Typeable (Typeable) import Text.Show (Show) import qualified Data.MonoTraversable as MT -- import qualified Data.NonNull as NonNull import qualified Data.TreeMap.Strict as TreeMap -- import Hcompta.LCC.Anchor import Hcompta.LCC.Tag import Hcompta.LCC.Name import qualified Hcompta as H -- * Type 'Account' newtype Account = Account (NonNull [NameAccount]) deriving (Data, Eq, MT.MonoFunctor, MT.MonoFoldable , NFData, Ord, Semigroup, Show, Typeable) type instance MT.Element Account = NameAccount {- instance H.Get (TreeMap.Path NameAccount) Account where get (Account n) = n instance H.Get Account (TreeMap.Path NameAccount) where get = Account instance H.Account Account -} instance H.To Account (TreeMap.Path NameAccount) where to = Account instance H.To (TreeMap.Path NameAccount) Account where to (Account a) = a -- ** Type 'NameAccount' type NameAccount = Name {- -- * Type 'Account_Anchor' newtype Account_Anchor = Account_Anchor Anchor deriving (Data, Eq, Ord, NFData, Show, Typeable) -- ** Type 'Account_Anchors' newtype Account_Anchors = Account_Anchors Anchors deriving (Data, Eq, Monoid, NFData, Ord, Semigroup, Show, Typeable) type instance MT.Element Account_Anchors = Account_Anchor -} -- * Type 'Account_Tag' newtype Account_Tag = Account_Tag Tag deriving (Data, Eq, NFData, Show, Typeable) type instance MT.Element Account_Tag = Tag -- type instance H.Tag_Path H.:@ Account_Tag = Tag_Path -- type instance H.Tag_Data H.:@ Account_Tag = Tag_Data instance MT.MonoFunctor Account_Tag where omap f (Account_Tag tag) = Account_Tag (f tag) -- ** Type 'Account_Tags' newtype Account_Tags = Account_Tags Tags deriving (Data, Eq, Monoid, NFData, Semigroup, Show, Typeable) type instance MT.Element Account_Tags = Account_Tag {- instance H.GetI H.Tag_Path Account_Tag where getI (Account_Tag tag) = tag_path tag instance H.SetI H.Tag_Path Account_Tag where setI tag_path = MT.omap (\tag -> tag{tag_path}) instance H.GetI H.Tag_Data Account_Tag where getI (Account_Tag tag) = tag_data tag instance H.SetI H.Tag_Data Account_Tag where setI tag_data = MT.omap (\tag -> tag{tag_data}) -}