
It is a goal of the ByteString library that you should almost never need to work directly with the PS constructor and the things used in that definition. If you find some task involving IO or string manipulation that seems to require using the internal operations, it's probably worth bringing it up on the list. That said, it's always good to know how things work, and the internals may be relevant if you want to make an interface to a foreign library use ByteStrings. Look at the Foreign.* modules to see how to work with Ptr values, especially Foreign.ForeignPtr, Foreign.Ptr, Foreign.Marshal: http://www.haskell.org/ghc/docs/latest/html/libraries/base-4.3.1.0/Foreign-F... http://www.haskell.org/ghc/docs/latest/html/libraries/base-4.3.1.0/Foreign-P... http://www.haskell.org/ghc/docs/latest/html/libraries/base-4.3.1.0/Foreign-M... The GHC manual has a little bit on unboxed types like Int# http://www.haskell.org/ghc/docs/latest/html/users_guide/primitives.html GHC.Prim provides the basic operations http://www.haskell.org/ghc/docs/latest/html/libraries/ghc-prim-0.2.0.0/GHC-P... There is also the original paper (from Simon Peyton-Jones' page) http://research.microsoft.com/en-us/um/people/simonpj/papers/unboxed-values.... Brandon