Stream: compiler development

Topic: roc fmt empty line between functions


view this post on Zulip Anton (Apr 21 2026 at 09:27):

Can I make roc fmt add an empty line between the last line of the function implementation and the next doc comment?
So, this:

        is_empty : Str -> Bool
        is_empty = |str| Str.count_utf8_bytes(str) == 0
        ## Concatenates two strings together.
        ## ```roc
        ## expect "ab".concat("cd") == "abcd"
        ## expect "hello".concat("") == "hello"
        ## expect "".concat("") == ""
        ## ```
        concat : Str, Str -> Str
        ## Determines whether or not the first Str contains the second.
        ## ```roc
        ## expect "foobarbaz".contains("bar")
        ## expect !"apple".contains("orange")
        ## expect "anything".contains("")
        ## ```
        contains : Str, Str -> Bool

Becomes:

        is_empty : Str -> Bool
        is_empty = |str| Str.count_utf8_bytes(str) == 0

        ## Concatenates two strings together.
        ## ```roc
        ## expect "ab".concat("cd") == "abcd"
        ## expect "hello".concat("") == "hello"
        ## expect "".concat("") == ""
        ## ```
        concat : Str, Str -> Str

        ## Determines whether or not the first Str contains the second.
        ## ```roc
        ## expect "foobarbaz".contains("bar")
        ## expect !"apple".contains("orange")
        ## expect "anything".contains("")
        ## ```
        contains : Str, Str -> Bool

view this post on Zulip Luke Boswell (Apr 21 2026 at 09:40):

I like that -- but only when there is a doc comment.

view this post on Zulip Anton (Apr 21 2026 at 13:08):

I created "good first issue" #9356 for this.


Last updated: May 01 2026 at 12:45 UTC