diff options
author | Mikolaj Konarski <mikolaj.konarski@gmail.com> | 2024-05-19 10:34:33 +0200 |
---|---|---|
committer | Mikolaj Konarski <mikolaj.konarski@gmail.com> | 2024-05-19 10:34:33 +0200 |
commit | d6a748e01924b249cf61bf9a6d1167f4ab49bf4e (patch) | |
tree | 8fbdb9436b7b3c46624407ba4e3f16eb97bad4d4 /src/Data/Array/Nested/Internal.hs | |
parent | 607726b85cb83d2d29fafeca8cf73754b81995a4 (diff) |
Fix empty lists displayed as ']'
Diffstat (limited to 'src/Data/Array/Nested/Internal.hs')
-rw-r--r-- | src/Data/Array/Nested/Internal.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Data/Array/Nested/Internal.hs b/src/Data/Array/Nested/Internal.hs index b9adde9..6581963 100644 --- a/src/Data/Array/Nested/Internal.hs +++ b/src/Data/Array/Nested/Internal.hs @@ -208,7 +208,7 @@ unconsListR (i ::: sh') = Just (UnconsListRRes sh' i) unconsListR ZR = Nothing showListR :: forall sh i. (i -> ShowS) -> ListR sh i -> ShowS -showListR f l = go "[" l . showString "]" +showListR f l = showString "[" . go "" l . showString "]" where go :: String -> ListR sh' i -> ShowS go _ ZR = id @@ -293,7 +293,7 @@ foldListS _ ZS = mempty foldListS f (x ::$ xs) = f x <> foldListS f xs showListS :: forall sh f. (forall n. f n -> ShowS) -> ListS sh f -> ShowS -showListS f l = go "[" l . showString "]" +showListS f l = showString "[" . go "" l . showString "]" where go :: String -> ListS sh' f -> ShowS go _ ZS = id |