I hereby claim:
- I am bannerets on github.
- I am bannerets (https://keybase.io/bannerets) on keybase.
- I have a public key ASCcsTPX2xVtWOyZpEPt8dSej80ypQgwt2l1zL0bsiexTQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
#!/usr/bin/env node | |
// @flow | |
// https://gist.github.com/Bannerets/cc3ff0689869e6777ee18917388003e8 | |
const fs = require('fs') | |
const jsonfile = process.argv[2] | |
const json = JSON.parse(fs.readFileSync(jsonfile).toString()) |
#!/usr/bin/env node | |
// @flow | |
const fs = require('fs') | |
const jsonfile = process.argv[2] | |
const json = JSON.parse(fs.readFileSync(jsonfile).toString()) | |
/*:: |
use @pony_ctx[Pointer[None] iso]() | |
use @AES_init_ctx[None]( | |
ctx: _AESCTX, | |
key: Pointer[U8 val] tag) | |
use @AES_init_ctx_iv[None]( | |
ctx: _AESCTX, | |
key: Pointer[U8 val] tag, | |
iv: Pointer[U8 val] tag) |
[ignore] | |
[include] | |
[libs] | |
[lints] | |
[options] |
// https://flow.org/try/#0FA4FwTwBwUwAgAoCcYBMBiA7APAWgCoB8cAvHPqcQEYD2NANjAIaYgDG9TAzl3AMI1MYJE2Ro8ROAG9gcOAGooALkQoMOIgG5ZcHW0FdhAVzZgaSOAAplqtFmxEAlNLhgAFgEsuAOiik4fgC+IHIA5jBgYqiWjipR9pJScChgRkiYrp4+QTp6gsJMALZMUA4AjISWAGaYKvhllOSx-PkiUeXEMnJyKWkZmDAA7i1CbWqWAB6N7l6+1ZiTjks6wcHAAPTrcACqXEzhSsD6mIZwXgCiAG4wGWQDwwKjouNTJMRTAKRwAEykJGQABmcmxGBXamCMhSoMCQhCOBjAZy4VxuAGVhP4LtdMN5jgVilBrEwkFwYABJITAraPMFqbCGJAeTChOHHU5QNSY5HY9FIbzhSLjKm2dT04RMlnwk6I2gMfwctCWADk3yVjilXAYMG89BooUssvoVLeriQRhgQA | |
// Contravariant functor. | |
// type Contravariant<-T> = { | |
// contramap<T1>(fn: (T1) => T): Contravariant<T1> | |
// } | |
// See also https://github.com/fantasyland/fantasy-land#contravariant | |
type PredFn<-T> = T => boolean |
/* | |
https://flow.org/try/#0FAFwngDgpgBA8jAvDA3jA2gcgIaYLoBcMAziAE4CWAdgOYwC+MAZKhpgEb5FUCuAtuyhkGMAPSiYAewDWMABQADLADpVXGKuUKYFYjGxUdVACZQAHkICUwYKYDGAG2xlYAN2dSicANw3vcyWVsbn5BMksxCSEySWE5c2g7EChja39A4JJyahoI8SlpPwDldhCBK0iC4HSSolJKWjyoshi4hKgklMsgA | |
*/ | |
type O = { ['a']: string } & { ['b']: number } // ok (`['...']: ...` is an indexer) | |
declare var o: O; | |
;(o.a: number) // error (expected) | |
;(o.a: string) // ok |
[ignore] | |
[include] | |
[libs] | |
[lints] | |
[options] | |
module.system=haste |
Comparison of abstracting over monads in OCaml and Haskell.
Defining monads in OCaml first:
module type Monad = sig
type 'a t
val return : 'a -> 'a t
val (>>=) : 'a t -> ('a -> 'b t) -> 'b t
end
Create a bookmark with this URL:
javascript:void function(){const e="https://hexworld.org/board/#",r=window.location.href,n=r.match(/\/table\?table=(\d+)/),o=r.match(/\/gamereview\?table=(\d+)/),t=r.match(/\/replay\/.*?\/\?table=\d+/);function a(e){return e.match(/\/(\d+\/hex)\?table=(\d+)/)}const i=a(r);let s="";function l(e){let r,n;return e.reduce((e,r)=>[...e,...r.data],[]).map(({type:e,args:o,log:t})=>{if("message"===e&&o.size){o.red&&!r?r=String(o.red):console.warn('No "args.red"');const e=o.size.match(/(\d+)x\d+/);if(e)return e[1]+"c1,"}if("playToken"===e){r||(r=o.player_id);const e=n==o.player_id?":p"+o.coord:o.coord;return n=o.player_id,e}return"swapPieces"===e?(n=o.player_id,":s"):"pass"===e?(n=o.player_id,":p"):"resign"===e||"playerConcedeGame"===e?o.player_id==r?":rb":":rw":void 0}).join("")}function c(e){return fetch(window.location.origin+e,{cache:"no-cache",headers:{"X-Request-Token":s}})}function d(e,r,n){return c(e?`/archive/archive/logs.html?table=${r}`:`/${n}/hex/notificationHistory.ht