Stream: beginners

Topic: Newline formatting between methods


view this post on Zulip Chander Ramesh (Sep 07 2026 at 19:24):

Curious if this is intentional or not, but the Roc formatter currently finds this first one to be totally fine:

  Math :: [].{
      double : U64 -> U64
      double = |value| value * 2
      triple : U64 -> U64
      triple = |value| value * 3
  }

Whereas I prefer this:

  Math :: [].{
      double : U64 -> U64
      double = |value| value * 2

      triple : U64 -> U64
      triple = |value| value * 3
  }

(not a big deal, I made my own extension to the formatter afterwards, just curious)

view this post on Zulip Anton (Sep 08 2026 at 10:23):

I prefer the second version too. @Chander Ramesh does the formatter also change the second version to the first one, or does it just leave it as is?

view this post on Zulip Luke Boswell (Sep 08 2026 at 11:04):

I prefer the second also

I feel like if there is an annotation, we should always format with a preceding empty line.

On the other hand when there is no annotation I like to group things without spaces sometimes like

first = ...
second = ...
third = ...

view this post on Zulip Luke Boswell (Sep 08 2026 at 11:31):

@Chander Ramesh would you like to make a GH issue for these formatter changes?

view this post on Zulip Richard Feldman (Sep 08 2026 at 11:38):

Luke Boswell said:

I prefer the second also

I feel like if there is an annotation, we should always format with a preceding empty line.

On the other hand when there is no annotation I like to group things without spaces sometimes like

first = ...
second = ...
third = ...

this use case is the reason we currently don't enforce a blank line

view this post on Zulip Chander Ramesh (Sep 08 2026 at 18:21):

Anton said:

I prefer the second version too. Chander Ramesh does the formatter also change the second version to the first one, or does it just leave it as is?

Yup, it's okay with leaving it as it is currently; I have a small patch on my local formatter to mandate the second style.


Last updated: Sep 24 2026 at 15:59 UTC