#5032: putting left equation sides in parantheses causes GHC.Prim.Any
specialization
-------------------------------+--------------------------------------------
    Reporter:  jeltsch         |       Owner:              
        Type:  bug             |      Status:  new         
    Priority:  normal          |   Component:  Compiler    
     Version:  6.12.1          |    Keywords:              
    Testcase:                  |   Blockedby:              
          Os:  Linux           |    Blocking:              
Architecture:  x86_64 (amd64)  |     Failure:  None/Unknown
-------------------------------+--------------------------------------------
 I put this code into a file:
 {{{
 identity : a -> a
 (identity) = id
 }}}
 I get this error message:
 {{{
 Inferred type is less polymorphic than expected
   Quantified type variable `a' escapes
 In the expression: id
 In a pattern binding: (identity) = id
 }}}
 This may be correct, I don’t know.

 However, I can also do this:
 {{{
 (identity) = id
 }}}
 GHCi accepts this. If I enter {{{:type identity}}} into GHCi, I get this:
 {{{
 identity :: GHC.Prim.Any -> GHC.Prim.Any
 }}}
 This seems weird, in my opinion.

 This is also accepted by GHCi:
 {{{
 (identity) = id
 hello      = identity "hello"
 }}}
 Evaluating {{{hello}}} yields {{{"hello"}}}, and {{{:type identity}}}
 yields this:
 {{{
 identity :: [Char] -> [Char]
 }}}

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

_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to