Skip to content

Commit

Permalink
implement case expression for displaySeverity
Browse files Browse the repository at this point in the history
  • Loading branch information
aleeusgr committed Oct 18, 2023
1 parent 95cfcdc commit b0bbbbb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
8 changes: 4 additions & 4 deletions cabal-install/src/Distribution/Client/Init/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -458,10 +458,10 @@ instance Exception BreakException
data Severity = Info | Warning | Error deriving (Eq)

displaySeverity :: Severity -> String
displaySeverity severity
| severity == Info = "Info"
| severity == Warning = "Warn"
| severity == Error = "Err"
displaySeverity severity = case severity of
Info -> "Info"
Warning -> "Warn"
Error -> "Err"

-- | Convenience alias for the literate haskell flag
type IsLiterate = Bool
Expand Down
12 changes: 7 additions & 5 deletions cabal-install/tests/IntegrationTests2/config/default-config
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ repository hackage.haskell.org
-- store-dir:
-- active-repositories:
-- local-no-index-repo:
remote-repo-cache: /home/colton/.cabal/packages
-- logs-dir: /home/colton/.cabal/logs
remote-repo-cache: /home/alex/.cabal/packages
-- logs-dir: /home/alex/.cabal/logs
-- default-user-config:
-- verbose: 1
-- compiler: ghc
Expand Down Expand Up @@ -104,24 +104,26 @@ remote-repo-cache: /home/colton/.cabal/packages
-- index-state:
-- root-cmd:
-- symlink-bindir:
build-summary: /home/colton/.cabal/logs/build.log
build-summary: /home/alex/.cabal/logs/build.log
-- build-log:
remote-build-reporting: none
-- report-planning-failure: False
-- per-component: True
-- run-tests:
-- semaphore: False
jobs: $ncpus
-- keep-going: False
-- offline: False
-- lib: False
-- package-env:
-- overwrite-policy:
-- install-method:
installdir: /home/colton/.cabal/bin
installdir: /home/alex/.cabal/bin
-- token:
-- username:
-- password:
-- password-command:
-- multi-repl:
-- builddir:

haddock
Expand Down Expand Up @@ -161,7 +163,7 @@ init
-- source-dir: src

install-dirs user
-- prefix: /home/colton/.cabal
-- prefix: /home/alex/.cabal
-- bindir: $prefix/bin
-- libdir: $prefix/lib
-- libsubdir: $abi/$libname
Expand Down

0 comments on commit b0bbbbb

Please sign in to comment.