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
Parenthesized function type gets an extra indent level where no outer function type needs it #3554
typeT=(LongTypeNameNumberOne -> LongTypeNameNumberTwo -> LongTypeNameNumberThree -> LongTypeNameNumberFour -> LongTypeNameNumberFive) list
Result
typeT=(LongTypeNameNumberOne
-> LongTypeNameNumberTwo
-> LongTypeNameNumberThree
-> LongTypeNameNumberFour
-> LongTypeNameNumberFive) list
Problem description
Since 8.0.0-alpha-003 (#3225, the fix for #3043), every multiline parenthesized function type indents its -> lines one extra level. 7.0.6 and 8.0.0-alpha-002 put them one level past (. 8.0.0-alpha-003, 8.0.10 and main put them two levels past it.
The extra level is only needed when the parenthesized type is part of an outer function type, as in #3043: there the old layout gives FS0010: Incomplete structured construct. I compiled the 7.0.6 layout in each context:
type T = (a -> b -> c) list (this sample): compiles
type application f<(a -> b -> c) list>: compiles
union case | Case of (a -> b -> c): compiles
record field F : (a -> b -> c): compiles
Expected: the extra level only inside an outer function type, and the 7.0.6 layout otherwise.
Extra information
The formatted result breaks my code.
The formatted result gives compiler warnings.
I or my company would be willing to help fix this.
I would like a release if this problem is solved.
Options
Fantomas main branch at 2026-10-17T10:43:43Z - f734124
Default Fantomas configuration
Did you know that you can ignore files when formatting by using a .fantomasignore file? PS: It's unlikely that someone else will solve your specific issue, as it's something that you have a personal stake in.
Activity
Cover a parenthesized function type after an arrow with indent size 2