[Haskell-beginners] Fish tank monad
adrian.alexander.may at gmail.com
Fri May 17 19:51:11 CEST 2013
I think I need a monad but I'm not sure which, and maybe something simpler
I want to model a fish tank as a function of time onto how many fish there
are in it at that time. If I already have such a function, I want to
operate on it with something like "add 2 fish on day 20" or "take 3 away on
day 15" to get a new function of the same form, but the latter should not
remove more fish than there are in the tank at that time, and it should
tell me how many I get. I don't promise to apply these operators in
This seems like the kind of thing that would be in the prelude somewhere.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Beginners