私は haskell を学んでいて、Haskell コードとモジュールの使用に慣れるためにいくつかの小さなテスト プログラムを作成してみることにしました。現在、最初の引数を使用して、Cypto.PasswordStore を使用してパスワード ハッシュを作成しようとしています。プログラムをテストするために、最初の引数からハッシュを作成し、そのハッシュを画面に出力しようとしています。
import Crypto.PasswordStore
import System.Environment
main = do
args <- getArgs
putStrLn (makePassword (head args) 12)
次のエラーが表示されます。
testmakePassword.hs:8:19:
Couldn't match expected type `String'
with actual type `IO Data.ByteString.Internal.ByteString'
In the return type of a call of `makePassword'
In the first argument of `putStrLn', namely
`(makePassword (head args) 12)'
In a stmt of a 'do' block: putStrLn (makePassword (head args) 12)
私は次のリンクを参照として使用してきましたが、今は試行錯誤しているだけで役に立ちません。 http://hackage.haskell.org/packages/archive/bytestring/0.9.0.4/doc/html/Data-ByteString-Internal.html http://hackage.haskell.org/packages/archive/pwstore-purehaskell/2.1 /doc/html/Crypto-PasswordStore.html