[Haskell-cafe] Newbie questions

Crypt Master cryptmaster at hotmail.com
Sat Jul 3 04:52:02 EDT 2004


Very very helpful, thanks. I wasnt sure about the "From" on the end, but I 
get the subtle change in way you see it. Much better than mine.

Using you other advice I got:

gaSolutionSpaceFrom :: a -> [a]
gaSolutionSpaceFrom p = iterate evolvePopulation p

and even managed to curry it :-)   :

gaSolutionSpaceFrom :: a -> [a]
gaSolutionSpaceFrom = iterate evolvePopulation

Thanks again.



I think you mean:
gaSolutionSpaceFrom :: a -> [a]
gaSolutionSpaceFrom x = x : gaSolutionSpaceFrom (evolvepopulation x)

gaSolutionSpace = gaSolutionSpaceFrom createRandomPopulation

Note that "a" above should be replaced with your population type.

Also note the "iterate" function in the standard library does just this.

Tired of spam? Get advanced junk mail protection with MSN 8. 

More information about the Haskell-Cafe mailing list