私はコードを持っています
main :: IO()
main = runInputT defaultSettings loop
where
--loop :: InputT IO ()
loop = do
minput <- getInputLine "$ "
case minput of
Nothing -> return ()
Just input -> process $ words input
loop
プロセスに型定義がある場所
process :: [String] -> IO ()
ただし、次のエラーが表示されます。
• Couldn't match type ‘IO’ with ‘InputT m’
Expected type: InputT m ()
Actual type: IO ()
• In the expression: process $ words input
In a case alternative: Just input -> process $ words input
In a stmt of a 'do' block:
case minput of {
Nothing -> return ()
Just input -> process $ words input }
私が間違っていることを誰かが説明できるかどうか疑問に思っていました。他のことをするために getInputLine から生の入力をしたいだけです。
ありがとう