code: function spawnLoop(init, onMessage)
  {
  	var andThen = _elm_lang$core$Native_Scheduler.andThen;
  
  	function loop(state)
  	{
  		var handleMsg = _elm_lang$core$Native_Scheduler.receive(function(msg) {
  			return onMessage(msg, state);
  		});
  		return A2(andThen, loop, handleMsg);
  	}
  
  	var task = A2(andThen, loop, init);
  
  	return _elm_lang$core$Native_Scheduler.rawSpawn(task);
  }
docs: HELPER for STATEFUL LOOPS