plumbers-0.0.4: Pointless plumbing combinators

Copyright(c) 2012 Michael Sloan
LicenseBSD-style (see the LICENSE file)
MaintainerMichael Sloan <mgsloan@gmail.com>
Stabilityexperimental
PortabilityGHC only
Safe HaskellNone
LanguageHaskell98

Control.Plumbers.TH

Contents

Description

This module is used to generate operators that follow the plumbers symbolic convention for routing parameters.

Synopsis

Documentation

data PlumberSpec Source #

Specifies all of the information needed to implement a plumber.

Constructors

PlumberSpec 

Fields

baseSpec :: String -> String -> PlumberSpec Source #

Creates a plumber spec for the given prefix for the generated operators, and the name of the infix operator to use to construct the implementation.

data PlumberTypes Source #

Specifies all of the information needed to construct type declarations for the plumber.

Constructors

PlumberTypes 

Fields

  • leftType :: Type

    Type of the left argument's result

  • rightType :: Type

    Type of the right argument's result

  • resultType :: Type

    Results type. This needs to be wrapped in a forall naming all of the utilized type variables.

baseTypes :: PlumberTypes Source #

A basic set of types, which make r' the left type, and r'' the right type. The resultType is a forall that introduces these type variables, and has undefined content. Therefore any implementation in terms of baseTypes needs to redefine resultType, as the Forall has undefined as its content.

implementPlumbers :: PlumberSpec -> DecsQ Source #

Implements all of the plumbers specified by the given PlumberSpec.

implementPlumber :: PlumberSpec -> String -> DecsQ Source #

Implement only the specific plumber requested.

operatorNames :: PlumberSpec -> [[String]] Source #

All of the operator names that the given PlumberSpec would implement.

aritiesString :: PlumberSpec -> String Source #

For now this is just a string-yielding function, to be evaluated by the user, to generate the line defining the fixities. This code should be pasted below the TH invocation of implementPlumbers

TH Utilities