Add train and further methods for extending thunk actions
This commit is contained in:
parent
522585a7f1
commit
be7b289b02
|
@ -38,6 +38,9 @@ class MonadThunkId m => MonadThunk t m a | t -> m, t -> a where
|
|||
queryM :: t -> m r -> (a -> m r) -> m r
|
||||
force :: t -> (a -> m r) -> m r
|
||||
forceEff :: t -> (a -> m r) -> m r
|
||||
-- | Modify the action to be performed by the thunk. For some implicits
|
||||
-- this modifies the thunk, for others it may create a new thunk.
|
||||
further :: t -> (m a -> m a) -> m t
|
||||
|
||||
newtype ThunkLoop = ThunkLoop String -- contains rendering of ThunkId
|
||||
deriving Typeable
|
||||
|
|
|
@ -6,3 +6,7 @@ module Nix.Value.Monad where
|
|||
class MonadValue v m where
|
||||
defer :: m v -> m v
|
||||
demand :: v -> (v -> m r) -> m r
|
||||
-- | If 'v' is a thunk, 'train' allows us to modify the action to be
|
||||
-- peformed by the thunk, perhaps by enriching it with scpoe info, for
|
||||
-- example.
|
||||
train :: v -> (m v -> m v) -> m v
|
||||
|
|
Loading…
Reference in a new issue