This blog post provides information on the different string types in Haskell, including Text, ByteString, ShortByteString, OsString, and more. It explains the purpose and use cases of each type, as well as their advantages and limitations. The post also covers topics such as Unicode, character encoding, text encoding, and conversions between different types. It emphasizes the importance of using the appropriate string type for different purposes, such as filepaths and operating system API. Additionally, it discusses the drawbacks of lazy IO and suggests using streaming libraries instead. The post concludes by addressing the criticism that Haskell has too many string types, highlighting the unique properties and trade-offs of each type.

33m read timeFrom hasufell.github.io
Post cover image
Table of contents
TOCMotivationString in PreludeUnicodeBack to Haskell String typeString typesLazy vs StrictSlicable vs non-slicablePinned vs unpinnedString Types Cheat SheetConstructionConversionsA word on lazy IOStreamingA note on FilePathsReflectionSpecial thanks toLinks and relevant stuff

Sort: