1
1
mirror of https://github.com/github/semantic.git synced 2024-11-28 18:23:44 +03:00

Eta-reduce the definition of unchanged.

This commit is contained in:
Rob Rix 2015-12-21 13:01:38 -05:00
parent 3c85d4d0af
commit c0a566be4a

View File

@ -163,7 +163,7 @@ spec = do
leftRow xs = Row (Line False xs) EmptyLine leftRow xs = Row (Line False xs) EmptyLine
rowText a b = Row (Line False [ Text a ]) (Line False [ Text b ]) rowText a b = Row (Line False [ Text a ]) (Line False [ Text b ])
info source category = Info (totalRange source) (Set.fromList [ category ]) info source category = Info (totalRange source) (Set.fromList [ category ])
unchanged source category = formatted source source category unchanged source = formatted source source
formatted source1 source2 category = Annotated (info source1 category, info source2 category) formatted source1 source2 category = Annotated (info source1 category, info source2 category)
offsetInfo by (Info (Range start end) categories) = Info (Range (start + by) (end + by)) categories offsetInfo by (Info (Range start end) categories) = Info (Range (start + by) (end + by)) categories
offsetAnnotated by1 by2 (Annotated (left, right) syntax) = Annotated (offsetInfo by1 left, offsetInfo by2 right) syntax offsetAnnotated by1 by2 (Annotated (left, right) syntax) = Annotated (offsetInfo by1 left, offsetInfo by2 right) syntax