git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Missed fromSpine
commitfc4090fd1fddca5cfda91b2be03937356a93e19c authorPhil Freeman <paf31@cantab.net> dateTue 17 Nov 2015, 20:12 (11 years ago) parent9aa0928
2 files changed+3−3
core-tests/tests/generic-deriving/Main.purs+2−2 src/Language/PureScript/Sugar/TypeClasses/Deriving.hs+1−1
core-tests/tests/generic-deriving/Main.purs+2−2
@@ -14,7 +14,7 @@ data A a
1414 = A Number String
1515 | B Int
1616 | C (Array (A a))
17− | D { a :: a }
17+ | D { "asgård" :: a }
1818 | E Void
1919
2020derive instance genericA :: (Generic b) => Generic (A b)
@@ -24,4 +24,4 @@ newtype X b = X b
2424derive instance genericX :: Generic (X String)
2525
2626main :: forall eff. Eff (console :: CONSOLE | eff) Unit
27−main = Control.Monad.Eff.Console.log (gShow (D { a: C [ A 1.0 "test", B 42, D { a: true } ] }))
27+main = Control.Monad.Eff.Console.log (gShow (D { "asgård": C [ A 1.0 "test", B 42, D { "asgård": true } ] }))
src/Language/PureScript/Sugar/TypeClasses/Deriving.hs+1−1
@@ -170,7 +170,7 @@ mkFromSpineFunction mn (DataDeclaration _ _ _ args) = lamCase "$x" <$> (addCatch
170170 mkAlternative :: (ProperName, [Type]) -> m CaseAlternative
171171 mkAlternative (ctorName, tys) = do
172172 idents <- replicateM (length tys) (fmap Ident freshName)
173− return $ CaseAlternative [ prodBinder [ StringBinder (runProperName ctorName), ArrayBinder (map VarBinder idents)]]
173+ return $ CaseAlternative [ prodBinder [ StringBinder (showQualified runProperName (Qualified (Just mn) ctorName)), ArrayBinder (map VarBinder idents)]]
174174 . Right
175175 $ liftApplicative (mkJust $ Constructor (Qualified (Just mn) ctorName))
176176 (zipWith fromSpineFun (map (Var . Qualified Nothing) idents) tys)