fsharp / fslang-design

RFCs and docs related to the F# language design process, see https://github.com/fsharp/fslang-suggestions to submit ideas
512 stars 142 forks source link

[style-guide] Treat cast operators :> and :?> as pipe operators #737

Open cmeeren opened 1 year ago

cmeeren commented 1 year ago

I suggest that the style guide is updated to specify that the cast operators :> and :?> can be treated as pipelines when formatting.

For example, for a suitable max width, Fantomas currently formats

MyImpl(arg) :> MyInterface |> MyUnionCase

as

MyImpl(arg) :> MyInterface
|> MyUnionCase

whereas I'd suggest

MyImpl(arg)
:> MyInterface
|> MyUnionCase