Restricted Template Haskell

Greg Weber greg at gregweber.info
Tue Feb 3 03:41:42 UTC 2015


I would like to figure out how to improve the state of TTH documentation.
The GHC wiki is usually for things that are changing, and the page is
written in that future style, so it makes one wonder if all things are
finished or if some things remain unfinished. Some "this is how it is"
documentation in the user guide would seem more useful now.

But I am not sure if the user guide [1] is even correct because it
indicates a type of `Q (TExp a)` where I would expect just `TExp a` from
reading the wiki [2].

[1]
https://downloads.haskell.org/~ghc/7.8.4/docs/html/users_guide/template-haskell.html
[2] https://ghc.haskell.org/trac/ghc/wiki/TemplateHaskell/BlogPostChanges

On Mon, Feb 2, 2015 at 11:31 AM, Greg Weber <greg at gregweber.info> wrote:

> Hi Simon,
>
> I am just starting the proposal: gathering interested parties and pointers
> to related information.
> Thanks for the pointer to Typed Template Haskell. I was actually unaware
> of the extent to which Typed Template Haskell is restricted. I have not
> seen any usage of Typed Template Haskell in the wild or been able to use it
> myself unfortunately due to backwards compatibility needs (once the next
> GHC release is out libraries will start to consider dropping 7.6 support
> and we will see more usage, although Ubuntu still ships 7.6 by default).
> I will study Typed Template Haskell.
>
> Greg Weber
>
> On Mon, Feb 2, 2015 at 9:33 AM, Simon Peyton Jones <simonpj at microsoft.com>
> wrote:
>
>>  The new TH is already split into two parts
>> <https://ghc.haskell.org/trac/ghc/blog/Template%20Haskell%20Proposal> as
>> I’m sure you know
>>
>> ·         Typed TH is for expressions only, and doesn’t have reify, nor
>> any Q monad.
>>
>> ·         Untyped TH is the wild west
>>
>>
>>
>> Typed TH may get some of what you want?   Certainly you want to
>> acknowledge the existing split in your own design.
>>
>>
>>
>> The proposal could do with examples to illustrate what the difficulties
>> are.  What bad things happen in the Q monad?  Can you give examples of
>> reasoning that would be valid in level 1 but not in level 2.  etc.  More
>> precision please!
>>
>>
>>
>> Simon
>>
>>
>>
>> *From:* Glasgow-haskell-users [mailto:
>> glasgow-haskell-users-bounces at haskell.org] *On Behalf Of *Greg Weber
>> *Sent:* 30 January 2015 23:39
>> *To:* ghc-devs at haskell.org; GHC users
>> *Cc:* David Terei; Maxwell Swadling
>> *Subject:* Restricted Template Haskell
>>
>>
>>
>> Hello GHC friends!
>>
>>
>>
>> I am starting up a proposal for variants of Template Haskell that
>> restrict what operations are available. The goal is to make TH easier for
>> users to reason about and to allow for an easier compilation story.
>>
>>
>>
>> Here is the proposal page:
>>
>> https://ghc.haskell.org/trac/ghc/wiki/TemplateHaskell/Restricted
>>
>>
>>
>> Right now the proposal does not have any details and the goal is to write
>> out a clear specification.
>>
>> If this sounds interesting to you, let me know or leave some feedback on
>> the wiki.
>>
>>
>>
>>
>>
>> Thanks,
>>
>> Greg Weber
>>
>>
>>
>>
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/ghc-devs/attachments/20150202/fca095ac/attachment.html>


More information about the ghc-devs mailing list