Annotations with names

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Annotations with names

Joachim Breitner-2

I’d like to use Annotations to transport some meta-information from the
Haskell source to GHC Plugins (as they are meant to be, right?).

But I am struggling expressing annotations that relate different
symbols. Here are some hypthetical examples what I want to express:

    foo :: String -> String
    foo = …

    bar :: [(String,String), (String, String)]
    {-# ANN bar (TestCasesFor 'foo) #-}

    rec :: Natural -> (a -> a) -> a -> a
    {-# ANN rec (RecurserFor 'Natural) $-}

This code actually works (with TemplateHaskell). It will put a TH.Name
into the annotations, but when I am in Core, I need a core Name.

Is there a good way of transporting such references in Annotations so
that the desugarer (or the renamer) will do the necessary name changes
for me?

And slightly related: Do Annotations keep bindings alive? (It seems so,
but then it should be documented in


Joachim “nomeata” Breitner
  [hidden email]

Glasgow-haskell-users mailing list
[hidden email]

signature.asc (849 bytes) Download Attachment