Consider this example:
λ import Data.Text.Lazy
λ stimes @Data.Text.Lazy.Text 0 (Data.Text.Lazy.pack "x")
"*** Exception: stimes: positive multiplier expected
Compare with the behaviour of stimes on String:
λ stimes @String 0 "x"
""
Surely we can return an empty lazy text!
This happens because implementation for stimes is not provided. A similar issue for strict text was addressed in #288.
There is also a blind spot in our test suite — it should reveal differences in behaviour between Text and String.
I drafted an implementation that resolves this issue, but there are certain fine points that we should address.
- For strict text,
stimes works only on relatively small numbers — specifically, Int. Should the same restriction apply for lazy text?
- Should we expect any performance gains or losses? There is no bench mark measuring this yet.
Consider this example:
Compare with the behaviour of
stimesonString:Surely we can return an empty lazy text!
This happens because implementation for
stimesis not provided. A similar issue for strict text was addressed in #288.There is also a blind spot in our test suite — it should reveal differences in behaviour between
TextandString.I drafted an implementation that resolves this issue, but there are certain fine points that we should address.
stimesworks only on relatively small numbers — specifically,Int. Should the same restriction apply for lazy text?