Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- class (Show v, Monad m) => MonadEval v m where
- freeVariable :: Text -> m v
- synHole :: Text -> m v
- attrMissing :: NonEmpty Text -> Maybe v -> m v
- evaledSym :: Text -> v -> m v
- evalCurPos :: m v
- evalConstant :: NAtom -> m v
- evalString :: NString (m v) -> m v
- evalLiteralPath :: FilePath -> m v
- evalEnvPath :: FilePath -> m v
- evalUnary :: NUnaryOp -> v -> m v
- evalBinary :: NBinaryOp -> v -> m v -> m v
- evalWith :: m v -> m v -> m v
- evalIf :: v -> m v -> m v -> m v
- evalAssert :: v -> m v -> m v
- evalApp :: v -> m v -> m v
- evalAbs :: Params (m v) -> (forall a. m v -> (AttrSet (m v) -> m v -> m (a, v)) -> m (a, v)) -> m v
- evalError :: Exception s => s -> m a
- type MonadNixEval v m = (MonadEval v m, Scoped v m, MonadValue v m, MonadFix m, ToValue Bool m v, ToValue [v] m v, FromValue NixString m v, ToValue (AttrSet v, AttrSet SourcePos) m v, FromValue (AttrSet v, AttrSet SourcePos) m v)
- data EvalFrame m v
- = EvaluatingExpr (Scopes m v) NExprLoc
- | ForcingExpr (Scopes m v) NExprLoc
- | Calling String SrcSpan
- | SynHole (SynHoleInfo m v)
- data SynHoleInfo m v = SynHoleInfo {}
- eval :: forall v m. MonadNixEval v m => NExprF (m v) -> m v
- evalWithAttrSet :: forall v m. MonadNixEval v m => m v -> m v -> m v
- attrSetAlter :: forall v m. MonadNixEval v m => [Text] -> SourcePos -> AttrSet (m v) -> AttrSet SourcePos -> m v -> m (AttrSet (m v), AttrSet SourcePos)
- desugarBinds :: forall r. ([Binding r] -> r) -> [Binding r] -> [Binding r]
- evalBinds :: forall v m. MonadNixEval v m => Bool -> [Binding (m v)] -> m (AttrSet v, AttrSet SourcePos)
- evalSelect :: forall v m. MonadNixEval v m => m v -> NAttrPath (m v) -> m (Either (v, NonEmpty Text) (m v))
- evalGetterKeyName :: forall v m. (MonadEval v m, FromValue NixString m v) => NKeyName (m v) -> m Text
- evalSetterKeyName :: (MonadEval v m, FromValue NixString m v) => NKeyName (m v) -> m (Maybe Text)
- assembleString :: forall v m. (MonadEval v m, FromValue NixString m v) => NString (m v) -> m (Maybe NixString)
- buildArgument :: forall v m. MonadNixEval v m => Params (m v) -> m v -> m (AttrSet v)
- addSourcePositions :: (MonadReader e m, Has e SrcSpan) => Transform NExprLocF (m a)
- addStackFrames :: forall v e m a. (Scoped v m, Framed e m, Typeable v, Typeable m) => Transform NExprLocF (m a)
- framedEvalExprLoc :: forall e v m. (MonadNixEval v m, Framed e m, Has e SrcSpan, Typeable m, Typeable v) => NExprLoc -> m v
Documentation
class (Show v, Monad m) => MonadEval v m where Source #
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 #
Instances
type MonadNixEval v m = (MonadEval v m, Scoped v m, MonadValue v m, MonadFix m, ToValue Bool m v, ToValue [v] m v, FromValue NixString m v, ToValue (AttrSet v, AttrSet SourcePos) m v, FromValue (AttrSet v, AttrSet SourcePos) m v) Source #
EvaluatingExpr (Scopes m v) NExprLoc | |
ForcingExpr (Scopes m v) NExprLoc | |
Calling String SrcSpan | |
SynHole (SynHoleInfo m v) |
Instances
Show (EvalFrame m v) Source # | |
(Typeable m, Typeable v) => Exception (EvalFrame m v) Source # | |
Defined in Nix.Eval toException :: EvalFrame m v -> SomeException # fromException :: SomeException -> Maybe (EvalFrame m v) # displayException :: EvalFrame m v -> String # |
data SynHoleInfo m v Source #
Instances
Show (SynHoleInfo m v) Source # | |
Defined in Nix.Eval 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 # | |
Defined in Nix.Eval toException :: SynHoleInfo m v -> SomeException # fromException :: SomeException -> Maybe (SynHoleInfo m v) # displayException :: SynHoleInfo m v -> String # |
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 #
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 #
addSourcePositions :: (MonadReader e m, Has e SrcSpan) => Transform NExprLocF (m a) 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 #