Skip to content

Commit b79ae03

Browse files
committed
[Unrelated] Rename showR -> showB
1 parent 919ad4a commit b79ae03

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

src/Generics/Diff/Render.hs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ module Generics.Diff.Render
2929
, renderDoc
3030
, listDiffErrorDoc
3131
, diffErrorNestedDoc
32-
, showR
32+
, showB
3333
, linesDoc
3434
, makeDoc
3535
)
@@ -128,13 +128,13 @@ Length of right list: 5
128128
listDiffErrorDoc :: TB.Builder -> ListDiffError a -> Doc
129129
listDiffErrorDoc lst = \case
130130
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)"
132132
in makeDoc lns err
133133
WrongLengths l r ->
134134
linesDoc $
135135
(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
138138
]
139139

140140
{- | Convert a 'DiffErrorNested' to a 'Doc'.
@@ -213,7 +213,7 @@ unpackAtLocErr cInfo nsErr =
213213

214214
renderRField :: RField -> TB.Builder
215215
renderRField = \case
216-
IdxField n -> "In field " <> showR n <> " (0-indexed)"
216+
IdxField n -> "In field " <> showB n <> " (0-indexed)"
217217
InfixField side -> case side of
218218
ILeft -> "In the left-hand field"
219219
IRight -> "In the right-hand field"
@@ -227,9 +227,9 @@ unlinesB (b : bs) = b <> TB.singleton '\n' <> unlinesB bs
227227
unlinesB [] = mempty
228228

229229
-- | '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 #-}
233233

234234
liftANS :: forall f g xs. (forall a. f a -> g a) -> NS f xs -> NS g xs
235235
liftANS f = go
@@ -242,7 +242,7 @@ liftANS f = go
242242
mkIndent :: RenderOpts -> Bool -> Int -> TB.Builder
243243
mkIndent RenderOpts {..} isFirst ind =
244244
let spaces = TB.fromText (T.replicate (ind * fromIntegral indentSize) " ")
245-
number = showR (ind + 1) <> ". "
245+
number = showB (ind + 1) <> ". "
246246
noNumber = " "
247247

248248
withNumber = spaces <> number

src/Generics/Diff/Special.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,16 @@ instance ('Generics.Diff.Diff' a) => 'SpecialDiff' [a] where
4747
'DiffAtIndex' idx err ->
4848
let
4949
-- top line
50-
lns = pure $ "Diff at " <> lst <> " index " <> 'Generics.Diff.Render.showR' idx <> " (0-indexed)"
50+
lns = pure $ "Diff at " <> lst <> " index " <> 'Generics.Diff.Render.showB' idx <> " (0-indexed)"
5151
in
5252
-- 'Generics.Diff.Render.makeDoc' is a smart constructor for a 'Doc' with a sub error
5353
'Generics.Diff.Render.makeDoc' lns err
5454
'WrongLengths' l r ->
5555
-- 'Generics.Diff.Render.linesDoc' is a smart constructor for a 'Doc' without a sub error
5656
'Generics.Diff.Render.linesDoc' $
5757
(lst <> "s are wrong lengths")
58-
:| [ "Length of left list: " <> 'Generics.Diff.Render.showR' l
59-
, "Length of right list: " <> 'Generics.Diff.Render.showR' r
58+
:| [ "Length of left list: " <> 'Generics.Diff.Render.showB' l
59+
, "Length of right list: " <> 'Generics.Diff.Render.showB' r
6060
]
6161
@
6262

0 commit comments

Comments
 (0)