hnix-0.5.1: Haskell implementation of the Nix language

Safe HaskellNone
LanguageHaskell2010

Nix.Eval

Synopsis

Documentation

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

Methods

freeVariable :: 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

MonadLint e m => MonadEval (Symbolic m) m Source # 

Methods

freeVariable :: 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 #

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

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

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

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

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

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

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

evalGetterKeyName :: (MonadEval v m, FromValue (Text, DList Text) m v) => Bool -> NKeyName (m v) -> m Text Source #

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

evalKeyNameStatic :: forall v m. MonadEval v m => NKeyName (m v) -> m Text Source #

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

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

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

evalKeyNameDynamicNullable :: forall v m. (MonadEval v m, FromValue (Text, DList Text) m v) => NKeyName (m v) -> m (Maybe Text) Source #

Returns Nothing iff the key value is null

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

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

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

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