hnix-0.5.1: Haskell implementation of the Nix language

Safe HaskellSafe
LanguageHaskell2010

Nix.Thunk

Documentation

data Deferred m v Source #

Constructors

Deferred (m v) 
Computed v 

Instances

Functor m => Functor (Deferred m) Source # 

Methods

fmap :: (a -> b) -> Deferred m a -> Deferred m b #

(<$) :: a -> Deferred m b -> Deferred m a #

Foldable m => Foldable (Deferred m) Source # 

Methods

fold :: Monoid m => Deferred m m -> m #

foldMap :: Monoid m => (a -> m) -> Deferred m a -> m #

foldr :: (a -> b -> b) -> b -> Deferred m a -> b #

foldr' :: (a -> b -> b) -> b -> Deferred m a -> b #

foldl :: (b -> a -> b) -> b -> Deferred m a -> b #

foldl' :: (b -> a -> b) -> b -> Deferred m a -> b #

foldr1 :: (a -> a -> a) -> Deferred m a -> a #

foldl1 :: (a -> a -> a) -> Deferred m a -> a #

toList :: Deferred m a -> [a] #

null :: Deferred m a -> Bool #

length :: Deferred m a -> Int #

elem :: Eq a => a -> Deferred m a -> Bool #

maximum :: Ord a => Deferred m a -> a #

minimum :: Ord a => Deferred m a -> a #

sum :: Num a => Deferred m a -> a #

product :: Num a => Deferred m a -> a #

Traversable m => Traversable (Deferred m) Source # 

Methods

traverse :: Applicative f => (a -> f b) -> Deferred m a -> f (Deferred m b) #

sequenceA :: Applicative f => Deferred m (f a) -> f (Deferred m a) #

mapM :: Monad m => (a -> m b) -> Deferred m a -> m (Deferred m b) #

sequence :: Monad m => Deferred m (m a) -> m (Deferred m a) #

class Monad m => MonadVar m where Source #

Minimal complete definition

newVar, readVar, writeVar, atomicModifyVar

Associated Types

type Var m :: * -> * Source #

Methods

newVar :: a -> m (Var m a) Source #

readVar :: Var m a -> m a Source #

writeVar :: Var m a -> a -> m () Source #

atomicModifyVar :: Var m a -> (a -> (a, b)) -> m b Source #

Instances

MonadVar (Lint s) Source # 

Associated Types

type Var (Lint s :: * -> *) :: * -> * Source #

Methods

newVar :: a -> Lint s (Var (Lint s) a) Source #

readVar :: Var (Lint s) a -> Lint s a Source #

writeVar :: Var (Lint s) a -> a -> Lint s () Source #

atomicModifyVar :: Var (Lint s) a -> (a -> (a, b)) -> Lint s b Source #

MonadIO m => MonadVar (Lazy m) Source # 

Associated Types

type Var (Lazy m :: * -> *) :: * -> * Source #

Methods

newVar :: a -> Lazy m (Var (Lazy m) a) Source #

readVar :: Var (Lazy m) a -> Lazy m a Source #

writeVar :: Var (Lazy m) a -> a -> Lazy m () Source #

atomicModifyVar :: Var (Lazy m) a -> (a -> (a, b)) -> Lazy m b Source #

class Monad m => MonadThunk v t m | v -> m, v -> t, t -> m, t -> v where Source #

Minimal complete definition

thunk, force, value

Methods

thunk :: m v -> m t Source #

force :: t -> (v -> m r) -> m r Source #

value :: v -> t Source #

Instances

MonadLint e m => MonadThunk (Symbolic m) (SThunk m) m Source # 

Methods

thunk :: m (Symbolic m) -> m (SThunk m) Source #

force :: SThunk m -> (Symbolic m -> m r) -> m r Source #

value :: Symbolic m -> SThunk m Source #

data Thunk m v Source #

Constructors

Value v 
Thunk Int (Var m Bool) (Var m (Deferred m v)) 

valueRef :: v -> Thunk m v Source #

buildThunk :: MonadVar m => m v -> m (Thunk m v) Source #

forceThunk :: (MonadVar m, MonadThrow m) => Thunk m v -> (v -> m a) -> m a Source #

forceEffects :: MonadVar m => Thunk m v -> (v -> m a) -> m a Source #