@@ -56,31 +56,31 @@ encodeToTextBuilder :: ToJSON a => a -> Builder
56
56
encodeToTextBuilder =
57
57
go . toJSON
58
58
where
59
- go Null = {-# SCC "go/Null" #-} " null"
60
- go (Bool b) = {-# SCC "go/Bool" #-} if b then " true" else " false"
61
- go (Number s) = {-# SCC "go/Number" #-} fromScientific s
62
- go (String s) = {-# SCC "go/String" #-} string s
59
+ go Null = " null"
60
+ go (Bool b) = if b then " true" else " false"
61
+ go (Number s) = fromScientific s
62
+ go (String s) = string s
63
63
go (Array v)
64
- | V. null v = {-# SCC "go/Array" #-} " []"
65
- | otherwise = {-# SCC "go/Array" #-}
64
+ | V. null v = " []"
65
+ | otherwise =
66
66
TB. singleton ' [' <>
67
67
go (V. unsafeHead v) <>
68
68
V. foldr f (TB. singleton ' ]' ) (V. unsafeTail v)
69
69
where f a z = TB. singleton ' ,' <> go a <> z
70
- go (Object m) = {-# SCC "go/Object" #-}
70
+ go (Object m) =
71
71
case KM. toList m of
72
72
(x: xs) -> TB. singleton ' {' <> one x <> foldr f (TB. singleton ' }' ) xs
73
73
_ -> " {}"
74
74
where f a z = TB. singleton ' ,' <> one a <> z
75
75
one (k,v) = string (Key. toText k) <> TB. singleton ' :' <> go v
76
76
77
77
string :: T. Text -> Builder
78
- string s = {-# SCC "string" #-} TB. singleton ' "' <> quote s <> TB. singleton ' "'
78
+ string s = TB. singleton ' "' <> quote s <> TB. singleton ' "'
79
79
where
80
80
quote q = case T. uncons t of
81
81
Nothing -> TB. fromText h
82
82
Just (! c,t') -> TB. fromText h <> escape c <> quote t'
83
- where (h,t) = {-# SCC "break" #-} T. break isEscape q
83
+ where (h,t) = T. break isEscape q
84
84
isEscape c = c == ' \" ' ||
85
85
c == ' \\ ' ||
86
86
c < ' \x20 '
0 commit comments