@@ -29,7 +29,7 @@ module Generics.Diff.Render
29
29
, renderDoc
30
30
, listDiffErrorDoc
31
31
, diffErrorNestedDoc
32
- , showR
32
+ , showB
33
33
, linesDoc
34
34
, makeDoc
35
35
)
@@ -128,13 +128,13 @@ Length of right list: 5
128
128
listDiffErrorDoc :: TB. Builder -> ListDiffError a -> Doc
129
129
listDiffErrorDoc lst = \ case
130
130
DiffAtIndex idx err ->
131
- let lns = pure $ " Diff at " <> lst <> " index " <> showR idx <> " (0-indexed)"
131
+ let lns = pure $ " Diff at " <> lst <> " index " <> showB idx <> " (0-indexed)"
132
132
in makeDoc lns err
133
133
WrongLengths l r ->
134
134
linesDoc $
135
135
(lst <> " s are wrong lengths" )
136
- :| [ " Length of left list: " <> showR l
137
- , " Length of right list: " <> showR r
136
+ :| [ " Length of left list: " <> showB l
137
+ , " Length of right list: " <> showB r
138
138
]
139
139
140
140
{- | Convert a 'DiffErrorNested' to a 'Doc'.
@@ -213,7 +213,7 @@ unpackAtLocErr cInfo nsErr =
213
213
214
214
renderRField :: RField -> TB. Builder
215
215
renderRField = \ case
216
- IdxField n -> " In field " <> showR n <> " (0-indexed)"
216
+ IdxField n -> " In field " <> showB n <> " (0-indexed)"
217
217
InfixField side -> case side of
218
218
ILeft -> " In the left-hand field"
219
219
IRight -> " In the right-hand field"
@@ -227,9 +227,9 @@ unlinesB (b : bs) = b <> TB.singleton '\n' <> unlinesB bs
227
227
unlinesB [] = mempty
228
228
229
229
-- | 'show' a value as a 'TB.Builder'.
230
- showR :: (Show a ) => a -> TB. Builder
231
- showR = TB. fromString . show
232
- {-# INLINE showR #-}
230
+ showB :: (Show a ) => a -> TB. Builder
231
+ showB = TB. fromString . show
232
+ {-# INLINE showB #-}
233
233
234
234
liftANS :: forall f g xs . (forall a . f a -> g a ) -> NS f xs -> NS g xs
235
235
liftANS f = go
@@ -242,7 +242,7 @@ liftANS f = go
242
242
mkIndent :: RenderOpts -> Bool -> Int -> TB. Builder
243
243
mkIndent RenderOpts {.. } isFirst ind =
244
244
let spaces = TB. fromText (T. replicate (ind * fromIntegral indentSize) " " )
245
- number = showR (ind + 1 ) <> " . "
245
+ number = showB (ind + 1 ) <> " . "
246
246
noNumber = " "
247
247
248
248
withNumber = spaces <> number
0 commit comments