from-text: Type class to convert from Text

[ bsd3, library, text ] [ Propose Tags ] [ Report a vulnerability ]

This package provides class IsText a where fromText :: Text -> a, aiming to simplify conversion from Text to other textual data types, including ByteArray, ByteString and OsPath.


[Skip to Readme]

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1
Change log CHANGELOG.md
Dependencies base (>=4.12 && <5), bytestring (>=0.12 && <0.13), data-array-byte (>=0.1 && <0.2), filepath (>=1.5 && <1.6), os-string (>=2.0.2 && <2.1), text (>=2.1.1 && <2.2) [details]
Tested with ghc ==9.14.1, ghc ==9.12.2, ghc ==9.10.3, ghc ==9.8.4, ghc ==9.6.7, ghc ==9.4.8, ghc ==9.2.8, ghc ==9.0.2, ghc ==8.10.7, ghc ==8.8.4, ghc ==8.6.5
License BSD-3-Clause
Author Bodigrim
Maintainer andrew.lelechenko@gmail.com
Uploaded by Bodigrim at 2026-05-21T22:33:48Z
Category Text
Source repo head: git clone https://github.com/Bodigrim/from-text.git
Distributions
Downloads 2 total (2 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2026-05-21 [all 1 reports]

Readme for from-text-0.1

[back to package description]

from-text Hackage Stackage LTS Stackage Nightly

This package provides

class IsText a where
  fromText :: Text -> a

aiming to simplify conversion from Text to other textual data types, including ByteArray, ByteString and OsPath. When converting to binary types without an associated encoding, we use UTF-8.

There is an overwhelming number of alternative packages for text conversions. To name a few in no particular order:

At the moment none of them provide conversions from Text to OsPath. I could not decide which one to contribute such function to, so decided to create a new package.