Skip to content

Instantly share code, notes, and snippets.

I like LYAH as a reference and cheat-sheet but I found it a little slow for learning Haskell.

Here's my recommended order for just learning Haskell:

http://yannesposito.com/Scratch/en/blog/Haskell-the-Hard-Way/ 80% completion here is fine if you feel your attention waning, the next thing will address hammering in things like functors and monads via typeclasses.

https://github.com/NICTA/course/ this will hammer in the lessons in a very direct form by forcing you to confront the challenges and lessons learned by the creators and community of Haskell itself. Doing the exercises here is critical for being fluent.

Real World Haskell is available online. I recommend it as a reference only.

// Not all of the pipeline is async, but some of it is, so even the non-async functions
// get lifted into a promise (a compliant Promises/A+ impl will lift your functions for free)
Q.delay(100)
.then(function (_) { return { a: 1 }})
.then(function (acc) { return _.extend(acc, { b: 2 }); })
.then(function (acc) { return _.extend(acc, { a: acc.a + 1 }); })
.then(_.bind(this.setState, this))
.done();
/** @jsx React.DOM */
define([
'underscore', 'react', 'wingspan-forms', 'wingspan-cursor'
], function (_, React, Forms, Cursor) {
'use strict';
var FormField = Forms.FormField;
var KendoText = Forms.KendoText;
var KendoComboBox = Forms.KendoComboBox;
var AutoControl = Forms.AutoControl;
define([
'underscore.mixed', 'react', 'wingspan-forms'
], function (_, React, Forms) {
'use strict';
var DateSlider = React.createClass({
displayName: 'DateSlider',
getDefaultProps: _.always({
cursor: undefined
define([
'underscore', 'react', 'jquery', 'kendo', 'underscore.string'
], function (_, React, $, kendo, str) {
'use strict';
var KendoPanelBar = React.createClass({
getDefaultProps: function () {
return {
panels: undefined,
@dustingetz
dustingetz / gist:018828c0754e0e73f8c8
Created July 7, 2014 13:47
Dismissible Grid - Dustin's version
define([
'underscore.mixed', 'react', 'wingspan-forms'
], function (_, React, Forms) {
'use strict';
var SelectedRecipientsGrid = React.createClass({
getDefaultProps: function () {
return {
dataSource: undefined, // the datasource as list of records
@dustingetz
dustingetz / gist:ee926a14a36137a34b2c
Created July 7, 2014 13:48
Kendo Grid Picker using native Kendo selection state
define([
'underscore.mixed', 'react', 'jquery', 'wingspan-forms'
], function (_, React, $, Forms) {
'use strict';
var PatientPicker = React.createClass({
displayName: 'PatientPicker',
getDefaultProps: function () {
return {
// In lieu of unit tests:
var c1 = window.c1 = Cursor.build(window.App);
var c2 = window.c2 = Cursor.build(window.App);
console.assert(c1.value === c2.value);
console.assert(c1.onChange === c2.onChange);
console.assert(c1 === c2);
var c10 = c1.refine('very', 'deeply', 'nested', 'counts', '0');
var c20 = c2.refine('very', 'deeply', 'nested', 'counts', '0');
console.assert(c10.value === c20.value);
/**
* Turns an array of promises into a promise for an array. If any of
* the promises gets rejected, the whole array is rejected immediately.
* @param {Array*} an array (or promise for an array) of values (or
* promises for values)
* @returns a promise for an array of the corresponding values
*/
// By Mark Miller
// http://wiki.ecmascript.org/doku.php?id=strawman:concurrency&rev=1308776521#allfulfilled
Q.all = all;
@dustingetz
dustingetz / gist:1490f9ecd2903203cd99
Created October 1, 2014 00:47
proper separation of concerns
(ns quiescent-json-editor.core
(:require [cljs.core.async :as a]
[quiescent :as q :include-macros true]
[quiescent.dom :as d])
(:require-macros [cljs.core.async.macros :as am]))
(q/defcomponent App [state dispatcher]
(d/div {}
(d/pre {} (.stringify js/JSON state))