Type synonyms “not in scope” when using Template Haskell
问题 I am getting a strange error about a data type being "not in scope" when using Template Haskell. Here is my Main.hs file: {-# LANGUAGE TemplateHaskell #-} module Main where import Control.Lens import Data.Aeson import Data.Aeson.TH type Foo = Bar data Baz = Baz $(deriveJSON defaultOptions ''Baz) -- $(makeLenses ''Baz) data Bar = Bar main :: IO () main = print "hello" When trying to compile it, I get the following error: test-0.1.0.0: configure Configuring test-0.1.0.0... test-0.1.0.0: build