fay-text-0.3.2.2: Fay Text type represented as JavaScript strings

Safe HaskellNone
LanguageHaskell98

Fay.Text.Type

Description

Module to be shared between server and client.

This module must be valid for both GHC and Fay.

For GHC this is an alias for Data.Text, for Fay it's an opaque data type represented by JavaScript strings.

Synopsis

Documentation

data Text :: *

A space efficient, packed, unboxed Unicode text type.

Instances

IsList Text 
Eq Text 
Data Text

This instance preserves data abstraction at the cost of inefficiency. We omit reflection services for the sake of data abstraction.

This instance was created by copying the updated behavior of Data.Set.Set and Data.Map.Map. If you feel a mistake has been made, please feel free to submit improvements.

The original discussion is archived here: could we get a Data instance for Data.Text.Text?

The followup discussion that changed the behavior of Set and Map is archived here: Proposal: Allow gunfold for Data.Map, ...

Ord Text 
Read Text 
Show Text 
IsString Text 
Monoid Text 
NFData Text 
Typeable * Text 
type Item Text = Char 

pack :: String -> Text

O(n) Convert a String into a Text. Subject to fusion. Performs replacement on invalid scalar values.

unpack :: Text -> String

O(n) Convert a Text into a String. Subject to fusion.

fromString :: String -> Text Source

Have this in scope with the OverloadedStrings and BindableSyntax extensions and Fay will replace all string literals with Text.