Safe Haskell | None |
---|---|
Language | Haskell2010 |
- class (Show v, Monad m) => MonadEval v m | v -> m where
- type MonadNixEval e v t m = (MonadEval v m, Scoped e t m, MonadThunk v t m, MonadFix m, ToValue Bool m v, ToValue [t] m v, FromValue (Text, DList Text) m v, ToValue (AttrSet t, AttrSet SourcePos) m v, FromValue (AttrSet t, AttrSet SourcePos) m v)
- data EvalFrame m v
- = EvaluatingExpr (Scopes m v) NExprLoc
- | ForcingExpr (Scopes m v) NExprLoc
- | Calling String SrcSpan
- eval :: forall e v t m. MonadNixEval e v t m => NExprF (m v) -> m v
- evalWithAttrSet :: forall e v t m. MonadNixEval e v t m => m v -> m v -> m v
- attrSetAlter :: forall e v t m. MonadNixEval e v t m => [Text] -> AttrSet (m v) -> m v -> m (AttrSet (m v))
- desugarBinds :: forall r. ([Binding r] -> r) -> [Binding r] -> [Binding r]
- evalBinds :: forall e v t m. MonadNixEval e v t m => Bool -> Bool -> [Binding (m v)] -> m (AttrSet t, AttrSet SourcePos)
- evalSelect :: forall e v t m. MonadNixEval e v t m => m v -> NAttrPath (m v) -> m (Either (v, NonEmpty Text) (m v))
- evalSelector :: (MonadEval v m, FromValue (Text, DList Text) m v) => Bool -> NAttrPath (m v) -> m (NonEmpty Text)
- evalGetterKeyName :: (MonadEval v m, FromValue (Text, DList Text) m v) => Bool -> NKeyName (m v) -> m Text
- evalKeyNameStatic :: forall v m. MonadEval v m => NKeyName (m v) -> m Text
- evalKeyNameDynamicNotNull :: forall v m. (MonadEval v m, FromValue (Text, DList Text) m v) => NKeyName (m v) -> m Text
- evalSetterKeyName :: (MonadEval v m, FromValue (Text, DList Text) m v) => Bool -> NKeyName (m v) -> m (Maybe Text)
- evalKeyNameDynamicNullable :: forall v m. (MonadEval v m, FromValue (Text, DList Text) m v) => NKeyName (m v) -> m (Maybe Text)
- assembleString :: forall v m. (MonadEval v m, FromValue (Text, DList Text) m v) => NString (m v) -> m (Maybe (Text, DList Text))
- buildArgument :: forall e v t m. MonadNixEval e v t m => Params (m v) -> m v -> m (AttrSet t)
- addSourcePositions :: (MonadReader e m, Has e SrcSpan) => Transform NExprLocF (m a)
- addStackFrames :: forall t e m a. (Scoped e t m, Framed e m, Typeable t, Typeable m) => Transform NExprLocF (m a)
- framedEvalExprLoc :: forall t e v m. (MonadNixEval e v t m, Framed e m, Has e SrcSpan, Typeable t, Typeable m) => NExprLoc -> m v
Documentation
class (Show v, Monad m) => MonadEval v m | v -> m where Source #
freeVariable, attrMissing, evaledSym, evalCurPos, evalConstant, evalString, evalLiteralPath, evalEnvPath, evalUnary, evalBinary, evalWith, evalIf, evalAssert, evalApp, evalAbs, evalError
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 #
type MonadNixEval e v t m = (MonadEval v m, Scoped e t m, MonadThunk v t m, MonadFix m, ToValue Bool m v, ToValue [t] m v, FromValue (Text, DList Text) m v, ToValue (AttrSet t, AttrSet SourcePos) m v, FromValue (AttrSet t, AttrSet SourcePos) m v) Source #
EvaluatingExpr (Scopes m v) NExprLoc | |
ForcingExpr (Scopes m v) NExprLoc | |
Calling String SrcSpan |
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 #
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 #
evalSelector :: (MonadEval v m, FromValue (Text, DList Text) m v) => Bool -> NAttrPath (m v) -> m (NonEmpty Text) 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
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 #
addSourcePositions :: (MonadReader e m, Has e SrcSpan) => Transform NExprLocF (m a) 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 #