import curry from '../Func/curry';
import { keys } from '../Obj';

//+ areSimilar :: a -> a -> Boolean
export default curry((a, b) => {
  switch(typeOf(a)) {
    case 'Array':
      return a.length === b.length &&
        keys(a).reduce((acc, k) => acc && areSimilar((a.sort()[k]), (b.sort()[k])), true);
    case 'Object':
      return keys(a).length === keys(b).length &&
        keys(a).reduce((acc, k) => acc && areSimilar(a[k], b[k]), true);
    default:
      return a === b;
  }
});

@@ -1,20 +1,29 @@
 import
+ %7B
  curry
+, fix %7D
  from '.
@@ -32,14 +32,8 @@
 Func
-/curry
 ';%0Ai
@@ -66,75 +66,65 @@
 j';%0A
-%0A//+ areSimilar :: a -%3E a -%3E Boolean%0Aexport default curry(
+import typeOf from './typeOf';%0A%0Afunction areSimilar
 (a, b)
- =%3E
  %7B%0A 
@@ -473,11 +473,81 @@
 b;%0A  %7D%0A%7D
+;%0A%0A//+ areSimilar :: a -%3E a -%3E Boolean%0Aexport default curry(areSimilar
 );%0A

make it curried