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
When using the Iter monad, it is common to, at some point, run the computation until it terminates by using runIdentity . retract.
This could be implemented as a separate function, named, for example unsafeIter :: Iter a -> a, in the same spirit as fromMaybe :: Maybe a -> a or unsafePerformIO :: IO a -> a. The unsafe monicker warns that the safety guarantees from the Iter monad are lost, namely, evaluation might not terminate.
When using the
Iter
monad, it is common to, at some point, run the computation until it terminates by usingrunIdentity . retract
.This could be implemented as a separate function, named, for example
unsafeIter :: Iter a -> a
, in the same spirit asfromMaybe :: Maybe a -> a
orunsafePerformIO :: IO a -> a
. The unsafe monicker warns that the safety guarantees from theIter
monad are lost, namely, evaluation might not terminate.Any input on the name, the implementation or the usefulness of the proposed function is welcome.
The text was updated successfully, but these errors were encountered: