Reusable Code & Reusable Data Structures
const& c) { } 1 2 auto rects = tc::make_vector(tc::transform(c, 3 [](widget const& w) { return w.bounding_box(); } 4 )); 5 // Magic happens 6 tc::for_each(tc::zip(c, rects), 7 [&](widget& const& c) { } 1 2 auto rects = tc::make_vector(tc::transform(c, 3 [](widget const& w) { return w.bounding_box(); } 4 )); 5 // Magic happens 6 tc::for_each(tc::zip(c, rects), 7 [&](widget& [&](widget& w, rect r) { 8 widget.place(r); 9 } 10 11 ); 12 auto rects = tc::make_vector(tc::transform(c, [](widget const& w) { return w.bounding_box(); } )); // https://github.com/think-cell/think-cell-library0 码力 | 132 页 | 14.20 MB | 5 月前3Express Your Expectations: A Fast, Compliant JSON Pull Parser for Writing Robust Applications
Cordell Jonathan Müller — @foonathan Express your expectations CppCon 2023-10-03 1tc::json::parser Extract some JSON members tc nlohmann RapidJSON Boost.JSON simdjson 0 10 20 30 40 Library Time in ms stdv::filter([](int i) { return i % 2 == 0; }) | stdv::transform([](int i) { return i * i; }); return tc::find_first_if<tc::return_value_or_none>(even_squares, [](int square) { return square % 3 == 0; }); } Jonathan struct tc::json::parser { … }; Jonathan Müller — @foonathan Express your expectations CppCon 2023-10-03 52Pulling primitive values templatestruct tc::json::parser 0 码力 | 143 页 | 736.91 KB | 5 月前3Agda User Manual v2.6.3
particular implicit argument using the @(tactic t) attribute, where t : Term → TC ⊤. For instance: clever-search : Term → TC ⊤ clever-search hole = unify hole (lit (nat 17)) the-best-number : {@(tactic arguments to the function: default : {A : Set} → A → Term → TC ⊤ default x hole = bindTC (quoteTC x) (unify hole) search : (depth : Nat) → Term → TC ⊤ example : {@(tactic default 10) depth : Nat} monad TC: postulate TC : ∀ {a} → Set a → Set a returnTC : ∀ {a} {A : Set a} → A → TC A bindTC : ∀ {a b} {A : Set a} {B : Set b} → TC A → (A → TC B) → TC B {-# BUILTIN AGDATCM TC0 码力 | 379 页 | 354.83 KB | 1 年前3Agda User Manual v2.6.2
particular implicit argument using the @(tactic t) attribute, where t : Term → TC ⊤. For instance: clever-search : Term → TC ⊤ clever-search hole = unify hole (lit (nat 17)) the-best-number : {@(tactic arguments to the function: default : {A : Set} → A → Term → TC ⊤ default x hole = bindTC (quoteTC x) (unify hole) search : (depth : Nat) → Term → TC ⊤ example : {@(tactic default 10) depth : Nat} monad TC: postulate TC : ∀ {a} → Set a → Set a returnTC : ∀ {a} {A : Set a} → A → TC A bindTC : ∀ {a b} {A : Set a} {B : Set b} → TC A → (A → TC B) → TC B {-# BUILTIN AGDATCM TC0 码力 | 348 页 | 414.11 KB | 1 年前3Agda User Manual v2.6.2.2
particular implicit argument using the @(tactic t) attribute, where t : Term → TC ⊤. For instance: clever-search : Term → TC ⊤ clever-search hole = unify hole (lit (nat 17)) the-best-number : {@(tactic arguments to the function: default : {A : Set} → A → Term → TC ⊤ default x hole = bindTC (quoteTC x) (unify hole) search : (depth : Nat) → Term → TC ⊤ example : {@(tactic default 10) depth : Nat} monad TC: postulate TC : ∀ {a} → Set a → Set a returnTC : ∀ {a} {A : Set a} → A → TC A bindTC : ∀ {a b} {A : Set a} {B : Set b} → TC A → (A → TC B) → TC B {-# BUILTIN AGDATCM TC0 码力 | 354 页 | 433.60 KB | 1 年前3Agda User Manual v2.6.2.1
particular implicit argument using the @(tactic t) attribute, where t : Term → TC ⊤. For instance: clever-search : Term → TC ⊤ clever-search hole = unify hole (lit (nat 17)) the-best-number : {@(tactic arguments to the function: default : {A : Set} → A → Term → TC ⊤ default x hole = bindTC (quoteTC x) (unify hole) search : (depth : Nat) → Term → TC ⊤ example : {@(tactic default 10) depth : Nat} monad TC: postulate TC : ∀ {a} → Set a → Set a returnTC : ∀ {a} {A : Set a} → A → TC A bindTC : ∀ {a b} {A : Set a} {B : Set b} → TC A → (A → TC B) → TC B {-# BUILTIN AGDATCM TC0 码力 | 350 页 | 416.80 KB | 1 年前3Agda User Manual v2.6.3
particular implicit argument using the @(tactic t) attribute, where t : Term → TC ⊤. For instance: clever-search : Term → TC ⊤ clever-search hole = unify hole (lit (nat 17)) the-best-number : {@(tactic arguments to the function: default : {A : Set} → A → Term → TC ⊤ default x hole = bindTC (quoteTC x) (unify hole) search : (depth : Nat) → Term → TC ⊤ example : {@(tactic default 10) depth : Nat} {@(tactic checking monad TC: postulate TC : ∀ {a} → Set a → Set a returnTC : ∀ {a} {A : Set a} → A → TC A bindTC : ∀ {a b} {A : Set a} {B : Set b} → TC A → (A → TC B) → TC B {-# BUILTIN AGDATCM TC #-} (continues0 码力 | 288 页 | 1.24 MB | 1 年前3Agda User Manual v2.5.2
monad TC: postulate TC : ∀ {a} → Set a → Set a returnTC : ∀ {a} {A : Set a} → A → TC A bindTC : ∀ {a b} {A : Set a} {B : Set b} → TC A → (A → TC B) → TC B {-# BUILTIN AGDATCM TC #-} {-# BUILTIN AGDATCMRETURN returnTC #-} {-# BUILTIN AGDATCMBIND bindTC #-} The TC monad provides an interface to the Agda type checker using the following primitive operations: postulate -- metavariables in the process. unify : Term → Term → TC ⊤ -- Throw a type error. Can be caught by catchTC. typeError : ∀ {a} {A : Set a} → List ErrorPart → TC A -- Block a type checking computation on a0 码力 | 151 页 | 152.49 KB | 1 年前3Agda User Manual v2.6.4.1
particular implicit argument using the @(tactic t) attribute, where t : Term → TC ⊤. For instance: clever-search : Term → TC ⊤ clever-search hole = unify hole (lit (nat 17)) the-best-number : {@(tactic arguments to the function: default : {A : Set} → A → Term → TC ⊤ default x hole = bindTC (quoteTC x) (unify hole) search : (depth : Nat) → Term → TC ⊤ example : {@(tactic default 10) depth : Nat} {@(tactic checking monad TC: postulate TC : ∀ {a} → Set a → Set a returnTC : ∀ {a} {A : Set a} → A → TC A bindTC : ∀ {a b} {A : Set a} {B : Set b} → TC A → (A → TC B) → TC B {-# BUILTIN AGDATCM TC #-} {-# BUILTIN0 码力 | 311 页 | 1.38 MB | 1 年前3Agda User Manual v2.6.4.3
particular implicit argument using the @(tactic t) attribute, where t : Term → TC ⊤. For instance: clever-search : Term → TC ⊤ clever-search hole = unify hole (lit (nat 17)) the-best-number : {@(tactic arguments to the function: default : {A : Set} → A → Term → TC ⊤ default x hole = bindTC (quoteTC x) (unify hole) search : (depth : Nat) → Term → TC ⊤ example : {@(tactic default 10) depth : Nat} {@(tactic checking monad TC: postulate TC : ∀ {a} → Set a → Set a returnTC : ∀ {a} {A : Set a} → A → TC A bindTC : ∀ {a b} {A : Set a} {B : Set b} → TC A → (A → TC B) → TC B {-# BUILTIN AGDATCM TC #-} {-# BUILTIN0 码力 | 311 页 | 1.38 MB | 1 年前3
共 243 条
- 1
- 2
- 3
- 4
- 5
- 6
- 25