mirror of
https://github.com/barrucadu/dejafu.git
synced 2024-12-19 03:21:49 +03:00
Add a comment explaining AReturn
This commit is contained in:
parent
eaa50d11b2
commit
2e5f79a2c4
@ -41,6 +41,8 @@ instance Functor (M n r) where
|
||||
fmap f m = M $ \ c -> runM m (c . f)
|
||||
|
||||
instance Applicative (M n r) where
|
||||
-- without the @AReturn@, a thread could lock up testing by
|
||||
-- entering an infinite loop (eg: @forever (return ())@)
|
||||
pure x = M $ \c -> AReturn $ c x
|
||||
f <*> v = M $ \c -> runM f (\g -> runM v (c . g))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user