You can post code snippets by doing the following:

  1. Create a Post
  2. Click the Edit Html tab
  3. Enter <pre></pre> and paste the code between the pre tags.

This will preserve the whitespace. Below is an example:

fun fact(n) =
  case n
    of 0 => 1
     | x => fact(x * fact(x - 1))

val ans = fact(5)
val () = print(Int.toString(ans))
val () = print("\\n")