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
require("pointfree-fantasy").expose(global); | |
var curry = require("lodash.curry"); | |
var fs = require("fs"); | |
var Either = require("data.either"); | |
// HELPERS | |
// ============ | |
var add = curry(function(x,y) { return x + y }); |
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
Nothing.prototype.traverse = function(f) { | |
return ?.of(Nothing()); //how to get pure if we can't call f? | |
} | |
Just.prototype.traverse = function(f) { | |
return f(this.val).map(Just); | |
} | |
Nothing.prototype.foldl = function(f) { | |
return ?.empty() // same prob as traverse - need to run f() to get correct empty | |
}; | |
Just.prototype.foldl = function(f, acc) { |
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 Option = require('fantasy-options') | |
var Some = Option.Some; | |
var None = Option.None; | |
var Compose = function(x){ | |
this.val = x; | |
} | |
Compose.prototype.map = function(f){ | |
return new Compose(this.val.map(function(u){return u.map(f); })); |
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 _One = function(v) { | |
this.value = v; | |
}; | |
var _Many = function(v, vs) { | |
this.value = v; | |
this.tail = vs; | |
}; | |
var One = function(x) { return new _One(x); }; |
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
// helpers | |
var compose = function(f,g) { | |
return function(x) { | |
return f(g(x)) | |
} | |
} | |
var id = function(x) { return x } | |
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
// Helpers | |
//================= | |
var compose = function(f,g) { | |
return function(x) { | |
return f(g(x)) | |
} | |
} | |
var id = function(x) { return x } |
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 React = require('react'); | |
var Notification = require('./notification'); | |
var App = React.createClass({ | |
render: function() { | |
return ( | |
<div> | |
<Notification /> | |
</div> |
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 App = React.createClass({ | |
render: function() { | |
return ( | |
<div> | |
<Notification> | |
<h2 className="slds-text-heading--small">Beware of the Trash Dragons!</h2> | |
</Notification> | |
</div> | |
); |
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 React = require('react'); | |
var Notification = React.createClass({ | |
render: function() { | |
return <div />; | |
} | |
} | |
module.exports = Notification; |
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
render: function() { | |
return ( | |
<div className="slds-notify-container"> | |
<div className="slds-notify slds-notify--alert" role="alert"> | |
<span className="slds-assistive-text">info</span> | |
<button className="slds-button slds-notify__close slds-icon--small"> | |
<svg aria-hidden="true" className="slds-button__icon slds-button__icon--inverse" dangerouslySetInnerHTML={{__html:'<use xlink:href="/assets/icons/action-sprite/svg/symbols.svg#close"></use>'}}> | |
</svg> | |
<span className="slds-assistive-text">Close</span> | |
</button> |
OlderNewer