626
fixed rule (lemmy.blahaj.zone)
you are viewing a single comment's thread
view the rest of the comments
[-] t_veor@sopuli.xyz 11 points 9 months ago

It's sometimes called comma-leading style where you move all the special characters to the front of the line and it is exceedingly common in Haskell, possibly due to how Haskell treats significant whitespace. You've surely seen list definitions that look like this:

someList =
  [ 1
  , 2
  , 3
  ] 

or a data definition like this:

data Color
  = Red
  | Green
  | Blue
  | RGB Int Int Int
  deriving (Show, Eq)

or a list of module exports like this:

module Foo
  { bar
  , baz
  , quux
  } 

Or in a long function type declaration where the arrows are moved to the start of the line, or a record definition, etc. etc.

this post was submitted on 10 Feb 2024
626 points (100.0% liked)

196

16439 readers
1752 users here now

Be sure to follow the rule before you head out.

Rule: You must post before you leave.

^other^ ^rules^

founded 1 year ago
MODERATORS