about summary refs log tree commit diff
path: root/users/Profpatsch/my-prelude/src/Tool.hs
diff options
context:
space:
mode:
authorProfpatsch <mail@profpatsch.de>2023-10-15T18·16+0200
committerclbot <clbot@tvl.fyi>2023-10-15T18·58+0000
commit0a98f8ec3b7c98b53e9bb1203cb5b63ecdc068ce (patch)
treed30e5a18cf121605767d5905abf50807ca7be6db /users/Profpatsch/my-prelude/src/Tool.hs
parent9aafbe8d952d6e31fa7273572f00ec79d9d15554 (diff)
chore(third_party/haskell): update pa packages r/6816
Change-Id: I8abcb479b0f5c0bd6ed1abc3c9618c2362ff835a
Reviewed-on: https://cl.tvl.fyi/c/depot/+/9740
Autosubmit: Profpatsch <mail@profpatsch.de>
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
Diffstat (limited to 'users/Profpatsch/my-prelude/src/Tool.hs')
-rw-r--r--users/Profpatsch/my-prelude/src/Tool.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/users/Profpatsch/my-prelude/src/Tool.hs b/users/Profpatsch/my-prelude/src/Tool.hs
index 066f68bbe0df..b773f4444e87 100644
--- a/users/Profpatsch/my-prelude/src/Tool.hs
+++ b/users/Profpatsch/my-prelude/src/Tool.hs
@@ -31,12 +31,12 @@ readTools env toolParser =
       Exit.die [fmt|Please set {env.toolsEnvVar} to a directory with all tools we need (see `Tools` in the code).|]
     Just toolsDir ->
       (Posix.fileExist toolsDir & ifTrueOrErr () [fmt|{env.toolsEnvVar} directory does not exist: {toolsDir}|])
-        & thenValidate
+        & thenValidateM
           ( \() ->
               (Posix.getFileStatus toolsDir <&> Posix.isDirectory)
                 & ifTrueOrErr () [fmt|{env.toolsEnvVar} does not point to a directory: {toolsDir}|]
           )
-        & thenValidate
+        & thenValidateM
           (\() -> toolParser.unToolParser toolsDir)
         <&> first (errorTree [fmt|Could not find all tools in {env.toolsEnvVar}|])
         >>= \case
@@ -61,14 +61,14 @@ readTool exeName = ToolParserT $ \toolDir -> do
   let exec = True
   Posix.fileExist toolPath
     & ifTrueOrErr () [fmt|Tool does not exist: {toolPath}|]
-    & thenValidate
+    & thenValidateM
       ( \() ->
           Posix.fileAccess toolPath read' write exec
             & ifTrueOrErr (Tool {..}) [fmt|Tool is not readable/executable: {toolPath}|]
       )
 
 -- | helper
-ifTrueOrErr :: Functor f => a -> Text -> f Bool -> f (Validation (NonEmpty Error) a)
+ifTrueOrErr :: (Functor f) => a -> Text -> f Bool -> f (Validation (NonEmpty Error) a)
 ifTrueOrErr true err io =
   io <&> \case
     True -> Success true