次の Haskell スニピットはコンパイルされず、その理由がわかりません。
runCompiler :: TC -> IO ()
runCompiler tc = let cp' = cp in
do
cp'
return ()
where
cp = compileProg tc
GHCi から次のエラーが表示されます。
Couldn't match expected type `IO a0' with actual type `String'
In a stmt of a 'do' block: cp'
In the expression:
do { cp';
return () }
In the expression:
let cp' = cp
in
do { cp';
return () }
コンパイルするために何をすべきかについてのアイデア。与えられた最終値として () を受け入れない理由がわかりません。