Skip to content

Commit

Permalink
Make NodeComments monoid (#939)
Browse files Browse the repository at this point in the history
  • Loading branch information
toku-sa-n authored Aug 13, 2024
1 parent a074653 commit 0d2bd1f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/HIndent/Ast/NodeComments.hs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ instance Semigroup NodeComments where
, commentsAfter = commentsAfter x <> commentsAfter y
}

instance Monoid NodeComments where
mempty =
NodeComments
{commentsBefore = [], commentsOnSameLine = [], commentsAfter = []}

fromEpAnn :: GHC.EpAnn a -> NodeComments
fromEpAnn = fromEpAnn' . filterOutEofAndPragmasFromAnn

Expand Down

0 comments on commit 0d2bd1f

Please sign in to comment.