Ramda experiments

by Alexander Zonov

HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/ramda/0.25.0/ramda.min.js"></script>

JavaScript

// R stays for Ramda 
let show = R.bind(document.documentElement.append, document.documentElement);

let words = R.curry(R.split(' '));
let sentences = R.map(words);


var filterQs = R.filter(R.match(/q/i));

show(
	filterQs('qeriqidnq')
);

/*
	let words = R.curry(R.split(' '));
*/

/*
  // doesn't work for arrow functions, and that is good and expected
  const binded = R.bind(function(){ console.log(this.a, 'foo'); }, {a: 2});
*/

/*
  // no magic, even if it returns a clone of the input, it is not a deep clone
  const immutable = R.always({a: {b: 2, c: 3}});
  immutable().a.b = immutable().a.c;
  console.log(immutable()); //=> {a: {b: 3, c: 3}}
*/