Skip to content

Commit

Permalink
[ regression ] revert to previous implementation of Show
Browse files Browse the repository at this point in the history
  • Loading branch information
stefan-hoeck authored and CodingCellist committed May 2, 2023
1 parent 83f5ef2 commit bc1a51e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion libs/base/Data/List/Quantifiers.idr
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion libs/base/Data/Vect/Quantifiers.idr
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bc1a51e

Please sign in to comment.