http://swannodette.github.io/mori/
var emptyVec = mori.vector();
var nonEmpty = mori.conj(emptyVec, 1, 2, 3, 4);
/* | |
* Example of a state monad in use. This is adapted from an example on | |
* the Haskell Wiki: | |
* http://www.haskell.org/haskellwiki/State_Monad#Complete_and_Concrete_Example_1 | |
*/ | |
require(['state', 'qunit'], function(state, qunit) { | |
/* | |
* playGame() is a recursive function that given an array of moves | |
* defines an algorithm for constructing a final game score. Along |
(function(mod) { | |
if (typeof exports == "object" && typeof module == "object") return mod(exports); // CommonJS | |
if (typeof define == "function" && define.amd) return define(["exports"], mod); // AMD | |
mod(self.acorn || (self.acorn = {})); // Plain browser env | |
})(function(exports) { | |
"use strict"; | |
exports.version = "0.2.0"; | |
/* ... */ |
; A monad comprehension is a syntactic construct that translates | |
; synchronous-looking code into a callback-based implementation. Monads | |
; are a very general abstraction - which means that monad comprehensions | |
; have more expressive power than other sync-to-async code | |
; transformations. | |
; Here is an example that uses jQuery's $.get method to fetch resources: | |
(def post-with-author (id) | |
(for |
http://swannodette.github.io/mori/
var emptyVec = mori.vector();
var nonEmpty = mori.conj(emptyVec, 1, 2, 3, 4);
2013-09-16 07:21:40,143 INFO com.buddycloud.mediaserver.Main - buddycloud Media Server HTTP server started! | |
2013-09-16 07:21:41,481 ERROR com.buddycloud.mediaserver.Main - Media Server XMPP Component could not be started. | |
org.xmpp.component.ComponentException: java.io.EOFException: input contained no data | |
at org.jivesoftware.whack.ExternalComponent.connect(ExternalComponent.java:267) ~[whack.jar:na] | |
at org.jivesoftware.whack.ExternalComponentManager.addComponent(ExternalComponentManager.java:211) ~[whack.jar:na] | |
at org.jivesoftware.whack.ExternalComponentManager.addComponent(ExternalComponentManager.java:191) ~[whack.jar:na] | |
at com.buddycloud.mediaserver.Main.createXMPPComponent(Main.java:138) ~[buddycloud-media-server-0.1.jar:na] | |
at com.buddycloud.mediaserver.Main.startXMPPToolBox(Main.java:105) ~[buddycloud-media-server-0.1.jar:na] | |
at com.buddycloud.mediaserver.Main.main(Main.java:51) ~[buddycloud-media-server-0.1.jar:na] | |
Caused by: java.io.EOFException: in |
http://swannodette.github.io/mori/
var l0 = mori.list(3, 4, 5);
var l1 = mori.cons(2, l0);
var fs = require('fs'); | |
var exec = require('child_process').exec; | |
var templ_ = fs.readFileSync('package.json.template', { encoding: 'UTF-8' }); | |
var templ = JSON.parse(templ_); | |
var deps = {}; | |
exec("npm search substack | grep '=substack' | awk '{ print $1 }'", function(err, stdout) { | |
var lines = stdout.toString('UTF-8'); | |
lines.split("\n").forEach(function(line) { |
import Control.Applicative ((<$>), (<*>)) | |
import Control.Concurrent.Async (Concurrently(..), runConcurrently) | |
import Data.Monoid (Monoid, (<>), mappend, mempty) | |
instance (Monoid a) => Monoid (IO a) where | |
mappend x y = runConcurrently $ (<>) <$> Concurrently x <*> Concurrently y | |
mempty = return mempty | |
-- example: | |
action = getLine <> getLine |
! | |
! Invert number row | |
! | |
! This changes the behavior of keys in the number row, but does not | |
! affect the number pad. | |
! | |
keycode 10 = exclam 1 1 exclam | |
keycode 11 = at 2 2 at | |
keycode 12 = numbersign 3 3 numbersign | |
keycode 13 = dollar 4 4 dollar |
# open vim in a new split | |
bind e split-window -h -c "#{pane_current_path}" sensible-editor | |
# shortcuts for common git operations | |
bind g split-window -h -c "#{pane_current_path}" 'GIT_PAGER="less -+F" git lg' | |
bind D split-window -h -c "#{pane_current_path}" 'GIT_PAGER="less -+F" git diff' | |
bind C split-window -h -c "#{pane_current_path}" 'GIT_PAGER="less -+F" git diff --cached' | |
bind A split-window -h -c "#{pane_current_path}" 'git add -p' |