<span style="font-family: courier new,monospace;">I'm trying to translate this HXT code to use the Arrow 'do' syntax:<br>readWriteDoc :: String -> IOSLA (XIOState s) b Int<br>readWriteDoc path = readDocument [(a_validate, "0")] path
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"></span><span style="font-family: courier new,monospace;"> >>> writeDocument [(a_output_encoding, isoLatin1)] "-"
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> >>> getErrStatus</span><br style="font-family: courier new,monospace;"><br>This attempt fails to compile:
<span style="font-family: courier new,monospace;"><br></span><span style="font-family: courier new,monospace;">readWriteDoc :: String -> IOSLA (XIOState s) b Int</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
readWriteDoc = proc path -> do </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> doc <- readDocument [(a_validate, "0")] -< path
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"></span><span style="font-family: courier new,monospace;"> result <- writeDocument [(a_output_encoding, isoLatin1)] "-" -< doc
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> getErrStatus -< result<br><br>I get this error message:<br> Couldn't match `(->)' against `IOSLA (XIOState s)'
<br> Expected type: t -> t1<br> Inferred type: IOStateArrow s XmlTree XmlTree<br> Probable cause: `writeDocument' is applied to too many arguments in the call<br><br> (writeDocument [(a_output_encoding, isoLatin1)] "-")
<br> In the command: writeDocument [(a_output_encoding, isoLatin1)] "-" -< doc<br style="font-family: courier new,monospace;"></span><span style="font-family: courier new,monospace;"><br><br>Any idea what I'm doing wrong?
<br></span><br>Thanks,<br>Greg<br><br>