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
--| @(unsafeTextWithoutNewlines s)@ contains the literal string @s@.
--
-- The string must not contain any newline characters, since this is an
-- invariant of the 'Text' constructor.
unsafeTextWithoutNewlines::Text->Docann
unsafeTextWithoutNewlines text =caseT.uncons text of
Nothing->Empty
Just (t,ext)
|T.null ext ->Char t
|otherwise->Text (T.length text) text
It seems that this function would allocate a new Text value in order to perform the T.null check on it. GHC may be able to optimize this allocation away, but it seems fragile.
The text was updated successfully, but these errors were encountered:
prettyprinter/prettyprinter/src/Prettyprinter/Internal.hs
Lines 468 to 477 in 0dbe08f
It seems that this function would allocate a new
Text
value in order to perform theT.null
check on it. GHC may be able to optimize this allocation away, but it seems fragile.The text was updated successfully, but these errors were encountered: