extra newline after putStrLn?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

extra newline after putStrLn?

Doug McIlroy
Why does putStrln "" produce two newlines in hugs, but one in ghci?

Doug McIlroy
_______________________________________________
Hugs-Users mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/hugs-users
Reply | Threaded
Open this post in threaded view
|

Re: extra newline after putStrLn?

Neil Mitchell
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


On Sun, Aug 3, 2014 at 9:44 PM, Doug McIlroy <[hidden email]> wrote:
> Why does putStrln "" produce two newlines in hugs, but one in ghci?
>
> Doug McIlroy
> _______________________________________________
> Hugs-Users mailing list
> [hidden email]
> http://www.haskell.org/mailman/listinfo/hugs-users
_______________________________________________
Hugs-Users mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/hugs-users