You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a program in which I want to run an effectful function several times with different arguments, evaluate which is best, and continue as if only that one had happened. As far as I know, this can't be done with NonDet (as there's no way to communicate between branches to choose one) or any other existing effect. Is something like that possible? I have no idea how state threading works, but I would imagine an API akin to
choose::Ordc=> [Semr (c, a)] ->Semra
choose alts =do
st <- getState
values <- forM alts $\alt ->do
setState st
(c, v) <- alt
st' <- getState
pure (st', c, v)
let (st', _, v) = maximumBy (comparing (\(_, c, _) -> c)) values
setState st'
pure v
The text was updated successfully, but these errors were encountered:
I have a program in which I want to run an effectful function several times with different arguments, evaluate which is best, and continue as if only that one had happened. As far as I know, this can't be done with NonDet (as there's no way to communicate between branches to choose one) or any other existing effect. Is something like that possible? I have no idea how state threading works, but I would imagine an API akin to
The text was updated successfully, but these errors were encountered: