[GHC] #7828: RebindableSyntax and Arrow

GHC ghc-devs at haskell.org
Wed Jun 18 12:08:45 UTC 2014


#7828: RebindableSyntax and Arrow
----------------------------------------------+----------------------------
        Reporter:  AlessandroVermeulen        |            Owner:
            Type:  bug                        |  jstolarek
        Priority:  normal                     |           Status:  new
       Component:  Compiler (Type checker)    |        Milestone:  7.10.1
      Resolution:                             |          Version:  7.6.2
Operating System:  Unknown/Multiple           |         Keywords:
 Type of failure:  GHC rejects valid program  |     Architecture:
       Test Case:                             |  Unknown/Multiple
        Blocking:                             |       Difficulty:  Unknown
                                              |       Blocked By:
                                              |  Related Tickets:  #1537,
                                              |  #3613
----------------------------------------------+----------------------------

Comment (by jstolarek):

 Replying to [comment:34 simonpj]:
 > So the type checker should be able to construct functions `arr-at-T`,
 `(>>>)-at-T` (for the ambient arrow T) ''that are polymorphic in the
 environment argument''.

 My concern was what if the `arr` defined by the user cannot be made
 polymorphic in the environment argument?

 According to my understanding of this bug report the problem is that
 during desugaring all calls to user-defined `arr` are instantiated to be
 the same and thus typechecking fails, because different types are required
 at different call sites. Why the same thing doesn't happen without
 rebinding?

 Replying to [comment:35 ross]:
 > Not quite.  There are three different grammar items here:
 > {{{
 > exp  ::=  \ pat -> exp
 > exp  ::=  proc pat -> cmd
 > cmd  ::=  \ pat -> cmd
 > }}}
 > In the last one you're already in the command world, and you want to
 take a value off the stack and give names to its components for use in the
 subcommand.

 Now I see this was even mentioned in "A New Notation for Arrows" paper.
 Again there's something I don't understand here. So far I though that
 stack is an implicit mechanism that is used to pass around values bound
 using `<-`. But here it seems that the user is allowed to explicitly
 access the stack. Isn't that a bit risky?

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


More information about the ghc-tickets mailing list