invertible-syntax-poly-0.1.0.1: Extends invertible-syntax library capable to use parameterized token type.

Copyright2012 Kei Hibino
LicenseBSD3
Maintainerex8k.hibino@gmail.com
Stabilityexperimental
Portabilityunknown
Safe HaskellNone
LanguageHaskell98

Text.Syntax.Printer.List

Contents

Description

This module includes a naive printer implementation for Syntax.

Synopsis

Syntax instance Printer type

data Printer tok alpha Source

Naive Printer type. Print alpha into [tok].

Instances

Eq tok => Syntax tok (Printer tok) Source

Syntax instance for Printer. Print token into singleton.

IsoFunctor (Printer tok) Source

IsoFunctor instance for Printer. Unapplying Iso and print.

AbstractSyntax (Printer tok) Source

AbstractSyntax instance for Printer. Match parsed result and success.

TryAlternative (Printer tok) Source

TryAlternative instance for Printer. Along with default definition.

IsoAlternative (Printer tok) Source

IsoAlternative instance for Printer. Print first or second.

ProductFunctor (Printer tok) Source

ProductFunctor instance for Printer. Just print sequential.

runPrinter :: Printer tok alpha -> alpha -> Maybe [tok] Source

Function to run printer

Print action

printM :: Monad m => Printer tok alpha -> alpha -> m [tok] Source

Expect print side effect.

Poly-morphic wrapper of runPrinter

type RunAsPrinter tok a e = RunAsPrinter tok [tok] a e Source

Specialized RunAsPrinter type into list.

type RunAsStringPrinter a e = RunAsPrinter Char a e Source

Specialized RunAsPrinter type into String.