git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Qualified constructors are not valid identifiers for operator aliases.
a6b3468Liam Goodacre
examples/passing/DctorOperatorAlias.purs+5
@@ -11,9 +11,14 @@ module Main where
11 import Control.Monad.Eff.Console (CONSOLE, log)
11 import Control.Monad.Eff.Console (CONSOLE, log)
12 import Test.Assert (ASSERT, assert')
12 import Test.Assert (ASSERT, assert')
13 import Data.List (List(..), (:))
13 import Data.List (List(..), (:))
14+ import Data.List as L
14
15
16+ -- unqualified
15 infixl 6 Cons as !
17 infixl 6 Cons as !
16
18
19+ -- qualified
20+ infixl 6 L.Cons as !!
21+
17 get1 ∷ ∀ a. a → List a → a
22 get1 ∷ ∀ a. a → List a → a
18 get1 y xs = case xs of
23 get1 y xs = case xs of
19 _ : x : _ → x
24 _ : x : _ → x
src/Language/PureScript/Parser/Declarations.hs+2−2
@@ -126,8 +126,8 @@ parseFixityDeclaration = do
126 name <- symbol
126 name <- symbol
127 return $ FixityDeclaration fixity name alias
127 return $ FixityDeclaration fixity name alias
128 where
128 where
129− aliased = (Left <$> parseQualified (Ident <$> identifier))
129+ aliased = P.try (Left <$> parseQualified (Ident <$> identifier))
130− <|> (Right <$> parseQualified (ProperName <$> uname))
130+ <|> (Right <$> parseQualified properName)
131
131
132parseImportDeclaration :: TokenParser Declaration
132parseImportDeclaration :: TokenParser Declaration
133parseImportDeclaration = do
133parseImportDeclaration = do