From 729c659d2adc9549af5d5d88f4b6fb3dfc164fc2 Mon Sep 17 00:00:00 2001 From: Phil de Joux Date: Tue, 12 Dec 2023 15:13:16 -0500 Subject: [PATCH] Use -XRecordWildCards As prompted to do so in review --- .../src/Distribution/Client/InstallSymlink.hs | 32 ++++++++----------- 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/cabal-install/src/Distribution/Client/InstallSymlink.hs b/cabal-install/src/Distribution/Client/InstallSymlink.hs index f453bc15d14..13e29a44d81 100644 --- a/cabal-install/src/Distribution/Client/InstallSymlink.hs +++ b/cabal-install/src/Distribution/Client/InstallSymlink.hs @@ -1,6 +1,7 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE NamedFieldPuns #-} +{-# LANGUAGE RecordWildCards #-} ----------------------------------------------------------------------------- @@ -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? --