Version: 4.1.3.8
9 Generators (short names)
(require (planet untyped/unlib/gen)) |
This module re-provides the procedures from "generator.ss" with shorter, more convenient names. See Generators for more detailed documentation.
Shorter name for generator-end.
(g:end? item) → boolean? |
item : any |
Shorter name for generator-end?.
(gen-> value-contract) → flat-contract? |
value-contract : flat-contract? |
(g:list lis) → (gen-> a) |
lis : (listof a) |
Shorter name for list->generator.
(g:range start [end step]) → (gen-> integer?) |
start : integer? |
end : (U integer? #f) = #f |
step : integer? = 1 |
Shorter name for range->generator.
(g:map fn gen1 gen2 ...) → (gen-> ans) |
fn : (arg1 arg2 ... -> ans) |
gen1 : (gen-> arg1) |
gen2 : (gen-> arg2) |
Shorter name for generator-map.
(g:fold-map fn initial-seed gen1 gen2 ...) → seed |
fn : (arg1 arg2 ... seed -> seed) |
initial-seed : seed |
gen1 : (gen-> arg1) |
gen2 : (gen-> arg2) |
Shorter name for generator-fold-map.
(g:filter pred src) → (gen-> arg) |
pred : (arg -> boolean?) |
src : (gen-> arg) |
Shorter name for generator-filter.
(g:filter-map fn src) → (gen-> ans) |
fn : (arg -> (U ans #f)) |
src : (gen-> arg) |
Shorter name for generator-filter-map.
(g:remove-duplicates src [same?]) → (gen-> a) |
src : (gen-> a) |
same? : (a a -> boolean?) = equal? |
Shorter name for generator-remove-duplicates.
(g:for-each fn gen1 gen2 ...) → void? |
fn : (arg1 arg2 ... -> void) |
gen1 : (gen-> arg1) |
gen2 : (gen-> arg2) |
Shorter name for generator-for-each
(g:fold fn initial-seed gen1 gen2 ...) → seed |
fn : (arg1 arg2 ... seed -> seed) |
initial-seed : seed |
gen1 : (gen-> arg1) |
gen2 : (gen-> arg2) |
Shorter name for generator-fold
(g:collect src) → (listof a) |
src : (gen-> a) |
Shorter name for generator-fold.
(g:collect/hash | | src | | | | | | | item->key | | | | | | [ | item->val | | | | | | | initial-hash]) | | → | | (hashof b c) |
|
src : (gen-> a) |
item->key : (a -> b) |
item->val : (a -> c) = (lambda (a) a) |
initial-hash : (hashof b c) = (make-hash) |
Shorter name for generator->hash.
(g:project mask src [same?]) |
→ (gen-> (list any ... (listof (listof any)))) |
mask : (listof boolean) |
src : (gen-> (listof any)) |
same? : [(any any -> boolean)] = eq? |
Shorter name for generator-project
(g:debug message src) → (gen-> a) |
message : string? |
src : (gen-> a) |
Shorter name for generator-debug.