Skip to content

Commit d8fe564

Browse files
authored
fix(PRELUDE) correct union sig
the union signature was incorrect
1 parent 2be3c4f commit d8fe564

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

prelude.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,18 @@ const identity = x => x
1414

1515
const concat = (xs, list) => xs.concat(list)
1616

17-
const union = compose([uniq, identity])
17+
const union = compose([uniq, concat])
1818

1919
const join = separator => xs => xs.join(separator)
2020

2121
const split = separator => str => str.split(separator)
2222

23-
const pathUnion = compose([join('/'), union, split('/'), concat])
23+
const map = (fn, xs) => xs.map(fn)
24+
25+
const chain = fn => xs => [].concat.apply([], map(fn, xs))
26+
27+
const of = Array.of.bind(Array)
28+
29+
const pathUnion = compose([join('/'), union, chain(split('/')), of])
2430

2531
exports.pathUnion = pathUnion

0 commit comments

Comments
 (0)