_ Haskell ã® "printf" ããã° Stateã¢ããã¨ãIORefã¨ã使ãããã°ã©ã ã ã¨ãå®è¡æä¸ã«ä¸èº«ãè¦ããããªãããã人ã unsafePerformIO 㧠print ããã¨ãè¨ãã®ã§ãããã¯ã¡ãã£ã¨å¾ ã¦ã¨ãHaskell ããã®æã®ããã°ããã«ããã®ã§ãä»ã®è¨èªã«ç§»ãã¨ããã®ã¯ãã¡ãã£ã¨ã ãå¾ ã£ã¦ã»ããã Haskell ã«ã¯ Debug.Trace ã¨ããã¢ã¸ã¥ã¼ã«ããã£ã¦ããã®ä¸ã® trace :: String -> a -> a ã¯ãIO ãæ°ã«ããã«æååãæ¨æºã¨ã©ã¼åºåã«åºããã®ã§ããã import "Debug.Trace" main = trace "Good morning" $ print "Hello, world" zsh% runghc TracingHello.hs 1> out.txt 2> err.txt zsh% cat out
{{#tags}}- {{label}}
{{/tags}}