#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):
Another correction, I need to use (++) append operation, not cons (:).
{{{
iterate :: ([a] -> [a]) -> [a] -> [a]
iterate f x = iterate f (x ++ (f x))
-- iterate f x == [x, f x, f (f x), ...]
}}}
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3631#comment:3>
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