Good Morning,
I currently want to write a search algorithm with 3 end conditions:
a) Solution Found
b) N-iterations done
c) x minutes timeout
I would like to split the function in two pieces, one which is pure with a seed and no timeout, and one time-outed in a monad (IO?).
So
pureSearch :: Seed -> Iterations -> Maybe Result
and
search :: Timeout -> Seed -> Iterations -> IO Maybe Result
Is this a known Pattern?
Do you know good examples for this behavior?
Any other recommendations before I start implementing?
Best
Leonhard