I just tried something



evalRules :: [Rule] -> Step -> [Double]
evalRules rules step = catMaybes . takeWhile isJust . map (flip evalRule step) $ rules

This seems to work according to my testing.



On Fri, Sep 30, 2016 at 1:32 PM, Imants Cekusins <imantc@gmail.com> wrote:
> short-circuits the computation if it hits Nothing. However, unlike the way the Maybe monad works, I want to know the partial results.
could store partial results in a State monad.. Maybe would short circuit but the values would stay in the State.

would this work?

_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners