refactoring to support grouping simply.

This commit is contained in:
Bryce Covert
2018-05-14 13:33:04 -07:00
parent 431645ad42
commit d9994b988c
7 changed files with 59 additions and 37 deletions

View File

@@ -0,0 +1,10 @@
(ns auto-ap.utils)
(defn by
([f xs]
(by f identity xs))
([f fv xs]
(reduce
#(assoc %1 (f %2) (fv %2))
{}
xs)))