git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Fix codegen for data constructor names
b71dd8bGary Burgess
examples/passing/DottedModules.purs+6−2
@@ -2,8 +2,10 @@ module Some.Module.Name where
2
2
3 class Foo a where
3 class Foo a where
4 foo :: a -> a
4 foo :: a -> a
5+
6+ data Text = Text String
5
7
6− x = "Done"
8+ x = Text "Done"
7
9
8module Main where
10module Main where
9
11
@@ -12,5 +14,7 @@ module Main where
12
14
13 instance Some.Module.Name.Foo String where
15 instance Some.Module.Name.Foo String where
14 foo s = s
16 foo s = s
17+
18+ unwrap (Text x) = x
15
19
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
80
80
81instance (Show a) => Show (Qualified a) where
81instance (Show a) => Show (Qualified a) where
82 show (Qualified Nothing a) = show a
82 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
84
84
85-- |
85-- |
86-- Provide a default module name, if a name is unqualified
86-- Provide a default module name, if a name is unqualified