Notice how a client operations are all !
, then ?
, then client
.
type mathClient = +{
max: !integer.!integer.?integer. mathClient,
isZero: !integer.?boolean. mathClient,
quit: end
}
import Control.Applicative | |
import Control.Monad (guard) | |
import Data.Maybe (isNothing) | |
-- expansion ideas: | |
-- * linear | |
-- * compilation (registers, etc) | |
-- * toggle HOAS / bidirectional knobs | |
-- * ABTs | |
-- * data types! |
import Control.Applicative | |
import Control.Monad (guard) | |
import Data.Maybe (isNothing) | |
-- inspiration: https://github.com/AndrasKovacs/tcbe/blob/master/nosubst.md | |
-- expansion ideas: | |
-- * linear | |
-- * compilation (registers, etc) | |
-- * toggle HOAS / bidirectional knobs |
Quick note about self
/ this
:
Since the beginning, the this
keyword in JS has been confusing.
I recommend getting a good grasp of it, but I want to point out one specific case.
It's common to need access to this
in a callback. JavaScript's scoping rules used to make it necessary
to capture this
explicitly:
var self = this;
(anonymous function) @ VM6003:1 | |
evaluate @ (program):491 | |
InjectedScript._evaluateOn @ VM5670:875 | |
InjectedScript._evaluateAndWrap @ VM5670:808 | |
InjectedScript.evaluateOnCallFrame @ VM5670:933 | |
getData @ backend.js:2590 | |
walkNode @ backend.js:2491 | |
(anonymous function) @ backend.js:2494 | |
walkNode @ backend.js:2493 | |
(anonymous function) @ backend.js:2494 |
Starting from a dependently typed functional programming environment, I'll make a simplifying but nontrivial assumption - all program development is expressed as a series of changes. For example, if I start from some program f (x : X)(y : Y) = ?
, then change the implementation to g (x : X)(y : Y) = ?
, that change is known to the environment as "rename f
to g
", not "munge a character on line 1".
The entire course of program development, from the empty file, is changes like:
Bike
to Bicycle
vehicles
Airplane
joel@dublin react-haskell (master) $ nix-env -i gnutar | |
installing ‘gnutar-1.27.1’ | |
these derivations will be built: | |
/nix/store/1n01k44qqqzffi17c5cjw5gb41j2mdaa-hook.drv | |
/nix/store/khrfnv769klndplrcs0xncsxxamfldq0-perl-5.20.1.drv | |
/nix/store/23h5p8wix8w1p3fl08p0k4nlscmv8agr-coreutils-8.23.drv | |
/nix/store/mvjsycfh9g3c2xa8v86f0bh9jpnszfql-mirrors-list.drv | |
/nix/store/asw4d872wncdfvw3d9sladp3k0x75m4w-openssl-1.0.1l.drv | |
/nix/store/lhcf41ckdgn37vl76b6pz4g93kw2xyac-zlib-1.2.8.drv | |
/nix/store/bq7zrs2j4ggmvvmriwjhb4krhm1hv4qg-libssh2-1.4.3.drv |
I hereby claim:
To claim this, I am signing this object:
var Button = React.createClass({ | |
render: function() { | |
return this.transferPropsTo(<div style={{ border: "1px solid gray" }} className="button" />); | |
} | |
}); | |
<Button style={{ background-color: "blue" }} className="blue-button" /> | |
-> |