text-builder 0.4 → 0.4.1
raw patch · 3 files changed
+7/−13 lines, 3 files
Files
- library/Text/Builder.hs +0/−11
- tests/Main.hs +6/−1
- text-builder.cabal +1/−1
library/Text/Builder.hs view
@@ -40,17 +40,6 @@ action2 array (offset + size1) size = size1 + size2- {-# INLINE mconcat #-}- mconcat list =- Builder action size- where- action =- Action $ \array offset -> foldlM (step array) offset list $> ()- where- step array offset (Builder (Action action) size) =- action array offset $> offset + size- size =- sum (map (\(Builder _ x) -> x) list) instance Semigroup Builder
tests/Main.hs view
@@ -18,8 +18,13 @@ A.pack chars === B.run (foldMap B.char chars) ,- testProperty "Concatting a list of texts is isomorphic to concatting a list of builders" $+ testProperty "Concatting a list of texts is isomorphic to fold-mapping with builders" $ \texts -> mconcat texts === B.run (foldMap B.text texts)+ ,+ testProperty "Concatting a list of texts is isomorphic to concatting a list of builders" $+ \texts ->+ mconcat texts ===+ B.run (mconcat (map B.text texts)) ]
text-builder.cabal view
@@ -1,7 +1,7 @@ name: text-builder version:- 0.4+ 0.4.1 category: Text synopsis: