git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Add passing example for import mod hiding (..)
commit008b70bdcb1a9b4b2755ce2c4699ab7f299c330c authorAndrey Popp <8mayday@gmail.com> dateMon 4 Aug 2014, 13:23 (12 years ago) parent3057898
2 files changed+22−4
examples/passing/ImportHiding.purs+18 src/Language/PureScript/Parser/Declarations.hs+4−4
examples/passing/ImportHiding.pursnew file+18
@@ -0,0 +1,18 @@
1+module Main where
2+
3+import Debug.Trace
4+import Prelude hiding (
5+ show, -- a value
6+ Show, -- a type class
7+ Unit(..) -- a constructor
8+ )
9+
10+show = 1
11+
12+class Show a where
13+ noshow :: a -> a
14+
15+data Unit = X | Y
16+
17+main = do
18+ print show
src/Language/PureScript/Parser/Declarations.hs+4−4
@@ -125,13 +125,13 @@ parseImportDeclaration = do
125125 moduleName' <- moduleName
126126 stdImportHiding moduleName' <|> stdImportQualifying moduleName'
127127 where
128− stdImportHiding moduleName' = do
128+ stdImportHiding mn = do
129129 reserved "hiding"
130130 declType <- importDeclarationType Hiding
131− return $ ImportDeclaration moduleName' declType Nothing
132− stdImportQualifying moduleName' = do
131+ return $ ImportDeclaration mn declType Nothing
132+ stdImportQualifying mn = do
133133 declType <- importDeclarationType Qualifying
134− return $ ImportDeclaration moduleName' declType Nothing
134+ return $ ImportDeclaration mn declType Nothing
135135 qualImport = do
136136 reserved "qualified"
137137 indented