[Haskell-cafe] Infinite lists in real world programs

Yves Parès limestrael at gmail.com
Wed Dec 15 19:28:11 CET 2010


> 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 <ezyang at mit.edu>

> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20101215/cd2e633c/attachment.htm>


More information about the Haskell-Cafe mailing list