Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,828
    • Issues 4,828
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 448
    • Merge requests 448
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #19788

Closed
Open
Created May 03, 2021 by Richard Eisenberg@raeDeveloper

GHC's parser is more accepting than Haskell2010 for function bindings

If I say

{-# LANGUAGE Haskell2010 #-}

module Bug where

((f x)) y = x + y

GHC succeeds. This appears to go against the Haskell 2010 Report, Section 4.4.3:

decl 	→ 	(funlhs | pat) rhs
 
funlhs 	→ 	var apat { apat }
	| 	pat varop pat
	| 	'(' funlhs ')' apat { apat }
 
rhs 	→ 	= exp [where decls]
	| 	gdrhs [where decls] 

Note that a funlhs is allowed to have parentheses, but there must be an apat after the ). My example above has a ) after the ), and yet is accepted.

Similarly

(f) x y = x + y

is accepted, despite having no apats within the parentheses.

I propose to continue accepting this syntax, but to document this as a deviation from the standard.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking