> if one day you decide you need an agent that generates random numbers

I could say that my agents now run in a certain monad, I just would have to
transform my basic agents to :
agent1 = liftM . fmap (*2)

(or even agen1 = fmap . fmap (*2), however it is less readable IMO)


Thanks for your comments.

2010/12/15 Edward Z. Yang <[email protected]>

> It sounds like a good fit for your problem as stated.  One thing to note
> is that Haskell will give you great abstractions for very strong amounts
> of code, as long as what you want to do is a good fit for the abstraction.
> Haskell makes it quite hard to fit a square peg into a round hole, so
> if one day you decide you need an agent that generates random numbers,
> you can either do dangerous stuff with unsafeInterleaveIO or you'll need
> to find a more flexible abstraction.
>
> Cheers,
> Edward
>
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to