This code is compiled fine:
data None = None { _f :: Int }
type Simpl = Env
type Env = Int
Run Code Online (Sandbox Code Playgroud)
However, I got an error with this code:
{-# LANGUAGE TemplateHaskell #-}
import Control.Lens
data None = None { _f :: Int }
type Simpl = Env
makeLenses ''None
type Env = Int
Run Code Online (Sandbox Code Playgroud)
Error:
Not in scope: type constructor or class `Env'
Run Code Online (Sandbox Code Playgroud)
I just added a single line makeLenses ''None between type declarations.
This means TemplateHaskell code could …