plumbers-0.0.4: Pointless plumbing combinators

Copyright(c) 2012 Michael Sloan
LicenseBSD-style (see the LICENSE file)
MaintainerMichael Sloan <>
PortabilityGHC only
Safe HaskellNone




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



data PlumberSpec Source #

Specifies all of the information needed to implement a plumber.




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.




  • 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