"Computing is Interaction", Robin Milner (Cambridge)
"The case for wireless overlay networks", Randy Katz (UC Berkeley)
Joe Armstrong (Ericsson)
| ;; This code is AWFUL and I'm sorry. | |
| ;; idea from http://stackoverflow.com/a/23718676/415518 | |
| ;; This works after I added the `concat`! | |
| (define permutations | |
| (lambda (ls) | |
| (cond | |
| [(null? ls) '(())] | |
| [(equal? (length ls) 1) `((,(car ls)))] | |
| [(equal? (length ls) 2) |
| lkuper.github.com [source] $ ghci | |
| GHCi, version 7.8.3: http://www.haskell.org/ghc/ :? for help | |
| Loading package ghc-prim ... linking ... done. | |
| Loading package integer-gmp ... linking ... done. | |
| Loading package base ... linking ... done. | |
| Prelude> :set -XScopedTypeVariables | |
| Prelude> :set -XRankNTypes | |
| Prelude> let x :: (forall a . (a -> a) -> a) = undefined | |
| Prelude> :t x | |
| x :: (a -> a) -> a |
| function hello(name) { | |
| console.log("Hello from privileged code, " + name + "!"); | |
| } | |
| Components.utils.exportFunction(hello, unsafeWindow, {defineAs: "hello"}); |
| // Extension-side code | |
| let AnObj = { | |
| field: "hello", | |
| thisIsATest: function() { | |
| let str = this.field + " world!"; | |
| return str; | |
| }, | |
| }; |
| {-# LANGUAGE DataKinds #-} | |
| {-# LANGUAGE TypeFamilies #-} | |
| import Control.Concurrent (threadDelay) | |
| import Control.LVish | |
| import Control.LVish.DeepFrz | |
| import Control.LVish.Internal (liftIO) | |
| import Data.LVar.IVar | |
| import Data.LVar.Counter | |
| import Data.Word |
| Components.utils.import('resource://gre/modules/Services.jsm'); | |
| function myObserver() | |
| { | |
| this.register(); | |
| } | |
| myObserver.prototype = { | |
| observe: function(subject, topic, data) { | |
| console.log("observed: " + subject); |
| repos $ mkdir tmp | |
| repos $ cd tmp/ | |
| tmp $ cabal sandbox init | |
| Writing a default package environment file to | |
| /Users/lkuper/repos/tmp/cabal.sandbox.config | |
| Creating a new sandbox at /Users/lkuper/repos/tmp/.cabal-sandbox | |
| tmp $ cabal install ~/repos/lvars/haskell/lvish/ | |
| Resolving dependencies... | |
| cabal: Could not resolve dependencies: | |
| trying: lvish-2.0 (user goal) |
| Components.utils.import('resource://gre/modules/Services.jsm'); | |
| // Code that listens for a custom DOM event. This is how we | |
| // implement communication between unprivileged (web page) and | |
| // privileged (extension) JS code. | |
| function load(win) { | |
| let document = win.document; | |
| document.addEventListener("TestExtensionCustomEvent", function(e) { | |
| win.alert("Hello from privileged code! Event received!"); | |
| }, false, true); |