You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
textfile uses the URL renderer (i.e. justVarInterpolation = False) whereas stextfile disables the URL renderer (i.e. justVarInterpolation = True). This seems odd because based on their names it seems like textfile and stextfile should behave almost the same except that textfile generates lazy Text whereas stextfile generates strict Text.
However, they don't behave the same, because textfile generates a Haskell expression that expects an additional argument (the render function) whereas stextfile doesn't, so if you were to switch between the two you'd suddenly add or remove a function argument, which is unexpected.
Unfortunately, unifying the two to behave in the same way would be a breaking change, but I wanted to check if (A) this inconsistency was intentional and (B) if it was unintentional, would the maintainers be receptive to a breaking change to textfile to set justVarInterpolation = True?
The text was updated successfully, but these errors were encountered:
I think it was historically intentionally, but I'm honestly not sure. The first usage of s as the prefix was in Hamlet, where s was for "simple Hamlet" and was entirely about dropping the URL rendering. It actually seems a bit strange to me that we return two different data types from these two functions, as opposed to the difference in behavior around URL handling which I'd expect.
Oh, for some reason I thought the s stood for strict. In that case, the difference in behavior is less surprising to me. Maybe it just needs a documentation comment
textfile
uses the URL renderer (i.e.justVarInterpolation = False
) whereasstextfile
disables the URL renderer (i.e.justVarInterpolation = True
). This seems odd because based on their names it seems liketextfile
andstextfile
should behave almost the same except thattextfile
generates lazyText
whereasstextfile
generates strictText
.However, they don't behave the same, because
textfile
generates a Haskell expression that expects an additional argument (therender
function) whereasstextfile
doesn't, so if you were to switch between the two you'd suddenly add or remove a function argument, which is unexpected.Unfortunately, unifying the two to behave in the same way would be a breaking change, but I wanted to check if (A) this inconsistency was intentional and (B) if it was unintentional, would the maintainers be receptive to a breaking change to
textfile
to setjustVarInterpolation = True
?The text was updated successfully, but these errors were encountered: