Closed chshersh closed 2 years ago
Currently, the checkTool function has the following type:
checkTool
checkTool :: cmd -> Tool cmd -> IO ToolCheckResult
where ToolCheckResult is defined as follows:
ToolCheckResult
data ToolCheckResult = ToolNotFound Text | ToolWrongVersion Text | ToolOk
A value of ToolCheckResult is thrown as an exception here:
https://github.com/chshersh/iris/blob/6be65d46a5b3f2cabd09dedbc88045c4be4fb224/src/Iris/Env.hs#L138-L141
This is suboptimal because the result can never have the ToolOk constructors but we're forcing downstream users to handle this case.
ToolOk
So we want to split success and error cases in the ToolCheckResult type.
Currently, the
checkTool
function has the following type:where
ToolCheckResult
is defined as follows:A value of
ToolCheckResult
is thrown as an exception here:https://github.com/chshersh/iris/blob/6be65d46a5b3f2cabd09dedbc88045c4be4fb224/src/Iris/Env.hs#L138-L141
This is suboptimal because the result can never have the
ToolOk
constructors but we're forcing downstream users to handle this case.So we want to split success and error cases in the
ToolCheckResult
type.