1 {-# LANGUAGE DeriveDataTypeable #-}
2 {-# LANGUAGE StandaloneDeriving #-}
3 {-# OPTIONS_GHC -fno-warn-orphans #-}
4 module Hcompta.Lib.Strict where
6 import Control.DeepSeq (NFData(..))
9 import Data.Monoid (Monoid(..))
10 import Text.Show (Show)
15 -- A data type to calculate an 'inclusive' value
16 -- (through some propagation mecanism,
17 -- eg. incorporating the values of the children of a tree node),
18 -- while keeping the original 'exclusive' value
19 -- (eg. the original value of a tree node).
24 } deriving (Data, Eq, Show, Typeable)
27 => Monoid (Clusive a) where
28 mempty = Clusive mempty mempty
29 mappend (Clusive e0 i0) (Clusive e1 i1) =
30 Clusive (e0`mappend`e1) (i0`mappend`i1)
33 NFData (Clusive a) where
34 rnf (Clusive e i) = rnf e `seq` rnf i