SYNOPSIS 的にコード片を書いてみる。runghcへ標準入力からぶっ込んで試せる感じの方がREPLよりしっくり来る派なので。
% runghc
import System.Process
main = do
name <- readProcess "hostname" [] []
let chompedName = filter (/= '\n') name
putStrLn $ "Hello, " ++ chompedName ++ "!"
-- [実行結果]
-- Hello, mymac.local!