reformat-0.1.0.0: The parser and render to parsec and render the string.

Copyright(C) 2018 Johann Lee <me@qinka.pro>
LicenseGPL3
Maintainerme@qinka.pro
Stabilityexperimental
Safe HaskellSafe
LanguageHaskell2010

Text.Reformat

Description

Portablility: unknown

Synopsis

Documentation

class Reformat t where Source #

The class of reformat to parser and reformat the string

Minimal complete definition

parser, renderPair

Associated Types

type Str t Source #

Methods

parser :: Monad m => ParsecT (Str t) () m t Source #

parser to parse the sting

renderPair :: t -> Str t -> Value Source #

look at value via name (in string)

data Value Source #

to hold the values

Constructors

I Integer

integer

R Double

double

S String

string

N 

Instances

Eq Value Source # 

Methods

(==) :: Value -> Value -> Bool #

(/=) :: Value -> Value -> Bool #

Show Value Source # 

Methods

showsPrec :: Int -> Value -> ShowS #

show :: Value -> String #

showList :: [Value] -> ShowS #

renderFromReformat Source #

Arguments

:: (Monad m, Reformat t, Str t ~ String) 
=> t

item

-> String

format string

-> m (Either ParseError String) 

render the string with given format and item

parsingToReformat Source #

Arguments

:: (Stream (Str t) m Char, Reformat t) 
=> SourceName

name of input source

-> Str t

string of input

-> m (Either ParseError t)

output

Parse the string with the parser. The parser is provided with instance of Reformat.