addPostlineToAccountMap
  :: Map Account (Set Text)
  -- ^
  -> Postline a
  -- ^
  -> Map Account (Set Text)
  -- ^
addPostlineToAccountMap acctMap postline
  | X.null fitid = acctMap
  | otherwise = Map.alter f acct acctMap
  where
    fitid = Lens.view Tranche.fitid postline
    acct = Lens.view Tranche.account postline
    f = Just . maybe (Set.singleton fitid) (Set.insert fitid)
addPostlineToAccountMap
  :: Map Account (Set Text)
  -- ^
  -> Postline a
  -- ^
  -> Map Account (Set Text)
addPostlineToAccountMap acctMap postline
  | X.null fitid = acctMap
  | otherwise = Map.alter f acct acctMap
  where
    fitid = Lens.view Tranche.fitid postline
    acct = Lens.view Tranche.account postline
    f = Just . maybe (Set.singleton fitid) (Set.insert fitid)
addPostlineToAccountMap acctMap postline
  | X.null fitid = acctMap
  | otherwise = Map.alter f acct acctMap
  where
    fitid = Lens.view Tranche.fitid postline
    acct = Lens.view Tranche.account postline
    f = Just . maybe (Set.singleton fitid) (Set.insert fitid)