haskell / text

Haskell library for space- and time-efficient operations over Unicode text.
http://hackage.haskell.org/package/text
BSD 2-Clause "Simplified" License
408 stars 159 forks source link

added TextBuilder alias #581

Closed BebeSparkelSparkel closed 7 months ago

Bodigrim commented 7 months ago

Hmm, we have StrictBuilder already. Even while it's in an internal module and not widely advertised, it would be nice to come up with a consistent naming.

Should this one be LazyBuilder or LazyTextBuilder or TextLazyBuilder?.. @Lysxia what do you think?

Lysxia commented 7 months ago

I like LazyTextBuilder since there is also type LazyText, and so that leave room for TextBuilder as the new (and public) name for StrictBuilder.

BebeSparkelSparkel commented 7 months ago

I have added StrictTextBuilder and LazyTextBuilder.

Lysxia commented 7 months ago

I forgot we're already exporting StrictBuilder. So LazyBuilder for symmetry, instead of adding another step of renaming. Sorry for the confusion.

BebeSparkelSparkel commented 7 months ago

I can add LazyBuilder, but I want to have Text directly in the name with StrictTextBuilder and LazyTextBuilder to differentiate it from other builder types.

Lysxia commented 7 months ago

I want to have Text directly in the name with StrictTextBuilder and LazyTextBuilder to differentiate it from other builder types.

Wouldn't qualified imports let you disambiguate as well?

BebeSparkelSparkel commented 7 months ago

I see many type TextBuilder aliases in packages so it seems that many people want to be able to disambiguate with the name.

https://github.com/search?q=%22type+TextBuilder%22+language%3AHaskell+&type=code

Bodigrim commented 7 months ago

I forgot we're already exporting StrictBuilder. So LazyBuilder for symmetry, instead of adding another step of renaming. Sorry for the confusion.

We can go for StrictTextBuilder / LazyTextBuilder and deprecate the existing StrictBuilder name, I don't think there are any users at the moment.

Bodigrim commented 7 months ago

That's fine by me, but let me defer the judgement to @Lysxia as an original author of StrictBuilder.

Bodigrim commented 7 months ago

Thanks!