factor/extra/grouping/extras/extras-docs.factor

15 lines
595 B
Factor
Raw Normal View History

USING: help.markup help.syntax sequences splitting strings ;
IN: grouping.extras
HELP: group-by
2014-05-24 20:16:26 -04:00
{ $values { "seq" sequence } { "quot" { $quotation ( elt -- key ) } } { "groups" "a new assoc" } }
{ $description "Groups the elements by the key received by applying quot to each element in the sequence." }
{ $examples
{ $example
2014-03-12 23:08:15 -04:00
"USING: grouping.extras unicode.data prettyprint sequences strings ;"
"\"THis String Has CasE!\" [ category ] group-by [ last >string ] { } map-as ."
"{ \"TH\" \"is\" \" \" \"S\" \"tring\" \" \" \"H\" \"as\" \" \" \"C\" \"as\" \"E\" \"!\" }"
}
} ;