File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed
Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change 2121(defn- combinations [xs f cost]
2222 (let [idxs (g/continuous-combinations (count xs))]
2323 (for [combo idxs]
24- ( vector (fn [& vs]
25- (let [res (to-seq (apply f vs))]
26- (subvec res (first combo) (inc (last combo)))))
27- (g/types (subvec xs (first combo) (inc (last combo))))
28- (cond-> cost
29- ; ; TODO: mark as lossy conversion
30- ; ; currently we just incur a 0.5*number of types dropped penalty
31- (not= (count idxs) (count xs))
32- (+ (* 0.5 (- (count xs) (count combo)))))) )))
24+ [ (fn [& vs]
25+ (let [res (to-seq (apply f vs))]
26+ (subvec res (first combo) (inc (last combo)))))
27+ (g/types (subvec xs (first combo) (inc (last combo))))
28+ (cond-> cost
29+ ; ; TODO: mark as lossy conversion
30+ ; ; currently we just incur a 0.5*number of types dropped penalty
31+ (not= (count idxs) (count xs))
32+ (+ (* 0.5 (- (count xs) (count combo)))))] )))
3333
3434(def ^:dynamic *fail-on-duplicate-conversion?* true )
3535
You can’t perform that action at this time.
0 commit comments