2015-05-16 10 views
6

Kann jemand sagen, warum dieser Code nichtIst das erwartete Verhalten von Template Haskell?

data A = A { 
    _b :: B 
} 
makeLenses ''A 

type B = String 

mit Nachricht

Not in scope: type constructor or class B 

und tut dies nicht kompiliert:

type B = String 

data A = A { 
    _b :: B 
} 
makeLenses ''A 

Ohne makeLenses alles kompiliert in Ordnung.

Warum kann ich nach makeLenses keine synonim-Deklaration eingeben?

Antwort