Skip to content

added TextBuilder alias - #581

Merged
Bodigrim merged 3 commits into
haskell:masterfrom
BebeSparkelSparkel:builder-alias
Apr 19, 2024
Merged

added TextBuilder alias#581
Bodigrim merged 3 commits into
haskell:masterfrom
BebeSparkelSparkel:builder-alias

Conversation

@BebeSparkelSparkel

Copy link
Copy Markdown
Contributor

No description provided.

@Bodigrim

Copy link
Copy Markdown
Contributor

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

Lysxia commented Apr 14, 2024

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Contributor Author

I have added StrictTextBuilder and LazyTextBuilder.

@Lysxia

Lysxia commented Apr 15, 2024

Copy link
Copy Markdown
Contributor

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

@BebeSparkelSparkel

Copy link
Copy Markdown
Contributor Author

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

Lysxia commented Apr 16, 2024

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Contributor Author

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

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Contributor

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

@Bodigrim
Bodigrim merged commit 3f2a71b into haskell:master Apr 19, 2024
@Bodigrim

Copy link
Copy Markdown
Contributor

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants