This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open BinarySearchTree | |
module List = Belt.List | |
let rec weave = (list1, list2, prefix, results) => | |
switch (list1, list2) { | |
| (list[], _) | (_, list[]) => | |
let everything = List.concatMany([prefix, list1, list2])->List.toArray | |
results->Js.Array2.push(everything)->ignore | |
| (list[hd1, ...tail1], list[hd2, ...tail2]) => |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.file "" | |
.section __TEXT,__literal16,16byte_literals | |
.align 4 | |
_caml_negf_mask: | |
.quad 0x8000000000000000 | |
.quad 0 | |
.align 4 | |
_caml_absf_mask: | |
.quad 0x7fffffffffffffff |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* uncurried function definition */ | |
let add = [@bs] (a, b) => a + b; | |
/* uncurried function application */ | |
let two = [@bs] add(1, 2); | |
/* uncurried callbacks === inline uncurried function definition */ | |
setTimeout([@bs] () => Js.log("test"), 1000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Arguments: | |
/usr/local/bin/node /usr/local/lib/node_modules/esy/node_modules/@esy-ocaml/esy-install/bin/esy-install.js --cache-folder /usr/local/lib/node_modules/esy/bin/../_esyInstallCache-3.x.x install | |
PATH: | |
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin | |
Yarn version: | |
1.2.1013 | |
Node version: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let module Title = React.CreateComponent { | |
type props = string; | |
/* this part is a lot of boilerplate */ | |
type underlyingJsValue = Js.t Js.js_string; | |
let to_js props => Js.string props; | |
let from_js js_props => Js.to_string js_props; | |
/* end of boilerplate */ | |
let render props => H1.make [Text props]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defui RootView | |
static om/IQuery | |
(query [_] | |
[:property]) | |
...) | |
(om/set-query! RootView {:query (om/get-query RootView)}) | |
;; => #object[Error Error: Assert failed: Query violation, [object Object] reuses function etc. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defui OverviewItem | |
static om/Ident | |
(ident [_ {:keys [id]}] | |
[:overview/panels-by-id id]) | |
static om/IQuery | |
(query [this] | |
'[:title :body [:overview/count _]]) | |
Object | |
(render [this] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns om-tutorial.core | |
(:require-macros [cljs.core.async.macros :refer [go]]) | |
(:require [goog.dom :as gdom] | |
[cljs.core.async :as async :refer [<! >! put! chan]] | |
[clojure.string :as string] | |
[om.next :as om :refer-macros [defui]] | |
[om.dom :as dom] | |
[datascript.core :as d] | |
[cognitect.transit :as t]) | |
(:import [goog Uri] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; wrong RootQuery | |
(defui RootView | |
static om/IQueryParams | |
(params [this] | |
{:year (om/get-query Year) | |
:yearTitle (om/get-query YearTitle) | |
:resultQuery (om/get-query ResultList) ;; here I 'stole' the full query from ResultList, doesn't work | |
:selected 2015}) | |
static om/IQuery |