JSFiddle

  • Z.traverse Not Stack Safe

    No-Library (pure JS), HTML, CSS, JavaScript

    const Z = sanctuaryTypeClasses
    
    function newtype() {
      function newType(v) {
        if(!(this instanceof newType)) {
          return new newType(v)
        }
        this.__wrapped__ = v
      }
      newType ...
  • appp

    No-Library (pure JS), HTML, CSS, JavaScript

    "use strict";
    function nextRec(value) {
        return {
            done: false,
            value: value
        };
    }
    function doneRec(value) {
        return {
            done: true,
            value: value
        };
    }
    function generatorStep ...
  • Fibonacci number using Generator

    fibonacci generator is infinite generator, you can take as much as you want using take function helper

    // repeat target as much as times, if no times
    // given the generator becomens infinite
    function* repeat(target, times = null) {
    	if ...
  • Mithril and false values as virtual DOM nodes #8 is the latest revision

    False values are coerced toString in order to produce text nodes. I contend that this is highly undesirable — my expectation is for falsey values to produce empty text nodes. This makes simple conditional logic (ors, ands) far more powerful in writing terse, legible views.

    var churchFalse = (x) => (y) => y
    var churchTrue = (x) => (y) => x
    // if x true then use churchFalse to fill empty string ...
  • function index

    No-Library (pure JS), HTML, CSS, JavaScript

    // for now just set the model here, you will need ajax in real life
    var raw = [
      [4,50,'vector_add'],
      [4 ...
  • How do different redraw strategies affect controller & view execution logic? #1 is the latest revision

    MithrilJS 0.2.0, HTML, CSS, Babel + JSX

    const App = {
    	view : ( ctrl, ...contents ) =>
      	m( '.app', 
        	contents
        )
    }
    
    const Header = {
    	view : () =>
      	m( 'h1.header', 'How do different redraw strategies affect ...