Thanks folks. I was concerned I might be missing some dedicated way to achieve the same with the GHC API. I agree there's a fair chance this won't be noticeable in benchmarks.

Cheers!
Facundo


On Fri, Jan 27, 2023 at 10:15 PM Ben Gamari <ben@smart-cactus.org> wrote:
Facundo Domínguez <facundo.dominguez@tweag.io> writes:

> Dear GHC devs,
>
> I'm trying to port Liquid Haskell to ghc 9.2.5. And having much difficulty
> using the GHC API for a specific task, so I come here to ask about it.
>
> As you may know already, Liquid Haskell needs to read special comments from
> Haskell source code which have the form {-@ ... @-}.
>
I agree with Santiago here: Data doesn't produce fantiastic code but I
would guess that the cost of the traversal to collect your signatures
will be negligible relative to the cost of the work you will later do
later in your pipeline. I would leave optimising this until you know
that it is a significant problem.

Cheers,

 - Ben