1 {-# LANGUAGE DeriveDataTypeable #-}
2 module Hcompta.Model.Amount.Style where
5 import Data.Word (Word8)
6 import Data.Typeable ()
12 { fractioning :: Maybe Fractioning
13 , grouping_integral :: Maybe Grouping
14 , grouping_fractional :: Maybe Grouping
15 , precision :: Precision
16 -- TODO: , sign_plus :: Maybe Bool
17 , unit_side :: Maybe Side
18 , unit_spaced :: Maybe Spacing
19 } deriving (Data, Eq, Ord, Read, Show, Typeable)
26 deriving (Data, Eq, Ord, Read, Show, Typeable)
37 deriving (Data, Eq, Ord, Read, Show, Typeable)
44 { fractioning = Nothing
45 , grouping_integral = Nothing
46 , grouping_fractional = Nothing
49 , unit_spaced = Nothing
54 union :: Style -> Style -> Style
57 { fractioning=fractioning_
58 , grouping_integral=grouping_integral_
59 , grouping_fractional=grouping_fractional_
60 , precision=precision_
65 { fractioning=fractioning'
66 , grouping_integral=grouping_integral_'
67 , grouping_fractional=grouping_fractional_'
68 , precision=precision'
76 { fractioning=maybe fractioning' (const fractioning_) fractioning_
77 , grouping_integral=maybe grouping_integral_' (const grouping_integral_) grouping_integral_
78 , grouping_fractional=maybe grouping_fractional_' (const grouping_fractional_) grouping_fractional_
79 , precision=max precision_ precision'
80 , unit_side=maybe side' (const side) side
81 , unit_spaced=maybe spaced' (const spaced) spaced