So I work with files, and I need to know the largest line in file X. Using Unix awk results in a Int that I m looking for. But in Haskell how can I return that value and save it to a variable?
I tried define something with IO [Int] -> [Int]
maxline = do{system "awk { if ( length > x ) { x = length } }END{ print x } filename";}
工作原因:
Couldn t match expected type Int ,against inferred type IO GHC.IO.Exception.ExitCode