You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
0.9.0.0 regression with multiline comment + record con #1225
dataFutureSumType={- | This is what the documentation for this type looks like. It is pretty awkward that the @--@s aren't aligned.-}SingleConstructor{someRecordField::Bool
, someOtherRecordField::Int}
At Ormolu Live, this formats to
dataFutureSumType={- | This is what the documentation for this type looks like. It is pretty awkward that the @--@s aren't aligned.-}SingleConstructor{someRecordField::Bool,
someOtherRecordField::Int}
Expected behavior
Should be a fixed point.
Ormolu 0.8.1.1 formatted this as
dataFutureSumType=--| This is what the documentation for this type looks like.-- It is pretty awkward that the @--@s aren't aligned.SingleConstructor{someRecordField::Bool,
someOtherRecordField::Int}
Which isn't great, but at least the constructor is at the correct column
Environment
OS name + version:
Version of the code:
Additional context
Add any other context about the problem here.
dataFutureSumType={- | This is what the documentation for this type looks like. It is pretty awkward that the @--@s aren't aligned.-}SingleConstructor{someRecordField::Bool,
someOtherRecordField::Int}
| Foo
Formats to expected:
dataFutureSumType={- | This is what the documentation for this type looks like. It is pretty awkward that the @--@s aren't aligned.-}SingleConstructor{someRecordField::Bool,
someOtherRecordField::Int}
| Foo
That is expected. And in this case diff is smaller in 0.8, so the same should be for 0.9 as well. Thanks for the report we will take a loot.
data FutureSumType
= {- This is what the documentation for this type looks like.
It is pretty awkward that the @--@s aren't aligned.
-}
SingleConstructor
{ someRecordField :: Bool
, someOtherRecordField :: Int
}
data FutureSumType
= {- This is what the documentation for this type looks like.
It is pretty awkward that the @--@s aren't aligned.
-}
SingleConstructor
{ someRecordField :: Bool,
someOtherRecordField :: Int
}
And with a constructor
data FutureSumType
= {- This is what the documentation for this type looks like.
It is pretty awkward that the @--@s aren't aligned.
-}
SingleConstructor
{ someRecordField :: Bool,
someOtherRecordField :: Int
}
| Foo
And with line comments only:
data FutureSumType
= -- This is what the documentation for this type looks like.
-- It is pretty awkward that the @--@s aren't aligned.
SingleConstructor
{ someRecordField :: Bool,
someOtherRecordField :: Int
}
And
data FutureSumType
= SingleConstructor
{ someRecordField :: Bool,
someOtherRecordField :: Int
}
With all of that I think it worth restoring at least behaviour of the comments
Activity
qnikst commentedon Oct 4, 2026
Thanks for the comment. Also I noticed that:
Formats to expected:
That is expected. And in this case diff is smaller in 0.8, so the same should be for 0.9 as well. Thanks for the report we will take a loot.
qnikst commentedon Oct 4, 2026
@brandonchinn178 thanks for report. There is a fix in a linked branch. We will recheck that it does not lead to any problems and publish.
qnikst commentedon Oct 5, 2026
Ok, without haddock I have:
And with a constructor
And with line comments only:
And
With all of that I think it worth restoring at least behaviour of the comments