Home > Blockchain >  Is there a way to define multiple type synonyms in a single line?
Is there a way to define multiple type synonyms in a single line?

Time:01-19

My code is currently like this:

type Speed = Float
type Height = Float
type FuelMass = Float
type Gravity = Float

is there a way to not be wasting so much space by grouping the declarations, like

type (Speed, Height, FuelMass, Gravity) = Float

CodePudding user response:

No. A type definition is its own statement. If you really wanted to, you could group them on the same line by separating with semicolons instead of newlines, but this would be a very very unusual style.

  •  Tags:  
  • Related