from-string: Instances of 'From' for common string types

[ apache, bytestring, library, string, text ] [ Propose Tags ] [ Report a vulnerability ]

Convenient "sane default" conversion from/to strict ByteString, lazy ByteString, ByteString Builder, ShortByteString, strict Text, lazy Text, Text Builder, and String. When the conversions crosses the boundary of the byte types and the textual types, UTF-8 is assumed.


[Skip to Readme]

Modules

[Index] [Quick Jump]

Flags

Manual Flags

NameDescriptionDefault
codegen

Enable code generation test

Disabled

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 1.0.0.0, 1.0.0.1, 1.0.0.2
Change log CHANGELOG.md
Dependencies base (>=4.2 && <5), bytestring (>=0.11.4.0 && <2), from (>=1.0 && <2), text (>=2.0 && <3) [details]
License Apache-2.0
Copyright Copyright (C) 2024-2025 XT
Author XT
Maintainer git@xtendo.org
Category ByteString, Text, String
Home page https://codeberg.org/xt/from
Bug tracker https://codeberg.org/xt/from/issues
Source repo head: git clone https://codeberg.org/xt/from
Uploaded by xt at 2025-10-24T12:41:20Z
Distributions
Downloads 6 total (6 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2025-10-24 [all 1 reports]

Readme for from-string-1.0.0.2

[back to package description]

from-string

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.