hobbits-1.3: A library for canonically representing terms with binding

Copyright(c) 2011 Edwin Westbrook Nicolas Frisby and Paul Brauner
LicenseBSD3
Maintaineremw4@rice.edu
Stabilityexperimental
PortabilityGHC
Safe HaskellNone
LanguageHaskell2010

Data.Binding.Hobbits.QQ

Description

Defines a quasi-quoter for writing patterns that match the bodies of Mb multi-bindings. Uses the haskell-src-exts parser. [nuP| P ] defines a pattern that will match a multi-binding whose body matches P. Any variables matched by P will remain inside the binding; thus, for example, in the pattern [nuP| x |], x matches the entire multi-binding.

Examples:

case (nu Left) of [nuP| Left x |] -> x  ==  nu id

[clP| P |] does the same for the Closed type, and [clNuP| P |] works for both simultaneously: Closed (Mb ctx a).

Synopsis

Documentation

nuP :: QuasiQuoter Source #

Quasi-quoter for patterns that match over Mb

clP :: QuasiQuoter Source #

Quasi-quoter for patterns that match over Closed, built using clKit

clNuP :: QuasiQuoter Source #

Quasi-quoter for patterns that match over Closed (Mb ctx a)