[GHC] #1404: allow more type signatures

GHC trac at galois.com
Fri Jun 1 15:55:40 EDT 2007


#1404: allow more type signatures
------------------------------+---------------------------------------------
  Reporter:  Isaac Dupree     |          Owner:         
      Type:  feature request  |         Status:  new    
  Priority:  normal           |      Milestone:         
 Component:  Compiler         |        Version:  6.6.1  
  Severity:  normal           |       Keywords:         
Difficulty:  Unknown          |             Os:  Unknown
  Testcase:                   |   Architecture:  Unknown
------------------------------+---------------------------------------------
(idea triggered by #393)

 Allow multiple copies of a type-signature in a module, such that it is an
 error if they're not equivalent, but they don't have to be syntactically
 equal (
 {{{f :: ShowS}}}
 {{{f :: String -> String}}}
 is okay).

 It would also be nice to allow any name in scope at top-level (even if
 imported) to be given a type signature.  But that raises a question: can
 these type signatures give a more specific type than that of the raw
 imported function, the way normal function type signatures can with
 regards to their implementation?

 Use cases: (1. making sure multiple implementations give the same
 interface, generally varying by #ifdef) (2. asserting that something's
 type can be specified in two different weird ways).  I don't really want
 to abandon having a type-signature right above every function definition
 even if it is a duplicate.

 (1.) would be fixed by allowing type signatures in export lists instead.
 I suppose these could be more restrictive than in the module and not
 affect the module, e.g.
 {{{
 module X (idN :: Int -> Int, true) where
 idN n = n
 true :: Bool
 true = idN True
 }}}

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1404>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
-------------- next part --------------
_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs at haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


More information about the Glasgow-haskell-bugs mailing list