uu-cco-0.1.0.1: Utilities for compiler construction: core functionality

Portabilitynon-portable (uses CPP)
Stabilityprovisional
Maintainerstefan@cs.uu.nl
Safe HaskellSafe-Inferred

CCO.Component

Contents

Description

An arrow for constructing and composing compiler components.

Synopsis

Components

data Component a b Source

The Component arrow. A Component a b takes input of type a to output of type b.

Instances

Category Component 
ArrowChoice Component 
Arrow Component 

Creating components

component :: (a -> Feedback b) -> Component a bSource

Creates a Component from a Feedback computation.

parser :: Lexer s -> Parser s a -> Component String aSource

Creates a Component from a Lexer and a Parser.

Generic components

printer :: Printable a => Component a StringSource

A Component for rendering Printables.

Wrapping components

ioWrap :: Component String String -> IO ()Source

Wraps a Component into a program that provides it with input from the standard input channel and relays its output to the standard output channel.