SafeHaskell vs TemplateHaskell

Richard Eisenberg rae at
Tue Oct 4 12:09:36 UTC 2016

Hi Erik,

You're right that Template Haskell violates Safe Haskell guarantees, but that should be independent of the Language.Haskell.TH.Syntax module. The problem is the -XTemplateHaskell extension, not the module. So I think labeling the module Trustworthy is OK.


> On Oct 4, 2016, at 3:28 AM, Erik de Castro Lopo <mle+hs at> wrote:
> Hi all,
> I tried to fix trac ticket #12511 (template-haskell's Language.Haskell.Syntax
> module should be Trustworthy) but in doing so I began to think this is actually
> a bad idea. Specifically, I suspect its actually possible to craft something
> using TH that bypasses the guarantees that Safe is supposed to ensure.
> Comments?
> Erik
> -- 
> ----------------------------------------------------------------------
> Erik de Castro Lopo
> _______________________________________________
> ghc-devs mailing list
> ghc-devs at

More information about the ghc-devs mailing list