hnix-0.5.1: Haskell implementation of the Nix language

Safe HaskellNone
LanguageHaskell2010

Nix.Exec

Contents

Synopsis

Documentation

nverr :: forall s e m a. (MonadNix e m, Exception s) => s -> m a Source #

currentPos :: forall e m. (MonadReader e m, Has e SrcSpan) => m SrcSpan Source #

callFunc :: forall e m. (MonadNix e m, Typeable m) => NValue m -> m (NValue m) -> m (NValue m) infixl 1 Source #

execUnaryOp :: (Framed e m, MonadVar m) => Scopes m (NThunk m) -> SrcSpan -> NUnaryOp -> NValue m -> m (NValue m) Source #

execBinaryOp :: forall e m. (MonadNix e m, MonadEval (NValue m) m) => Scopes m (NThunk m) -> SrcSpan -> NBinaryOp -> NValue m -> m (NValue m) -> m (NValue m) Source #

newtype Lazy m a Source #

Constructors

Lazy 

Instances

Monad m => Monad (Lazy m) Source # 

Methods

(>>=) :: Lazy m a -> (a -> Lazy m b) -> Lazy m b #

(>>) :: Lazy m a -> Lazy m b -> Lazy m b #

return :: a -> Lazy m a #

fail :: String -> Lazy m a #

Functor m => Functor (Lazy m) Source # 

Methods

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

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

MonadFix m => MonadFix (Lazy m) Source # 

Methods

mfix :: (a -> Lazy m a) -> Lazy m a #

Monad m => Applicative (Lazy m) Source # 

Methods

pure :: a -> Lazy m a #

(<*>) :: Lazy m (a -> b) -> Lazy m a -> Lazy m b #

liftA2 :: (a -> b -> c) -> Lazy m a -> Lazy m b -> Lazy m c #

(*>) :: Lazy m a -> Lazy m b -> Lazy m b #

(<*) :: Lazy m a -> Lazy m b -> Lazy m a #

MonadPlus m => Alternative (Lazy m) Source # 

Methods

empty :: Lazy m a #

(<|>) :: Lazy m a -> Lazy m a -> Lazy m a #

some :: Lazy m a -> Lazy m [a] #

many :: Lazy m a -> Lazy m [a] #

MonadPlus m => MonadPlus (Lazy m) Source # 

Methods

mzero :: Lazy m a #

mplus :: Lazy m a -> Lazy m a -> Lazy m a #

MonadIO m => MonadIO (Lazy m) Source # 

Methods

liftIO :: IO a -> Lazy m a #

MonadThrow m => MonadThrow (Lazy m) Source # 

Methods

throwM :: Exception e => e -> Lazy m a #

MonadCatch m => MonadCatch (Lazy m) Source # 

Methods

catch :: Exception e => Lazy m a -> (e -> Lazy m a) -> Lazy m a #

MonadException m => MonadException (Lazy m) Source # 

Methods

controlIO :: (RunIO (Lazy m) -> IO (Lazy m a)) -> Lazy m a #

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 #

(MonadFix m, MonadCatch m, MonadIO m, Alternative m, MonadPlus m, Typeable (* -> *) m) => MonadEffects (Lazy m) Source # 
Monad m => MonadReader (Context (Lazy m) (NThunk (Lazy m))) (Lazy m) Source # 

Methods

ask :: Lazy m (Context (Lazy m) (NThunk (Lazy m))) #

local :: (Context (Lazy m) (NThunk (Lazy m)) -> Context (Lazy m) (NThunk (Lazy m))) -> Lazy m a -> Lazy m a #

reader :: (Context (Lazy m) (NThunk (Lazy m)) -> a) -> Lazy m a #

type Var (Lazy m) Source # 
type Var (Lazy m) = IORef

runLazyM :: Options -> MonadIO m => Lazy m a -> m a Source #

removeDotDotIndirections :: FilePath -> FilePath Source #

Incorrectly normalize paths by rewriting patterns like ab.. to a. This is incorrect on POSIX systems, because if b is a symlink, its parent may be a different directory from a. See the discussion at https://hackage.haskell.org/package/directory-1.3.1.5/docs/System-Directory.html#v:canonicalizePath

findEnvPathM :: forall e m. (MonadNix e m, MonadIO m) => FilePath -> m FilePath Source #

evalExprLoc :: forall e m. (MonadNix e m, Has e Options, MonadIO m) => NExprLoc -> m (NValue m) Source #

Orphan instances

(MonadIO m, Monad m) => MonadFile m Source # 
MonadNix e m => MonadEval (NValue m) m Source # 

Methods

freeVariable :: Text -> m (NValue m) Source #

attrMissing :: NonEmpty Text -> Maybe (NValue m) -> m (NValue m) Source #

evaledSym :: Text -> NValue m -> m (NValue m) Source #

evalCurPos :: m (NValue m) Source #

evalConstant :: NAtom -> m (NValue m) Source #

evalString :: NString (m (NValue m)) -> m (NValue m) Source #

evalLiteralPath :: FilePath -> m (NValue m) Source #

evalEnvPath :: FilePath -> m (NValue m) Source #

evalUnary :: NUnaryOp -> NValue m -> m (NValue m) Source #

evalBinary :: NBinaryOp -> NValue m -> m (NValue m) -> m (NValue m) Source #

evalWith :: m (NValue m) -> m (NValue m) -> m (NValue m) Source #

evalIf :: NValue m -> m (NValue m) -> m (NValue m) -> m (NValue m) Source #

evalAssert :: NValue m -> m (NValue m) -> m (NValue m) Source #

evalApp :: NValue m -> m (NValue m) -> m (NValue m) Source #

evalAbs :: Params (m (NValue m)) -> (forall a. m (NValue m) -> (AttrSet (m (NValue m)) -> m (NValue m) -> m (a, NValue m)) -> m (a, NValue m)) -> m (NValue m) Source #

evalError :: Exception s => s -> m a Source #

MonadNix e m => MonadThunk (NValue m) (NThunk m) m Source # 

Methods

thunk :: m (NValue m) -> m (NThunk m) Source #

force :: NThunk m -> (NValue m -> m r) -> m r Source #

value :: NValue m -> NThunk m Source #