I am learning Haskell and I'm not very good at it yet... Some of the tutorials I've read (Haskell's String IO and Learn You a Haskell) have explained a lot of things about IO, but I still could not write my desired function:
TutorialCopy inputName outputName = do
contents <- Str.readFile inputName -- Opens the target File.
writeFile outputName contents -- Creates the destination File.
The Idea here was to read a file based on the Input File's location ('inputName') and have it's contents transferred to the Output File ('outputName'). I have also tried the function type:
TutorialCopy :: FilePath -> FilePath -> IO ()
Or even:
TutorialCopy :: String -> String -> IO ()
With no success whatsoever, as GHCi returns signature errors when I declare the signature or a data constructor error when I don't.
I appreciate all the help, thank you!