Skip to content

Commit b71dd8b

Browse files
committed
Fix codegen for data constructor names
1 parent 17d4ff3 commit b71dd8b

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

examples/passing/DottedModules.purs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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

810
module 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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ data Qualified a = Qualified (Maybe ModuleName) a deriving (Eq, Ord, Data, Typea
8080

8181
instance (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

0 commit comments

Comments
 (0)