[ regression ] revert to previous implementation of Show

This commit is contained in:
stefan-hoeck 2023-03-22 06:19:54 +01:00 committed by CodingCellist
parent 83f5ef27b6
commit bc1a51ea18
2 changed files with 12 additions and 2 deletions

View File

@ -122,7 +122,12 @@ namespace All
export
All (Show . p) xs => Show (All p xs) where
show = show . forget . imapProperty (Show . p) show
show pxs = "[" ++ show' "" pxs ++ "]"
where
show' : String -> All (Show . p) xs' => All p xs' -> String
show' acc @{[]} [] = acc
show' acc @{[_]} [px] = acc ++ show px
show' acc @{_ :: _} (px :: pxs) = show' (acc ++ show px ++ ", ") pxs
export
All (Eq . p) xs => Eq (All p xs) where

View File

@ -136,7 +136,12 @@ namespace All
export
All (Show . p) xs => Show (All p xs) where
show = show . forget . imapProperty (Show . p) show
show pxs = "[" ++ show' "" pxs ++ "]"
where
show' : String -> All (Show . p) xs' => All p xs' -> String
show' acc @{[]} [] = acc
show' acc @{[_]} [px] = acc ++ show px
show' acc @{_ :: _} (px :: pxs) = show' (acc ++ show px ++ ", ") pxs
export
All (Eq . p) xs => Eq (All p xs) where