Type signatures in patterns not (yet) handled by Template Haskell
This bit me just now, so I figured I should report a feature request bug.
ezyang@sabre:~/Dev/whisk$ ghc-8.0 --interactive -XTemplateHaskell GHCi, version 188.8.131.5260204: http://www.haskell.org/ghc/ :? for help Prelude> Language.Haskell.TH.runQ [| \(x :: ()) -> x |] <interactive>:1:29: error: Type signatures in patterns not (yet) handled by Template Haskell x :: ()
In the code, there is a bit of mumbling about scoped type variables. I believe it is referring to code like this:
Prelude> :t (\(x :: a) -> (x :: a)) (\(x :: a) -> (x :: a)) :: a -> a
Described in the manual here: https://downloads.haskell.org/\~ghc/latest/docs/html/users_guide/glasgow_exts.html\#pattern-type-signatures This means that TH has to somehow bring the type into scope. I don't actually know how to do it.
It seems a bit awful for this to be the reason why these quotes are not accepted; maybe without scoped type variables we should be able to do something cheap and cheerful.