#5267: Arrow command combinators
----------------------------------------+-----------------------------------
  Reporter:  peteg                      |          Owner:                  
      Type:  bug                        |         Status:  closed          
  Priority:  normal                     |      Milestone:                  
 Component:  Compiler                   |        Version:  7.0.3           
Resolution:  invalid                    |       Keywords:                  
  Testcase:                             |      Blockedby:                  
Difficulty:                             |             Os:  Unknown/Multiple
  Blocking:                             |   Architecture:  Unknown/Multiple
   Failure:  GHC rejects valid program  |  
----------------------------------------+-----------------------------------
Changes (by ross):

  * status:  new => closed
  * resolution:  => invalid


Comment:

 GHC seems to be performing properly here.

 In each case GHC is objecting to {{{(| (arr id) (returnA -< x) |)}}},
 saying the type of the first argument of a command form has the wrong
 shape.  Since you've used an operator with one argument, it's expecting
 the operator to have the form
 {{{
 forall e. a (...(e,t1), ... tn) t -> a (...(e,t1'), ... tn') t'
 }}}
 for some arrow {{{a}}}, and with {{{e}}} not free in the other t's (see
 Section 7.10.4 of the GHC User's Guide).  In your case the operator,
 namely {{{(arr id)}}}, has type {{{forall a' b. Arrow a => a' b b}}}.  GHC
 has instantiated {{{a'}}} as {{{->}}} to match the above, and then
 generalized and complained that the type of the argument is a type
 variable instead of an arrow type.  Perhaps you were expecting it to use
 the type of the argument {{{(returnA -< 3)}}} to instantiate {{{b}}} to
 {{{a e Int}}} before generalizing, but this behaviour is consistent with
 the treatment of rank-2 types elsewhere.

 I'm not sure what you were trying to do here.  Maybe the mailing list
 would be a good place to discuss it.

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

_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to