{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TypeFamilies #-}
+{-# OPTIONS_GHC -fno-warn-deprecations #-} -- FIXME: to be removed when dropping GHC-7.6 support
module Hcompta.Calc.Balance where
import Control.Exception (assert)
{ balance_by_account :: Balance_by_Account amount (Amount_Unit amount)
, balance_by_unit :: Balance_by_Unit amount (Amount_Unit amount)
}
-deriving instance Amount amount => Data (Balance amount)
-deriving instance Amount amount => Eq (Balance amount)
-deriving instance Amount amount => Show (Balance amount)
-deriving instance Typeable Balance
+deriving instance Amount amount => Data (Balance amount)
+deriving instance Amount amount => Eq (Balance amount)
+deriving instance Amount amount => Show (Balance amount)
+deriving instance Typeable1 Balance -- FIXME: use 'Typeable' when dropping GHC-7.6 support
type Balance_by_Account amount unit
= TreeMap Account.Name
newtype Amount amount
=> Deviation amount
= Deviation (Balance_by_Unit amount (Amount_Unit amount))
-deriving instance Amount amount => Data (Deviation amount)
-deriving instance Amount amount => Eq (Deviation amount)
-deriving instance Amount amount => Show (Deviation amount)
-deriving instance Typeable Deviation
+deriving instance Amount amount => Data (Deviation amount)
+deriving instance Amount amount => Eq (Deviation amount)
+deriving instance Amount amount => Show (Deviation amount)
+deriving instance Typeable1 Deviation -- FIXME: use 'Typeable' when dropping GHC-7.6 support
-- | Return the 'balance_by_unit' of the given 'Balance' with:
--
{ exclusive :: Map (Amount_Unit amount) amount
, inclusive :: Map (Amount_Unit amount) amount -- ^ 'amount_add' folded over 'exclusive' and 'inclusive' of 'Lib.TreeMap.node_descendants'
}
-deriving instance Amount amount => Data (Account_Sum_Expanded amount)
-deriving instance Amount amount => Eq (Account_Sum_Expanded amount)
-deriving instance Amount amount => Show (Account_Sum_Expanded amount)
-deriving instance Typeable Account_Sum_Expanded
+deriving instance Amount amount => Data (Account_Sum_Expanded amount)
+deriving instance Amount amount => Eq (Account_Sum_Expanded amount)
+deriving instance Amount amount => Show (Account_Sum_Expanded amount)
+deriving instance Typeable1 Account_Sum_Expanded -- FIXME: use 'Typeable' when dropping GHC-7.6 support
-- | Return the given 'Balance_by_Account' with:
--