mirror of
https://github.com/barrucadu/dejafu.git
synced 2025-01-05 04:05:17 +03:00
Add comment about free monads vs continuations.
This commit is contained in:
parent
83a25fd188
commit
bbfa36aadf
@ -22,7 +22,15 @@ import Control.Applicative (Applicative(..))
|
||||
--------------------------------------------------------------------------------
|
||||
-- * The @Conc@ Monad
|
||||
|
||||
-- | The underlying monad is based on continuations over Actions.
|
||||
-- | The underlying monad is based on continuations over 'Action's.
|
||||
--
|
||||
-- One might wonder why the return type isn't reflected in 'Action',
|
||||
-- and a free monad formulation used. This would remove the need for a
|
||||
-- @Lift@ action as the penultimate action of thread 0 used to
|
||||
-- communicate back the result, and be more pleasing in a
|
||||
-- sense. However, this makes the current expression of threads and
|
||||
-- exception handlers very difficult (perhaps even not possible
|
||||
-- without significant reworking), so I abandoned the attempt.
|
||||
newtype M n r s a = M { runM :: (a -> Action n r s) -> Action n r s }
|
||||
|
||||
instance Functor (M n r s) where
|
||||
|
Loading…
Reference in New Issue
Block a user