Get the latest tech news

Guide to Haskell strings


mate guide to Haskell StringsMay 7, 2024, Posted by Julian Ospald This guide is aimed at Haskellers who seek to improve their understanding of String types, be it beginners or seasoned developers. It is also meant to be a quick reference/cheat sheet for deciding which string type to use in a given situation.

it is inefficient for large text (carries the overhead of a linked list with thunks for every Char); the haddock documentation of Data.String goes into more detail it is often confusing for users who don’t have a good mental model of what a Unicode Code Point is it causes problems for certain conversions (e.g. lots of small to medium sized byte sequences large data, if strictness is desired and efficient slicing not needed dealing with C FFI (although it incurs memcpy) storing non-Unicode encodings e.g. via a newtype wrapper writing type safe operating system APIs while maintaining the original bytes without decoding abstracting over Unix and Windows making minimal assumptions on underlying encodings

Get the Android app

Or read this on Hacker News