[Haskell-cafe] Re: Newbie questions
cryptmaster at hotmail.com
Sat Jul 3 04:46:24 EDT 2004
>-- gaSolutionSpace :: [a] -> [a]
>>gaSolutionSpace x = x : gaSolutionSpace (evolvepopulation x)
-Stop deceiving yourself until it's too late.
-Why did you comment out the type annotation?
*Sheepish Grin* its historical, my original thought and attempt was that you
would recieve a list of populations and evolve it to a bigger list of
populations. Hence the [a] -> [a]. It didnt work out too well as this is
what I came up with:
gaSolSpace [x:xs] = gaSolutionSpace [x : evolePopulation x]
Eventually i realised that I needed to evolve a single population, not a
list, which let to a -> [a] and thanks to Keith I now have this:
gaSolutionSpaceFrom :: a -> [a]
gaSolutionSpaceFrom = iterate evolvePopulation
Add photos to your e-mail with MSN 8. Get 2 months FREE*.
More information about the Haskell-Cafe