#3631: Overload the Prelude iterate to support list input
------------------------------+---------------------------------------------
Reporter: shelbymoore3 | Owner:
Type: feature request | Status: new
Priority: normal | Milestone:
Component: Prelude | Version: 6.10.4
Severity: normal | Resolution:
Keywords: | Testcase:
Os: Unknown/Multiple | Architecture: Unknown/Multiple
------------------------------+---------------------------------------------
Comment (by shelbymoore3):
The suggested iterate function remains as stated. I just want to point
out my example lamba function usage was not returning a list. Corrected:
fibs = iterate (\x -> [last x + last init x]) [ 0 : 1 ] where
Ditto (and I think I need to add the semicolon in the one line guard?):
fibs = iterate (\x -> [fib -1 + fib -2] where fib i = | i==-1=last x; |
i==-2=last init x) [ 0 : 1 ]
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3631#comment:2>
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