cd /news/developer-tools/from-text-type-class-to-convert-from… · home topics developer-tools article
[ARTICLE · art-10056] src=discourse.haskell.org ↗ pub= topic=developer-tools verified=true sentiment=· neutral

From-text: type class to convert from Text

A new Haskell package introduces the `IsText` type class with a `fromText` function to simplify conversion from `Text` to other textual data types like `ByteArray`, `ByteString`, and `OsPath`, using UTF-8 for binary types. The author created this package because existing alternatives do not support conversion from `Text` to `OsPath`, and they could not decide which existing library to contribute this functionality to.

read1 min views30 publishedMay 22, 2026

I released a new package which provides

class IsText a where
fromText :: Text -> a

aiming to simplify conversion from Text to other textual data types, including ByteArray , ByteString and OsPath . It uses UTF-8 when converting to binary types without an associated encoding. 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.

── more in #developer-tools 4 stories · sorted by recency
── more on @bytearray 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/from-text-type-class…] indexed:0 read:1min 2026-05-22 ·