[GHC] #13600: surprising error message with bang pattern
GHC
ghc-devs at haskell.org
Fri Sep 7 13:49:41 UTC 2018
#13600: surprising error message with bang pattern
-------------------------------------+-------------------------------------
Reporter: andrewufrank | Owner: v0d1ch
Type: bug | Status: patch
Priority: normal | Milestone:
Component: Compiler | Version: 8.0.2
Resolution: | Keywords: BangPatterns,
| newcomer
Operating System: Unknown/Multiple | Architecture:
Type of failure: Poor/confusing | Unknown/Multiple
error message | Test Case:
Blocked By: | Blocking:
Related Tickets: #15166, #15458 | Differential Rev(s): Phab:D5040
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by simonpj):
It's not just a parsing thing. That definition of `go` really might be
defining `(!)`, as if you'd written
{{{
let (!) go t
| T.null t = ...
| otherwise = ...
}}}
We could simply discourage infix definitions of `(!)` (which is used for
array indexing anyway), by issuing a warning and asking the user to write
their definition prefix (as I have done above) to avoid the potential
ambiguity with bang-patterns.
Or, maybe only warn if there is no space between the `!` and the argument
(comment:2).
I dunno. This is user-facing, so a GHC proposal (a very small one!) might
be indicated.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13600#comment:14>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list