Hi,

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
https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/extending_ghc.html#source-annotations


Thanks,
Joachim


-- 
Joachim “nomeata” Breitner
  m...@joachim-breitner.de
  https://www.joachim-breitner.de/

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users

Reply via email to