@@ -11,6 +11,7 @@ module Ormolu.Diff
13import BasicTypes (SourceText)
13import BasicTypes (SourceText)
14+import Data.ByteString (ByteString)
14import Data.Generics
15import Data.Generics
16import Ormolu.Imports (sortImports)
17import Ormolu.Imports (sortImports)
@@ -51,6 +52,12 @@ matchIgnoringSrcSpans = genericQuery
52 genericQuery :: GenericQ (GenericQ Diff)
53 genericQuery :: GenericQ (GenericQ Diff)
53 genericQuery x y
54 genericQuery x y
55+ -- NOTE 'ByteString' implement 'Data' instance manually and does not
56+ -- implement 'toConstr', so we have to deal with it in a special way.
57+ | Just x' <- cast x, Just y' <- cast y =
58+ if x' == (y' :: ByteString)
54 | typeOf x == typeOf y, toConstr x == toConstr y =
61 | typeOf x == typeOf y, toConstr x == toConstr y =
55 mconcat $ gzipWithQ
62 mconcat $ gzipWithQ
56 (genericQuery
63 (genericQuery