Note that this package is a part of the “project” that includes from and from-string. For the general rationale behind this idea, see README.md under the project root.
This Haskell library package provides the From typeclass instances for the conversion of following types:
String
bytestring:
Strict ByteString
Lazy ByteString
Builder for ByteString
ShortByteString
text:
Strict Text
Lazy Text
Builder for Text
Whenever encoding/decoding happens, this library assumes that the aforementioned types internally contains either
a sequence of Unicode characters, or
a sequence of bytes in UTF-8.
This should be a reasonable assumption for practical software development. If you need any other assumption, you should specify the accurate conversion in the code, instead of ‘from’.
See the From.String module documentation for more detail.
Changes
Changelog for from-string
All notable changes to this project should be documented in this file.
Split the test code into ordinary test and code generation test. The code generation test will not be run by default (by Hackage or Stackage, for example).
1.0.0.1 - 2025-10-24
Changed
Set upper/lower bound for the dependencies: bytestring, text, and from.
1.0.0.0 - 2025-10-24
Initial release.
Added
From instances for string-related types. Any of the following types can be converted from one to another using from:
Prelude.String
Data.Text.Text
Data.Text.Lazy.Text
Data.Text.Lazy.Builder.Builder
Data.ByteString.ByteString
Data.ByteString.Lazy.ByteString
Data.ByteString.Builder.Builder
Data.ByteString.Short.ShortByteString
When the conversion crosses the boundary of the byte-sequence types and the character-sequence types, UTF-8 is assumed.