]> gitweb.factorcode.org Git - factor.git/blob - extra/grouping/extras/extras-docs.factor
factor: trim more using lists.
[factor.git] / extra / grouping / extras / extras-docs.factor
1 USING: help.markup help.syntax sequences ;
2
3 IN: grouping.extras
4
5 HELP: group-by
6 { $values { "seq" sequence } { "quot" { $quotation ( elt -- key ) } } { "groups" "a new assoc" } }
7 { $description "Groups the elements by the key received by applying quot to each element in the sequence." }
8 { $examples
9   { $example
10     "USING: grouping.extras unicode.data prettyprint sequences strings ;"
11     "\"THis String Has  CasE!\" [ category ] group-by [ last >string ] { } map-as ."
12     "{ \"TH\" \"is\" \" \" \"S\" \"tring\" \" \" \"H\" \"as\" \"  \" \"C\" \"as\" \"E\" \"!\" }"
13   }
14 } ;