My comment on this post has all the code on one line:

ninjagecko unfortunatelly Your code doesn't work for me. I have changed my code and now it works (unfortunatelly i don't know how I can write code in comment - why all code is in one line ?): main = do db <- loadFile "db.txt" mainMenu db mainMenu rs = do putStrLn "Choose option:" n <- getLine case n of "1" -> do menuRectangles rs; mainMenu rs "2" -> putStrLn "bye, bye" otherwise -> do putStrLn "Bad option"; mainMenu rs

Why is it displayed that way? It looks horrible

  • Stack Overflow does have ways to properly format code. You can always use the braces in the toolbar above the answer box and see what you get. Apr 19, 2011 at 16:51
  • 2
    That's your second question on this subject posted (wrongly) on stackoverflow. This type of questions should be posted on the meta website, only after reading the documentation from the FAQ.
    – AdrianMar
    Apr 19, 2011 at 16:51
  • So how I can show multi-line code in comment ? I won't click SHIFT + ENTER 100 times in each line.
    – user160517
    Apr 19, 2011 at 17:02
  • 7
    Read my answer. You cannot show multi-line code in comments because you cannot write multi-line comments. In the case of the question you linked, you can add that code as an edit to your original question.
    – Matt Ball
    Apr 19, 2011 at 17:04
  • Thx for answer Matt. May I know why you don't want to allow users write multi-line comments ?
    – user160517
    Apr 19, 2011 at 17:08
  • 4
    @user160517: Because the body of the question / answer is for substantial content relevant to the problem / solution. Apr 19, 2011 at 17:36
  • 2
    If you need to add code edit your question or answer.
    – ChrisF Mod
    Apr 19, 2011 at 20:30

1 Answer 1


Because that's Stack Exchange comments work: you only get to a newline by line wrapping.

Multiple lines are not supported in comments, and will never be.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .