Skip to content
Snippets Groups Projects
Unverified Commit 68353ccd authored by cdornan's avatar cdornan Committed by GitHub
Browse files

Merge pull request #15 from Bodigrim/avoid-head-and-tail

Avoid `Data.List.{head,tail}`
parents 41d2570e 1e57cb7b
No related branches found
No related tags found
No related merge requests found
...@@ -10,6 +10,8 @@ import Text.XHtml.Table ...@@ -10,6 +10,8 @@ import Text.XHtml.Table
import Text.XHtml.Strict.Elements import Text.XHtml.Strict.Elements
import Text.XHtml.Strict.Attributes import Text.XHtml.Strict.Attributes
import Data.List (uncons)
-- --
-- * Tree Displaying Combinators -- * Tree Displaying Combinators
-- --
...@@ -51,7 +53,7 @@ treeHtml colors h = table ! [ ...@@ -51,7 +53,7 @@ treeHtml colors h = table ! [
where where
-- This stops a column of colors being the same -- This stops a column of colors being the same
-- color as the immediately outside nesting bar. -- color as the immediately outside nesting bar.
morecolors = filter ((/= c).head) (manycolors cs) morecolors = filter (maybe True ((/= c) . fst) . uncons) (manycolors cs)
bar = td ! [bgcolor' c,width "10"] << spaceHtml bar = td ! [bgcolor' c,width "10"] << spaceHtml
hd = td ! [bgcolor' c] << hopen hd = td ! [bgcolor' c] << hopen
tl = td ! [bgcolor' c] << hclose tl = td ! [bgcolor' c] << hclose
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment