मैं हैकेल सीख रहा हूं और हास्केल कोड और मॉड्यूल का उपयोग करने के लिए कुछ छोटे परीक्षण कार्यक्रम लिखने का प्रयास करने का फैसला किया। वर्तमान में मैं Cypto.PasswordStore का उपयोग कर पासवर्ड हैश बनाने के लिए पहले तर्क का उपयोग करने की कोशिश कर रहा हूं। मेरे प्रोग्राम का परीक्षण करने के लिए मैं पहले तर्क से हैश बनाने की कोशिश कर रहा हूं और फिर हैश को स्क्रीन पर प्रिंट कर रहा हूं। मैं संदर्भ के रूप में निम्नलिखित लिंक का उपयोग कर रहा हैमैं एक डेटा कैसे डाल सकता हूं। ByteString.Internal.ByteString?
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)
लेकिन अब मैं कोई लाभ नहीं हुआ सिर्फ परीक्षण erroring हूँ:
import Crypto.PasswordStore
import System.Environment
main = do
args <- getArgs
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
धन्यवाद ! यह मेरे लिए काम करता है। कोड एक बहिष्कृत समारोह के बारे में चेतावनी देता है लेकिन जवाब मुझे चाहिए। _ चेतावनी: 'BputStrLn ' (डेटा.बेटस्ट्रिंग से आयातित) के उपयोग में: बहिष्कृत:" डेटा का उपयोग करें। ByteString.Char8.putStrLn इसके बजाय – NerdGGuy
@NerdGGuy चलो' डेटा.बेटस्ट्रिंग 'से पूरी तरह से छुटकारा पाएं और बस ' ।। Data.ByteString.Char8' बजाय तो (संपादित देखें) – AndrewC
ग्रेट का उपयोग Data.ByteString.Char8 मेरे लिए समझ में आता है – NerdGGuy