【发布时间】:2011-02-08 16:16:30
【问题描述】:
我在此代码中收到无法匹配预期类型错误,我不确定原因。如果有人能指出我修复它的正确方向,将不胜感激。
import qualified Data.ByteString.Lazy as S
import Data.Binary.Get
import Data.Word
getBinary :: Get Word16
getBinary = do
a <- getWord16be "Test.class"
return (a)
main :: IO ()
main = do
contents <- S.getContents
print getBinary contents
具体而言,它无法将预期类型 'S.ByteString -> IO ()' 与推断类型 'IO ()' 匹配
【问题讨论】: