Work with textbooks, etc. in ghci - so far so good. I don’t lose anything like this: my function creates the IO [FilePath]“thing”. In ghci, this happens as follows:
["xml","velocity.log.1","velocity.log"] (shortened for short)
I see that the function does what I want. The next step I want to “print” is myself.
Nothing I do allows me to print the result. I don't want to perpetuate my Java / C # / Python habits in Haskell - that makes no sense. I believe that a good reason for Haskell to do things differently, but I don’t see how to get the (limited) value from this function.
module Main (
main
) where
import RecursiveContents
main = do putStrLn "this"
getRecursiveContents "/home/xyz/myDir"
It works. But what if I want main to print the result getRecursiveContents "/home/xyz/myDir"?
ghci / getRecursiveContents "/home/xyz/myDir", - , ?
:
let xyz = getRecursiveContents "/home/xyz/myDir" ghci , xyz, :
xyz <enter> .
, .. .. , IO [FilePath] - , , [a], , , .
- - -, Haskell Real World Haskell. ?
- .