-
-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversion instances for text Builder type #398
Comments
@chris-martin No particular reason. I didn't need to do this often enough to have a need for introducing this to I imagine working with builders as constructing a builder from different parts and converting the final single value of type So, actually, the most benefit would be in having a typeclass like
Also, there're two builders: |
Typically what I have is something like this:
Module Module |
@chris-martin I understand your use-case as the following (so, please, correct me if I'm wrong):
myText :: Text
-myText = toText $ Data.Text.Lazy.Builder.toLazyText myBuilder
+myText = toText myBuilder I can see this as a UX improvement. But rather small one if you only have this And I wonder if this change is justified. My current worry in adding instances of Which is now less convenient and is bad UX. So my current decision is to not introduce such instances and keep things as it is. But I'm not an active user of |
A little background on my case: With feedback from the community of display :: Display a => a -> Text
display a = TL.toStrict $ TB.toLazyText $ displayBuilder a This has the advantage that the consuming site gets a Regarding the multiplicity of the Builder types, I also had to make an arbitrary choice between Bytestring and Text's builders; I think I'll adopt Bodigrim's builder when my support window allows it. Should there be a support for |
I think it's a reasonable request, but take it with a grain of salt: I'm a fan of |
Is there a reason that the
Data.Text.Lazy.Builder
type does not make any appearance inRelude.String.Conversion
? I think it would be useful to haveToText
,ToLText
, andToString
instances for it.The text was updated successfully, but these errors were encountered: