cabal-install-solver-3.10.1.0: The command-line interface for Cabal and Hackage.

Safe Haskell | Safe-Inferred
Language | Haskell2010

Distribution.Solver.Modular.RetryLog

Synopsis

- data RetryLog step fail done
- toProgress :: RetryLog step fail done -> Progress step fail done
- fromProgress :: Progress step fail done -> RetryLog step fail done
- mapFailure :: (fail1 -> fail2) -> RetryLog step fail1 done -> RetryLog step fail2 done
- retry :: RetryLog step fail1 done -> (fail1 -> RetryLog step fail2 done) -> RetryLog step fail2 done
- failWith :: step -> fail -> RetryLog step fail done
- succeedWith :: step -> done -> RetryLog step fail done
- continueWith :: step -> RetryLog step fail done -> RetryLog step fail done
- tryWith :: Message -> RetryLog Message fail done -> RetryLog Message fail done

# Documentation

data RetryLog step fail done #

`Progress` as a difference list that allows efficient appends at failures.

toProgress :: RetryLog step fail done -> Progress step fail done #

O(1). Convert a `RetryLog` to a `Progress`.

fromProgress :: Progress step fail done -> RetryLog step fail done #

O(N). Convert a `Progress` to a `RetryLog`.

mapFailure :: (fail1 -> fail2) -> RetryLog step fail1 done -> RetryLog step fail2 done #

O(1). Apply a function to the failure value in a log.

retry :: RetryLog step fail1 done -> (fail1 -> RetryLog step fail2 done) -> RetryLog step fail2 done #

O(1). If the first log leads to failure, continue with the second.

failWith :: step -> fail -> RetryLog step fail done #

O(1). Create a log with one message before a failure.

succeedWith :: step -> done -> RetryLog step fail done #

O(1). Create a log with one message before a success.

continueWith :: step -> RetryLog step fail done -> RetryLog step fail done #

O(1). Prepend a message to a log.

tryWith :: Message -> RetryLog Message fail done -> RetryLog Message fail done #

O(1). Prepend the given message and `Enter` to the log, and insert `Leave` before the failure if the log fails.