mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-24 20:23:11 +03:00
[ regression ] revert to previous implementation of Show
This commit is contained in:
parent
83f5ef27b6
commit
bc1a51ea18
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user