fri.js
function setIn(o, path, value) {
  if(path.length) {
    var key = path[0];
    var rest = path.slice(1);
    if(typeof key === 'number' && !(o instanceof immutable.List)) {
        o = new immutable.List();
    } else if(!(o instanceof immutable.Map)) {
        o = new immutable.Map();
    }
    return o.set(key, setIn(o.get(path[0]), 
          path.slice(1), value));
  } else {
    return immutable.fromJS(value);
  }
}
function setIn(o, path, value) {
  if(path.length) {
    var key = path[0];
    var rest = path.slice(1);
    if(typeof key === 'number' && !(o instanceof immutable.List)) {
        o = new immutable.List();
    } else if(!(o instanceof immutable.Map)) {
        o = new immutable.Map();
    }
    return o.set(key, setIn(o.get(path[0]), 
          path.slice(1), value));
  } else {
    return immutable.fromJS(value);
  }
}
### setIn