Open sjakobi opened 2 years ago
https://github.com/quchen/prettyprinter/blob/0dbe08f65468697b729d5e05c98c89a58a42486b/prettyprinter/src/Prettyprinter/Internal.hs#L468-L477
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.
Text
T.null
Apparently this issue was investigated before: https://github.com/quchen/prettyprinter/blob/0dbe08f65468697b729d5e05c98c89a58a42486b/prettyprinter/bench/FasterUnsafeText.hs
https://github.com/quchen/prettyprinter/blob/0dbe08f65468697b729d5e05c98c89a58a42486b/prettyprinter/src/Prettyprinter/Internal.hs#L468-L477
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.