Commit 37f7e920 authored by Ben Gamari's avatar Ben Gamari 🐢
Browse files

Name consistency

parent 05c1364c
......@@ -62,22 +62,22 @@ collectArgsBenchmarks len = bgroup ("length="++show len)
xs = appChain len
rebuildSeq :: [a] -> Seq.Seq a
rebuildSeq = go mempty
rebuild_Seq :: [a] -> Seq.Seq a
rebuild_Seq = go mempty
where
go :: Seq.Seq a -> [a] -> Seq.Seq a
go acc (x:xs) = go (acc Seq.|> x) xs
go acc [] = acc
rebuildList :: [a] -> [a]
rebuildList = go mempty
rebuild_List :: [a] -> [a]
rebuild_List = go mempty
where
go :: [a] -> [a] -> [a]
go acc (x:xs) = go (x : acc) xs
go acc [] = reverse acc
rebuildDList :: [a] -> [a]
rebuildDList = go mempty
rebuild_DList :: [a] -> [a]
rebuild_DList = go mempty
where
go :: DList.DList a -> [a] -> [a]
go acc (x:xs) = go (acc <> DList.singleton x) xs
......@@ -85,9 +85,9 @@ rebuildDList = go mempty
rebuildBenchmarks :: Int -> Benchmark
rebuildBenchmarks len = bgroup ("length="++show len)
[ bench "sequence" $ whnf (length . rebuildSeq) xs
, bench "dlist" $ whnf (length . rebuildDList) xs
, bench "list" $ whnf (length . rebuildList) xs
[ bench "sequence" $ whnf (length . rebuild_Seq) xs
, bench "dlist" $ whnf (length . rebuild_DList) xs
, bench "list" $ whnf (length . rebuild_List) xs
]
where
xs = [1..len]
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment