[GHC] #13453: Seemingly can't mix ImplicitParams in where clauses

GHC ghc-devs at haskell.org
Sun Mar 19 11:18:34 UTC 2017


#13453: Seemingly can't mix ImplicitParams in where clauses
-------------------------------------+-------------------------------------
        Reporter:  Iceland_jack      |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.1
  (Parser)                           |             Keywords:
      Resolution:                    |  ImplicitParams
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Description changed by Iceland_jack:

Old description:

> These are fine
>
> {{{#!hs
> v = () where
>   a = True
>   b = 'a'
> }}}
>
> {{{#!hs
> v = () where
>   ?a = True
>   ?b = 'a'
> }}}
>
> but the moment one of them is an `ImplicitParams` it fails to parse
>
> {{{#!hs
> -- tAMA.hs:9:3-4: error: Parse error in pattern: ?b
> -- Compilation failed.
> v = () where
>   a  = True
>   ?b = 'a'
>
> -- tAMA.hs:9:3: error: parse error on input ‘b’
> -- Compilation failed.
> v = () where
>   ?a = True
>   b  = 'a'
> }}}

New description:

 These are fine

 {{{#!hs
 v = () where
   a = True
   b = 'a'
 }}}

 {{{#!hs
 v = () where
   ?a = True
   ?b = 'a'
 }}}

 but the moment one of them is an `ImplicitParams` variable '''as well'''
 as a regular one, it fails to parse

 {{{#!hs
 -- tAMA.hs:9:3-4: error: Parse error in pattern: ?b
 -- Compilation failed.
 v = () where
   a  = True
   ?b = 'a'

 -- tAMA.hs:9:3: error: parse error on input ‘b’
 -- Compilation failed.
 v = () where
   ?a = True
   b  = 'a'
 }}}

--

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13453#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list