Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions cabal-install-solver/src/Distribution/Solver/Types/Progress.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# LANGUAGE DeriveFunctor #-}
module Distribution.Solver.Types.Progress
( Progress(..)
, foldProgress
Expand All @@ -13,14 +14,7 @@ import Distribution.Solver.Compat.Prelude hiding (fail)
data Progress step fail done = Step step (Progress step fail done)
| Fail fail
| Done done

-- This Functor instance works around a bug in GHC 7.6.3.
-- See https://gitlab.haskell.org/ghc/ghc/-/issues/7436#note_66637.
-- The derived functor instance caused a space leak in the solver.
instance Functor (Progress step fail) where
fmap f (Step s p) = Step s (fmap f p)
fmap _ (Fail x) = Fail x
fmap f (Done r) = Done (f r)
deriving (Functor)

-- | Consume a 'Progress' calculation. Much like 'foldr' for lists but with two
-- base cases, one for a final result and one for failure.
Expand Down
Loading