Changeset 3291
- Timestamp:
- 05/16/05 14:58:37 (4 years ago)
- svk:copy_cache_prev:
- 4878
- Files:
-
- 1 modified
-
src/Pugs/Monads.hs (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Pugs/Monads.hs
r3249 r3291 19 19 import Pugs.Types 20 20 21 -- |Perform the specified evaluation in a lexical scope that has been 22 -- augmented by the given list of lexical 'Pad' transformers. Subsequent 23 -- chained 'Eval's do /not/ see this new scope. 21 {-| 22 Create a new lexical scope by applying the list of 'Pad'-transformers 23 (which install new bindings), then perform the specified evaluation in that 24 new scope. 25 26 (Subsequent chained 'Eval's do /not/ see this new scope.) 27 -} 24 28 enterLex :: [Pad -> Pad] -- ^ Transformations on current 'Pad' to produce the 25 29 -- new 'Pad'. … … 29 33 enterLex newSyms = local (\e -> e{ envLexical = combine newSyms (envLexical e) }) 30 34 31 -- |Perform the specified evaluation in the specified context ('Cxt'). 32 -- Subsequent chained 'Eval's do /not/ see this new scope. 35 {-| 36 Perform the specified evaluation in the specified (Perl6) context ('Cxt'). 37 38 (Subsequent chained 'Eval's do /not/ see this new scope.) 39 -} 33 40 enterContext :: Cxt -> Eval a -> Eval a 34 41 enterContext cxt = local (\e -> e{ envContext = cxt }) 35 42 36 -- |Bind @\$_@ to the given topic value in a new lexical scope, then perform 37 -- the given evaluation in that scope. Used by "Pugs.Eval"'s implementation 38 -- of 'Pugs.Eval.reduce' for @\"given\"@. 43 {-| 44 Bind @\$_@ to the given topic value in a new lexical scope, then perform 45 the specified evaluation in that scope. 46 47 Used by "Pugs.Eval"'s implementation of 'Pugs.Eval.reduce' for @\"given\"@. 48 -} 39 49 enterGiven :: VRef -- ^ Reference to the value to topicalise 40 50 -> Eval a -- ^ Action to perform within the new scope
