We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Iris.need is the main function for checking whether a specified tool executable in PATH:
Iris.need
need :: MonadIO m => [Tool] -> m ()
It supposed to be used like this in the main application code:
app :: App () app = Iris.asksCliEnv Iris.cliEnvCmd >>= \case Download url -> do need ["curl"] runDownload url Evaluate hs -> do need ["ghc", "cabal"] runEvaluate hs
Where the Tool type is the following:
Tool
iris/src/Iris/Tool.hs
Lines 43 to 71 in c1597ee
It does the job but it's a bit suboptimal and maybe inconvenient at times.
I'd love to improve this API in the following way:
With such an eDSL, it should be possible to write the following code:
ghc :: Iris.Tool ghc = "ghc" `Iris.versionAtLeast` [8, 10, 7] `Iris.usingVersionFlag` "--numeric-version" cabal :: Iris.Tool cabal = "cabal" `Iris.versionAtLeast` [3, 6, 2, 0] `Iris.usingVersionFlag` "--numeric-version" app :: App () app = Iris.asksCliEnv Iris.cliEnvCmd >>= \case Download url -> do need ["curl"] runDownload url Evaluate hs -> do need [ghc, cabal] runEvaluate hs
The checkToolFunction should patched accordingly.
checkToolFunction
The text was updated successfully, but these errors were encountered:
Part of the API improvements are described in:
Sorry, something went wrong.
I'd like to work on this after #97 is merged, but I don't understand what you're suggesting on the second task. Could you help clarifying it please?
No branches or pull requests
Iris.need
is the main function for checking whether a specified tool executable in PATH:It supposed to be used like this in the main application code:
Where the
Tool
type is the following:iris/src/Iris/Tool.hs
Lines 43 to 71 in c1597ee
It does the job but it's a bit suboptimal and maybe inconvenient at times.
I'd love to improve this API in the following way:
With such an eDSL, it should be possible to write the following code:
The
checkToolFunction
should patched accordingly.The text was updated successfully, but these errors were encountered: