File tree 1 file changed +9
-9
lines changed
1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change 21
21
(defn- combinations [xs f cost]
22
22
(let [idxs (g/continuous-combinations (count xs))]
23
23
(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)))))] )))
33
33
34
34
(def ^:dynamic *fail-on-duplicate-conversion?* true )
35
35
You can’t perform that action at this time.
0 commit comments