@@ -73,45 +73,43 @@ newtype R a = R (ReaderT RC (State SC) a)
7373
7474-- | Reader context of 'R'. This should be used when we control rendering by
7575-- enclosing certain expressions with wrappers.
76−data RC
77− = RC
78− { -- | Indentation level, as the column index we need to start from after
79− -- a newline if we break lines
80− rcIndent :: !Int,
81− -- | Current layout
82− rcLayout :: Layout,
83− -- | Spans of enclosing elements of AST
84− rcEnclosingSpans :: [RealSrcSpan],
85− -- | Collection of annotations
86− rcAnns :: Anns,
87− -- | Whether the last expression in the layout can use braces
88− rcCanUseBraces :: Bool,
89− -- | Whether the source could have used the record dot preprocessor
90− rcUseRecDot :: Bool
91− }
76+data RC = RC
77+ { -- | Indentation level, as the column index we need to start from after
78+ -- a newline if we break lines
79+ rcIndent :: !Int,
80+ -- | Current layout
81+ rcLayout :: Layout,
82+ -- | Spans of enclosing elements of AST
83+ rcEnclosingSpans :: [RealSrcSpan],
84+ -- | Collection of annotations
85+ rcAnns :: Anns,
86+ -- | Whether the last expression in the layout can use braces
87+ rcCanUseBraces :: Bool,
88+ -- | Whether the source could have used the record dot preprocessor
89+ rcUseRecDot :: Bool
90+ }
9291
9392-- | State context of 'R'.
94−data SC
95− = SC
96− { -- | Index of the next column to render
97− scColumn :: !Int,
98− -- | Rendered source code so far
99− scBuilder :: Builder,
100− -- | Span stream
101− scSpanStream :: SpanStream,
102− -- | Comment stream
103− scCommentStream :: CommentStream,
104− -- | Pending comment lines (in reverse order) to be inserted before next
105− -- newline, 'Int' is the indentation level
106− scPendingComments :: ![(CommentPosition, Int, Text)],
107− -- | Whether the current line is “dirty”, that is, already contains
108− -- atoms that can have comments attached to them
109− scDirtyLine :: !Bool,
110− -- | Whether to output a space before the next output
111− scRequestedDelimiter :: !RequestedDelimiter,
112− -- | Span of last output comment
113− scLastCommentSpan :: !(Maybe (Maybe HaddockStyle, RealSrcSpan))
114− }
93+data SC = SC
94+ { -- | Index of the next column to render
95+ scColumn :: !Int,
96+ -- | Rendered source code so far
97+ scBuilder :: Builder,
98+ -- | Span stream
99+ scSpanStream :: SpanStream,
100+ -- | Comment stream
101+ scCommentStream :: CommentStream,
102+ -- | Pending comment lines (in reverse order) to be inserted before next
103+ -- newline, 'Int' is the indentation level
104+ scPendingComments :: ![(CommentPosition, Int, Text)],
105+ -- | Whether the current line is “dirty”, that is, already contains
106+ -- atoms that can have comments attached to them
107+ scDirtyLine :: !Bool,
108+ -- | Whether to output a space before the next output
109+ scRequestedDelimiter :: !RequestedDelimiter,
110+ -- | Span of last output comment
111+ scLastCommentSpan :: !(Maybe (Maybe HaddockStyle, RealSrcSpan))
112+ }
115113
116114-- | Make sure next output is delimited by one of the following.
117115data RequestedDelimiter