I have to work with the following Template Haskell code:
{-# OPTIONS_GHC -Wall #-}
{-# LANGUAGE TemplateHaskell #-}
module myModule where
import Language.Haskell.TH
newtype C a = C (TExpQ a)
unC :: C a -> TExpQ a
unC (C x) = x
However when I load the file I get an error:
Not in scope: type constructor or class ‘TExpQ’
Perhaps you meant one of these:
‘TExp’ (imported from Language.Haskell.TH),
‘ExpQ’ (imported from Language.Haskell.TH)
I looked in the docs and TExpQ is in the library that should be loaded http://hackage.haskell.org/package/template-haskell-2.16.0.0/docs/Language-Haskell-TH-Lib.html
Is the library not loading? Is that why the type is not in scope?