data-textual-0.3.0.3: Human-friendly textual representations.

Safe HaskellNone
LanguageHaskell2010

Data.Textual

Description

Working with human-friendly (as opposed to the compiler-friendly Show and Read ) textual representations.

Synopsis

Printing

class Printable α where Source #

The default printer for values of a type.

Methods

print :: Printer p => α -> p Source #

Instances
Instance details

Defined in Data.Textual

Methods

print :: Printer p => Char -> p Source #

Instance details

Defined in Data.Textual

Methods

print :: Printer p => Double -> p Source #

Instance details

Defined in Data.Textual

Methods

print :: Printer p => Float -> p Source #

Instance details

Defined in Data.Textual

Methods

print :: Printer p => Int -> p Source #

Instance details

Defined in Data.Textual

Methods

print :: Printer p => Int8 -> p Source #

Instance details

Defined in Data.Textual

Methods

print :: Printer p => Int16 -> p Source #

Instance details

Defined in Data.Textual

Methods

print :: Printer p => Int32 -> p Source #

Instance details

Defined in Data.Textual

Methods

print :: Printer p => Int64 -> p Source #

Instance details

Defined in Data.Textual

Methods

print :: Printer p => Integer -> p Source #

Instance details

Defined in Data.Textual

Methods

print :: Printer p => Word -> p Source #

Instance details

Defined in Data.Textual

Methods

print :: Printer p => Word8 -> p Source #

Instance details

Defined in Data.Textual

Methods

print :: Printer p => Word16 -> p Source #

Instance details

Defined in Data.Textual

Methods

print :: Printer p => Word32 -> p Source #

Instance details

Defined in Data.Textual

Methods

print :: Printer p => Word64 -> p Source #

Instance details

Defined in Data.Textual

Methods

print :: Printer p => Text -> p Source #

Instance details

Defined in Data.Textual

Methods

print :: Printer p => Text -> p Source #

Instance details

Defined in Data.Textual

Methods

print :: Printer p => String -> p Source #

Instance details

Defined in Data.Textual

Methods

print :: Printer p => Ratio α -> p Source #

Instance details

Defined in Data.Textual

Methods

print :: Printer p => Fixed α -> p Source #

maybePrint :: (Printer p, Printable α) => Maybe α -> p Source #

A shorthand for maybe mempty print .

toString :: Printable α => α -> String Source #

A shorthand for buildString . print .

toText :: Printable α => α -> Text Source #

A shorthand for buildText . print .

toLazyText :: Printable α => α -> Text Source #

A shorthand for buildLazyText . print .

toAscii :: Printable α => α -> ByteString Source #

A shorthand for buildAscii . print .

toLazyAscii :: Printable α => α -> ByteString Source #

A shorthand for buildLazyAscii . print .

toUtf8 :: Printable α => α -> ByteString Source #

A shorthand for buildUtf8 . print .

toLazyUtf8 :: Printable α => α -> ByteString Source #

A shorthand for buildLazyUtf8 . print .

Parsing

class Printable α => Textual α where Source #

The default parser for values of a type, must satisfy fromString (toString x) = Just x

Methods

textual :: (Monad μ, CharParsing μ) => μ α Source #

Instances
Instance details

Defined in Data.Textual

Methods

textual :: (Monad μ, CharParsing μ) => μ Char Source #

Instance details

Defined in Data.Textual

Methods

textual :: (Monad μ, CharParsing μ) => μ Int Source #

Instance details

Defined in Data.Textual

Methods

textual :: (Monad μ, CharParsing μ) => μ Int8 Source #

Instance details

Defined in Data.Textual

Methods

textual :: (Monad μ, CharParsing μ) => μ Int16 Source #

Instance details

Defined in Data.Textual

Methods

textual :: (Monad μ, CharParsing μ) => μ Int32 Source #

Instance details

Defined in Data.Textual

Methods

textual :: (Monad μ, CharParsing μ) => μ Int64 Source #

Instance details

Defined in Data.Textual

Methods

textual :: (Monad μ, CharParsing μ) => μ Integer Source #

Instance details

Defined in Data.Textual

Methods

textual :: (Monad μ, CharParsing μ) => μ Word Source #

Instance details

Defined in Data.Textual

Methods

textual :: (Monad μ, CharParsing μ) => μ Word8 Source #

Instance details

Defined in Data.Textual

Methods

textual :: (Monad μ, CharParsing μ) => μ Word16 Source #

Instance details

Defined in Data.Textual

Methods

textual :: (Monad μ, CharParsing μ) => μ Word32 Source #

Instance details

Defined in Data.Textual

Methods

textual :: (Monad μ, CharParsing μ) => μ Word64 Source #

Instance details

Defined in Data.Textual

Methods

textual :: (Monad μ, CharParsing μ) => μ (Ratio α) Source #

Instance details

Defined in Data.Textual

Methods

textual :: (Monad μ, CharParsing μ) => μ (Fixed α) Source #

Built-in parser

data Parsed α Source #

Parsing result.

Constructors

Parsed α
Instances
Instance details

Defined in Data.Textual

Methods

fmap :: (a -> b) -> Parsed a -> Parsed b #

(<$) :: a -> Parsed b -> Parsed a #

Instance details

Defined in Data.Textual

Methods

pure :: a -> Parsed a #

(<*>) :: Parsed (a -> b) -> Parsed a -> Parsed b #

liftA2 :: (a -> b -> c) -> Parsed a -> Parsed b -> Parsed c #

(*>) :: Parsed a -> Parsed b -> Parsed b #

(<*) :: Parsed a -> Parsed b -> Parsed a #

Instance details

Defined in Data.Textual

Methods

fold :: Monoid m => Parsed m -> m #

foldMap :: Monoid m => (a -> m) -> Parsed a -> m #

foldr :: (a -> b -> b) -> b -> Parsed a -> b #

foldr' :: (a -> b -> b) -> b -> Parsed a -> b #

foldl :: (b -> a -> b) -> b -> Parsed a -> b #

foldl' :: (b -> a -> b) -> b -> Parsed a -> b #

foldr1 :: (a -> a -> a) -> Parsed a -> a #

foldl1 :: (a -> a -> a) -> Parsed a -> a #

toList :: Parsed a -> [a] #

null :: Parsed a -> Bool #

length :: Parsed a -> Int #

elem :: Eq a => a -> Parsed a -> Bool #

maximum :: Ord a => Parsed a -> a #

minimum :: Ord a => Parsed a -> a #

sum :: Num a => Parsed a -> a #

product :: Num a => Parsed a -> a #

Instance details

Defined in Data.Textual

Methods

traverse :: Applicative f => (a -> f b) -> Parsed a -> f (Parsed b) #

sequenceA :: Applicative f => Parsed (f a) -> f (Parsed a) #

mapM :: Monad m => (a -> m b) -> Parsed a -> m (Parsed b) #

sequence :: Monad m => Parsed (m a) -> m (Parsed a) #

Instance details

Defined in Data.Textual

Methods

empty :: Parsed a #

(<|>) :: Parsed a -> Parsed a -> Parsed a #

some :: Parsed a -> Parsed [a] #

many :: Parsed a -> Parsed [a] #

Eq α => Eq (Parsed α) Source #
Instance details

Defined in Data.Textual

Methods

(==) :: Parsed α -> Parsed α -> Bool #

(/=) :: Parsed α -> Parsed α -> Bool #

Show α => Show (Parsed α) Source #
Instance details

Defined in Data.Textual

Methods

showsPrec :: Int -> Parsed α -> ShowS #

show :: Parsed α -> String #

showList :: [Parsed α] -> ShowS #

isParsed :: Parsed α -> Bool Source #

Map Parsed to True and Malformed to False .

isMalformed :: Parsed α -> Bool Source #

Map Parsed to False and Malformed to True .

maybeParsed :: Parsed α -> Maybe α Source #

Map Parsed values to Just and Malformed to Nothing .

builtInParser :: (forall μ. (Monad μ, CharParsing μ) => μ α) -> String -> Parsed α Source #

Use the built-in parser to parse a string. Intended for testing only.

parseString :: Textual α => String -> Parsed α Source #

Parse a String to extract the Textual value.

parseStringAs :: Textual α => p α -> String -> Parsed α Source #

Provide a hint for the type system when using parseString .

parseText :: Textual α => Text -> Parsed α Source #

Parse a Text to extract the Textual value.

parseTextAs :: Textual α => p α -> Text -> Parsed α Source #

Provide a hint for the type system when using parseText .

parseLazyText :: Textual α => Text -> Parsed α Source #

Parse a lazy Text to extract the Textual value.

parseLazyTextAs :: Textual α => p α -> Text -> Parsed α Source #

Provide a hint for the type system when using parseLazyText .

parseAscii :: Textual α => ByteString -> Parsed α Source #

Decode and parse an ASCII ByteString to extract the Textual value.

parseAsciiAs :: Textual α => p α -> ByteString -> Parsed α Source #

Provide a hint for the type system when using parseAscii .

parseLazyAscii :: Textual α => ByteString -> Parsed α Source #

Decode and parse a lazy ASCII ByteString to extract the Textual value.

parseLazyAsciiAs :: Textual α => ByteString -> Parsed α Source #

Provide a hint for the type system when using parseLazyAscii .

parseUtf8 :: Textual α => ByteString -> Parsed α Source #

Decode and parse a UTF-8 ByteString to extract the Textual value.

parseUtf8As :: Textual α => p α -> ByteString -> Parsed α Source #

Provide a hint for the type system when using parseUtf8 .

parseLazyUtf8 :: Textual α => ByteString -> Parsed α Source #

Decode and parse a lazy UTF-8 ByteString to extract the Textual value.

parseLazyUtf8As :: Textual α => p α -> ByteString -> Parsed α Source #

Provide a hint for the type system when using parseLazyUtf8 .

fromString :: Textual α => String -> Maybe α Source #

A shorthand for maybeParsed . parseString

fromStringAs :: Textual α => p α -> String -> Maybe α Source #

Provide a hint for the type system when using fromString .

fromText :: Textual α => Text -> Maybe α Source #

A shorthand for maybeParsed . parseText

fromTextAs :: Textual α => p α -> Text -> Maybe α Source #

Provide a hint for the type system when using fromText .

fromLazyText :: Textual α => Text -> Maybe α Source #

A shorthand for maybeParsed . parseLazyText

fromLazyTextAs :: Textual α => p α -> Text -> Maybe α Source #

Provide a hint for the type system when using fromLazyText .

fromAscii :: Textual α => ByteString -> Maybe α Source #

A shorthand for maybeParsed . parseAscii

fromAsciiAs :: Textual α => p α -> ByteString -> Maybe α Source #

Provide a hint for the type system when using fromAscii .

fromLazyAscii :: Textual α => ByteString -> Maybe α Source #

A shorthand for maybeParsed . parseLazyAscii

fromLazyAsciiAs :: Textual α => p α -> ByteString -> Maybe α Source #

Provide a hint for the type system when using fromLazyAscii .

fromUtf8 :: Textual α => ByteString -> Maybe α Source #

A shorthand for maybeParsed . parseUtf8

fromUtf8As :: Textual α => p α -> ByteString -> Maybe α Source #

Provide a hint for the type system when using fromUtf8 .

fromLazyUtf8 :: Textual α => ByteString -> Maybe α Source #

A shorthand for maybeParsed . parseLazyUtf8

fromLazyUtf8As :: Textual α => p α -> ByteString -> Maybe α Source #

Provide a hint for the type system when using fromLazyUtf8 .

AltStyle によって変換されたページ (->オリジナル) /