git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Merge pull request #2015 from LiamGoodacre/fix/qualified-ctor-ops

Qualified constructors are not valid identifiers for operator aliases

commit6cb50eea47d653e8824718378d2ebcfd24f7fe37 authorGary Burgess <gary.burgess@gmail.com> dateThu 14 Apr 2016, 11:33 (11 years ago) parentd490b18a6b3468
2 files changed+7−2
examples/passing/DctorOperatorAlias.purs+5 src/Language/PureScript/Parser/Declarations.hs+2−2
examples/passing/DctorOperatorAlias.purs+5
@@ -11,9 +11,14 @@ module Main where
1111 import Control.Monad.Eff.Console (CONSOLE, log)
1212 import Test.Assert (ASSERT, assert')
1313 import Data.List (List(..), (:))
14+ import Data.List as L
1415
16+ -- unqualified
1517 infixl 6 Cons as !
1618
19+ -- qualified
20+ infixl 6 L.Cons as !!
21+
1722 get1 ∷ ∀ a. a → List a → a
1823 get1 y xs = case xs of
1924 _ : x : _ → x
src/Language/PureScript/Parser/Declarations.hs+2−2
@@ -126,8 +126,8 @@ parseFixityDeclaration = do
126126 name <- symbol
127127 return $ FixityDeclaration fixity name alias
128128 where
129− aliased = (Left <$> parseQualified (Ident <$> identifier))
130− <|> (Right <$> parseQualified (ProperName <$> uname))
129+ aliased = P.try (Left <$> parseQualified (Ident <$> identifier))
130+ <|> (Right <$> parseQualified properName)
131131
132132parseImportDeclaration :: TokenParser Declaration
133133parseImportDeclaration = do