Fix wrong newline
This commit is contained in:
parent
8811c7a217
commit
2ef3e66b48
@ -24,12 +24,13 @@ repr obj = repr' obj 0 where
|
||||
repr' val lev =
|
||||
case val of
|
||||
Array x -> intercalate ", " $ mapl (\i -> repr' i lev) x
|
||||
Object x -> drop 1 $ concat $ map (dump x lev) $ H.keys x
|
||||
Object x -> newline lev $ concat $ map (dump x lev) $ H.keys x
|
||||
String x -> unpack x
|
||||
Number x -> show x
|
||||
Bool x -> show x
|
||||
Null -> "null"
|
||||
mapl f v = V.toList $ V.map f v
|
||||
mapl f v = V.toList (V.map f v)
|
||||
newline n = if n == 1 then id else drop 1
|
||||
indent l = '\n' : (concat . replicate l) " "
|
||||
dump o l k = concat [indent l, unpack k, ": ", repr' (o |. k) (l+1)]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user