[Haskell-cafe] ANNOUNCE: antiquoter-

L Corbijn aspergesoepje at gmail.com
Sun Apr 7 18:21:46 CEST 2013


A late reply, I was a bit busy. My comments are inline

On Thu, Apr 4, 2013 at 7:30 PM, Tillmann Rendel <
rendel at informatik.uni-marburg.de> wrote:

> Hi,
> L Corbijn wrote:
>> I'm happy to announce the release of my first package antiquoter, a
>> combinator library for writing quasiquoters and antiquoters. The main
>> aim is to simplify their definitions and reduce copy-and-paste
>> programming.
> Very interesting. I'm using something similar to your EP class, but yours
> looks more refined. See class PatOrExp in
> https://github.com/Toxaris/pts/blob/master/src-lib/PTS/QuasiQuote.hs

That looks interesting. Maybe I should include your version of Lift, to
extend the version of template-haskell to also work on patterns.

> I'm a bit overwhelmed by the rest of your library, though. Is the overall
> design explained somewhere?
It isn't really explained somewhere, so I should update the documentation
with it. The basic idea is that you build an AntiQuoter out of separate
AntiQuoterPass-es using (<<>) or (<>>). The resulting AntiQuoter can then
be used by dataToExpQ/dataToPatQ to form the total QuasiQuote, or using the
helper function mkQuasiQuoter.

The pattern-expression similarity is build is build on top of this
abstraction, where the result of the AntiQuoter(Pass) is fixed to any
instance of the EP class. Which are then used to define quite a few

Anyway, I'll try to update the documentation soon to make the design a bit

> And: Your package description says that it is "especially aimed at making
> user extensible antiquoters". That sounds very cool. Can you provide an
> example for how the antiquoter package supports extensions, and what kinds
> of extensions are supported?
That aim should have been removed as it still is not done. But let me put
it into context. The package started of as some reusable parts which I got
from refactoring haskell-src-exts-qq. Its quasiquoter has three patterns to
get something antiquoted each with their own special use cases. The problem
was that I wanted something antiquoted which could not be done in one of
those three patterns. Adding a fourth pattern has its problems, so I
started antiquoter with one of the aims being to make antiquoters
extensible by the user. I think I have got some ideas of how to do this,
but I didn't find the time to add them.


>    Tillmann
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20130407/0b6545a8/attachment.htm>

More information about the Haskell-Cafe mailing list