@@ -105,7 +105,7 @@ mkSpineFunction mn (DataDeclaration _ _ _ args) = lamCase "$x" <$> mapM mkCtorCl
105 return $ CaseAlternative [ConstructorBinder (Qualified (Just mn) ctorName) (map VarBinder idents)] (Right (caseResult idents))
105 return $ CaseAlternative [ConstructorBinder (Qualified (Just mn) ctorName) (map VarBinder idents)] (Right (caseResult idents))
107 caseResult idents =
107 caseResult idents =
108− App (prodConstructor (StringLiteral . runProperName $ ctorName))
108+ App (prodConstructor (StringLiteral . showQualified runProperName $ Qualified (Just mn) ctorName))
109 . ArrayLiteral
109 . ArrayLiteral
110 $ zipWith toSpineFun (map (Var . Qualified Nothing) idents) tys
110 $ zipWith toSpineFun (map (Var . Qualified Nothing) idents) tys
@@ -119,10 +119,12 @@ mkSpineFunction mn (PositionedDeclaration _ _ d) = mkSpineFunction mn d
119mkSpineFunction _ _ = internalError "mkSpineFunction: expected DataDeclaration"
119mkSpineFunction _ _ = internalError "mkSpineFunction: expected DataDeclaration"
121mkSignatureFunction :: ModuleName -> Declaration -> Expr
121mkSignatureFunction :: ModuleName -> Declaration -> Expr
122−mkSignatureFunction _ (DataDeclaration _ _ _ args) = lamNull . mkSigProd $ map mkProdClause args
122+mkSignatureFunction mn (DataDeclaration _ name _ args) = lamNull . mkSigProd $ map mkProdClause args
124 mkSigProd :: [Expr] -> Expr
124 mkSigProd :: [Expr] -> Expr
125− mkSigProd = App (Constructor (Qualified (Just dataGeneric) (ProperName "SigProd"))) . ArrayLiteral
125+ mkSigProd = App (App (Constructor (Qualified (Just dataGeneric) (ProperName "SigProd")))
126+ (StringLiteral (showQualified runProperName (Qualified (Just mn) name)))
127 mkSigRec :: [Expr] -> Expr
129 mkSigRec :: [Expr] -> Expr
128 mkSigRec = App (Constructor (Qualified (Just dataGeneric) (ProperName "SigRecord"))) . ArrayLiteral
130 mkSigRec = App (Constructor (Qualified (Just dataGeneric) (ProperName "SigRecord"))) . ArrayLiteral
@@ -131,7 +133,7 @@ mkSignatureFunction _ (DataDeclaration _ _ _ args) = lamNull . mkSigProd $ map m
131 proxy = TypeApp (TypeConstructor (Qualified (Just dataGeneric) (ProperName "Proxy")))
133 proxy = TypeApp (TypeConstructor (Qualified (Just dataGeneric) (ProperName "Proxy")))
133 mkProdClause :: (ProperName, [Type]) -> Expr
135 mkProdClause :: (ProperName, [Type]) -> Expr
134− mkProdClause (ctorName, tys) = ObjectLiteral [ ("sigConstructor", StringLiteral (runProperName ctorName))
136+ mkProdClause (ctorName, tys) = ObjectLiteral [ ("sigConstructor", StringLiteral (showQualified runProperName (Qualified (Just mn) ctorName)))
135 , ("sigValues", ArrayLiteral . map mkProductSignature $ tys)
137 , ("sigValues", ArrayLiteral . map mkProductSignature $ tys)