I hereby claim:
- I am zerokarmaleft on github.
- I am zerokarmaleft (https://keybase.io/zerokarmaleft) on keybase.
- I have a public key ASCmPSKLtqR_ZyuG3chst6HWkG8UrLmlmB_4Hbpvq4i0iQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| upstream http_backend { | |
| server localhost:3000; | |
| keepalive 32; | |
| } | |
| server { | |
| location /ralphedwards/ { | |
| proxy_pass http://http_backend/; | |
| proxy_http_version 1.1; | |
| proxy_set_header Connection ""; |
| (ns arith.core | |
| (:require [clojure.core.typed :refer [ann defalias Rec U Val Int]] | |
| [clojure.core.match :refer [match]])) | |
| (defalias Expr | |
| (Rec [Expr] | |
| (U '[(Val :zero)] | |
| '[(Val :succ) Expr]))) | |
| (ann evaluate [Expr -> Int]) |
| (ns vending-machine.core | |
| (:require [cljs.core.async | |
| :refer [<! >! chan timeout]] | |
| [figwheel.client :as figwheel | |
| :include-macros [true]] | |
| [om.core :as om | |
| :include-macros true] | |
| [sablono.core :as html | |
| :refer-macros [html]]) | |
| (:require-macros [cljs.core.async.macros |
| "X1. A drinks dispenser has two buttons labelled ORANGE and | |
| LEMON. The actions of pressing the two buttons are /set-orange/ and | |
| /set-lemon/. The actions of dispensing a drink are /orange/ and | |
| /lemon/. The choice of drink that will be dispensed is made by | |
| pressing the corresponding button. Before any button is pressed, no | |
| drink will be dispensed." | |
| (declare orange lemon) | |
| (def c (chan)) |
| # Memoization doesn't get you all the way there. While a memoized | |
| # function might exhibit referential transparency *at two successive | |
| # callsites*, your program as a whole will not exhibit that | |
| # property. An example with destructive updates of a mutable data | |
| # structure, an inherently effectful operation: | |
| phonebook = {} | |
| # assuming this function is augmented with memoization |
| var Lazy = require('lazy.js'); | |
| function isHeads(x) { return x >= 0.5; } | |
| function isTails(x) { return x < 0.5; } | |
| function toss(n) { | |
| var successes = Lazy.generate(function() { return Math.random(); }) | |
| .take(n) | |
| .filter(isHeads) | |
| .size(); |
| {-# LANGUAGE DeriveGeneric | |
| , FlexibleInstances | |
| , OverloadedStrings | |
| , ScopedTypeVariables | |
| , TypeSynonymInstances #-} | |
| module Main where | |
| import Control.Monad | |
| import Data.Aeson.Types |
| {-# LANGUAGE OverloadedStrings, ScopedTypeVariables, DeriveGeneric #-} | |
| module Main where | |
| import Data.Aeson.Types | |
| import qualified Data.ByteString.Lazy as BSL | |
| import qualified Data.ByteString.UTF8 as UTF8 | |
| import GHC.Generics | |
| import Network.Riak |