Taming the C++ Filter Viewstd::cout << *pos << '\n'; ++pos; if (pos != v2.end ## Pipelines: Lazy Evaluation std::vectorcoll{8, 15, 7, 0, 9}; // define a view on coll: auto vColl = coll | std::views::filter([] transform 15 val: -15 filter 7 filter 0 transform 0 val: 0 filter 9 transform 9 val: -9 Pull model (lazy evaluation): next element and its value are processed on demand josuttis | eckstein ## Pipelines: Price 0 码力 | 43 页 | 2.77 MB | 1 年前3
From Eager Futures/Promises to Lazy Continuations: Evolving an Actor Library Based on Lessons Learned## From Eager Futures/Promises to Lazy Continuations Evolving an Actor Library Based on Lessons Learned from Large-Scale Deployments ## prologue • past life at UC Berkeley, Twitter, Mesosphere/D2iQ std::move(body), std::move(k)}; ## lazy continuations auto k = http::Post(url, body, /* k */); resulting type is the “computational graph” ## lazy continuations auto k = http::Post(url, body the “computational graph” - the graph is lazy, i.e., nothing has started when we get it (tradeoff for dynamic allocation) and must be explicitly started ## lazy continuations auto k = http::Post(url, body0 码力 | 264 页 | 588.96 KB | 1 年前3
More Ranges Pleasein-place or output-iterator nature of C++98 algorithms Range Adaptors - algorithms encalsupated as ‘lazy ranges’ (views) ☑ Algorithms as composable objects - ‘expression templates’ ☐ Projections - unary arguments and results ranges::reverse(ranges::search(str,"abc"sv));qodbolt • Views as composable lazy ranges str | views::split(' ') | views::take(2);godbolt • Views have a value/algorithm duality Rank increasing - tuples: zip*, enumerate*, cartesian_product*, adjacent* Rank increasing - ranges: {lazy}split, slide*, chunk{by}* • Committee plan for C++23 is in P2214 ## Digression - Algorithm Selection0 码力 | 27 页 | 1.08 MB | 1 年前3
The Zig Programming Language 0.7.1 Documentation"perform fn"... OK All 1 tests passed. This example is a bit contrived, because the compile-time evaluation component is unnecessary; this code would work fine if it was all done at run-time. But it does expect(fibonacci(7) == 13); } } $ zig test test.zig ./docgen_tmp/test.zig:5:21: error: evaluation exceeded 1000 backward return fibonacci(index - 1) + fibonacci(index - 2); ./docgen_tmp/test.zig:5:21: while (i < 1001) : (i += 1) {} } } $ zig test test.zig ./docgen_tmp/test.zig:4:9: error: evaluation exceeded 1000 backward while (i < 1001) : (i += 1) {} ./docgen_tmp/test.zig:1:12: note: referenced0 码力 | 225 页 | 5.74 MB | 2 年前3
Thinking Functionally In C++add(Mash(banana)); return ingredient; }); } ## Part 4: Lazy Evaluation ## Lazy Evaluation Delay actions or calculations until they are needed class Data { public: DataType .GetType())) { return; } UseData(maybeNeededData.GetBuffer()); } ## Lazy Evaluation: Allocation ## Delay actions or calculations until they are needed class Data { public: .GetType())) { return; } UseData(maybeNeededData.GetBuffer()); } ## Lazy Evaluation: Fetch data lazily std::vectorMap::GetCitiesInBoundary(LatLonBounds boundary) { // 0 码力 | 114 页 | 3.14 MB | 1 年前3
The Idris Tutorial Version 0.99http://www.idris-lang.org/ Type :? for help Idris> This gives a ghci style interface which allows evaluation of, as well as type checking of, expressions; theorem proving, compilation; editing; and various Normally, arguments to functions are evaluated before the function itself (that is, Idris uses eager evaluation). However, this is not always the best approach. Consider the following function: ifThenElse : Idris provides a Lazy data type, which allows evaluation to be suspended: data Lazy : Type -> Type where Delay : (val : a) -> Lazy a Force : Lazy a -> a A value of type Lazy a is unevaluated0 码力 | 182 页 | 1.04 MB | 2 年前3
Kotlin 1.9.10 官方文档 中文版
Kotlin 多平台入门。 ## Kotlin Wasm Kotlin Wasm 是实验性的。 It may be changed at any time. Use it only for evaluation purposes. We would appreciate your feedback on it in YouTrack. ## ! WebAssembly (Wasm) is a ## 用于Web的Compose多平台 Web support is Experimental and may be changed at any time. Use it only for evaluation purposes. We would appreciate your feedback on it in the public Slack channel #compose-web. If layer_tooltips() TooltipOptions lazy(() -> T) Lazylazy(LazyThreadSafetyMode, () -> T) Lazy lazy(LazyThreadSafetyMode, () -> T) Lazy lazyOf(T) Lazy longArrayOf(vararg Long) LongArray 0 码力 | 3753 页 | 29.69 MB | 2 年前3
The Idris Tutorial Version 0.99.2http://www.idris-lang.org/ Type :? for help Idris> This gives a ghci style interface which allows evaluation of, as well as type checking of, expressions; theorem proving, compilation; editing; and various Normally, arguments to functions are evaluated before the function itself (that is, Idris uses eager evaluation). However, this is not always the best approach. Consider the following function: ifThenElse : Idris provides a Lazy data type, which allows evaluation to be suspended: data Lazy : Type -> Type where Delay : (val : a) -> Lazy a Force : Lazy a -> a A value of type Lazy a is unevaluated0 码力 | 224 页 | 1.22 MB | 2 年前3
The Idris Tutorial Version 2.3.0org/ /___/\__,_/_/ /_/____/ Type :? for help Idris> This gives a ghci style interface which allows evaluation of, as well as type checking of, expressions; theorem proving, compilation; editing; and various this, Idris provides a Lazy data type, which allows evaluation to be suspended: data Lazy : Type -> Type where Delay : (val : a) -> Lazy a Force : Lazy a -> a A value of type Lazy a is unevaluated until until it is forced by Force. The Idris type checker knows about the Lazy type, and inserts conversions where necessary between Lazy a and a, and vice versa. We can therefore write ifThenElse as follows, without0 码力 | 228 页 | 1.23 MB | 2 年前3
The Idris Tutorial Version 1.0.1http://www.idris-lang.org/ Type :? for help Idris> This gives a ghci style interface which allows evaluation of, as well as type checking of, expressions; theorem proving, compilation; editing; and various Normally, arguments to functions are evaluated before the function itself (that is, Idris uses eager evaluation). However, this is not always the best approach. Consider the following function: ifThenElse : Idris provides a Lazy data type, which allows evaluation to be suspended: data Lazy : Type -> Type where Delay : (val : a) -> Lazy a Force : Lazy a -> a A value of type Lazy a is unevaluated0 码力 | 223 页 | 1.21 MB | 2 年前3
共 1000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 100
相关搜索词
Filter Viewscall-by-valuecall-by-referenceLazy EvaluationPipelinesFutures/PromisesActorsLazy ContinuationsEventualsSchedulingRangesC++composabilitylazy rangesfunctional languagesZigbuild modesC interoperror handlinglazy analysis函数式编程多范式语言ActionsCalculationsDataIdris依赖类型Vect类型Effects库KotlinKotlin 多平台Kotlin/NativeKotlin/JSKotlin/JVM依赖类型系统交互式环境编译器运行时系统dependent typesinteractive environmentimplicit conversionsforeign function calls副作用处理













