Data.Map methods gone

Create issue
Issue #56 closed
George C. Privon created an issue

I have been attempting to build arbtt 0.10.1 via cabal install arbtt. I receive several build errors that various methods within Data.Map are now gone:

src/Stats.hs:179:33: error:
    • Data.Map.insertWith' is gone. Use Data.Map.Strict.insertWith.
    • In the expression:
        M.insertWith' (+) act (fromInteger (tlRate tl) / 1000) m
      In an equation for ‘go'’:
          go' m act
            = M.insertWith' (+) act (fromInteger (tlRate tl) / 1000) m
      In the expression:
        let
          go' m act
            = M.insertWith' (+) act (fromInteger (tlRate tl) / 1000) m
        in foldl' go' m (snd (tlData tl))
    |
179 |                 let go' m act = M.insertWith' (+) act (fromInteger (tlRate tl)/1000) m
    |                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
src/Stats.hs:294:56: error:
    • Data.Map.fold is gone. Use foldr.
    • In the second argument of ‘(-)’, namely
        ‘M.fold (+) 0 filteredSums’
      In the expression: totalTimeSel - M.fold (+) 0 filteredSums
      In an equation for ‘uncategorizedTime’:
          uncategorizedTime = totalTimeSel - M.fold (+) 0 filteredSums
    |
294 |                     uncategorizedTime = totalTimeSel - M.fold (+) 0 filteredSums
    |                                                        ^^^^^^^^^^^^^^^^^^^^^^^^^
src/Stats.hs:296:37: error:
    • Data.Map.fold is gone. Use foldr.
    • In the expression: M.fold (+) 0 tooSmallSums
      In an equation for ‘tooSmallTimes’:
          tooSmallTimes = M.fold (+) 0 tooSmallSums
      In the second argument of ‘($)’, namely
        ‘let
           filteredSums = M.filterWithKey (\ a _ -> isCategory cat a) sums
           uncategorizedTime = totalTimeSel - M.fold (+) 0 filteredSums
           tooSmallSums
             = M.filter
                 (\ t
                    -> realToFrac t / realToFrac totalTimeSel * 100
                         < roMinPercentage opts)
                 filteredSums
           ....
         in
           mapMaybe
             (\ (tag, time)
                -> let
                     perc = ...
                     ....
                   in
                     if pick && perc * 100 >= roMinPercentage opts then
                         Just (show tag, showTimeDiff opts time, perc)
                     else
                         Nothing)
             (reverse $ sortBy (comparing snd) $ M.toList filteredSums)
             ++
               (if tooSmallTimes > 0 then
                    [(printf "(%d entries omitted)" (M.size tooSmallSums),
                      showTimeDiff opts tooSmallTimes,
                      realToFrac tooSmallTimes / realToFrac totalTimeSel)]
                else
                    [])
                 ++
                   (if uncategorizedTime > 0 then
                        [("(unmatched time)", showTimeDiff opts uncategorizedTime,
                          realToFrac uncategorizedTime / realToFrac totalTimeSel)]
                    else
                        [])’
    |
296 |                     tooSmallTimes = M.fold (+) 0 tooSmallSums
    |                                     ^^^^^^^^^^^^^^^^^^^^^^^^^

I am on an arch linux system and haskell libraries are primarily installed via the official arch software repositories. Based on what's on hackage, the containers package (currently 0.6.0.1) satisfies the arbtt version requirements (>=0.5 && <0.7).

Comments (4)

  1. nomeata repo owner

    This might have been fixed in master already. Can you check?

    But I should make a new release, and edit the version bounds on the version on hackage.

  2. George C. Privon reporter

    Indeed it appears that this has already been fixed in master, thanks! I'll close this issue then.

  3. Log in to comment