git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Fix codegen for data constructor names
commitb71dd8bc6ed893e0ed42f627b150288f86f1be71 authorGary Burgess <gary.burgess@gmail.com> dateMon 17 Feb 2014, 22:20 (13 years ago) parent17d4ff3
2 files changed+7−3
examples/passing/DottedModules.purs+6−2 src/Language/PureScript/Names.hs+1−1
examples/passing/DottedModules.purs+6−2
@@ -2,8 +2,10 @@ module Some.Module.Name where
22
33 class Foo a where
44 foo :: a -> a
5+
6+ data Text = Text String
57
6− x = "Done"
8+ x = Text "Done"
79
810module Main where
911
@@ -12,5 +14,7 @@ module Main where
1214
1315 instance Some.Module.Name.Foo String where
1416 foo s = s
17+
18+ unwrap (Text x) = x
1519
16− main = Trace.print $ foo x
20+ main = Trace.print $ foo $ unwrap x
src/Language/PureScript/Names.hs+1−1
@@ -80,7 +80,7 @@ data Qualified a = Qualified (Maybe ModuleName) a deriving (Eq, Ord, Data, Typea
8080
8181instance (Show a) => Show (Qualified a) where
8282 show (Qualified Nothing a) = show a
83− show (Qualified (Just (ModuleName name)) a) = show name ++ "." ++ show a
83+ show (Qualified (Just name) a) = show name ++ "." ++ show a
8484
8585-- |
8686-- Provide a default module name, if a name is unqualified