Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data NValueF m r
- type NValueNF m = Fix (NValueF m)
- type ValueSet m = AttrSet (NThunk m)
- data Provenance m = Provenance {
- _lexicalScope :: Scopes m (NThunk m)
- _originExpr :: NExprLocF (Maybe (NValue m))
- data NThunk m = NThunk {
- _thunkProvenance :: [Provenance m]
- _baseThunk :: Thunk m (NValue m)
- data NValue m = NValue {
- _valueProvenance :: [Provenance m]
- _baseValue :: NValueF m (NThunk m)
- addProvenance :: (NValue m -> Provenance m) -> NValue m -> NValue m
- pattern NVConstant :: forall (m :: * -> *). NAtom -> NValue m
- nvConstant :: NAtom -> NValue m
- nvConstantP :: Provenance m -> NAtom -> NValue m
- pattern NVStr :: forall (m :: * -> *). Text -> DList Text -> NValue m
- nvStr :: Text -> DList Text -> NValue m
- nvStrP :: Provenance m -> Text -> DList Text -> NValue m
- pattern NVPath :: forall (m :: * -> *). FilePath -> NValue m
- nvPath :: FilePath -> NValue m
- nvPathP :: Provenance m -> FilePath -> NValue m
- pattern NVList :: forall (m :: * -> *). [NThunk m] -> NValue m
- nvList :: [NThunk m] -> NValue m
- nvListP :: Provenance m -> [NThunk m] -> NValue m
- pattern NVSet :: forall (m :: * -> *). AttrSet (NThunk m) -> AttrSet SourcePos -> NValue m
- nvSet :: AttrSet (NThunk m) -> AttrSet SourcePos -> NValue m
- nvSetP :: Provenance m -> AttrSet (NThunk m) -> AttrSet SourcePos -> NValue m
- pattern NVClosure :: forall (m :: * -> *). Params () -> (m (NValue m) -> m (NValue m)) -> NValue m
- nvClosure :: Params () -> (m (NValue m) -> m (NValue m)) -> NValue m
- nvClosureP :: Provenance m -> Params () -> (m (NValue m) -> m (NValue m)) -> NValue m
- pattern NVBuiltin :: forall (m :: * -> *). String -> (m (NValue m) -> m (NValue m)) -> NValue m
- nvBuiltin :: String -> (m (NValue m) -> m (NValue m)) -> NValue m
- nvBuiltinP :: Provenance m -> String -> (m (NValue m) -> m (NValue m)) -> NValue m
- checkComparable :: (Framed e m, Typeable m) => NValue m -> NValue m -> m ()
- builtin :: Monad m => String -> (m (NValue m) -> m (NValue m)) -> m (NValue m)
- builtin2 :: Monad m => String -> (m (NValue m) -> m (NValue m) -> m (NValue m)) -> m (NValue m)
- builtin3 :: Monad m => String -> (m (NValue m) -> m (NValue m) -> m (NValue m) -> m (NValue m)) -> m (NValue m)
- isClosureNF :: Monad m => NValueNF m -> Bool
- thunkEq :: MonadThunk (NValue m) (NThunk m) m => NThunk m -> NThunk m -> m Bool
- alignEqM :: (Align f, Traversable f, Monad m) => (a -> b -> m Bool) -> f a -> f b -> m Bool
- isDerivation :: MonadThunk (NValue m) (NThunk m) m => AttrSet (NThunk m) -> m Bool
- valueEq :: MonadThunk (NValue m) (NThunk m) m => NValue m -> NValue m -> m Bool
- data ValueType
- valueType :: NValueF m r -> ValueType
- describeValue :: ValueType -> String
- data ValueFrame m
- = ForcingThunk
- | ConcerningValue (NValue m)
- | Comparison (NValue m) (NValue m)
- | Addition (NValue m) (NValue m)
- | Multiplication (NValue m) (NValue m)
- | Division (NValue m) (NValue m)
- | Coercion ValueType ValueType
- | CoercionToJsonNF (NValueNF m)
- | CoercionFromJson Value
- | ExpectationNF ValueType (NValueNF m)
- | Expectation ValueType (NValue m)
- _NVBuiltinF :: Applicative f => ((String, m (NValue m) -> m (NValue m)) -> f (String, m (NValue m) -> m (NValue m))) -> NValueF m r -> f (NValueF m r)
- _NVClosureF :: Applicative f => ((Params (), m (NValue m) -> m (NValue m)) -> f (Params (), m (NValue m) -> m (NValue m))) -> NValueF m r -> f (NValueF m r)
- _NVSetF :: Applicative f => ((AttrSet r, AttrSet SourcePos) -> f (AttrSet r, AttrSet SourcePos)) -> NValueF m r -> f (NValueF m r)
- _NVListF :: Applicative f => ([r] -> f [r]) -> NValueF m r -> f (NValueF m r)
- _NVPathF :: Applicative f => (FilePath -> f FilePath) -> NValueF m r -> f (NValueF m r)
- _NVStrF :: Applicative f => ((Text, DList Text) -> f (Text, DList Text)) -> NValueF m r -> f (NValueF m r)
- _NVConstantF :: Applicative f => (NAtom -> f NAtom) -> NValueF m r -> f (NValueF m r)
- originExpr :: Functor f => (NExprLocF (Maybe (NValue m)) -> f (NExprLocF (Maybe (NValue m)))) -> Provenance m -> f (Provenance m)
- lexicalScope :: Functor f => (Scopes m (NThunk m) -> f (Scopes m (NThunk m))) -> Provenance m -> f (Provenance m)
- baseThunk :: Functor f => (Thunk m (NValue m) -> f (Thunk m (NValue m))) -> NThunk m -> f (NThunk m)
- thunkProvenance :: Functor f => ([Provenance m] -> f [Provenance m]) -> NThunk m -> f (NThunk m)
- baseValue :: Functor f => (NValueF m (NThunk m) -> f (NValueF m (NThunk m))) -> NValue m -> f (NValue m)
- valueProvenance :: Functor f => ([Provenance m] -> f [Provenance m]) -> NValue m -> f (NValue m)
- alterF :: (Eq k, Hashable k, Functor f) => (Maybe v -> f (Maybe v)) -> k -> HashMap k v -> f (HashMap k v)
- hashAt :: VarName -> Lens' (AttrSet v) (Maybe v)
- key :: Applicative f => VarName -> LensLike' f (NValue m) (Maybe (NThunk m))
Documentation
An NValue
is the most reduced form of an NExpr
after evaluation is
completed. s
is related to the type of errors that might occur during
construction or use of a value.
NVConstantF NAtom | |
NVStrF Text (DList Text) | A string has a value and a context, which can be used to record what a string has been build from |
NVPathF FilePath | |
NVListF [r] | |
NVSetF (AttrSet r) (AttrSet SourcePos) | |
NVClosureF (Params ()) (m (NValue m) -> m (NValue m)) | A function is a closed set of parameters representing the "call signature", used at application time to check the type of arguments passed to the function. Since it supports default values which may depend on other values within the final argument set, this dependency is represented as a set of pending evaluations. The arguments are finally normalized into a set which is passed to the function. Note that 'm r' is being used here because effectively a function and its set of default arguments is "never fully evaluated". This enforces in the type that it must be re-evaluated for each call. |
NVBuiltinF String (m (NValue m) -> m (NValue m)) | A builtin function is itself already in normal form. Also, it may or may not choose to evaluate its argument in the production of a result. |
type NValueNF m = Fix (NValueF m) Source #
An NValueNF
is a fully evaluated value in normal form. An 'NValue m' is
a value in head normal form, where only the "top layer" has been
evaluated. An action of type 'm (NValue m)' is a pending evualation that
has yet to be performed. An 'NThunk m' is either a pending evaluation, or
a value in head normal form. A NThunkSet
is a set of mappings from keys
to thunks.
data Provenance m Source #
Provenance | |
|
NThunk | |
|
NValue | |
|
addProvenance :: (NValue m -> Provenance m) -> NValue m -> NValue m Source #
nvConstant :: NAtom -> NValue m Source #
nvConstantP :: Provenance m -> NAtom -> NValue m Source #
pattern NVClosure :: forall (m :: * -> *). Params () -> (m (NValue m) -> m (NValue m)) -> NValue m Source #
nvClosureP :: Provenance m -> Params () -> (m (NValue m) -> m (NValue m)) -> NValue m Source #
pattern NVBuiltin :: forall (m :: * -> *). String -> (m (NValue m) -> m (NValue m)) -> NValue m Source #
nvBuiltinP :: Provenance m -> String -> (m (NValue m) -> m (NValue m)) -> NValue m Source #
builtin2 :: Monad m => String -> (m (NValue m) -> m (NValue m) -> m (NValue m)) -> m (NValue m) Source #
builtin3 :: Monad m => String -> (m (NValue m) -> m (NValue m) -> m (NValue m) -> m (NValue m)) -> m (NValue m) Source #
alignEqM :: (Align f, Traversable f, Monad m) => (a -> b -> m Bool) -> f a -> f b -> m Bool Source #
Checks whether two containers are equal, using the given item equality predicate. If there are any item slots that don't match between the two containers, the result will be False.
isDerivation :: MonadThunk (NValue m) (NThunk m) m => AttrSet (NThunk m) -> m Bool Source #
describeValue :: ValueType -> String Source #
data ValueFrame m Source #
ForcingThunk | |
ConcerningValue (NValue m) | |
Comparison (NValue m) (NValue m) | |
Addition (NValue m) (NValue m) | |
Multiplication (NValue m) (NValue m) | |
Division (NValue m) (NValue m) | |
Coercion ValueType ValueType | |
CoercionToJsonNF (NValueNF m) | |
CoercionFromJson Value | |
ExpectationNF ValueType (NValueNF m) | |
Expectation ValueType (NValue m) |
_NVBuiltinF :: Applicative f => ((String, m (NValue m) -> m (NValue m)) -> f (String, m (NValue m) -> m (NValue m))) -> NValueF m r -> f (NValueF m r) Source #
_NVClosureF :: Applicative f => ((Params (), m (NValue m) -> m (NValue m)) -> f (Params (), m (NValue m) -> m (NValue m))) -> NValueF m r -> f (NValueF m r) Source #
_NVSetF :: Applicative f => ((AttrSet r, AttrSet SourcePos) -> f (AttrSet r, AttrSet SourcePos)) -> NValueF m r -> f (NValueF m r) Source #
_NVStrF :: Applicative f => ((Text, DList Text) -> f (Text, DList Text)) -> NValueF m r -> f (NValueF m r) Source #
_NVConstantF :: Applicative f => (NAtom -> f NAtom) -> NValueF m r -> f (NValueF m r) Source #
originExpr :: Functor f => (NExprLocF (Maybe (NValue m)) -> f (NExprLocF (Maybe (NValue m)))) -> Provenance m -> f (Provenance m) Source #
lexicalScope :: Functor f => (Scopes m (NThunk m) -> f (Scopes m (NThunk m))) -> Provenance m -> f (Provenance m) Source #
baseThunk :: Functor f => (Thunk m (NValue m) -> f (Thunk m (NValue m))) -> NThunk m -> f (NThunk m) Source #
thunkProvenance :: Functor f => ([Provenance m] -> f [Provenance m]) -> NThunk m -> f (NThunk m) Source #
baseValue :: Functor f => (NValueF m (NThunk m) -> f (NValueF m (NThunk m))) -> NValue m -> f (NValue m) Source #
valueProvenance :: Functor f => ([Provenance m] -> f [Provenance m]) -> NValue m -> f (NValue m) Source #