I implemented a quote decompiler as part of a larger open source project, Unquote . It can decompile many simple expressions specified in F # as single-line strings without syntax highlighting (see the main page of the project for a list of decompiler functions). For example,
> decompile <@ (11 + 3) / 2 = String.length ("hello world".Substring(4, 5)) @>;;
val it : string =
"(11 + 3) / 2 = String.length ("hello world".Substring(4, 5))"
@Kurt Schelfthout , F # Quotations . , , F #. , , Unquote F # :
> decompile <@ match true with | true -> "hi" | _ -> "bye" @>;;
val it : string =
"let matchValue = true in if matchValue then "hi" else "bye""
> decompile <@ seq {yield 1; yield 2} @>;;
val it : string =
"seq (Seq.delay (fun unitVar -> Seq.append (Seq.singleton 1) (Seq.delay (fun unitVar -> Seq.singleton 2))))"
Infix ( ), , , ( , ). Unquote .