textual-0.2.0.0: Textual type class for data that represent text

Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Textual.Class

Description

Type class for textual data and simple (fromItegral like) conversion between them.

The conversion utility here, although simple may not be the fastest one available, and aims at preserving the textual representation of data, not its binary structure. This, given the existence of codecs with ambiguous representation means that the following function may evaluate to False:

mayBeFalse :: Textual a => a -> Bool mayBeFalse a = let b = fromText a in a == b

Synopsis

Documentation

class IsString a => Textual a where Source

Type class for data structures that are logically text

Methods

toString :: a -> String Source

Instances

Textual String 
Textual ByteString

With UTF-8 encoding

Textual ByteString

With UTF-8 encoding

Textual Text 

fromTextual :: (Textual a, Textual b) => a -> b Source

Converts between instances of Textual