@@ -598,7 +598,7 @@ fnDecl syn = try (do notEndBlock
598598@
599599-}
600600fnDecl' :: SyntaxInfo -> IdrisParser PDecl
601−fnDecl' syn = checkFixity $
601+fnDecl' syn = checkDeclFixity $
602602 do (doc, argDocs, fc, opts', n, nfc, acc) <- try (do
603603 pushIndent
604604 (doc, argDocs) <- docstring syn
@@ -618,22 +618,6 @@ fnDecl' syn = checkFixity $
618618 <|> caf syn
619619 <|> pattern syn
620620 <?> "function declaration"
621− where checkFixity :: IdrisParser PDecl -> IdrisParser PDecl
622− checkFixity p = do decl <- p
623− case getName decl of
624− Nothing -> return decl
625− Just n -> do fOk <- fixityOK n
626− unless fOk . fail $
627− "Missing fixity declaration for " ++ show n
628− return decl
629− getName (PTy _ _ _ _ _ n _ _) = Just n
630− getName _ = Nothing
631− fixityOK (NS n _) = fixityOK n
632− fixityOK (UN n) | all (flip elem opChars) (str n) =
633− do fixities <- fmap idris_infixes get
634− return . elem (str n) . map (\ (Fix _ op) -> op) $ fixities
635− | otherwise = return True
636− fixityOK _ = return True
637621
638622{-| Parses a series of function and accessbility options
639623