git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Operators can be function arguments again #124
commitd95f52f1a1895c959578785682b09995ee3ab86c authorPhil Freeman <paf31@cantab.net> dateTue 21 Jan 2014, 19:43 (13 years ago) parent67edf7a
2 files changed+5−1
examples/passing/Operators.purs+2 src/Language/PureScript/CodeGen/JS.hs+3−1
examples/passing/Operators.purs+2
@@ -42,3 +42,5 @@ module Operators2 where
4242 (...) = \as -> \bs -> as
4343
4444 test11 = [1, 2, 3] ... [4, 5, 6]
45+
46+ test12 (<%>) a b = a <%> b
src/Language/PureScript/CodeGen/JS.hs+3−1
@@ -143,7 +143,9 @@ varToJs :: ModuleName -> Environment -> Qualified Ident -> JS
143143varToJs m e qual@(Qualified _ ident) = case M.lookup (qualify m qual) (names e) of
144144 Just (_, ty) | isExtern ty -> JSVar ident
145145 Just (_, Alias aliasModule aliasIdent) -> qualifiedToJS identToJs (Qualified (Just aliasModule) aliasIdent)
146− _ -> qualifiedToJS identToJs qual
146+ _ -> case qual of
147+ Qualified Nothing _ -> JSVar ident
148+ _ -> qualifiedToJS identToJs qual
147149 where
148150 isExtern (Extern ForeignImport) = True
149151 isExtern (Alias m' ident') = case M.lookup (m', ident') (names e) of