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

PortabilityGHC
Stabilityexperimental
Maintaineremw4@rice.edu

Data.Binding.Hobbits.QQ

Description

Defines a quasi-quoter for writing patterns that match the bodies of Mb multi-bindings. Uses the Data.Binding.Hobbits.PatternParser module, and thus only supports the pattern forms listed there. If P is a (supported) Haskell pattern, then [nuQQ| P ] defines a pattern that will match an multi-binding whose body matches P. Any variables matched by P will remain inside the binding; thus, for example, in the pattern [nuQQ| x |], x matches the entire multi-binding.

Examples:

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

Documentation