Skip to content

Commit

Permalink
Merge pull request #872 from Bodigrim/avoid-head-and-tail
Browse files Browse the repository at this point in the history
Avoid `Data.List.{head,tail}`
  • Loading branch information
treeowl authored Nov 19, 2022
2 parents 4b7770a + 2830f16 commit 3db464d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion containers/src/Data/IntMap/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3504,7 +3504,7 @@ showsBars :: [String] -> ShowS
showsBars bars
= case bars of
[] -> id
_ -> showString (concat (reverse (tail bars))) . showString node
_ : tl -> showString (concat (reverse tl)) . showString node

node :: String
node = "+--"
Expand Down
2 changes: 1 addition & 1 deletion containers/src/Data/IntSet/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1299,7 +1299,7 @@ showWide wide bars

showsBars :: [String] -> ShowS
showsBars [] = id
showsBars bars = showString (concat (reverse (tail bars))) . showString node
showsBars (_ : tl) = showString (concat (reverse tl)) . showString node

showsBitMap :: Word -> ShowS
showsBitMap = showString . showBitMap
Expand Down
2 changes: 1 addition & 1 deletion containers/src/Data/Map/Internal/Debug.hs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ showsBars :: [String] -> ShowS
showsBars bars
= case bars of
[] -> id
_ -> showString (concat (reverse (tail bars))) . showString node
_ : tl -> showString (concat (reverse tl)) . showString node

node :: String
node = "+--"
Expand Down
2 changes: 1 addition & 1 deletion containers/src/Data/Set/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1977,7 +1977,7 @@ showsBars :: [String] -> ShowS
showsBars bars
= case bars of
[] -> id
_ -> showString (concat (reverse (tail bars))) . showString node
_ : tl -> showString (concat (reverse tl)) . showString node

node :: String
node = "+--"
Expand Down

0 comments on commit 3db464d

Please sign in to comment.