Designing TimeOut for Search Algorithm

7 Jun
2021
7 Jun
'21
1:32 a.m.
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
1443
Age (days ago)
1443
Last active (days ago)
0 comments
1 participants
participants (1)
-
Leonhard Applis