[GHC] #7642: Nullary type classes

GHC cvs-ghc at haskell.org
Fri Feb 8 03:10:10 CET 2013


#7642: Nullary type classes
----------------------------------------+-----------------------------------
    Reporter:  shachaf                  |       Owner:                  
        Type:  feature request          |      Status:  new             
    Priority:  normal                   |   Milestone:                  
   Component:  Compiler (Type checker)  |     Version:  7.6.1           
    Keywords:                           |          Os:  Unknown/Multiple
Architecture:  Unknown/Multiple         |     Failure:  None/Unknown    
  Difficulty:  Unknown                  |    Testcase:                  
   Blockedby:                           |    Blocking:                  
     Related:                           |  
----------------------------------------+-----------------------------------

Comment(by DerekElkins):

 The idea is that there wouldn't necessarily be an instance.  The final
 application code would make the instance, in that case, if they were
 willing to rely on results that rely on the truth of the Riemann
 Hypothesis.  Similarly for Unsafe.  Until that instance was made, it would
 be a compile error (an unresolvable constraint), so you'd be notified if
 you inadvertently relied on it, and it would be explicit in the signatures
 of all functions that used the features.

 Another use-case is statically configurable parameters, e.g. class Modulus
 where modulus :: Integer.  With this, applications can configure such
 parameters just by specifying some instances, say in their Main module.

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



More information about the ghc-tickets mailing list