Skip to content

Commit ab0de20

Browse files
authored
add type sigs
1 parent 00b32fa commit ab0de20

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

prelude.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
11
'use strict';
22

3+
// decode :: String -> String
34
const decode = decodeURIComponent;
5+
6+
// _compose :: (b -> c) -> (a -> b) -> (a -> c)
47
const _compose = (f, g) => (...args) => f(g(...args));
8+
59
const compose = fns => fns.reduce(_compose);
10+
11+
// replace :: Regex -> String -> String -> String
612
const replace = (pattern, substr) => str => str.replace(pattern, substr);
13+
14+
// toLower :: String -> String
715
const toLower = str => str.toLowerCase();
16+
17+
// append :: String -> String -> String
818
const append = a => b => b.concat(a);
919

1020
export {decode, compose, replace, toLower, append};

0 commit comments

Comments
 (0)