[Hugs] #50: Hugs's implementation of defaulting does not conform to Haskell 98

Hugs trac at galois.com
Wed Nov 29 03:53:10 EST 2006


#50: Hugs's implementation of defaulting does not conform to Haskell 98
--------------------------+-------------------------------------------------
  Reporter:  guest        |       Owner:  nobody               
      Type:  defect       |      Status:  new                  
  Priority:  minor        |   Milestone:                       
 Component:  type system  |     Version:  current              
Resolution:               |    Keywords:  top level overloading
--------------------------+-------------------------------------------------
Changes (by ross):

  * milestone:  next release =>
  * component:  hugs => type system
  * summary:  Disparity between GHCi and Hugs: Outstanding context : Show b
              => Hugs's implementation of defaulting does not
              conform to Haskell 98
  * version:  200503 => current

Comment:

 This is a divergence of Hugs from Haskell 98 (documented in the User's
 Guide): Haskell 98 says to apply defaulting to the whole module, but Hugs
 applies it to binding groups.
 In the binding group
 {{{
 showln  = (++ "\n") . show
 }}}
 the MR applies.
 Hugs attempts to apply defaulting at this point, but fails because the
 constraint `Show a` is not defaultable under the Haskell 98 rules (section
 4.3.4).
 Haskell 98 (and GHC) defer defaulting until after typing `main`, at which
 point `a` has been instantiated to `Int`, so defaulting is no longer
 required.

-- 
Ticket URL: <http://hackage.haskell.org/trac/hugs/ticket/50>
Hugs <http://www.haskell.org/hugs/>
Hugs 98, an interpreter for Haskell


More information about the Hugs-Bugs mailing list