简体   繁体   English

带字节串的HSP

[英]HSP with bytestrings

I switched to HSP in my home project - I like that it compiles to Haskell code. 我在家庭项目中切换到HSP-我喜欢将其编译为Haskell代码。 But my server uses ByteString for output. 但是我的服务器使用ByteString进行输出。 Is there a good way to make HSP generate ByteString output? 有什么好方法可以使HSP生成ByteString输出吗? As I can see output and the HSP' source code, there is hardcoded "Any string literal" :: String - explicit type qualification to String. 正如我看到的输出和HSP的源代码一样,这里有硬编码的"Any string literal" :: String - "Any string literal" :: String显式类型限定。

My point is that using lazy ByteString for concatenation is faster that String, and since input and output are ByteString there is no reason to have String just for templating. 我的观点是,使用惰性ByteString进行串联比使用String更快,并且由于输入和输出都是ByteString,因此没有理由只将String用作模板。

Probably there is alternative to HSP? 可能有替代HSP的方法吗?

HSP的最新版本使用text包,该text包比String更有效,但比ByteString更正确。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM