Skip to content

Commit

Permalink
Use -XRecordWildCards
Browse files Browse the repository at this point in the history
As prompted to do so in review
  • Loading branch information
philderbeast committed Dec 12, 2023
1 parent eb46bdc commit 729c659
Showing 1 changed file with 14 additions and 18 deletions.
32 changes: 14 additions & 18 deletions cabal-install/src/Distribution/Client/InstallSymlink.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE RecordWildCards #-}

-----------------------------------------------------------------------------

Expand Down Expand Up @@ -284,24 +285,19 @@ onSymlinkBinary
-- ^ Prompt action
-> Symlink
-> IO a
onSymlinkBinary
onMissing
onOverwrite
onNever
onPrompt
Symlink{overwritePolicy, publicBindir, privateBindir, publicName, privateName} = do
ok <-
targetOkToOverwrite
(publicBindir </> publicName)
(privateBindir </> privateName)
case ok of
NotExists -> onMissing
OkToOverwrite -> onOverwrite
NotOurFile ->
case overwritePolicy of
NeverOverwrite -> onNever
AlwaysOverwrite -> onOverwrite
PromptOverwrite -> onPrompt
onSymlinkBinary onMissing onOverwrite onNever onPrompt Symlink{..} = do
ok <-
targetOkToOverwrite
(publicBindir </> publicName)
(privateBindir </> privateName)
case ok of
NotExists -> onMissing
OkToOverwrite -> onOverwrite
NotOurFile ->
case overwritePolicy of
NeverOverwrite -> onNever
AlwaysOverwrite -> onOverwrite
PromptOverwrite -> onPrompt

-- | Can we symlink a binary?
--
Expand Down

0 comments on commit 729c659

Please sign in to comment.