Hacker News new | ask | show | jobs
by zzo38computer 2516 days ago
If you have a macro then something like "do notation" could be done in a superset of JavaScript, such as something like this:

  const listMonad=(m,f)=>[].concat(...m.map(f));
  const x=listMonad*>{
    let a=yield [1,2,9];
    let b=yield [3,4,5,7];
    return a-b;
  };
Such a code can then be compiled into a ordinary JavaScript code.