Skip to content

Commit cdd5339

Browse files
authored
chore(PRELUDE) init 🔥
1 parent 44c4296 commit cdd5339

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

prelude.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
'use strict'
2+
3+
const compose = (f, g) => x => f(g(x))
4+
5+
const uniq = xs => xs.reduce((list, x) => list.indexOf(x) === -1 ? list.concat(x) : list, [])
6+
7+
const identity = x => x
8+
9+
const flatten = xs => [].concat.apply([], xs.map(identity));
10+
11+
exports.union = compose(uniq, flatten)

0 commit comments

Comments
 (0)