#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):

 Actually none of that above works, we need instead an accumulator argument
 for the list, which solves the collision problem with standard Prelude
 `iterate` also:

 {{{
 iterate :: ([a] -> [a]) -> [a] -> [a] -> [a]
 iterate f x y = y ++ iterate f (x ++ (f (x ++ y))) (f (x ++ y))
 }}}

 {{{
 fibs = 0 : 1 : iterate (\x -> [last x + last init x]) [ 0 : 1 ] [] where
 }}}

 IMHO, it is not most productive to mark useful input as "Won't fix", and
 have it disappear into a black-hole.  It is more productive to mark as
 "Incomplete" and let people apply their effort later to make it complete,
 as has now been done.  "Won't fix" should apply to something that should
 not be fixed (an entirely erroneous report with no chance of being ever
 fixed), not to something that is in a useful direction, but incomplete.
 "Won't fix" is effectually little different than a moral judgment, because
 it is a black hole.  It is analogous to telling someone sorry you were
 misclassified on the "do not fly list" and are spending the rest of your
 vacation in a DHS holding area, but be comforted that it was not a moral
 mis-classification.  Who cares.  Give me back my vacation and my wasted
 time.

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