
19 May
2022
19 May
'22
8:15 p.m.
Hello Haskell Cafe, When can a type not share the name of a constructor? Defining a type and a constructor with the same name, manually, as follows, seems to be acceptable: data F = F | T data T However, if the type is generated by Template Haskell, it is no longer acceptable, as follows: voidType :: Name -> DecsQ voidType n = do d <- dataD (return []) n [] Nothing [] [] return [d] In a separate module: data F = F | T $(voidType 'T) This will result in a "Multiple declarations of âTâ" error. Is this expected? Thank you, Patrick