import Data.Decimal (DecimalRaw(..))
import qualified Data.Char (isSpace)
import Data.Fixed (showFixed)
+import qualified Data.Foldable
import qualified Data.List
+import qualified Data.List.NonEmpty
import qualified Data.Map.Strict as Data.Map
import Data.Maybe (fromMaybe)
import qualified Data.Text.Lazy as TL
account_ :: Account -> Doc
account_ acct =
W.align $ W.hcat $
- Data.List.intersperse
- (W.bold $ W.dullblack $ W.char Read.account_name_sep)
- (Data.List.map account_name acct)
+ Data.List.NonEmpty.toList $
+ Data.List.NonEmpty.intersperse
+ (W.bold $ W.yellow $ W.char Read.account_name_sep)
+ (Data.List.NonEmpty.map account_name acct)
account_name :: Account.Name -> Doc
account_name = W.strict_text
account_length :: Posting.Type -> Account -> Int
account_length type_ acct =
- Data.List.foldl
+ Data.Foldable.foldl
(\acc -> (1 +) . (acc +) . Text.length)
- (if acct == [] then 0 else (- 1)) acct +
+ (- 1) acct +
case type_ of
Posting.Type_Regular -> 0
Posting.Type_Virtual -> 2
sign <> do
W.bold $ W.blue $ do
W.text (TL.pack $ maybe id (\g -> reverse . group g . reverse) grouping_integral $ int) <> do
- W.char (fromMaybe default_fractioning fractioning) <> do
+ (W.yellow $ W.char (fromMaybe default_fractioning fractioning)) <> do
W.text (TL.pack $ maybe id group grouping_fractional frac)
where
group :: Style.Grouping -> [Char] -> [Char]