I'm implementing Template Haskell support for injective type families and I'm 
struggling to 
understand DsMeta module. It seems that all functions in that module delegate 
their calls to 
functions in Language.Haskell.TH.Lib via wired-in names and the `DsMeta.rep2` 
function. I'm 
puzzled by this design and I'd appreciate if someone could explain why things 
are done this way. 
Take this function example:

repPlainTV :: Core TH.Name -> DsM (Core TH.TyVarBndr)
repPlainTV (MkC nm) = rep2 plainTVName [nm]

where `plainTvName` is a name of `Language.Haskell.TH.Lib.plainTV`:

plainTV :: Name -> TyVarBndr
plainTV = PlainTV

Why not implement repPlainTV like this: ?

repPlainTV :: Core TH.Name -> DsM (Core TH.TyVarBndr)
repPlainTV (MkC nm) = return $ MkC (TH.PlainTV nm)

Janek
_______________________________________________
ghc-devs mailing list
ghc-devs@haskell.org
http://www.haskell.org/mailman/listinfo/ghc-devs

Reply via email to