*Sorry for the basic question, just started learning Haskell.
I am trying to write a function that will get a string and return an encrypted hash.
What I have come up with for the moment is:
encrypt :: ByteString -> ByteString
encrypt = do
x <- Crypto.Scrypt.encryptPassIO' (Pass "secret")
fmap Crypto.Scrypt.getEncryptedPass x
However I get the error:
• Couldn't match expected type ‘ByteString’
with actual type ‘IO ByteString’
• In a stmt of a 'do' block: x <- encryptPassIO' (Pass plain)
In the expression:
do { x <- encryptPassIO' (Pass plain);
fmap Crypto.Scrypt.getEncryptedPass x }
In an equation for ‘encrypt’:
encrypt plain
= do { x <- encryptPassIO' (Pass plain);
fmap Crypto.Scrypt.getEncryptedPass x }
Any idea how I can get rid of the IO?
Thanks!