#3631: Overload the Prelude iterate to support list input
---------------------------------+------------------------------------------
    Reporter:  shelbymoore3      |        Owner:                  
        Type:  feature request   |       Status:  closed          
    Priority:  normal            |    Milestone:                  
   Component:  Prelude           |      Version:  6.10.4          
    Severity:  normal            |   Resolution:  wontfix         
    Keywords:                    |   Difficulty:  Unknown         
    Testcase:                    |           Os:  Unknown/Multiple
Architecture:  Unknown/Multiple  |  
---------------------------------+------------------------------------------
Comment (by shelbymoore3):

 Replying to [comment:9 shelbymoore3]:
 > Any one who relies on type inference globally can except such domino
 cascades generally.

 Typo 'except' to 'expects'.

 > >  Furthermore, your proposed overloading is not parametric in a way
 that can easily be captured by type classes.  What is the least
 generalisation of the the two signatures for iterate?
 > >
 > > {{{
 > >     iterate :: (a   -> a)   ->  a  -> [a]
 > >     iterate :: ([a] -> [a]) -> [a] -> [a]
 > > }}}
 > >
 > > Hint: there isn't one.
 >
 >
 > If I am not mistake, a type class can specify the signature that it
 expects.

 I do assume above that Haskell will not allow a type '[a]' where a type
 'a' is expected.  If type inference is allowing lists of types to be
 assumed where only a type was expected, then IMHO that was a mistake that
 opened a very big can of worms.  Perhaps I am unaware of some usage that
 could not be accomplished otherwise, but it sure seems intuitive to me
 that conflation inference in that way would kill scale.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3631#comment:10>
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