git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Fix #1846, start work on '_ - 1' syntax for sections
22c9dfdPhil Freeman
examples/failing/AnonArgument.pursnew file+5
@@ -0,0 +1,5 @@
1+-- @shouldFailWith IncorrectAnonymousArgument
2+module Main where
3+
4+test :: Int -> Int
5+test = _
examples/passing/ExplicitOperatorSections.pursnew file+11
@@ -0,0 +1,11 @@
1+module Main where
2+
3+import Prelude
4+
5+subtractOne :: Int -> Int
6+subtractOne = _ - 1
7+
8+addOne :: Int -> Int
9+addOne = 1 + _
10+
11+main = Control.Monad.Eff.Console.log "Done"
src/Language/PureScript/AST/Declarations.hs+4−15
@@ -334,11 +334,6 @@ data Expr
334 --
334 --
335 | BinaryNoParens Expr Expr Expr
335 | BinaryNoParens Expr Expr Expr
336 -- |
336 -- |
337− -- Explicit parentheses. During the rebracketing phase of desugaring, this data constructor
338− -- will be removed.
339− --
340− | Parens Expr
341− -- |
342 -- Operator section. This will be removed during desugaring and replaced with a partially applied
337 -- Operator section. This will be removed during desugaring and replaced with a partially applied
343 -- operator or lambda to flip the arguments.
338 -- operator or lambda to flip the arguments.
344 --
339 --
@@ -352,11 +347,6 @@ data Expr
352 --
347 --
353 | ObjectLiteral [(String, Expr)]
348 | ObjectLiteral [(String, Expr)]
354 -- |
349 -- |
355− -- An object constructor (object literal with underscores). This will be removed during
356− -- desugaring and expanded into a lambda that returns an object literal.
357− --
358− | ObjectConstructor [(String, Maybe Expr)]
359− -- |
360 -- An object property getter (e.g. `_.x`). This will be removed during
350 -- An object property getter (e.g. `_.x`). This will be removed during
361 -- desugaring and expanded into a lambda that reads a property from an object.
351 -- desugaring and expanded into a lambda that reads a property from an object.
362 --
352 --
@@ -370,11 +360,6 @@ data Expr
370 --
360 --
371 | ObjectUpdate Expr [(String, Expr)]
361 | ObjectUpdate Expr [(String, Expr)]
372 -- |
362 -- |
373− -- Partial record updater. This will be removed during desugaring and
374− -- expanded into a lambda that returns an object update.
375− --
376− | ObjectUpdater (Maybe Expr) [(String, Maybe Expr)]
377− -- |
378 -- Function introduction
363 -- Function introduction
379 --
364 --
380 | Abs (Either Ident Binder) Expr
365 | Abs (Either Ident Binder) Expr
@@ -433,6 +418,10 @@ data Expr
433 --
418 --
434 | SuperClassDictionary (Qualified (ProperName 'ClassName)) [Type]
419 | SuperClassDictionary (Qualified (ProperName 'ClassName)) [Type]
435 -- |
420 -- |
421+ -- A placeholder for an anonymous function argument
422+ --
423+ | AnonymousArgument
424+ -- |
436 -- A value with source position information
425 -- A value with source position information
437 --
426 --
438 | PositionedValue SourceSpan [Comment] Expr
427 | PositionedValue SourceSpan [Comment] Expr
src/Language/PureScript/AST/Traversals.hs+1−22
@@ -23,7 +23,7 @@ import Data.Foldable (fold)
23import qualified Data.Set as S
23import qualified Data.Set as S
24
24
25import Control.Monad
25import Control.Monad
26−import Control.Arrow ((***), (+++), second)
26+import Control.Arrow ((***), (+++))
27
27
28import Language.PureScript.AST.Binders
28import Language.PureScript.AST.Binders
29import Language.PureScript.AST.Declarations
29import Language.PureScript.AST.Declarations
@@ -49,16 +49,13 @@ everywhereOnValues f g h = (f', g', h')
49 g' :: Expr -> Expr
49 g' :: Expr -> Expr
50 g' (UnaryMinus v) = g (UnaryMinus (g' v))
50 g' (UnaryMinus v) = g (UnaryMinus (g' v))
51 g' (BinaryNoParens op v1 v2) = g (BinaryNoParens (g' op) (g' v1) (g' v2))
51 g' (BinaryNoParens op v1 v2) = g (BinaryNoParens (g' op) (g' v1) (g' v2))
52− g' (Parens v) = g (Parens (g' v))
53 g' (OperatorSection op (Left v)) = g (OperatorSection (g' op) (Left $ g' v))
52 g' (OperatorSection op (Left v)) = g (OperatorSection (g' op) (Left $ g' v))
54 g' (OperatorSection op (Right v)) = g (OperatorSection (g' op) (Right $ g' v))
53 g' (OperatorSection op (Right v)) = g (OperatorSection (g' op) (Right $ g' v))
55 g' (ArrayLiteral vs) = g (ArrayLiteral (map g' vs))
54 g' (ArrayLiteral vs) = g (ArrayLiteral (map g' vs))
56 g' (ObjectLiteral vs) = g (ObjectLiteral (map (fmap g') vs))
55 g' (ObjectLiteral vs) = g (ObjectLiteral (map (fmap g') vs))
57− g' (ObjectConstructor vs) = g (ObjectConstructor (map (second (fmap g')) vs))
58 g' (TypeClassDictionaryConstructorApp name v) = g (TypeClassDictionaryConstructorApp name (g' v))
56 g' (TypeClassDictionaryConstructorApp name v) = g (TypeClassDictionaryConstructorApp name (g' v))
59 g' (Accessor prop v) = g (Accessor prop (g' v))
57 g' (Accessor prop v) = g (Accessor prop (g' v))
60 g' (ObjectUpdate obj vs) = g (ObjectUpdate (g' obj) (map (fmap g') vs))
58 g' (ObjectUpdate obj vs) = g (ObjectUpdate (g' obj) (map (fmap g') vs))
61− g' (ObjectUpdater obj vs) = g (ObjectUpdater (fmap g' obj) (map (second (fmap g')) vs))
62 g' (Abs name v) = g (Abs name (g' v))
59 g' (Abs name v) = g (Abs name (g' v))
63 g' (App v1 v2) = g (App (g' v1) (g' v2))
60 g' (App v1 v2) = g (App (g' v1) (g' v2))
64 g' (IfThenElse v1 v2 v3) = g (IfThenElse (g' v1) (g' v2) (g' v3))
61 g' (IfThenElse v1 v2 v3) = g (IfThenElse (g' v1) (g' v2) (g' v3))
@@ -107,16 +104,13 @@ everywhereOnValuesTopDownM f g h = (f' <=< f, g' <=< g, h' <=< h)
107
104
108 g' (UnaryMinus v) = UnaryMinus <$> (g v >>= g')
105 g' (UnaryMinus v) = UnaryMinus <$> (g v >>= g')
109 g' (BinaryNoParens op v1 v2) = BinaryNoParens <$> (g op >>= g') <*> (g v1 >>= g') <*> (g v2 >>= g')
106 g' (BinaryNoParens op v1 v2) = BinaryNoParens <$> (g op >>= g') <*> (g v1 >>= g') <*> (g v2 >>= g')
110− g' (Parens v) = Parens <$> (g v >>= g')
111 g' (OperatorSection op (Left v)) = OperatorSection <$> (g op >>= g') <*> (Left <$> (g v >>= g'))
107 g' (OperatorSection op (Left v)) = OperatorSection <$> (g op >>= g') <*> (Left <$> (g v >>= g'))
112 g' (OperatorSection op (Right v)) = OperatorSection <$> (g op >>= g') <*> (Right <$> (g v >>= g'))
108 g' (OperatorSection op (Right v)) = OperatorSection <$> (g op >>= g') <*> (Right <$> (g v >>= g'))
113 g' (ArrayLiteral vs) = ArrayLiteral <$> traverse (g' <=< g) vs
109 g' (ArrayLiteral vs) = ArrayLiteral <$> traverse (g' <=< g) vs
114 g' (ObjectLiteral vs) = ObjectLiteral <$> traverse (sndM (g' <=< g)) vs
110 g' (ObjectLiteral vs) = ObjectLiteral <$> traverse (sndM (g' <=< g)) vs
115− g' (ObjectConstructor vs) = ObjectConstructor <$> traverse (sndM $ maybeM (g' <=< g)) vs
116 g' (TypeClassDictionaryConstructorApp name v) = TypeClassDictionaryConstructorApp name <$> (g v >>= g')
111 g' (TypeClassDictionaryConstructorApp name v) = TypeClassDictionaryConstructorApp name <$> (g v >>= g')
117 g' (Accessor prop v) = Accessor prop <$> (g v >>= g')
112 g' (Accessor prop v) = Accessor prop <$> (g v >>= g')
118 g' (ObjectUpdate obj vs) = ObjectUpdate <$> (g obj >>= g') <*> traverse (sndM (g' <=< g)) vs
113 g' (ObjectUpdate obj vs) = ObjectUpdate <$> (g obj >>= g') <*> traverse (sndM (g' <=< g)) vs
119− g' (ObjectUpdater obj vs) = ObjectUpdater <$> (maybeM g obj >>= maybeM g') <*> traverse (sndM $ maybeM (g' <=< g)) vs
120 g' (Abs name v) = Abs name <$> (g v >>= g')
114 g' (Abs name v) = Abs name <$> (g v >>= g')
121 g' (App v1 v2) = App <$> (g v1 >>= g') <*> (g v2 >>= g')
115 g' (App v1 v2) = App <$> (g v1 >>= g') <*> (g v2 >>= g')
122 g' (IfThenElse v1 v2 v3) = IfThenElse <$> (g v1 >>= g') <*> (g v2 >>= g') <*> (g v3 >>= g')
116 g' (IfThenElse v1 v2 v3) = IfThenElse <$> (g v1 >>= g') <*> (g v2 >>= g') <*> (g v3 >>= g')
@@ -160,16 +154,13 @@ everywhereOnValuesM f g h = (f', g', h')
160
154
161 g' (UnaryMinus v) = (UnaryMinus <$> g' v) >>= g
155 g' (UnaryMinus v) = (UnaryMinus <$> g' v) >>= g
162 g' (BinaryNoParens op v1 v2) = (BinaryNoParens <$> g' op <*> g' v1 <*> g' v2) >>= g
156 g' (BinaryNoParens op v1 v2) = (BinaryNoParens <$> g' op <*> g' v1 <*> g' v2) >>= g
163− g' (Parens v) = (Parens <$> g' v) >>= g
164 g' (OperatorSection op (Left v)) = (OperatorSection <$> g' op <*> (Left <$> g' v)) >>= g
157 g' (OperatorSection op (Left v)) = (OperatorSection <$> g' op <*> (Left <$> g' v)) >>= g
165 g' (OperatorSection op (Right v)) = (OperatorSection <$> g' op <*> (Right <$> g' v)) >>= g
158 g' (OperatorSection op (Right v)) = (OperatorSection <$> g' op <*> (Right <$> g' v)) >>= g
166 g' (ArrayLiteral vs) = (ArrayLiteral <$> traverse g' vs) >>= g
159 g' (ArrayLiteral vs) = (ArrayLiteral <$> traverse g' vs) >>= g
167 g' (ObjectLiteral vs) = (ObjectLiteral <$> traverse (sndM g') vs) >>= g
160 g' (ObjectLiteral vs) = (ObjectLiteral <$> traverse (sndM g') vs) >>= g
168− g' (ObjectConstructor vs) = (ObjectConstructor <$> traverse (sndM $ maybeM g') vs) >>= g
169 g' (TypeClassDictionaryConstructorApp name v) = (TypeClassDictionaryConstructorApp name <$> g' v) >>= g
161 g' (TypeClassDictionaryConstructorApp name v) = (TypeClassDictionaryConstructorApp name <$> g' v) >>= g
170 g' (Accessor prop v) = (Accessor prop <$> g' v) >>= g
162 g' (Accessor prop v) = (Accessor prop <$> g' v) >>= g
171 g' (ObjectUpdate obj vs) = (ObjectUpdate <$> g' obj <*> traverse (sndM g') vs) >>= g
163 g' (ObjectUpdate obj vs) = (ObjectUpdate <$> g' obj <*> traverse (sndM g') vs) >>= g
172− g' (ObjectUpdater obj vs) = (ObjectUpdater <$> maybeM g' obj <*> traverse (sndM $ maybeM g') vs) >>= g
173 g' (Abs name v) = (Abs name <$> g' v) >>= g
164 g' (Abs name v) = (Abs name <$> g' v) >>= g
174 g' (App v1 v2) = (App <$> g' v1 <*> g' v2) >>= g
165 g' (App v1 v2) = (App <$> g' v1 <*> g' v2) >>= g
175 g' (IfThenElse v1 v2 v3) = (IfThenElse <$> g' v1 <*> g' v2 <*> g' v3) >>= g
166 g' (IfThenElse v1 v2 v3) = (IfThenElse <$> g' v1 <*> g' v2 <*> g' v3) >>= g
@@ -216,16 +207,13 @@ everythingOnValues (<>) f g h i j = (f', g', h', i', j')
216
207
217 g' v@(UnaryMinus v1) = g v <> g' v1
208 g' v@(UnaryMinus v1) = g v <> g' v1
218 g' v@(BinaryNoParens op v1 v2) = g v <> g' op <> g' v1 <> g' v2
209 g' v@(BinaryNoParens op v1 v2) = g v <> g' op <> g' v1 <> g' v2
219− g' v@(Parens v1) = g v <> g' v1
220 g' v@(OperatorSection op (Left v1)) = g v <> g' op <> g' v1
210 g' v@(OperatorSection op (Left v1)) = g v <> g' op <> g' v1
221 g' v@(OperatorSection op (Right v1)) = g v <> g' op <> g' v1
211 g' v@(OperatorSection op (Right v1)) = g v <> g' op <> g' v1
222 g' v@(ArrayLiteral vs) = foldl (<>) (g v) (map g' vs)
212 g' v@(ArrayLiteral vs) = foldl (<>) (g v) (map g' vs)
223 g' v@(ObjectLiteral vs) = foldl (<>) (g v) (map (g' . snd) vs)
213 g' v@(ObjectLiteral vs) = foldl (<>) (g v) (map (g' . snd) vs)
224− g' v@(ObjectConstructor vs) = foldl (<>) (g v) (map g' (mapMaybe snd vs))
225 g' v@(TypeClassDictionaryConstructorApp _ v1) = g v <> g' v1
214 g' v@(TypeClassDictionaryConstructorApp _ v1) = g v <> g' v1
226 g' v@(Accessor _ v1) = g v <> g' v1
215 g' v@(Accessor _ v1) = g v <> g' v1
227 g' v@(ObjectUpdate obj vs) = foldl (<>) (g v <> g' obj) (map (g' . snd) vs)
216 g' v@(ObjectUpdate obj vs) = foldl (<>) (g v <> g' obj) (map (g' . snd) vs)
228− g' v@(ObjectUpdater obj vs) = foldl (<>) (maybe (g v) (\x -> g v <> g' x) obj) (map g' (mapMaybe snd vs))
229 g' v@(Abs _ v1) = g v <> g' v1
217 g' v@(Abs _ v1) = g v <> g' v1
230 g' v@(App v1 v2) = g v <> g' v1 <> g' v2
218 g' v@(App v1 v2) = g v <> g' v1 <> g' v2
231 g' v@(IfThenElse v1 v2 v3) = g v <> g' v1 <> g' v2 <> g' v3
219 g' v@(IfThenElse v1 v2 v3) = g v <> g' v1 <> g' v2 <> g' v3
@@ -283,16 +271,13 @@ everythingWithContextOnValues s0 r0 (<>) f g h i j = (f'' s0, g'' s0, h'' s0, i'
283
271
284 g' s (UnaryMinus v1) = g'' s v1
272 g' s (UnaryMinus v1) = g'' s v1
285 g' s (BinaryNoParens op v1 v2) = g'' s op <> g'' s v1 <> g'' s v2
273 g' s (BinaryNoParens op v1 v2) = g'' s op <> g'' s v1 <> g'' s v2
286− g' s (Parens v1) = g'' s v1
287 g' s (OperatorSection op (Left v)) = g'' s op <> g'' s v
274 g' s (OperatorSection op (Left v)) = g'' s op <> g'' s v
288 g' s (OperatorSection op (Right v)) = g'' s op <> g'' s v
275 g' s (OperatorSection op (Right v)) = g'' s op <> g'' s v
289 g' s (ArrayLiteral vs) = foldl (<>) r0 (map (g'' s) vs)
276 g' s (ArrayLiteral vs) = foldl (<>) r0 (map (g'' s) vs)
290 g' s (ObjectLiteral vs) = foldl (<>) r0 (map (g'' s . snd) vs)
277 g' s (ObjectLiteral vs) = foldl (<>) r0 (map (g'' s . snd) vs)
291− g' s (ObjectConstructor vs) = foldl (<>) r0 (map (g'' s) (mapMaybe snd vs))
292 g' s (TypeClassDictionaryConstructorApp _ v1) = g'' s v1
278 g' s (TypeClassDictionaryConstructorApp _ v1) = g'' s v1
293 g' s (Accessor _ v1) = g'' s v1
279 g' s (Accessor _ v1) = g'' s v1
294 g' s (ObjectUpdate obj vs) = foldl (<>) (g'' s obj) (map (g'' s . snd) vs)
280 g' s (ObjectUpdate obj vs) = foldl (<>) (g'' s obj) (map (g'' s . snd) vs)
295− g' s (ObjectUpdater obj vs) = foldl (<>) (maybe r0 (g'' s) obj) (map (g'' s) (mapMaybe snd vs))
296 g' s (Abs _ v1) = g'' s v1
281 g' s (Abs _ v1) = g'' s v1
297 g' s (App v1 v2) = g'' s v1 <> g'' s v2
282 g' s (App v1 v2) = g'' s v1 <> g'' s v2
298 g' s (IfThenElse v1 v2 v3) = g'' s v1 <> g'' s v2 <> g'' s v3
283 g' s (IfThenElse v1 v2 v3) = g'' s v1 <> g'' s v2 <> g'' s v3
@@ -353,16 +338,13 @@ everywhereWithContextOnValuesM s0 f g h i j = (f'' s0, g'' s0, h'' s0, i'' s0, j
353
338
354 g' s (UnaryMinus v) = UnaryMinus <$> g'' s v
339 g' s (UnaryMinus v) = UnaryMinus <$> g'' s v
355 g' s (BinaryNoParens op v1 v2) = BinaryNoParens <$> g'' s op <*> g'' s v1 <*> g'' s v2
340 g' s (BinaryNoParens op v1 v2) = BinaryNoParens <$> g'' s op <*> g'' s v1 <*> g'' s v2
356− g' s (Parens v) = Parens <$> g'' s v
357 g' s (OperatorSection op (Left v)) = OperatorSection <$> g'' s op <*> (Left <$> g'' s v)
341 g' s (OperatorSection op (Left v)) = OperatorSection <$> g'' s op <*> (Left <$> g'' s v)
358 g' s (OperatorSection op (Right v)) = OperatorSection <$> g'' s op <*> (Right <$> g'' s v)
342 g' s (OperatorSection op (Right v)) = OperatorSection <$> g'' s op <*> (Right <$> g'' s v)
359 g' s (ArrayLiteral vs) = ArrayLiteral <$> traverse (g'' s) vs
343 g' s (ArrayLiteral vs) = ArrayLiteral <$> traverse (g'' s) vs
360 g' s (ObjectLiteral vs) = ObjectLiteral <$> traverse (sndM (g'' s)) vs
344 g' s (ObjectLiteral vs) = ObjectLiteral <$> traverse (sndM (g'' s)) vs
361− g' s (ObjectConstructor vs) = ObjectConstructor <$> traverse (sndM $ maybeM (g'' s)) vs
362 g' s (TypeClassDictionaryConstructorApp name v) = TypeClassDictionaryConstructorApp name <$> g'' s v
345 g' s (TypeClassDictionaryConstructorApp name v) = TypeClassDictionaryConstructorApp name <$> g'' s v
363 g' s (Accessor prop v) = Accessor prop <$> g'' s v
346 g' s (Accessor prop v) = Accessor prop <$> g'' s v
364 g' s (ObjectUpdate obj vs) = ObjectUpdate <$> g'' s obj <*> traverse (sndM (g'' s)) vs
347 g' s (ObjectUpdate obj vs) = ObjectUpdate <$> g'' s obj <*> traverse (sndM (g'' s)) vs
365− g' s (ObjectUpdater obj vs) = ObjectUpdater <$> maybeM (g'' s) obj <*> traverse (sndM $ maybeM (g'' s)) vs
366 g' s (Abs name v) = Abs name <$> g'' s v
348 g' s (Abs name v) = Abs name <$> g'' s v
367 g' s (App v1 v2) = App <$> g'' s v1 <*> g'' s v2
349 g' s (App v1 v2) = App <$> g'' s v1 <*> g'' s v2
368 g' s (IfThenElse v1 v2 v3) = IfThenElse <$> g'' s v1 <*> g'' s v2 <*> g'' s v3
350 g' s (IfThenElse v1 v2 v3) = IfThenElse <$> g'' s v1 <*> g'' s v2 <*> g'' s v3
@@ -435,16 +417,13 @@ everythingWithScope f g h i j = (f'', g'', h'', i'', \s -> snd . j'' s)
435
417
436 g' s (UnaryMinus v1) = g'' s v1
418 g' s (UnaryMinus v1) = g'' s v1
437 g' s (BinaryNoParens op v1 v2) = g' s op <> g' s v1 <> g' s v2
419 g' s (BinaryNoParens op v1 v2) = g' s op <> g' s v1 <> g' s v2
438− g' s (Parens v1) = g'' s v1
439 g' s (OperatorSection op (Left v)) = g'' s op <> g'' s v
420 g' s (OperatorSection op (Left v)) = g'' s op <> g'' s v
440 g' s (OperatorSection op (Right v)) = g'' s op <> g'' s v
421 g' s (OperatorSection op (Right v)) = g'' s op <> g'' s v
441 g' s (ArrayLiteral vs) = foldMap (g'' s) vs
422 g' s (ArrayLiteral vs) = foldMap (g'' s) vs
442 g' s (ObjectLiteral vs) = foldMap (g'' s . snd) vs
423 g' s (ObjectLiteral vs) = foldMap (g'' s . snd) vs
443− g' s (ObjectConstructor vs) = foldMap (g'' s) (mapMaybe snd vs)
444 g' s (TypeClassDictionaryConstructorApp _ v1) = g'' s v1
424 g' s (TypeClassDictionaryConstructorApp _ v1) = g'' s v1
445 g' s (Accessor _ v1) = g'' s v1
425 g' s (Accessor _ v1) = g'' s v1
446 g' s (ObjectUpdate obj vs) = g'' s obj <> foldMap (g'' s . snd) vs
426 g' s (ObjectUpdate obj vs) = g'' s obj <> foldMap (g'' s . snd) vs
447− g' s (ObjectUpdater obj vs) = foldMap (g'' s) obj <> foldMap (g'' s) (mapMaybe snd vs)
448 g' s (Abs (Left name) v1) =
427 g' s (Abs (Left name) v1) =
449 let s' = S.insert name s
428 let s' = S.insert name s
450 in g'' s' v1
429 in g'' s' v1
src/Language/PureScript/Errors.hs+25−19
@@ -142,6 +142,7 @@ data SimpleErrorMessage
142 | ImplicitImport ModuleName [DeclarationRef]
142 | ImplicitImport ModuleName [DeclarationRef]
143 | HidingImport ModuleName [DeclarationRef]
143 | HidingImport ModuleName [DeclarationRef]
144 | CaseBinderLengthDiffers Int [Binder]
144 | CaseBinderLengthDiffers Int [Binder]
145+ | IncorrectAnonymousArgument
145 deriving (Show)
146 deriving (Show)
146
147
147-- | Error message hints, providing more detailed information about failure.
148-- | Error message hints, providing more detailed information about failure.
@@ -317,6 +318,7 @@ errorCode em = case unwrapErrorMessage em of
317 ImplicitImport{} -> "ImplicitImport"
318 ImplicitImport{} -> "ImplicitImport"
318 HidingImport{} -> "HidingImport"
319 HidingImport{} -> "HidingImport"
319 CaseBinderLengthDiffers{} -> "CaseBinderLengthDiffers"
320 CaseBinderLengthDiffers{} -> "CaseBinderLengthDiffers"
321+ IncorrectAnonymousArgument -> "IncorrectAnonymousArgument"
320
322
321-- |
323-- |
322-- A stack trace for an error
324-- A stack trace for an error
@@ -798,7 +800,7 @@ prettyPrintSingleError full level showWiki e = flip evalState defaultUnknownMap
798 renderSimpleErrorMessage (MisleadingEmptyTypeImport mn name) =
800 renderSimpleErrorMessage (MisleadingEmptyTypeImport mn name) =
799 line $ "Importing type " ++ runProperName name ++ "(..) from " ++ runModuleName mn ++ " is misleading as it has no exported data constructors."
801 line $ "Importing type " ++ runProperName name ++ "(..) from " ++ runModuleName mn ++ " is misleading as it has no exported data constructors."
800 renderSimpleErrorMessage (ImportHidingModule name) =
802 renderSimpleErrorMessage (ImportHidingModule name) =
801− paras [ line $ "'hiding' imports cannot be used to hide modules."
803+ paras [ line "'hiding' imports cannot be used to hide modules."
802 , line $ "An attempt was made to hide the import of " ++ runModuleName name
804 , line $ "An attempt was made to hide the import of " ++ runModuleName name
803 ]
805 ]
804 renderSimpleErrorMessage (WildcardInferredType ty) =
806 renderSimpleErrorMessage (WildcardInferredType ty) =
@@ -812,14 +814,14 @@ prettyPrintSingleError full level showWiki e = flip evalState defaultUnknownMap
812 , indent $ typeAsBox ty
814 , indent $ typeAsBox ty
813 ]
815 ]
814 renderSimpleErrorMessage (NotExhaustivePattern bs b) =
816 renderSimpleErrorMessage (NotExhaustivePattern bs b) =
815− paras $ [ line "A case expression could not be determined to cover all inputs."
817+ paras [ line "A case expression could not be determined to cover all inputs."
816− , line "The following additional cases are required to cover all inputs:\n"
818+ , line "The following additional cases are required to cover all inputs:\n"
817− , indent $ paras $
819+ , indent $ paras $
818− [ Box.hsep 1 Box.left (map (paras . map (line . prettyPrintBinderAtom)) (transpose bs)) ]
820+ [ Box.hsep 1 Box.left (map (paras . map (line . prettyPrintBinderAtom)) (transpose bs)) ]
819− ++ [ line "..." | not b ]
821+ ++ [ line "..." | not b ]
820− , line "Or alternatively, add a Partial constraint to the type of the enclosing value."
822+ , line "Or alternatively, add a Partial constraint to the type of the enclosing value."
821− , line "Non-exhaustive patterns for values without a `Partial` constraint will be disallowed in PureScript 0.9."
823+ , line "Non-exhaustive patterns for values without a `Partial` constraint will be disallowed in PureScript 0.9."
822− ]
824+ ]
823 renderSimpleErrorMessage (OverlappingPattern bs b) =
825 renderSimpleErrorMessage (OverlappingPattern bs b) =
824 paras $ [ line "A case expression contains unreachable cases:\n"
826 paras $ [ line "A case expression contains unreachable cases:\n"
825 , Box.hsep 1 Box.left (map (paras . map (line . prettyPrintBinderAtom)) (transpose bs))
827 , Box.hsep 1 Box.left (map (paras . map (line . prettyPrintBinderAtom)) (transpose bs))
@@ -835,7 +837,7 @@ prettyPrintSingleError full level showWiki e = flip evalState defaultUnknownMap
835 renderSimpleErrorMessage msg@(UnusedExplicitImport mn names _ _) =
837 renderSimpleErrorMessage msg@(UnusedExplicitImport mn names _ _) =
836 paras [ line $ "The import of module " ++ runModuleName mn ++ " contains the following unused references:"
838 paras [ line $ "The import of module " ++ runModuleName mn ++ " contains the following unused references:"
837 , indent $ paras $ map line names
839 , indent $ paras $ map line names
838− , line $ "It could be replaced with:"
840+ , line "It could be replaced with:"
839 , indent $ line $ showSuggestion msg ]
841 , indent $ line $ showSuggestion msg ]
840
842
841 renderSimpleErrorMessage (UnusedDctorImport name) =
843 renderSimpleErrorMessage (UnusedDctorImport name) =
@@ -849,15 +851,15 @@ prettyPrintSingleError full level showWiki e = flip evalState defaultUnknownMap
849 paras [ line $ "The operator (" ++ name ++ ") was declared as a value rather than an alias for a named function."
851 paras [ line $ "The operator (" ++ name ++ ") was declared as a value rather than an alias for a named function."
850 , line "Operator aliases are declared by using a fixity declaration, for example:"
852 , line "Operator aliases are declared by using a fixity declaration, for example:"
851 , indent $ line $ "infixl 9 someFunction as " ++ name
853 , indent $ line $ "infixl 9 someFunction as " ++ name
852− , line $ "Support for value-declared operators will be removed in PureScript 0.9."
854+ , line "Support for value-declared operators will be removed in PureScript 0.9."
853 ]
855 ]
854
856
855 renderSimpleErrorMessage (DeprecatedQualifiedSyntax name qualName) =
857 renderSimpleErrorMessage (DeprecatedQualifiedSyntax name qualName) =
856− paras [ line $ "Import uses the deprecated 'qualified' syntax:"
858+ paras [ line "Import uses the deprecated 'qualified' syntax:"
857 , indent $ line $ "import qualified " ++ runModuleName name ++ " as " ++ runModuleName qualName
859 , indent $ line $ "import qualified " ++ runModuleName name ++ " as " ++ runModuleName qualName
858 , line "Should instead use the form:"
860 , line "Should instead use the form:"
859 , indent $ line $ "import " ++ runModuleName name ++ " as " ++ runModuleName qualName
861 , indent $ line $ "import " ++ runModuleName name ++ " as " ++ runModuleName qualName
860− , line $ "The deprecated syntax will be removed in PureScript 0.9."
862+ , line "The deprecated syntax will be removed in PureScript 0.9."
861 ]
863 ]
862
864
863 renderSimpleErrorMessage (DeprecatedClassImport mn name) =
865 renderSimpleErrorMessage (DeprecatedClassImport mn name) =
@@ -865,15 +867,15 @@ prettyPrintSingleError full level showWiki e = flip evalState defaultUnknownMap
865 , indent $ line $ runProperName name
867 , indent $ line $ runProperName name
866 , line "Should instead use the form:"
868 , line "Should instead use the form:"
867 , indent $ line $ "class " ++ runProperName name
869 , indent $ line $ "class " ++ runProperName name
868− , line $ "The deprecated syntax will be removed in PureScript 0.9."
870+ , line "The deprecated syntax will be removed in PureScript 0.9."
869 ]
871 ]
870
872
871 renderSimpleErrorMessage (DeprecatedClassExport name) =
873 renderSimpleErrorMessage (DeprecatedClassExport name) =
872− paras [ line $ "Class export uses deprecated syntax that omits the 'class' keyword:"
874+ paras [ line "Class export uses deprecated syntax that omits the 'class' keyword:"
873 , indent $ line $ runProperName name
875 , indent $ line $ runProperName name
874 , line "Should instead use the form:"
876 , line "Should instead use the form:"
875 , indent $ line $ "class " ++ runProperName name
877 , indent $ line $ "class " ++ runProperName name
876− , line $ "The deprecated syntax will be removed in PureScript 0.9."
878+ , line "The deprecated syntax will be removed in PureScript 0.9."
877 ]
879 ]
878
880
879 renderSimpleErrorMessage (RedundantUnqualifiedImport name imp) =
881 renderSimpleErrorMessage (RedundantUnqualifiedImport name imp) =
@@ -915,9 +917,13 @@ prettyPrintSingleError full level showWiki e = flip evalState defaultUnknownMap
915 ]
917 ]
916
918
917 renderSimpleErrorMessage (CaseBinderLengthDiffers l bs) =
919 renderSimpleErrorMessage (CaseBinderLengthDiffers l bs) =
918− paras $ [ line $ "Binder list length differs in case alternative:"
920+ paras [ line "Binder list length differs in case alternative:"
919− , indent $ line $ intercalate ", " $ fmap prettyPrintBinderAtom bs
921+ , indent $ line $ intercalate ", " $ fmap prettyPrintBinderAtom bs
920− , line $ "Expecting " ++ show l ++ " binder" ++ (if l == 1 then "" else "s") ++ "." ]
922+ , line $ "Expecting " ++ show l ++ " binder" ++ (if l == 1 then "" else "s") ++ "."
923+ ]
924+
925+ renderSimpleErrorMessage IncorrectAnonymousArgument =
926+ line "An anonymous function argument appears in an invalid context."
921
927
922 renderHint :: ErrorMessageHint -> Box.Box -> Box.Box
928 renderHint :: ErrorMessageHint -> Box.Box -> Box.Box
923 renderHint (ErrorUnifyingTypes t1 t2) detail =
929 renderHint (ErrorUnifyingTypes t1 t2) detail =
src/Language/PureScript/Parser/Declarations.hs+14−20
@@ -312,18 +312,17 @@ parseArrayLiteral :: TokenParser Expr
312parseArrayLiteral = ArrayLiteral <$> squares (commaSep parseValue)
312parseArrayLiteral = ArrayLiteral <$> squares (commaSep parseValue)
313
313
314parseObjectLiteral :: TokenParser Expr
314parseObjectLiteral :: TokenParser Expr
315−parseObjectLiteral = ObjectConstructor <$> braces (commaSep parseIdentifierAndValue)
315+parseObjectLiteral = ObjectLiteral <$> braces (commaSep parseIdentifierAndValue)
316
316
317−parseIdentifierAndValue :: TokenParser (String, Maybe Expr)
317+parseIdentifierAndValue :: TokenParser (String, Expr)
318parseIdentifierAndValue =
318parseIdentifierAndValue =
319 do
319 do
320 name <- C.indented *> lname
320 name <- C.indented *> lname
321− b <- P.option (Just $ Var $ Qualified Nothing (Ident name)) rest
321+ b <- P.option (Var $ Qualified Nothing (Ident name)) rest
322 return (name, b)
322 return (name, b)
323 <|> (,) <$> (C.indented *> stringLiteral) <*> rest
323 <|> (,) <$> (C.indented *> stringLiteral) <*> rest
324 where
324 where
325− rest = C.indented *> colon *> C.indented *> val
325+ rest = C.indented *> colon *> C.indented *> parseValue
326− val = P.try (Just <$> parseValue) <|> (underscore *> pure Nothing)
327
326
328parseAbs :: TokenParser Expr
327parseAbs :: TokenParser Expr
329parseAbs = do
328parseAbs = do
@@ -373,13 +372,13 @@ parseLet = do
373
372
374parseValueAtom :: TokenParser Expr
373parseValueAtom :: TokenParser Expr
375parseValueAtom = P.choice
374parseValueAtom = P.choice
375+ [ parseAnonymousArgument
376− [ parseNumericLiteral
376+ , parseNumericLiteral
377 , parseCharLiteral
377 , parseCharLiteral
378 , parseStringLiteral
378 , parseStringLiteral
379 , parseBooleanLiteral
379 , parseBooleanLiteral
380 , parseArrayLiteral
380 , parseArrayLiteral
381 , P.try parseObjectLiteral
381 , P.try parseObjectLiteral
382− , P.try parseObjectGetter
383 , parseAbs
382 , parseAbs
384 , P.try parseConstructor
383 , P.try parseConstructor
385 , P.try parseVar
384 , P.try parseVar
@@ -387,10 +386,8 @@ parseValueAtom = P.choice
387 , parseIfThenElse
386 , parseIfThenElse
388 , parseDo
387 , parseDo
389 , parseLet
388 , parseLet
390− , P.try $ Parens <$> parens parseValue
389+ , P.try $ parens parseValue
391 , parseOperatorSection
390 , parseOperatorSection
392− -- TODO: combine this with parseObjectGetter
393− , parseObjectUpdaterWildcard
394 ]
391 ]
395
392
396-- |
393-- |
@@ -406,11 +403,11 @@ parseOperatorSection = parens $ left <|> right
406 right = OperatorSection <$> parseInfixExpr <* indented <*> (Right <$> indexersAndAccessors)
403 right = OperatorSection <$> parseInfixExpr <* indented <*> (Right <$> indexersAndAccessors)
407 left = flip OperatorSection <$> (Left <$> indexersAndAccessors) <* indented <*> parseInfixExpr
404 left = flip OperatorSection <$> (Left <$> indexersAndAccessors) <* indented <*> parseInfixExpr
408
405
409−parsePropertyUpdate :: TokenParser (String, Maybe Expr)
406+parsePropertyUpdate :: TokenParser (String, Expr)
410parsePropertyUpdate = do
407parsePropertyUpdate = do
411 name <- lname <|> stringLiteral
408 name <- lname <|> stringLiteral
412 _ <- C.indented *> equals
409 _ <- C.indented *> equals
413− value <- C.indented *> (underscore *> pure Nothing) <|> (Just <$> parseValue)
410+ value <- C.indented *> parseValue
414 return (name, value)
411 return (name, value)
415
412
416parseAccessor :: Expr -> TokenParser Expr
413parseAccessor :: Expr -> TokenParser Expr
@@ -436,15 +433,12 @@ parseDoNotationElement = P.choice
436 , DoNotationValue <$> parseValue
433 , DoNotationValue <$> parseValue
437 ]
434 ]
438
435
439−parseObjectGetter :: TokenParser Expr
440−parseObjectGetter = ObjectGetter <$> (underscore *> C.indented *> dot *> C.indented *> (lname <|> stringLiteral))
441−
442-- | Expressions including indexers and record updates
436-- | Expressions including indexers and record updates
443indexersAndAccessors :: TokenParser Expr
437indexersAndAccessors :: TokenParser Expr
444indexersAndAccessors = C.buildPostfixParser postfixTable parseValueAtom
438indexersAndAccessors = C.buildPostfixParser postfixTable parseValueAtom
445 where
439 where
446 postfixTable = [ parseAccessor
440 postfixTable = [ parseAccessor
447− , P.try . parseUpdaterBody . Just
441+ , P.try . parseUpdaterBody
448 ]
442 ]
449
443
450-- |
444-- |
@@ -466,11 +460,11 @@ parseValue = withSourceSpan PositionedValue
466 ]
460 ]
467 ]
461 ]
468
462
469−parseUpdaterBody :: Maybe Expr -> TokenParser Expr
463+parseUpdaterBody :: Expr -> TokenParser Expr
470−parseUpdaterBody v = ObjectUpdater v <$> (C.indented *> braces (commaSep1 (C.indented *> parsePropertyUpdate)))
464+parseUpdaterBody v = ObjectUpdate v <$> (C.indented *> braces (commaSep1 (C.indented *> parsePropertyUpdate)))
471
465
472−parseObjectUpdaterWildcard :: TokenParser Expr
466+parseAnonymousArgument :: TokenParser Expr
473−parseObjectUpdaterWildcard = underscore *> C.indented *> parseUpdaterBody Nothing
467+parseAnonymousArgument = underscore *> pure AnonymousArgument
474
468
475parseStringBinder :: TokenParser Binder
469parseStringBinder :: TokenParser Binder
476parseStringBinder = StringBinder <$> stringLiteral
470parseStringBinder = StringBinder <$> stringLiteral
src/Language/PureScript/Pretty/Values.hs+1−3
@@ -57,7 +57,6 @@ prettyPrintValue d (IfThenElse cond th el) =
57 ])
57 ])
58prettyPrintValue d (Accessor prop val) = prettyPrintValueAtom (d - 1) val <> text ("." ++ show prop)
58prettyPrintValue d (Accessor prop val) = prettyPrintValueAtom (d - 1) val <> text ("." ++ show prop)
59prettyPrintValue d (ObjectUpdate o ps) = prettyPrintValueAtom (d - 1) o <> text " " <> list '{' '}' (\(key, val) -> text (key ++ " = ") <> prettyPrintValue (d - 1) val) ps
59prettyPrintValue d (ObjectUpdate o ps) = prettyPrintValueAtom (d - 1) o <> text " " <> list '{' '}' (\(key, val) -> text (key ++ " = ") <> prettyPrintValue (d - 1) val) ps
60−prettyPrintValue d (ObjectUpdater o ps) = maybe (text "_") (prettyPrintValueAtom (d - 1)) o <> text " " <> list '{' '}' (\(key, val) -> text (key ++ " = ") <> maybe (text "_") (prettyPrintValue (d - 1)) val) ps
61prettyPrintValue d (App val arg) = prettyPrintValueAtom (d - 1) val `beforeWithSpace` prettyPrintValueAtom (d - 1) arg
60prettyPrintValue d (App val arg) = prettyPrintValueAtom (d - 1) val `beforeWithSpace` prettyPrintValueAtom (d - 1) arg
62prettyPrintValue d (Abs (Left arg) val) = text ('\\' : showIdent arg ++ " -> ") // moveRight 2 (prettyPrintValue (d - 1) val)
61prettyPrintValue d (Abs (Left arg) val) = text ('\\' : showIdent arg ++ " -> ") // moveRight 2 (prettyPrintValue (d - 1) val)
63prettyPrintValue d (TypeClassDictionaryConstructorApp className ps) =
62prettyPrintValue d (TypeClassDictionaryConstructorApp className ps) =
@@ -86,8 +85,7 @@ prettyPrintValueAtom _ (BooleanLiteral True) = text "true"
86prettyPrintValueAtom _ (BooleanLiteral False) = text "false"
85prettyPrintValueAtom _ (BooleanLiteral False) = text "false"
87prettyPrintValueAtom d (ArrayLiteral xs) = list '[' ']' (prettyPrintValue (d - 1)) xs
86prettyPrintValueAtom d (ArrayLiteral xs) = list '[' ']' (prettyPrintValue (d - 1)) xs
88prettyPrintValueAtom d (ObjectLiteral ps) = prettyPrintObject (d - 1) $ second Just `map` ps
87prettyPrintValueAtom d (ObjectLiteral ps) = prettyPrintObject (d - 1) $ second Just `map` ps
89−prettyPrintValueAtom d (ObjectConstructor ps) = prettyPrintObject (d - 1) ps
88+prettyPrintValueAtom _ AnonymousArgument = text "_"
90−prettyPrintValueAtom _ (ObjectGetter prop) = text $ "_." ++ show prop
91prettyPrintValueAtom _ (Constructor name) = text $ runProperName (disqualify name)
89prettyPrintValueAtom _ (Constructor name) = text $ runProperName (disqualify name)
92prettyPrintValueAtom _ (Var ident) = text $ showIdent (disqualify ident)
90prettyPrintValueAtom _ (Var ident) = text $ showIdent (disqualify ident)
93prettyPrintValueAtom d (OperatorSection op (Right val)) = ((text "(" <> prettyPrintValue (d - 1) op) `beforeWithSpace` prettyPrintValue (d - 1) val) `before` text ")"
91prettyPrintValueAtom d (OperatorSection op (Right val)) = ((text "(" <> prettyPrintValue (d - 1) op) `beforeWithSpace` prettyPrintValue (d - 1) val) `before` text ")"
src/Language/PureScript/Sugar/ObjectWildcards.hs+26−15
@@ -8,12 +8,11 @@ module Language.PureScript.Sugar.ObjectWildcards (
8import Prelude ()
8import Prelude ()
9import Prelude.Compat
9import Prelude.Compat
10
10
11−import Control.Arrow (second)
12import Control.Monad.Error.Class (MonadError(..))
11import Control.Monad.Error.Class (MonadError(..))
13import Control.Monad.Supply.Class
12import Control.Monad.Supply.Class
14
13
15import Data.List (partition)
14import Data.List (partition)
16−import Data.Maybe (isJust, fromJust, catMaybes)
15+import Data.Maybe (catMaybes)
17
16
18import Language.PureScript.AST
17import Language.PureScript.AST
19import Language.PureScript.Errors
18import Language.PureScript.Errors
@@ -24,30 +23,42 @@ desugarObjectConstructors (Module ss coms mn ds exts) = Module ss coms mn <$> ma
24 where
23 where
25
24
26 desugarDecl :: Declaration -> m Declaration
25 desugarDecl :: Declaration -> m Declaration
26+ desugarDecl (PositionedDeclaration pos com d) = rethrowWithPosition pos $ PositionedDeclaration pos com <$> desugarDecl d
27+ desugarDecl other = f other
28+ where
27− (desugarDecl, _, _) = everywhereOnValuesM return desugarExpr return
29+ (f, _, _) = everywhereOnValuesTopDownM return desugarExpr return
28
30
29 desugarExpr :: Expr -> m Expr
31 desugarExpr :: Expr -> m Expr
30− desugarExpr (ObjectConstructor ps) = wrapLambda ObjectLiteral ps
32+ desugarExpr AnonymousArgument = throwError . errorMessage $ IncorrectAnonymousArgument
31− desugarExpr (ObjectUpdater (Just obj) ps) = wrapLambda (ObjectUpdate obj) ps
33+ desugarExpr (BinaryNoParens op val u) | isAnonymousArgument u = return $ OperatorSection op (Left val)
32− desugarExpr (ObjectUpdater Nothing ps) = do
34+ desugarExpr (BinaryNoParens op u val) | isAnonymousArgument u = return $ OperatorSection op (Right val)
35+ desugarExpr (ObjectLiteral ps) = wrapLambda ObjectLiteral ps
36+ desugarExpr (ObjectUpdate u ps) | isAnonymousArgument u = do
33 obj <- freshIdent'
37 obj <- freshIdent'
34 Abs (Left obj) <$> wrapLambda (ObjectUpdate (Var (Qualified Nothing obj))) ps
38 Abs (Left obj) <$> wrapLambda (ObjectUpdate (Var (Qualified Nothing obj))) ps
35− desugarExpr (ObjectGetter prop) = do
39+ desugarExpr (ObjectUpdate obj ps) = wrapLambda (ObjectUpdate obj) ps
40+ desugarExpr (Accessor prop u) | isAnonymousArgument u = do
36 arg <- freshIdent'
41 arg <- freshIdent'
37 return $ Abs (Left arg) (Accessor prop (Var (Qualified Nothing arg)))
42 return $ Abs (Left arg) (Accessor prop (Var (Qualified Nothing arg)))
38 desugarExpr e = return e
43 desugarExpr e = return e
39
44
40− wrapLambda :: ([(String, Expr)] -> Expr) -> [(String, Maybe Expr)] -> m Expr
45+ wrapLambda :: ([(String, Expr)] -> Expr) -> [(String, Expr)] -> m Expr
41 wrapLambda mkVal ps =
46 wrapLambda mkVal ps =
42− let (props, args) = partition (isJust . snd) ps
47+ let (args, props) = partition (isAnonymousArgument . snd) ps
43 in if null args
48 in if null args
44− then return . mkVal $ second fromJust `map` props
49+ then return $ mkVal props
45 else do
50 else do
46 (args', ps') <- unzip <$> mapM mkProp ps
51 (args', ps') <- unzip <$> mapM mkProp ps
47 return $ foldr (Abs . Left) (mkVal ps') (catMaybes args')
52 return $ foldr (Abs . Left) (mkVal ps') (catMaybes args')
48
53
54+ isAnonymousArgument :: Expr -> Bool
55+ isAnonymousArgument AnonymousArgument = True
56+ isAnonymousArgument (PositionedValue _ _ e) = isAnonymousArgument e
57+ isAnonymousArgument _ = False
58+
49− mkProp :: (String, Maybe Expr) -> m (Maybe Ident, (String, Expr))
59+ mkProp :: (String, Expr) -> m (Maybe Ident, (String, Expr))
50− mkProp (name, Just e) = return (Nothing, (name, e))
60+ mkProp (name, e)
51− mkProp (name, Nothing) = do
61+ | isAnonymousArgument e = do
52− arg <- freshIdent'
62+ arg <- freshIdent'
53− return (Just arg, (name, Var (Qualified Nothing arg)))
63+ return (Just arg, (name, Var (Qualified Nothing arg)))
64+ | otherwise = return (Nothing, (name, e))
src/Language/PureScript/Sugar/Operators.hs+1−9
@@ -77,15 +77,7 @@ removeSignedLiterals (Module ss coms mn ds exts) = Module ss coms mn (map f' ds)
77rebracketModule :: (Applicative m, MonadError MultipleErrors m) => [[(Qualified Ident, Expr -> Expr -> Expr, Associativity)]] -> Module -> m Module
77rebracketModule :: (Applicative m, MonadError MultipleErrors m) => [[(Qualified Ident, Expr -> Expr -> Expr, Associativity)]] -> Module -> m Module
78rebracketModule opTable (Module ss coms mn ds exts) =
78rebracketModule opTable (Module ss coms mn ds exts) =
79 let (f, _, _) = everywhereOnValuesTopDownM return (matchOperators opTable) return
79 let (f, _, _) = everywhereOnValuesTopDownM return (matchOperators opTable) return
80− in Module ss coms mn <$> (map removeParens <$> parU ds f) <*> pure exts
80+ in Module ss coms mn <$> parU ds f <*> pure exts
81−
82−removeParens :: Declaration -> Declaration
83−removeParens =
84− let (f, _, _) = everywhereOnValues id go id
85− in f
86− where
87− go (Parens val) = val
88− go val = val
89
81
90externsFixities :: ExternsFile -> [(Qualified Ident, SourceSpan, Fixity, Maybe (Qualified Ident))]
82externsFixities :: ExternsFile -> [(Qualified Ident, SourceSpan, Fixity, Maybe (Qualified Ident))]
91externsFixities ExternsFile{..} =
83externsFixities ExternsFile{..} =