Eric Dedieu escribió:
> Still more importantly to me, I understand that anyhow  if I intend to
> use IO or random numbers, I must design my strategy from the beginning
> as "encapsulated in a monad". Something like:
>
> class (Monad m) => Strategy m a where ...
>   
That's not true at all, you can always pass this data to your strategy
entry points and let haskell get it lazily, though it is not as
intuitive as other aproaches,

Ie. I need to get the next pick for my IA so I can use a function called
get IA wich would take as arguments a random seed (or an infinite vector
of random numbers using laziness ;) ) and the previous user inputs and
strategy outputs.

Of course this is just retarding the monadification of the function as
soon or later you'll have to embed it into a IO monad to get the desired
results. Anyway, making the strategies completely deterministic can also
be useful when debugging.

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to