hnix-0.11.1: Haskell implementation of the Nix language
Safe HaskellNone
LanguageHaskell2010

Nix.Eval

Synopsis

Documentation

class (Show v, Monad m) => MonadEval v m where Source #

Methods

freeVariable :: Text -> m v Source #

synHole :: Text -> m v Source #

attrMissing :: NonEmpty Text -> Maybe v -> m v Source #

evaledSym :: Text -> v -> m v Source #

evalCurPos :: m v Source #

evalConstant :: NAtom -> m v Source #

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

evalLiteralPath :: FilePath -> m v Source #

evalEnvPath :: FilePath -> m v Source #

evalUnary :: NUnaryOp -> v -> m v Source #

evalBinary :: NBinaryOp -> v -> m v -> m v Source #

The second argument is an action because operators such as boolean && and || may not evaluate the second argument.

evalWith :: m v -> m v -> m v Source #

evalIf :: v -> m v -> m v -> m v Source #

evalAssert :: v -> m v -> m v Source #

evalApp :: v -> m v -> m v Source #

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

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

Instances

Instances details
MonadLint e m => MonadEval (Symbolic m) m Source # 
Instance details

Defined in Nix.Lint

Methods

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

synHole :: Text -> m (Symbolic m) Source #

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

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

evalCurPos :: m (Symbolic m) Source #

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

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

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

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

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

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

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

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

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

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

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

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

MonadNix e t f m => MonadEval (NValue t f m) m Source # 
Instance details

Defined in Nix.Exec

Methods

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

synHole :: Text -> m (NValue t f m) Source #

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

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

evalCurPos :: m (NValue t f m) Source #

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

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

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

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

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

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

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

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

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

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

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

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

data EvalFrame m v Source #

Instances

Instances details
Show (EvalFrame m v) Source # 
Instance details

Defined in Nix.Eval

Methods

showsPrec :: Int -> EvalFrame m v -> ShowS #

show :: EvalFrame m v -> String #

showList :: [EvalFrame m v] -> ShowS #

(Typeable m, Typeable v) => Exception (EvalFrame m v) Source # 
Instance details

Defined in Nix.Eval

data SynHoleInfo m v Source #

Instances

Instances details
Show (SynHoleInfo m v) Source # 
Instance details

Defined in Nix.Eval

Methods

showsPrec :: Int -> SynHoleInfo m v -> ShowS #

show :: SynHoleInfo m v -> String #

showList :: [SynHoleInfo m v] -> ShowS #

(Typeable m, Typeable v) => Exception (SynHoleInfo m v) Source # 
Instance details

Defined in Nix.Eval

eval :: forall v m. MonadNixEval v m => NExprF (m v) -> m v Source #

evalWithAttrSet :: forall v m. MonadNixEval v m => m v -> m v -> m v Source #

If you know that the scope action will result in an 'AttrSet v', then this implementation may be used as an implementation for evalWith.

attrSetAlter :: forall v m. MonadNixEval v m => [Text] -> SourcePos -> AttrSet (m v) -> AttrSet SourcePos -> m v -> m (AttrSet (m v), AttrSet SourcePos) Source #

desugarBinds :: forall r. ([Binding r] -> r) -> [Binding r] -> [Binding r] Source #

evalBinds :: forall v m. MonadNixEval v m => Bool -> [Binding (m v)] -> m (AttrSet v, AttrSet SourcePos) Source #

evalSelect :: forall v m. MonadNixEval v m => m v -> NAttrPath (m v) -> m (Either (v, NonEmpty Text) (m v)) Source #

evalGetterKeyName :: forall v m. (MonadEval v m, FromValue NixString m v) => NKeyName (m v) -> m Text Source #

Evaluate a component of an attribute path in a context where we are *retrieving* a value

evalSetterKeyName :: (MonadEval v m, FromValue NixString m v) => NKeyName (m v) -> m (Maybe Text) Source #

Evaluate a component of an attribute path in a context where we are *binding* a value

assembleString :: forall v m. (MonadEval v m, FromValue NixString m v) => NString (m v) -> m (Maybe NixString) Source #

buildArgument :: forall v m. MonadNixEval v m => Params (m v) -> m v -> m (AttrSet v) Source #

addStackFrames :: forall v e m a. (Scoped v m, Framed e m, Typeable v, Typeable m) => Transform NExprLocF (m a) Source #

framedEvalExprLoc :: forall e v m. (MonadNixEval v m, Framed e m, Has e SrcSpan, Typeable m, Typeable v) => NExprLoc -> m v Source #