运行以下代码:
import Crypto.BCrypt
import Data.ByteString.Lazy.Char8
main = do
maybe_pwhash <- hashPasswordUsingPolicy slowerBcryptHashingPolicy (pack "hunter2")
print $ maybe_pwhash
我收到以下编译错误:
test.hs:5:70:
Couldn't match expected type `Data.ByteString.Internal.ByteString'
with actual type `ByteString'
In the return type of a call of `pack'
In the second argument of `hashPasswordUsingPolicy', namely
`(C.pack "hunter2")'
In a stmt of a 'do' block:
maybe_pwhash <- hashPasswordUsingPolicy
slowerBcryptHashingPolicy (pack "hunter2")
我很困惑,因为我不明白为什么Data.ByteString.Internal.ByteString
和ByteString
之间存在差异。
答案 0 :(得分:9)