[GHC] #10708: Rejection of constant functions defined using conditional pattern matching
GHC
ghc-devs at haskell.org
Wed Jul 29 15:28:56 UTC 2015
#10708: Rejection of constant functions defined using conditional pattern matching
-------------------------------------+-------------------------------------
Reporter: HubertGaravel | Owner:
Type: bug | Status: closed
Priority: normal | Milestone:
Component: Compiler | Version: 7.10.1
Resolution: invalid | Keywords:
Operating System: Linux | Architecture: x86
Type of failure: GHC rejects | Test Case:
valid program |
Blocked By: | Blocking:
Related Tickets: | Differential Revisions:
-------------------------------------+-------------------------------------
Comment (by simonpj):
well of course you ''can'' define `d3` like that. But the question posed
by the ticket is: is it valid Haskell to write `d3` as in the description.
Looking at the
[https://www.haskell.org/onlinereport/haskell2010/haskellch4.html language
spec] section 4.4.3, it seems that a 'funlhs' must have at least one
argument. So this must be a 'pat' lhs, which can only have one set of
guarded rhss. So yes, I think it's invalid.
Simon
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10708#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list