Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Change mappend for CommaTracker to be a bit lazier

  • Loading branch information...
commit f9873e1c98a6b2096b8e115727d9040b68c37765 1 parent 3e314ec
Leon P Smith authored
Showing with 5 additions and 4 deletions.
  1. +5 −4 src/Data/Json/Builder/Internal.hs
9 src/Data/Json/Builder/Internal.hs
View
@@ -106,7 +106,8 @@ data CommaMonoid
instance Monoid CommaMonoid where
mempty = Empty
- mappend Empty y = y
- mappend x Empty = x
- mappend (Comma a) (Comma b)
- = Comma (a ++ fromChar ',' ++ b)
+ mappend Empty x = x
+ mappend (Comma a) x
+ = Comma (a ++ case x of
+ Empty -> mempty
+ Comma b -> fromChar ',' ++ b)
Please sign in to comment.
Something went wrong with that request. Please try again.