我尝试了什么:
main :: IO ()
main = do
let eitherSuccessOrErrorLine = inshellWithErr "stack build" empty
stackBuildOutput <- strict $ case eitherSuccessOrErrorLine of
Shell (Left line) -> line
Shell (Right line) -> line
putStr stackBuildOutput
错误信息:
src/Main.hs:34:12: error:
• Couldn't match expected type ‘Turtle.Shell.FoldShell
(Either Turtle.Line.Line Turtle.Line.Line) r0
-> IO r0’
with actual type ‘Either (Shell Turtle.Line.Line) b0’
• In the pattern: Left line
In the pattern: Shell (Left line)
In a case alternative: Shell (Left line) -> line
|
34 | Shell (Left line) -> line
| ^^^^^^^^^
src/Main.hs:35:12: error:
• Couldn't match expected type ‘Turtle.Shell.FoldShell
(Either Turtle.Line.Line Turtle.Line.Line) r1
-> IO r1’
with actual type ‘Either a0 (Shell Turtle.Line.Line)’
• In the pattern: Right line
In the pattern: Shell (Right line)
In a case alternative: Shell (Right line) -> line
|
35 | Shell (Right line) -> line
| ^^^^^^^^^^