binrep-0.5.0: Encode precise binary representations directly in types
Safe HaskellSafe-Inferred
LanguageGHC2021

Bytezap.Text

Synopsis

Documentation

stringUtf8 :: String -> Write Source #

TODO

In a perfect world, functions like this would not exist. But this is not a perfect world. Strings suck for a number of reasons. One big one is that they are horrendous to serialize. Worse, as of GHC 9.6, type-level strings only reflect to String. This function does the best it can to efficiently serialize Strings. It would be much easier and probably similarly fast to go through Text instead, but who doesn't like a little challenge?