import R from 'ramda';

export const count = (str, letter) => R.length(R.filter(R.equals(letter), R.split('', str)));

export const frequency = R.curry((str, letter) => count(str, letter) / str.length);

export const timesLog2 = x => x * Math.log2(x);

export default str => {
  const uni = R.uniq(str.split(''));
  return -R.sum(R.map(R.pipe(frequency(str), timesLog2), uni));
};

@@ -17,16 +17,55 @@
 amda';%0A%0A
+// count :: String -%3E String -%3E Number%0A
 export c
@@ -147,24 +147,67 @@
 ', str)));%0A%0A
+// frequency :: String -%3E String -%3E Number%0A
 export const
@@ -275,24 +275,57 @@
 r.length);%0A%0A
+// timesLog2 :: Number -%3E Number%0A
 export const
@@ -365,77 +365,58 @@
 );%0A%0A
-export default str =%3E %7B%0A  const uni = R.uniq(str.split(''));%0A  return
+// solve :: String -%3E Number%0Aexport default str =%3E
  -R.
@@ -464,14 +464,29 @@
 2), 
+R.
 uni
-));%0A%7D
+q(str.split(''))))
 ;%0A

add type declaration comments