This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Prototype of task guard implemented in a more functional style. | |
var Promise = require("q").Promise; | |
var pipeline = require("fn.js").pipeline; | |
var partial = require("fn.js").partial; | |
// STATE OF THE WORLD, CHANGES GO HERE: | |
var STATE; | |
function createState(isDisposed) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Prototype of task guard implemented in a more functional style. | |
var Promise = require("q").Promise; | |
var pipeline = require("fn.js").pipeline; | |
var partial = require("fn.js").partial; | |
// STATE OF THE WORLD, CHANGES GO HERE: | |
var STATE; | |
function createState(isDisposed) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var compose = require("fn.js").compose; | |
var pipeline = require("fn.js").pipeline; | |
var partial = require("fn.js").partial; | |
var insertCss = require("insert-css"); | |
insertCss("body { padding: 20px } \ | |
.selected { font-weight: bold; color: red; font-family: Consolas; font-size: 18px; }\ | |
.important { color: blue }"); | |
// string, string returns DomElement |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* Tennis Kata in OCaml! *) | |
type player = PlayerOne | PlayerTwo | |
type point = Love | Fifteen | Thirty | |
type score = | |
| Points of point * point |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// OOPS VIOLATION OF LISKOV!! Bad bad | |
Rectangle { | |
width(val) = _width = val | |
height(val) = _height = val | |
area() = width() * height() | |
} | |
test_area(rect: Rectangle) { | |
rect.width(4) |
OlderNewer