• barsoap
    link
    fedilink
    arrow-up
    4
    ·
    1 month ago

    It’s not just old Haskell code that’s how you write Haskell if you want explicit braces. Well, mostly generate, but it’s still the idiomatic formatting (and when you generate you always generate braces because it’s easy to get layout subtly wrong when generating).

    Haskell also does the whole

    data Foo = Bar
             | Baz
             | Quux
    
    foo = [ Bar
          , Baz
          , Quux
          ]
    

    thing, makes sense to apply it to braces especially as they’re seen only very rarely. Single-line, yes, but not multi-line.