Discussion:
[Hugs-users] extra newline after putStrLn?
Doug McIlroy
2014-08-03 20:44:38 UTC
Permalink
Why does putStrln "" produce two newlines in hugs, but one in ghci?

Doug McIlroy
Neil Mitchell
2014-08-03 20:59:33 UTC
Permalink
Generally in Hugs, after doing an IO thing, it writes out a newline.
In GHCi, it doesn't. On balance, I think the Hugs way is better, since
in GHC it's easy to get to:

Prelude> putStrLn "foo"
foo
Prelude> putStr "foo"
fooPrelude>

While in Hugs:

Hugs> putStrLn "foo"
foo

Hugs> putStr "foo"
foo
Hugs>

So it's nothing fundamental, just a difference in what to do after
some arbitrary IO.

Thanks, Neil
Post by Doug McIlroy
Why does putStrln "" produce two newlines in hugs, but one in ghci?
Doug McIlroy
_______________________________________________
Hugs-Users mailing list
http://www.haskell.org/mailman/listinfo/hugs-users
Loading...