From 4fe03d9cb67edd122d8eb90728a51e2416d76847 Mon Sep 17 00:00:00 2001 From: Paul Biggar Date: Wed, 31 Jul 2019 16:24:04 -0700 Subject: [PATCH 1/4] Add renderCallback --- src-ocaml/tea_app.ml | 13 +++++++++---- src-ocaml/tea_debug.ml | 14 +++++++++++--- src-ocaml/tea_navigation.ml | 2 ++ src-reason/tea_app.re | 36 ++++++++++++++++++++++++++++++------ src-reason/tea_debug.re | 33 ++++++++++++++++++++++++++++----- src-reason/tea_navigation.re | 2 ++ 6 files changed, 82 insertions(+), 18 deletions(-) diff --git a/src-ocaml/tea_app.ml b/src-ocaml/tea_app.ml index 636dc86..a617696 100644 --- a/src-ocaml/tea_app.ml +++ b/src-ocaml/tea_app.ml @@ -33,6 +33,7 @@ type ('flags, 'model, 'msg) program = { init : 'flags -> 'model * 'msg Tea_cmd.t; update : 'model -> 'msg -> 'model * 'msg Tea_cmd.t; view : 'model -> 'msg Vdom.t; + renderCallback: 'model -> unit; subscriptions : 'model -> 'msg Tea_sub.t; shutdown : 'model -> 'msg Tea_cmd.t; } @@ -42,6 +43,7 @@ type ('flags, 'model, 'msg) standardProgram = { init : 'flags -> 'model * 'msg Tea_cmd.t; update : 'model -> 'msg -> 'model * 'msg Tea_cmd.t; view : 'model -> 'msg Vdom.t; + renderCallback: 'model -> unit; subscriptions : 'model -> 'msg Tea_sub.t; } @@ -132,7 +134,7 @@ let programStateWrapper initModel pump shutdown = ~getHtmlString:render_string -let programLoop update view subscriptions initModel initCmd = function +let programLoop update view renderCallback subscriptions initModel initCmd = function | None -> fun callbacks -> let oldSub = ref Tea_sub.none in let handleSubscriptionChange model = @@ -177,6 +179,7 @@ let programLoop update view subscriptions initModel initCmd = function | Some _id -> let newVdom = [view !latestModel] in let justRenderedVdom = Vdom.patchVNodesIntoElement callbacks parentNode !priorRenderedVdom newVdom in + let () = renderCallback !latestModel in let () = priorRenderedVdom := justRenderedVdom in (* let () = Vdom.patchVNodesIntoElement callbacks parentNode !priorRenderedVdom !lastVdom in let () = priorRenderedVdom := (!lastVdom) in *) @@ -256,20 +259,21 @@ let programLoop update view subscriptions initModel initCmd = function let program : ('flags, 'model, 'msg) program -> Web.Node.t Js.null_undefined -> 'flags -> 'msg programInterface = - fun {init; update; view; subscriptions; shutdown} pnode flags -> + fun {init; update; view; renderCallback; subscriptions; shutdown} pnode flags -> let () = Web.polyfills () in let initModel, initCmd = init flags in let opnode = Js.Nullable.toOption pnode in - let pumpInterface = programLoop update view subscriptions initModel initCmd opnode in + let pumpInterface = programLoop update view renderCallback subscriptions initModel initCmd opnode in programStateWrapper initModel pumpInterface shutdown let standardProgram : ('flags, 'model, 'msg) standardProgram -> Web.Node.t Js.null_undefined -> 'flags -> 'msg programInterface = - fun {init; update; view; subscriptions} pnode args -> + fun {init; update; view; renderCallback; subscriptions} pnode args -> program { init = init; update = update; view = view; + renderCallback = renderCallback; subscriptions = subscriptions; shutdown = fun _model -> Tea_cmd.none } pnode args @@ -281,6 +285,7 @@ let beginnerProgram : ('model, 'msg) beginnerProgram -> Web.Node.t Js.null_undef init = (fun () -> (model, Tea_cmd.none)); update = (fun model msg -> (update model msg, Tea_cmd.none)); view = view; + renderCallback= (fun _ -> ()); subscriptions = (fun _model -> Tea_sub.none) } pnode () diff --git a/src-ocaml/tea_debug.ml b/src-ocaml/tea_debug.ml index 8479d3d..5d93fcf 100644 --- a/src-ocaml/tea_debug.ml +++ b/src-ocaml/tea_debug.ml @@ -20,7 +20,7 @@ let debug : ('flags, 'model debug_model, 'msg debug_msg) Tea_app.program = let client_msg msg = ClientMsg msg in - fun string_of_msg { init; update; view; subscriptions; shutdown } -> + fun string_of_msg { init; update; view; renderCallback; subscriptions; shutdown } -> let init' (flags : 'flags) = let cmodel, cmd = init flags in { @@ -245,6 +245,10 @@ let debug : ] in + let renderCallback' model = + model.history |> List.hd |> snd |> renderCallback + in + let subscriptions' model = model.history |> List.hd |> snd |> subscriptions |> Tea_sub.map client_msg in @@ -257,6 +261,7 @@ let debug : init = init'; update = update'; view = view'; + renderCallback = renderCallback'; subscriptions = subscriptions'; shutdown = shutdown'; } @@ -275,6 +280,7 @@ let beginnerProgram : init = (fun () -> model, Tea_cmd.none); update = (fun model msg -> update model msg, Tea_cmd.none); view; + renderCallback= (fun _ -> ()); subscriptions = (fun _model -> Tea_sub.none); shutdown = (fun _model -> Tea_cmd.none); } @@ -287,13 +293,14 @@ let standardProgram : Web.Node.t Js.null_undefined -> 'flags -> 'msg debug_msg Tea_app.programInterface - = fun { init; update; view; subscriptions } string_of_msg pnode flags -> + = fun { init; update; renderCallback; view; subscriptions } string_of_msg pnode flags -> let debugged = debug string_of_msg { init; update; view; + renderCallback; subscriptions; shutdown = (fun _model -> Tea_cmd.none); } @@ -306,13 +313,14 @@ let program : Web.Node.t Js.null_undefined -> 'flags -> 'msg debug_msg Tea_app.programInterface - = fun { init; update; view; subscriptions; shutdown } string_of_msg pnode flags -> + = fun { init; update; view; renderCallback; subscriptions; shutdown } string_of_msg pnode flags -> let debugged = debug string_of_msg { init; update; view; + renderCallback; subscriptions; shutdown; } diff --git a/src-ocaml/tea_navigation.ml b/src-ocaml/tea_navigation.ml index 15021e3..35e4ad7 100644 --- a/src-ocaml/tea_navigation.ml +++ b/src-ocaml/tea_navigation.ml @@ -4,6 +4,7 @@ type ('flags, 'model, 'msg) navigationProgram = ; update : 'model -> 'msg -> 'model * 'msg Tea_cmd.t ; view : 'model -> 'msg Vdom.t ; subscriptions : 'model -> 'msg Tea_sub.t + ; renderCallback : 'model -> unit ; shutdown : 'model -> 'msg Tea_cmd.t } @@ -91,5 +92,6 @@ let navigationProgram locationToMessage stuff = ; update = stuff.update ; view = stuff.view ; subscriptions = subscriptions + ; renderCallback = stuff.renderCallback ; shutdown = stuff.shutdown } diff --git a/src-reason/tea_app.re b/src-reason/tea_app.re index 23ef7c8..141fd0f 100644 --- a/src-reason/tea_app.re +++ b/src-reason/tea_app.re @@ -31,6 +31,7 @@ type program('flags, 'model, 'msg) = { init: 'flags => ('model, Tea_cmd.t('msg)), update: ('model, 'msg) => ('model, Tea_cmd.t('msg)), view: 'model => Vdom.t('msg), + renderCallback: 'model => unit, subscriptions: 'model => Tea_sub.t('msg), shutdown: 'model => Tea_cmd.t('msg), }; @@ -39,6 +40,7 @@ type standardProgram('flags, 'model, 'msg) = { init: 'flags => ('model, Tea_cmd.t('msg)), update: ('model, 'msg) => ('model, Tea_cmd.t('msg)), view: 'model => Vdom.t('msg), + renderCallback: 'model => unit, subscriptions: 'model => Tea_sub.t('msg), }; @@ -58,7 +60,7 @@ type pumpInterface('model, 'msg) = { type programInterface('msg) = {. "pushMsg": 'msg => unit}; [@bs.obj] -external makeProgramInterface : +external makeProgramInterface: ( ~pushMsg: 'msg => unit, ~shutdown: unit => unit, @@ -135,7 +137,8 @@ let programStateWrapper = (initModel, pump, shutdown) => { ); }; -let programLoop = (update, view, subscriptions, initModel, initCmd) => +let programLoop = + (update, view, renderCallback, subscriptions, initModel, initCmd) => fun | None => ( callbacks => { @@ -192,6 +195,7 @@ let programLoop = (update, view, subscriptions, initModel, initCmd) => priorRenderedVdom^, newVdom, ); + let () = renderCallback(latestModel^); let () = priorRenderedVdom := justRenderedVdom; /* let () = Vdom.patchVNodesIntoElement callbacks parentNode !priorRenderedVdom !lastVdom in let () = priorRenderedVdom := (!lastVdom) in */ @@ -290,12 +294,24 @@ let programLoop = (update, view, subscriptions, initModel, initCmd) => let program: (program('flags, 'model, 'msg), Js.null_undefined(Web.Node.t), 'flags) => programInterface('msg) = - ({init, update, view, subscriptions, shutdown}, pnode, flags) => { + ( + {init, update, view, renderCallback, subscriptions, shutdown}, + pnode, + flags, + ) => { let () = Web.polyfills(); let (initModel, initCmd) = init(flags); let opnode = Js.Nullable.toOption(pnode); let pumpInterface = - programLoop(update, view, subscriptions, initModel, initCmd, opnode); + programLoop( + update, + view, + renderCallback, + subscriptions, + initModel, + initCmd, + opnode, + ); programStateWrapper(initModel, pumpInterface, shutdown); }; @@ -306,9 +322,16 @@ let standardProgram: 'flags ) => programInterface('msg) = - ({init, update, view, subscriptions}, pnode, args) => + ({init, update, view, renderCallback, subscriptions}, pnode, args) => program( - {init, update, view, subscriptions, shutdown: _model => Tea_cmd.none}, + { + init, + update, + view, + renderCallback, + subscriptions, + shutdown: _model => Tea_cmd.none, + }, pnode, args, ); @@ -322,6 +345,7 @@ let beginnerProgram: init: () => (model, Tea_cmd.none), update: (model, msg) => (update(model, msg), Tea_cmd.none), view, + renderCallback: _ => (), subscriptions: _model => Tea_sub.none, }, pnode, diff --git a/src-reason/tea_debug.re b/src-reason/tea_debug.re index 67440ff..bbc8af6 100644 --- a/src-reason/tea_debug.re +++ b/src-reason/tea_debug.re @@ -18,7 +18,10 @@ let debug: ('msg => string, Tea_app.program('flags, 'model, 'msg)) => Tea_app.program('flags, debug_model('model), debug_msg('msg)) = { let client_msg = msg => ClientMsg(msg); - (string_of_msg, {init, update, view, subscriptions, shutdown}) => { + ( + string_of_msg, + {init, update, view, renderCallback, subscriptions, shutdown}, + ) => { let init' = (flags: 'flags) => { let (cmodel, cmd) = init(flags); ( @@ -383,6 +386,9 @@ let debug: ); }; + let renderCallback' = model => + model.history |> List.hd |> snd |> renderCallback; + let subscriptions' = model => model.history |> List.hd @@ -397,6 +403,7 @@ let debug: init: init', update: update', view: view', + renderCallback: renderCallback', subscriptions: subscriptions', shutdown: shutdown', }; @@ -419,6 +426,7 @@ let beginnerProgram: init: () => (model, Tea_cmd.none), update: (model, msg) => (update(model, msg), Tea_cmd.none), view, + renderCallback: _ => (), subscriptions: _model => Tea_sub.none, shutdown: _model => Tea_cmd.none, }, @@ -434,11 +442,23 @@ let standardProgram: 'flags ) => Tea_app.programInterface(debug_msg('msg)) = - ({init, update, view, subscriptions}, string_of_msg, pnode, flags) => { + ( + {init, update, renderCallback, view, subscriptions}, + string_of_msg, + pnode, + flags, + ) => { let debugged = debug( string_of_msg, - {init, update, view, subscriptions, shutdown: _model => Tea_cmd.none}, + { + init, + update, + view, + renderCallback, + subscriptions, + shutdown: _model => Tea_cmd.none, + }, ); Tea_app.program(debugged, pnode, flags); }; @@ -452,12 +472,15 @@ let program: ) => Tea_app.programInterface(debug_msg('msg)) = ( - {init, update, view, subscriptions, shutdown}, + {init, update, view, renderCallback, subscriptions, shutdown}, string_of_msg, pnode, flags, ) => { let debugged = - debug(string_of_msg, {init, update, view, subscriptions, shutdown}); + debug( + string_of_msg, + {init, update, view, renderCallback, subscriptions, shutdown}, + ); Tea_app.program(debugged, pnode, flags); }; diff --git a/src-reason/tea_navigation.re b/src-reason/tea_navigation.re index b2ee832..e5bf169 100644 --- a/src-reason/tea_navigation.re +++ b/src-reason/tea_navigation.re @@ -3,6 +3,7 @@ type navigationProgram('flags, 'model, 'msg) = { update: ('model, 'msg) => ('model, Tea_cmd.t('msg)), view: 'model => Vdom.t('msg), subscriptions: 'model => Tea_sub.t('msg), + renderCallback: 'model => unit, shutdown: 'model => Tea_cmd.t('msg), }; @@ -92,6 +93,7 @@ let navigationProgram = (locationToMessage, stuff) => { update: stuff.update, view: stuff.view, subscriptions, + renderCallback: stuff.renderCallback, shutdown: stuff.shutdown, }); }; From 5c70e15f66ac8a177f6ab7e700c6ac334383d588 Mon Sep 17 00:00:00 2001 From: Paul Biggar Date: Wed, 31 Jul 2019 16:47:08 -0700 Subject: [PATCH 2/4] Update tests for renderCallback --- test-ocaml/test_client_counter_debug_program.ml | 3 +++ test-ocaml/test_client_counter_debug_standard.ml | 3 +++ test-ocaml/test_client_drag.ml | 2 ++ test-ocaml/test_client_http_task.ml | 3 +++ test-reason/test_client_counter_debug_program.re | 14 +++++++++++--- test-reason/test_client_counter_debug_standard.re | 7 ++++--- test-reason/test_client_drag.re | 12 ++++++++---- test-reason/test_client_http_task.re | 3 +++ 8 files changed, 37 insertions(+), 10 deletions(-) diff --git a/test-ocaml/test_client_counter_debug_program.ml b/test-ocaml/test_client_counter_debug_program.ml index fbf27ca..0152ee6 100644 --- a/test-ocaml/test_client_counter_debug_program.ml +++ b/test-ocaml/test_client_counter_debug_program.ml @@ -52,11 +52,14 @@ let view model = ; if model <> 0 then view_button "Reset" Reset else noNode ] +let renderCallback _ = () + let main = Tea.Debug.program { init; update; view; subscriptions; + renderCallback; shutdown = (fun _model -> Tea.Cmd.none); } string_of_msg diff --git a/test-ocaml/test_client_counter_debug_standard.ml b/test-ocaml/test_client_counter_debug_standard.ml index d6320a6..bef4cb7 100644 --- a/test-ocaml/test_client_counter_debug_standard.ml +++ b/test-ocaml/test_client_counter_debug_standard.ml @@ -52,10 +52,13 @@ let view model = ; if model <> 0 then view_button "Reset" Reset else noNode ] +let renderCallback _ = () + let main = Tea.Debug.standardProgram { init; update; view; + renderCallback; subscriptions; } string_of_msg diff --git a/test-ocaml/test_client_drag.ml b/test-ocaml/test_client_drag.ml index 767b04a..a77310d 100644 --- a/test-ocaml/test_client_drag.ml +++ b/test-ocaml/test_client_drag.ml @@ -100,11 +100,13 @@ let view model = [ text "Drag Me!" ] +let renderCallback _ = () let main = standardProgram { init; update; view; + renderCallback; subscriptions; } diff --git a/test-ocaml/test_client_http_task.ml b/test-ocaml/test_client_http_task.ml index 661943f..ece7eb6 100644 --- a/test-ocaml/test_client_http_task.ml +++ b/test-ocaml/test_client_http_task.ml @@ -30,10 +30,13 @@ let som = function | GotResponse (Error _) -> "GotResponse Error" | Req -> "Req" +let renderCallback _ = () + let main = Tea.Debug.standardProgram { init = (fun () -> "nothing", Cmd.none); subscriptions = (fun _ -> Sub.none); update; view; + renderCallback; } som diff --git a/test-reason/test_client_counter_debug_program.re b/test-reason/test_client_counter_debug_program.re index 3b4f3be..102e58c 100644 --- a/test-reason/test_client_counter_debug_program.re +++ b/test-reason/test_client_counter_debug_program.re @@ -1,5 +1,4 @@ open Tea.App; - open Tea.Html; type msg = @@ -17,7 +16,7 @@ let string_of_msg = let init = () => (4, Tea.Cmd.none); -let subscriptions = (_) => Tea.Sub.none; +let subscriptions = _ => Tea.Sub.none; let update = model => fun @@ -55,8 +54,17 @@ let view = model => ], ); +let renderCallback = _ => (); + let main = Tea.Debug.program( - {init, update, view, subscriptions, shutdown: _model => Tea.Cmd.none}, + { + init, + update, + view, + subscriptions, + renderCallback, + shutdown: _model => Tea.Cmd.none, + }, string_of_msg, ); diff --git a/test-reason/test_client_counter_debug_standard.re b/test-reason/test_client_counter_debug_standard.re index 8312582..6010eab 100644 --- a/test-reason/test_client_counter_debug_standard.re +++ b/test-reason/test_client_counter_debug_standard.re @@ -1,5 +1,4 @@ open Tea.App; - open Tea.Html; type msg = @@ -17,7 +16,7 @@ let string_of_msg = let init = () => (4, Tea.Cmd.none); -let subscriptions = (_) => Tea.Sub.none; +let subscriptions = _ => Tea.Sub.none; let update = model => fun @@ -55,8 +54,10 @@ let view = model => ], ); +let renderCallback = _ => (); + let main = Tea.Debug.standardProgram( - {init, update, view, subscriptions}, + {init, update, view, renderCallback, subscriptions}, string_of_msg, ); diff --git a/test-reason/test_client_drag.re b/test-reason/test_client_drag.re index bde3af1..d5e2f2f 100644 --- a/test-reason/test_client_drag.re +++ b/test-reason/test_client_drag.re @@ -1,9 +1,6 @@ open Tea; - open Tea.App; - open Tea.Html; - open Tea.Mouse; [@bs.deriving {accessors: accessors}] @@ -33,6 +30,7 @@ let init = () => ({ let getPosition = ({position, drag}) => switch (drag) { | None => position + | Some({start, current}) => { x: position.x + current.x - start.x, y: position.y + current.y - start.y, @@ -42,6 +40,7 @@ let getPosition = ({position, drag}) => let updateHelp = ({position} as model) => fun | DragStart(xy) => {position, drag: Some({start: xy, current: xy})} + | DragAt(xy) => { position, drag: @@ -50,6 +49,7 @@ let updateHelp = ({position} as model) => | Some(drag) => Some({...drag, current: xy}) }, } + | DragEnd(_) => {position: getPosition(model), drag: None}; let update = (model, msg) => (updateHelp(model, msg), Cmd.none); @@ -57,6 +57,7 @@ let update = (model, msg) => (updateHelp(model, msg), Cmd.none); let subscriptions = model => switch (model.drag) { | None => Sub.none + | Some(_) => Sub.batch([Mouse.moves(dragAt), Mouse.ups(dragEnd)]) }; @@ -92,4 +93,7 @@ let view = model => { ); }; -let main = standardProgram({init, update, view, subscriptions}); +let renderCallback = _ => (); + +let main = + standardProgram({init, update, view, renderCallback, subscriptions}); diff --git a/test-reason/test_client_http_task.re b/test-reason/test_client_http_task.re index c435e5b..441a2eb 100644 --- a/test-reason/test_client_http_task.re +++ b/test-reason/test_client_http_task.re @@ -36,6 +36,8 @@ let som = | GotResponse(Error(_)) => "GotResponse Error" | Req => "Req"; +let renderCallback = _ => (); + let main = Tea.Debug.standardProgram( { @@ -43,6 +45,7 @@ let main = subscriptions: _ => Sub.none, update, view, + renderCallback, }, som, ); From 621ffcbbdceb862e216f339fc7b2cd20e2c00888 Mon Sep 17 00:00:00 2001 From: Paul Biggar Date: Wed, 31 Jul 2019 16:48:40 -0700 Subject: [PATCH 3/4] Regenerate committed build artifacts --- lib/js/src-ocaml/tea.js | 2 +- lib/js/src-ocaml/tea_animationframe.js | 2 +- lib/js/src-ocaml/tea_app.js | 21 +- lib/js/src-ocaml/tea_cmd.js | 2 +- lib/js/src-ocaml/tea_debug.js | 22 +- lib/js/src-ocaml/tea_ex.js | 2 +- lib/js/src-ocaml/tea_html.js | 10 +- lib/js/src-ocaml/tea_html2.js | 14 +- lib/js/src-ocaml/tea_html_cmds.js | 2 +- lib/js/src-ocaml/tea_http.js | 20 +- lib/js/src-ocaml/tea_json.js | 43 +- lib/js/src-ocaml/tea_mouse.js | 6 +- lib/js/src-ocaml/tea_navigation.js | 8 +- lib/js/src-ocaml/tea_program.js | 8 +- lib/js/src-ocaml/tea_promise.js | 6 +- lib/js/src-ocaml/tea_random.js | 2 +- lib/js/src-ocaml/tea_result.js | 16 +- lib/js/src-ocaml/tea_sub.js | 2 +- lib/js/src-ocaml/tea_svg.js | 2 +- lib/js/src-ocaml/tea_svg_attributes.js | 2 +- lib/js/src-ocaml/tea_svg_events.js | 2 +- lib/js/src-ocaml/tea_task.js | 14 +- lib/js/src-ocaml/tea_time.js | 2 +- lib/js/src-ocaml/vdom.js | 8 +- lib/js/src-ocaml/web.js | 2 +- lib/js/src-ocaml/web_date.js | 2 +- lib/js/src-ocaml/web_document.js | 2 +- lib/js/src-ocaml/web_event.js | 2 +- lib/js/src-ocaml/web_formdata.js | 2 +- lib/js/src-ocaml/web_json.js | 2 +- lib/js/src-ocaml/web_location.js | 2 +- lib/js/src-ocaml/web_node.js | 2 +- lib/js/src-ocaml/web_window.js | 2 +- lib/js/src-ocaml/web_window_history.js | 2 +- lib/js/src-ocaml/web_window_localstorage.js | 16 +- lib/js/src-ocaml/web_xmlhttprequest.js | 16 +- lib/js/test-ocaml/app_test_client.js | 1794 +++++++++-------- lib/js/test-ocaml/test_client.js | 2 +- .../test_client_attribute_removal.js | 6 +- .../test-ocaml/test_client_btn_update_span.js | 2 +- lib/js/test-ocaml/test_client_counter.js | 2 +- .../test_client_counter_debug_beginner.js | 2 +- .../test_client_counter_debug_program.js | 12 +- .../test_client_counter_debug_standard.js | 8 +- lib/js/test-ocaml/test_client_drag.js | 8 +- lib/js/test-ocaml/test_client_http_task.js | 12 +- .../test-ocaml/test_client_on_with_options.js | 2 +- lib/js/test-ocaml/tester.js | 2 +- 48 files changed, 1108 insertions(+), 1014 deletions(-) diff --git a/lib/js/src-ocaml/tea.js b/lib/js/src-ocaml/tea.js index 0a6def7..ee8faf7 100644 --- a/lib/js/src-ocaml/tea.js +++ b/lib/js/src-ocaml/tea.js @@ -1,4 +1,4 @@ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; diff --git a/lib/js/src-ocaml/tea_animationframe.js b/lib/js/src-ocaml/tea_animationframe.js index c277f73..336f15f 100644 --- a/lib/js/src-ocaml/tea_animationframe.js +++ b/lib/js/src-ocaml/tea_animationframe.js @@ -1,4 +1,4 @@ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; var Curry = require("bs-platform/lib/js/curry.js"); diff --git a/lib/js/src-ocaml/tea_app.js b/lib/js/src-ocaml/tea_app.js index 82407bc..fa8df9f 100644 --- a/lib/js/src-ocaml/tea_app.js +++ b/lib/js/src-ocaml/tea_app.js @@ -1,4 +1,4 @@ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; var Web = require("./web.js"); @@ -7,7 +7,7 @@ var Vdom = require("./vdom.js"); var Curry = require("bs-platform/lib/js/curry.js"); var Tea_cmd = require("./tea_cmd.js"); var Tea_sub = require("./tea_sub.js"); -var Caml_option = require("bs-platform/lib/js/caml_option.js"); +var Js_primitive = require("bs-platform/lib/js/js_primitive.js"); var Caml_builtin_exceptions = require("bs-platform/lib/js/caml_builtin_exceptions.js"); function programStateWrapper(initModel, pump, shutdown) { @@ -70,9 +70,9 @@ function programStateWrapper(initModel, pump, shutdown) { }; } -function programLoop(update, view, subscriptions, initModel, initCmd, param) { +function programLoop(update, view, renderCallback, subscriptions, initModel, initCmd, param) { if (param !== undefined) { - var parentNode = Caml_option.valFromOption(param); + var parentNode = Js_primitive.valFromOption(param); return (function (callbacks) { var priorRenderedVdom = /* record */[/* contents : [] */0]; var latestModel = /* record */[/* contents */initModel]; @@ -86,6 +86,7 @@ function programLoop(update, view, subscriptions, initModel, initCmd, param) { /* [] */0 ]; var justRenderedVdom = Vdom.patchVNodesIntoElement(callbacks, parentNode, priorRenderedVdom[0], newVdom); + Curry._1(renderCallback, latestModel[0]); priorRenderedVdom[0] = justRenderedVdom; nextFrameID[0] = undefined; return /* () */0; @@ -192,9 +193,9 @@ function program(param, pnode, flags) { Web.polyfills(/* () */0); var match = Curry._1(param[/* init */0], flags); var initModel = match[0]; - var opnode = (pnode == null) ? undefined : Caml_option.some(pnode); - var pumpInterface = programLoop(param[/* update */1], param[/* view */2], param[/* subscriptions */3], initModel, match[1], opnode); - return programStateWrapper(initModel, pumpInterface, param[/* shutdown */4]); + var opnode = (pnode == null) ? undefined : Js_primitive.some(pnode); + var pumpInterface = programLoop(param[/* update */1], param[/* view */2], param[/* renderCallback */3], param[/* subscriptions */4], initModel, match[1], opnode); + return programStateWrapper(initModel, pumpInterface, param[/* shutdown */5]); } function standardProgram(param, pnode, args) { @@ -202,7 +203,8 @@ function standardProgram(param, pnode, args) { /* init */param[/* init */0], /* update */param[/* update */1], /* view */param[/* view */2], - /* subscriptions */param[/* subscriptions */3], + /* renderCallback */param[/* renderCallback */3], + /* subscriptions */param[/* subscriptions */4], /* shutdown */(function (_model) { return /* NoCmd */0; }) @@ -226,6 +228,9 @@ function beginnerProgram(param, pnode, param$1) { ]; }), /* view */param[/* view */2], + /* renderCallback */(function (param) { + return /* () */0; + }), /* subscriptions */(function (_model) { return /* NoSub */0; }) diff --git a/lib/js/src-ocaml/tea_cmd.js b/lib/js/src-ocaml/tea_cmd.js index f121cea..e94aba0 100644 --- a/lib/js/src-ocaml/tea_cmd.js +++ b/lib/js/src-ocaml/tea_cmd.js @@ -1,4 +1,4 @@ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; var List = require("bs-platform/lib/js/list.js"); diff --git a/lib/js/src-ocaml/tea_debug.js b/lib/js/src-ocaml/tea_debug.js index 7b8db6d..1e83d7c 100644 --- a/lib/js/src-ocaml/tea_debug.js +++ b/lib/js/src-ocaml/tea_debug.js @@ -1,4 +1,4 @@ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; var List = require("bs-platform/lib/js/list.js"); @@ -17,8 +17,9 @@ function client_msg(msg) { } function debug(string_of_msg, param) { - var shutdown = param[/* shutdown */4]; - var subscriptions = param[/* subscriptions */3]; + var shutdown = param[/* shutdown */5]; + var subscriptions = param[/* subscriptions */4]; + var renderCallback = param[/* renderCallback */3]; var view = param[/* view */2]; var update = param[/* update */1]; var init = param[/* init */0]; @@ -885,6 +886,9 @@ function debug(string_of_msg, param) { ] ]); }; + var renderCallback$prime = function (model) { + return Curry._1(renderCallback, List.hd(model[/* history */0])[1]); + }; var subscriptions$prime = function (model) { return Tea_sub.map(client_msg, Curry._1(subscriptions, List.hd(model[/* history */0])[1])); }; @@ -895,6 +899,7 @@ function debug(string_of_msg, param) { /* init */init$prime, /* update */update$prime, /* view */view$prime, + /* renderCallback */renderCallback$prime, /* subscriptions */subscriptions$prime, /* shutdown */shutdown$prime ]; @@ -917,6 +922,9 @@ function beginnerProgram(param, string_of_msg, pnode, flags) { ]; }), /* view */param[/* view */2], + /* renderCallback */(function (param) { + return /* () */0; + }), /* subscriptions */(function (_model) { return /* NoSub */0; }), @@ -932,7 +940,8 @@ function standardProgram(param, string_of_msg, pnode, flags) { /* init */param[/* init */0], /* update */param[/* update */1], /* view */param[/* view */2], - /* subscriptions */param[/* subscriptions */3], + /* renderCallback */param[/* renderCallback */3], + /* subscriptions */param[/* subscriptions */4], /* shutdown */(function (_model) { return /* NoCmd */0; }) @@ -945,8 +954,9 @@ function program(param, string_of_msg, pnode, flags) { /* init */param[/* init */0], /* update */param[/* update */1], /* view */param[/* view */2], - /* subscriptions */param[/* subscriptions */3], - /* shutdown */param[/* shutdown */4] + /* renderCallback */param[/* renderCallback */3], + /* subscriptions */param[/* subscriptions */4], + /* shutdown */param[/* shutdown */5] ]); return Tea_app.program(debugged, pnode, flags); } diff --git a/lib/js/src-ocaml/tea_ex.js b/lib/js/src-ocaml/tea_ex.js index a9d992b..b22a7a0 100644 --- a/lib/js/src-ocaml/tea_ex.js +++ b/lib/js/src-ocaml/tea_ex.js @@ -1,4 +1,4 @@ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; var Block = require("bs-platform/lib/js/block.js"); diff --git a/lib/js/src-ocaml/tea_html.js b/lib/js/src-ocaml/tea_html.js index df0b355..9d98203 100644 --- a/lib/js/src-ocaml/tea_html.js +++ b/lib/js/src-ocaml/tea_html.js @@ -1,4 +1,4 @@ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; var List = require("bs-platform/lib/js/list.js"); @@ -9,7 +9,7 @@ var $$String = require("bs-platform/lib/js/string.js"); var Tea_app = require("./tea_app.js"); var Tea_json = require("./tea_json.js"); var Tea_result = require("./tea_result.js"); -var Caml_option = require("bs-platform/lib/js/caml_option.js"); +var Js_primitive = require("bs-platform/lib/js/js_primitive.js"); function text(str) { return /* Text */Block.__(1, [str]); @@ -754,7 +754,7 @@ function onInputOpt($staropt$star, msg) { function onInput($staropt$star, msg) { var key = $staropt$star !== undefined ? $staropt$star : ""; return onInputOpt(key, (function (ev) { - return Caml_option.some(Curry._1(msg, ev)); + return Js_primitive.some(Curry._1(msg, ev)); })); } @@ -777,7 +777,7 @@ function onChangeOpt($staropt$star, msg) { function onChange($staropt$star, msg) { var key = $staropt$star !== undefined ? $staropt$star : ""; return onChangeOpt(key, (function (ev) { - return Caml_option.some(Curry._1(msg, ev)); + return Js_primitive.some(Curry._1(msg, ev)); })); } @@ -816,7 +816,7 @@ function onCheckOpt($staropt$star, msg) { function onCheck($staropt$star, msg) { var key = $staropt$star !== undefined ? $staropt$star : ""; return onCheckOpt(key, (function (ev) { - return Caml_option.some(Curry._1(msg, ev)); + return Js_primitive.some(Curry._1(msg, ev)); })); } diff --git a/lib/js/src-ocaml/tea_html2.js b/lib/js/src-ocaml/tea_html2.js index eb21432..f1882ed 100644 --- a/lib/js/src-ocaml/tea_html2.js +++ b/lib/js/src-ocaml/tea_html2.js @@ -1,4 +1,4 @@ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; var List = require("bs-platform/lib/js/list.js"); @@ -10,8 +10,8 @@ var $$String = require("bs-platform/lib/js/string.js"); var Tea_app = require("./tea_app.js"); var Tea_html = require("./tea_html.js"); var Tea_json = require("./tea_json.js"); -var Caml_bytes = require("bs-platform/lib/js/caml_bytes.js"); -var Caml_option = require("bs-platform/lib/js/caml_option.js"); +var Caml_string = require("bs-platform/lib/js/caml_string.js"); +var Js_primitive = require("bs-platform/lib/js/js_primitive.js"); function text(str) { return /* Text */Block.__(1, [str]); @@ -1318,7 +1318,7 @@ function scoped(value) { function accesskey(ch) { return /* RawProp */Block.__(0, [ "accesskey", - Caml_bytes.bytes_to_string(Bytes.make(1, ch)) + Caml_string.bytes_to_string(Bytes.make(1, ch)) ]); } @@ -1607,7 +1607,7 @@ function onInputOpt($staropt$star, msg) { function onInput($staropt$star, msg) { var key = $staropt$star !== undefined ? $staropt$star : ""; return onInputOpt(key, (function (ev) { - return Caml_option.some(Curry._1(msg, ev)); + return Js_primitive.some(Curry._1(msg, ev)); })); } @@ -1630,7 +1630,7 @@ function onCheckOpt($staropt$star, msg) { function onCheck($staropt$star, msg) { var key = $staropt$star !== undefined ? $staropt$star : ""; return onCheckOpt(key, (function (ev) { - return Caml_option.some(Curry._1(msg, ev)); + return Js_primitive.some(Curry._1(msg, ev)); })); } @@ -1653,7 +1653,7 @@ function onChangeOpt($staropt$star, msg) { function onChange($staropt$star, msg) { var key = $staropt$star !== undefined ? $staropt$star : ""; return onChangeOpt(key, (function (ev) { - return Caml_option.some(Curry._1(msg, ev)); + return Js_primitive.some(Curry._1(msg, ev)); })); } diff --git a/lib/js/src-ocaml/tea_html_cmds.js b/lib/js/src-ocaml/tea_html_cmds.js index 8063a7b..e745cdb 100644 --- a/lib/js/src-ocaml/tea_html_cmds.js +++ b/lib/js/src-ocaml/tea_html_cmds.js @@ -1,4 +1,4 @@ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; var Block = require("bs-platform/lib/js/block.js"); diff --git a/lib/js/src-ocaml/tea_http.js b/lib/js/src-ocaml/tea_http.js index 13d1c94..12bea42 100644 --- a/lib/js/src-ocaml/tea_http.js +++ b/lib/js/src-ocaml/tea_http.js @@ -1,11 +1,11 @@ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; var List = require("bs-platform/lib/js/list.js"); var Block = require("bs-platform/lib/js/block.js"); var Curry = require("bs-platform/lib/js/curry.js"); var Tea_json = require("./tea_json.js"); -var Caml_option = require("bs-platform/lib/js/caml_option.js"); +var Js_primitive = require("bs-platform/lib/js/js_primitive.js"); var Caml_primitive = require("bs-platform/lib/js/caml_primitive.js"); var Web_xmlhttprequest = require("./web_xmlhttprequest.js"); var Caml_builtin_exceptions = require("bs-platform/lib/js/caml_builtin_exceptions.js"); @@ -394,7 +394,7 @@ function toTask(param) { }; var concat_or_join = function (t1, v, d, t2) { if (d !== undefined) { - return join(t1, v, Caml_option.valFromOption(d), t2); + return join(t1, v, Js_primitive.valFromOption(d), t2); } else { return concat(t1, t2); } @@ -409,7 +409,7 @@ function toTask(param) { if (c === 0) { return /* tuple */[ l, - Caml_option.some(d), + Js_primitive.some(d), r ]; } else if (c < 0) { @@ -441,7 +441,7 @@ function toTask(param) { var v1 = s1[1]; if (s1[4] >= height(s2)) { var match = split(v1, s2); - return concat_or_join(merge(f, s1[0], match[0]), v1, Curry._3(f, v1, Caml_option.some(s1[2]), match[1]), merge(f, s1[3], match[2])); + return concat_or_join(merge(f, s1[0], match[0]), v1, Curry._3(f, v1, Js_primitive.some(s1[2]), match[1]), merge(f, s1[3], match[2])); } else { exit = 1; } @@ -454,7 +454,7 @@ function toTask(param) { if (s2) { var v2 = s2[1]; var match$1 = split(v2, s1); - return concat_or_join(merge(f, match$1[0], s2[0]), v2, Curry._3(f, v2, match$1[1], Caml_option.some(s2[2])), merge(f, match$1[2], s2[3])); + return concat_or_join(merge(f, match$1[0], s2[0]), v2, Curry._3(f, v2, match$1[1], Js_primitive.some(s2[2])), merge(f, match$1[2], s2[3])); } else { throw [ Caml_builtin_exceptions.assert_failure, @@ -947,7 +947,7 @@ function send(resultToMessage, param) { }; var concat_or_join = function (t1, v, d, t2) { if (d !== undefined) { - return join(t1, v, Caml_option.valFromOption(d), t2); + return join(t1, v, Js_primitive.valFromOption(d), t2); } else { return concat(t1, t2); } @@ -962,7 +962,7 @@ function send(resultToMessage, param) { if (c === 0) { return /* tuple */[ l, - Caml_option.some(d), + Js_primitive.some(d), r ]; } else if (c < 0) { @@ -994,7 +994,7 @@ function send(resultToMessage, param) { var v1 = s1[1]; if (s1[4] >= height(s2)) { var match = split(v1, s2); - return concat_or_join(merge(f, s1[0], match[0]), v1, Curry._3(f, v1, Caml_option.some(s1[2]), match[1]), merge(f, s1[3], match[2])); + return concat_or_join(merge(f, s1[0], match[0]), v1, Curry._3(f, v1, Js_primitive.some(s1[2]), match[1]), merge(f, s1[3], match[2])); } else { exit = 1; } @@ -1007,7 +1007,7 @@ function send(resultToMessage, param) { if (s2) { var v2 = s2[1]; var match$1 = split(v2, s1); - return concat_or_join(merge(f, match$1[0], s2[0]), v2, Curry._3(f, v2, match$1[1], Caml_option.some(s2[2])), merge(f, match$1[2], s2[3])); + return concat_or_join(merge(f, match$1[0], s2[0]), v2, Curry._3(f, v2, match$1[1], Js_primitive.some(s2[2])), merge(f, match$1[2], s2[3])); } else { throw [ Caml_builtin_exceptions.assert_failure, diff --git a/lib/js/src-ocaml/tea_json.js b/lib/js/src-ocaml/tea_json.js index 2b126df..489d1d9 100644 --- a/lib/js/src-ocaml/tea_json.js +++ b/lib/js/src-ocaml/tea_json.js @@ -1,19 +1,18 @@ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; var List = require("bs-platform/lib/js/list.js"); var $$Array = require("bs-platform/lib/js/array.js"); var Block = require("bs-platform/lib/js/block.js"); var Curry = require("bs-platform/lib/js/curry.js"); -var Js_dict = require("bs-platform/lib/js/js_dict.js"); +var Js_exn = require("bs-platform/lib/js/js_exn.js"); var Web_json = require("./web_json.js"); var Caml_array = require("bs-platform/lib/js/caml_array.js"); var Pervasives = require("bs-platform/lib/js/pervasives.js"); var Tea_result = require("./tea_result.js"); -var Caml_option = require("bs-platform/lib/js/caml_option.js"); +var Js_primitive = require("bs-platform/lib/js/js_primitive.js"); var Caml_primitive = require("bs-platform/lib/js/caml_primitive.js"); var Caml_exceptions = require("bs-platform/lib/js/caml_exceptions.js"); -var Caml_js_exceptions = require("bs-platform/lib/js/caml_js_exceptions.js"); var Caml_builtin_exceptions = require("bs-platform/lib/js/caml_builtin_exceptions.js"); function height(param) { @@ -409,7 +408,7 @@ function concat(t1, t2) { function concat_or_join(t1, v, d, t2) { if (d !== undefined) { - return join(t1, v, Caml_option.valFromOption(d), t2); + return join(t1, v, Js_primitive.valFromOption(d), t2); } else { return concat(t1, t2); } @@ -425,7 +424,7 @@ function split(x, param) { if (c === 0) { return /* tuple */[ l, - Caml_option.some(d), + Js_primitive.some(d), r ]; } else if (c < 0) { @@ -458,7 +457,7 @@ function merge(f, s1, s2) { var v1 = s1[1]; if (s1[4] >= height(s2)) { var match = split(v1, s2); - return concat_or_join(merge(f, s1[0], match[0]), v1, Curry._3(f, v1, Caml_option.some(s1[2]), match[1]), merge(f, s1[3], match[2])); + return concat_or_join(merge(f, s1[0], match[0]), v1, Curry._3(f, v1, Js_primitive.some(s1[2]), match[1]), merge(f, s1[3], match[2])); } else { exit = 1; } @@ -471,7 +470,7 @@ function merge(f, s1, s2) { if (s2) { var v2 = s2[1]; var match$1 = split(v2, s1); - return concat_or_join(merge(f, match$1[0], s2[0]), v2, Curry._3(f, v2, match$1[1], Caml_option.some(s2[2])), merge(f, match$1[2], s2[3])); + return concat_or_join(merge(f, match$1[0], s2[0]), v2, Curry._3(f, v2, match$1[1], Js_primitive.some(s2[2])), merge(f, match$1[2], s2[3])); } else { throw [ Caml_builtin_exceptions.assert_failure, @@ -749,7 +748,7 @@ function list(param) { return /* Ok */Block.__(0, [List.map(parse, $$Array.to_list(match[0]))]); } catch (raw_exn){ - var exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + var exn = Js_exn.internalToOCamlException(raw_exn); if (exn[0] === ParseFail) { return /* Error */Block.__(1, ["list -> " + exn[1]]); } else { @@ -782,7 +781,7 @@ function array(param) { return /* Ok */Block.__(0, [$$Array.map(parse, match[0])]); } catch (raw_exn){ - var exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + var exn = Js_exn.internalToOCamlException(raw_exn); if (exn[0] === ParseFail) { return /* Error */Block.__(1, ["array -> " + exn[1]]); } else { @@ -803,9 +802,9 @@ function keyValuePairs(param) { var o = match[0]; var keys = Object.keys(o); var parse = function (k, l) { - var match = Js_dict.get(o, k); + var match = o[k]; if (match !== undefined) { - var match$1 = Curry._1(decoder, Caml_option.valFromOption(match)); + var match$1 = Curry._1(decoder, match); if (match$1.tag) { throw [ ParseFail, @@ -831,7 +830,7 @@ function keyValuePairs(param) { return /* Ok */Block.__(0, [$$Array.fold_right(parse, keys, /* [] */0)]); } catch (raw_exn){ - var exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + var exn = Js_exn.internalToOCamlException(raw_exn); if (exn[0] === ParseFail) { return /* Error */Block.__(1, ["Invalid keyValuePair parsing: " + exn[1]]); } else { @@ -852,9 +851,9 @@ function dict(param) { var o = match[0]; var keys = Object.keys(o); var parse = function (k, d) { - var match = Js_dict.get(o, k); + var match = o[k]; if (match !== undefined) { - var match$1 = Curry._1(decoder, Caml_option.valFromOption(match)); + var match$1 = Curry._1(decoder, match); if (match$1.tag) { throw [ ParseFail, @@ -874,7 +873,7 @@ function dict(param) { return /* Ok */Block.__(0, [$$Array.fold_right(parse, keys, /* Empty */0)]); } catch (raw_exn){ - var exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + var exn = Js_exn.internalToOCamlException(raw_exn); if (exn[0] === ParseFail) { return /* Error */Block.__(1, ["Invalid dict parsing: " + exn[1]]); } else { @@ -892,9 +891,9 @@ function field(key, param) { if (typeof match === "number" || match.tag !== 2) { return /* Error */Block.__(1, ["Non-fieldable value"]); } else { - var match$1 = Js_dict.get(match[0], key); + var match$1 = match[0][key]; if (match$1 !== undefined) { - var o = Curry._1(decoder, Caml_option.valFromOption(match$1)); + var o = Curry._1(decoder, match$1); if (o.tag) { return /* Error */Block.__(1, ["field `" + (key + ("` -> " + o[0]))]); } else { @@ -935,7 +934,7 @@ function maybe(param) { if (match.tag) { return /* Ok */Block.__(0, [undefined]); } else { - return /* Ok */Block.__(0, [Caml_option.some(match[0])]); + return /* Ok */Block.__(0, [Js_primitive.some(match[0])]); } })]; } @@ -1251,7 +1250,7 @@ function nullable(decoder) { $$null(undefined), /* :: */[ map$1((function (v) { - return Caml_option.some(v); + return Js_primitive.some(v); }), decoder), /* [] */0 ] @@ -1263,7 +1262,7 @@ function decodeValue(param, value) { return Curry._1(param[0], value); } catch (raw_exn){ - var exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + var exn = Js_exn.internalToOCamlException(raw_exn); if (exn[0] === ParseFail) { return /* Error */Block.__(1, [exn[1]]); } else { @@ -1277,7 +1276,7 @@ function decodeEvent(param, value) { return Curry._1(param[0], value); } catch (raw_exn){ - var exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + var exn = Js_exn.internalToOCamlException(raw_exn); if (exn[0] === ParseFail) { return /* Error */Block.__(1, [exn[1]]); } else { diff --git a/lib/js/src-ocaml/tea_mouse.js b/lib/js/src-ocaml/tea_mouse.js index 6e63ec2..04f0ddd 100644 --- a/lib/js/src-ocaml/tea_mouse.js +++ b/lib/js/src-ocaml/tea_mouse.js @@ -1,4 +1,4 @@ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; var Vdom = require("./vdom.js"); @@ -6,7 +6,7 @@ var Block = require("bs-platform/lib/js/block.js"); var Curry = require("bs-platform/lib/js/curry.js"); var Tea_sub = require("./tea_sub.js"); var Tea_json = require("./tea_json.js"); -var Caml_option = require("bs-platform/lib/js/caml_option.js"); +var Js_primitive = require("bs-platform/lib/js/js_primitive.js"); var position = Tea_json.Decoder[/* map2 */17]((function (x, y) { return /* record */[ @@ -23,7 +23,7 @@ function registerGlobal(name, key, tagger) { if (match.tag) { return undefined; } else { - return Caml_option.some(Curry._1(tagger, match[0])); + return Js_primitive.some(Curry._1(tagger, match[0])); } }; var handler = /* EventHandlerCallback */Block.__(0, [ diff --git a/lib/js/src-ocaml/tea_navigation.js b/lib/js/src-ocaml/tea_navigation.js index 05df621..e741784 100644 --- a/lib/js/src-ocaml/tea_navigation.js +++ b/lib/js/src-ocaml/tea_navigation.js @@ -1,4 +1,4 @@ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; var Block = require("bs-platform/lib/js/block.js"); @@ -98,13 +98,15 @@ function navigationProgram(locationToMessage, stuff) { }; var partial_arg_001 = /* update */stuff[/* update */1]; var partial_arg_002 = /* view */stuff[/* view */2]; - var partial_arg_004 = /* shutdown */stuff[/* shutdown */4]; + var partial_arg_003 = /* renderCallback */stuff[/* renderCallback */4]; + var partial_arg_005 = /* shutdown */stuff[/* shutdown */5]; var partial_arg = /* record */[ /* init */init, partial_arg_001, partial_arg_002, + partial_arg_003, /* subscriptions */subscriptions, - partial_arg_004 + partial_arg_005 ]; return (function (param, param$1) { return Tea_app.program(partial_arg, param, param$1); diff --git a/lib/js/src-ocaml/tea_program.js b/lib/js/src-ocaml/tea_program.js index bd9b500..36375a2 100644 --- a/lib/js/src-ocaml/tea_program.js +++ b/lib/js/src-ocaml/tea_program.js @@ -1,15 +1,15 @@ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; var Curry = require("bs-platform/lib/js/curry.js"); -var Caml_option = require("bs-platform/lib/js/caml_option.js"); +var Js_primitive = require("bs-platform/lib/js/js_primitive.js"); function spawn(initState, update, shutdown) { - var state = /* record */[/* contents */Caml_option.some(initState)]; + var state = /* record */[/* contents */Js_primitive.some(initState)]; return (function (procMsg) { var match = state[0]; if (match !== undefined) { - var model = Caml_option.valFromOption(match); + var model = Js_primitive.valFromOption(match); if (procMsg) { state[0] = Curry._2(update, model, procMsg[0]); return /* () */0; diff --git a/lib/js/src-ocaml/tea_promise.js b/lib/js/src-ocaml/tea_promise.js index 5eb7b6a..217e3ff 100644 --- a/lib/js/src-ocaml/tea_promise.js +++ b/lib/js/src-ocaml/tea_promise.js @@ -1,16 +1,16 @@ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; var Block = require("bs-platform/lib/js/block.js"); var Curry = require("bs-platform/lib/js/curry.js"); -var Caml_option = require("bs-platform/lib/js/caml_option.js"); +var Js_primitive = require("bs-platform/lib/js/js_primitive.js"); function cmd(promise, tagger) { return /* EnqueueCall */Block.__(2, [(function (callbacks) { promise.then((function (res) { var match = Curry._1(tagger, res); if (match !== undefined) { - Curry._1(callbacks[0][/* enqueue */0], Caml_option.valFromOption(match)); + Curry._1(callbacks[0][/* enqueue */0], Js_primitive.valFromOption(match)); return Promise.resolve(/* () */0); } else { return Promise.resolve(/* () */0); diff --git a/lib/js/src-ocaml/tea_random.js b/lib/js/src-ocaml/tea_random.js index 232147b..24bab97 100644 --- a/lib/js/src-ocaml/tea_random.js +++ b/lib/js/src-ocaml/tea_random.js @@ -1,4 +1,4 @@ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; var Block = require("bs-platform/lib/js/block.js"); diff --git a/lib/js/src-ocaml/tea_result.js b/lib/js/src-ocaml/tea_result.js index 756c856..4462729 100644 --- a/lib/js/src-ocaml/tea_result.js +++ b/lib/js/src-ocaml/tea_result.js @@ -1,15 +1,15 @@ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; var Block = require("bs-platform/lib/js/block.js"); -var Caml_option = require("bs-platform/lib/js/caml_option.js"); +var Js_primitive = require("bs-platform/lib/js/js_primitive.js"); var Caml_builtin_exceptions = require("bs-platform/lib/js/caml_builtin_exceptions.js"); function result_to_option(param) { if (param.tag) { return undefined; } else { - return Caml_option.some(param[0]); + return Js_primitive.some(param[0]); } } @@ -17,7 +17,7 @@ function option_of_result(param) { if (param.tag) { return undefined; } else { - return Caml_option.some(param[0]); + return Js_primitive.some(param[0]); } } @@ -25,13 +25,13 @@ function ok(param) { if (param.tag) { return undefined; } else { - return Caml_option.some(param[0]); + return Js_primitive.some(param[0]); } } function error(param) { if (param.tag) { - return Caml_option.some(param[0]); + return Js_primitive.some(param[0]); } } @@ -102,7 +102,7 @@ function error_of_any(_param) { if (param) { var hd = param[0]; if (hd.tag) { - return Caml_option.some(hd[0]); + return Js_primitive.some(hd[0]); } else { _param = param[1]; continue ; @@ -115,7 +115,7 @@ function error_of_any(_param) { function error_of_first(fst, param) { if (param.tag) { - return Caml_option.some(param[0]); + return Js_primitive.some(param[0]); } else { return error(fst); } diff --git a/lib/js/src-ocaml/tea_sub.js b/lib/js/src-ocaml/tea_sub.js index 563cab3..aab6291 100644 --- a/lib/js/src-ocaml/tea_sub.js +++ b/lib/js/src-ocaml/tea_sub.js @@ -1,4 +1,4 @@ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; var List = require("bs-platform/lib/js/list.js"); diff --git a/lib/js/src-ocaml/tea_svg.js b/lib/js/src-ocaml/tea_svg.js index 5a4a986..7524894 100644 --- a/lib/js/src-ocaml/tea_svg.js +++ b/lib/js/src-ocaml/tea_svg.js @@ -1,4 +1,4 @@ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; var Vdom = require("./vdom.js"); diff --git a/lib/js/src-ocaml/tea_svg_attributes.js b/lib/js/src-ocaml/tea_svg_attributes.js index 8d7e6c1..15a0844 100644 --- a/lib/js/src-ocaml/tea_svg_attributes.js +++ b/lib/js/src-ocaml/tea_svg_attributes.js @@ -1,4 +1,4 @@ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; var Block = require("bs-platform/lib/js/block.js"); diff --git a/lib/js/src-ocaml/tea_svg_events.js b/lib/js/src-ocaml/tea_svg_events.js index c7c99f3..86fc0f7 100644 --- a/lib/js/src-ocaml/tea_svg_events.js +++ b/lib/js/src-ocaml/tea_svg_events.js @@ -1,2 +1,2 @@ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE /* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ diff --git a/lib/js/src-ocaml/tea_task.js b/lib/js/src-ocaml/tea_task.js index 76e3c98..f9055db 100644 --- a/lib/js/src-ocaml/tea_task.js +++ b/lib/js/src-ocaml/tea_task.js @@ -1,11 +1,11 @@ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; var Block = require("bs-platform/lib/js/block.js"); var Curry = require("bs-platform/lib/js/curry.js"); var Caml_obj = require("bs-platform/lib/js/caml_obj.js"); var Pervasives = require("bs-platform/lib/js/pervasives.js"); -var Caml_option = require("bs-platform/lib/js/caml_option.js"); +var Js_primitive = require("bs-platform/lib/js/js_primitive.js"); var Caml_builtin_exceptions = require("bs-platform/lib/js/caml_builtin_exceptions.js"); function nothing(param) { @@ -24,7 +24,7 @@ function performOpt(toOptionalMessage, param) { } else { var match = Curry._1(toOptionalMessage, param[0]); if (match !== undefined) { - return Curry._1(callbacks[0][/* enqueue */0], Caml_option.valFromOption(match)); + return Curry._1(callbacks[0][/* enqueue */0], Js_primitive.valFromOption(match)); } else { return /* () */0; } @@ -35,7 +35,7 @@ function performOpt(toOptionalMessage, param) { function perform(toMessage, task) { return performOpt((function (v) { - return Caml_option.some(Curry._1(toMessage, v)); + return Js_primitive.some(Curry._1(toMessage, v)); }), task); } @@ -45,7 +45,7 @@ function attemptOpt(resultToOptionalMessage, param) { return Curry._1(task, (function (value) { var match = Curry._1(resultToOptionalMessage, value); if (match !== undefined) { - return Curry._1(callbacks[0][/* enqueue */0], Caml_option.valFromOption(match)); + return Curry._1(callbacks[0][/* enqueue */0], Js_primitive.valFromOption(match)); } else { return /* () */0; } @@ -55,7 +55,7 @@ function attemptOpt(resultToOptionalMessage, param) { function attempt(resultToMessage, task) { return attemptOpt((function (v) { - return Caml_option.some(Curry._1(resultToMessage, v)); + return Js_primitive.some(Curry._1(resultToMessage, v)); }), task); } @@ -138,7 +138,7 @@ function toOption(task) { return Curry._1(cb, /* Ok */Block.__(0, [undefined])); })]; }), andThen((function (v) { - var value = Caml_option.some(v); + var value = Js_primitive.some(v); return /* Task */[(function (cb) { return Curry._1(cb, /* Ok */Block.__(0, [value])); })]; diff --git a/lib/js/src-ocaml/tea_time.js b/lib/js/src-ocaml/tea_time.js index 30ac53e..971c8e2 100644 --- a/lib/js/src-ocaml/tea_time.js +++ b/lib/js/src-ocaml/tea_time.js @@ -1,4 +1,4 @@ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; var Block = require("bs-platform/lib/js/block.js"); diff --git a/lib/js/src-ocaml/vdom.js b/lib/js/src-ocaml/vdom.js index b2fecce..e9e678d 100644 --- a/lib/js/src-ocaml/vdom.js +++ b/lib/js/src-ocaml/vdom.js @@ -1,4 +1,4 @@ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; var List = require("bs-platform/lib/js/list.js"); @@ -8,7 +8,7 @@ var $$String = require("bs-platform/lib/js/string.js"); var Caml_obj = require("bs-platform/lib/js/caml_obj.js"); var Web_node = require("./web_node.js"); var Caml_array = require("bs-platform/lib/js/caml_array.js"); -var Caml_option = require("bs-platform/lib/js/caml_option.js"); +var Js_primitive = require("bs-platform/lib/js/js_primitive.js"); var Web_document = require("./web_document.js"); var Caml_builtin_exceptions = require("bs-platform/lib/js/caml_builtin_exceptions.js"); @@ -255,7 +255,7 @@ function eventHandler(callbacks, cb) { return (function (ev) { var match = Curry._1(cb[0], ev); if (match !== undefined) { - return Curry._1(callbacks[0][/* enqueue */0], Caml_option.valFromOption(match)); + return Curry._1(callbacks[0][/* enqueue */0], Js_primitive.valFromOption(match)); } else { return /* () */0; } @@ -266,7 +266,7 @@ function eventHandler_GetCB(param) { if (param.tag) { var msg = param[0]; return (function (_ev) { - return Caml_option.some(msg); + return Js_primitive.some(msg); }); } else { return param[1]; diff --git a/lib/js/src-ocaml/web.js b/lib/js/src-ocaml/web.js index 3ff2228..6627b2d 100644 --- a/lib/js/src-ocaml/web.js +++ b/lib/js/src-ocaml/web.js @@ -1,4 +1,4 @@ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; var Web_node = require("./web_node.js"); diff --git a/lib/js/src-ocaml/web_date.js b/lib/js/src-ocaml/web_date.js index f0087f0..390efc3 100644 --- a/lib/js/src-ocaml/web_date.js +++ b/lib/js/src-ocaml/web_date.js @@ -1,4 +1,4 @@ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; diff --git a/lib/js/src-ocaml/web_document.js b/lib/js/src-ocaml/web_document.js index 4e7a8be..5ab3670 100644 --- a/lib/js/src-ocaml/web_document.js +++ b/lib/js/src-ocaml/web_document.js @@ -1,4 +1,4 @@ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; diff --git a/lib/js/src-ocaml/web_event.js b/lib/js/src-ocaml/web_event.js index c7c99f3..86fc0f7 100644 --- a/lib/js/src-ocaml/web_event.js +++ b/lib/js/src-ocaml/web_event.js @@ -1,2 +1,2 @@ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE /* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ diff --git a/lib/js/src-ocaml/web_formdata.js b/lib/js/src-ocaml/web_formdata.js index 966efc8..4445e6e 100644 --- a/lib/js/src-ocaml/web_formdata.js +++ b/lib/js/src-ocaml/web_formdata.js @@ -1,4 +1,4 @@ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; diff --git a/lib/js/src-ocaml/web_json.js b/lib/js/src-ocaml/web_json.js index 1334e1f..8503a19 100644 --- a/lib/js/src-ocaml/web_json.js +++ b/lib/js/src-ocaml/web_json.js @@ -1,4 +1,4 @@ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; var Js_json = require("bs-platform/lib/js/js_json.js"); diff --git a/lib/js/src-ocaml/web_location.js b/lib/js/src-ocaml/web_location.js index 3f93e51..4de4af5 100644 --- a/lib/js/src-ocaml/web_location.js +++ b/lib/js/src-ocaml/web_location.js @@ -1,4 +1,4 @@ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; diff --git a/lib/js/src-ocaml/web_node.js b/lib/js/src-ocaml/web_node.js index 674bb03..c014086 100644 --- a/lib/js/src-ocaml/web_node.js +++ b/lib/js/src-ocaml/web_node.js @@ -1,4 +1,4 @@ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; diff --git a/lib/js/src-ocaml/web_window.js b/lib/js/src-ocaml/web_window.js index efbc2bc..1eb055f 100644 --- a/lib/js/src-ocaml/web_window.js +++ b/lib/js/src-ocaml/web_window.js @@ -1,4 +1,4 @@ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; diff --git a/lib/js/src-ocaml/web_window_history.js b/lib/js/src-ocaml/web_window_history.js index 86cf375..00482de 100644 --- a/lib/js/src-ocaml/web_window_history.js +++ b/lib/js/src-ocaml/web_window_history.js @@ -1,4 +1,4 @@ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; diff --git a/lib/js/src-ocaml/web_window_localstorage.js b/lib/js/src-ocaml/web_window_localstorage.js index cbf31ca..9c9bf95 100644 --- a/lib/js/src-ocaml/web_window_localstorage.js +++ b/lib/js/src-ocaml/web_window_localstorage.js @@ -1,12 +1,12 @@ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; -var Caml_option = require("bs-platform/lib/js/caml_option.js"); +var Js_primitive = require("bs-platform/lib/js/js_primitive.js"); function length($$window) { var match = $$window.localStorage; if (match !== undefined) { - return Caml_option.some(match.length); + return Js_primitive.some(match.length); } } @@ -14,7 +14,7 @@ function length($$window) { function clear($$window) { var match = $$window.localStorage; if (match !== undefined) { - return Caml_option.some(match.clear()); + return Js_primitive.some(match.clear()); } } @@ -22,7 +22,7 @@ function clear($$window) { function key($$window, idx) { var match = $$window.localStorage; if (match !== undefined) { - return Caml_option.some(match.key(idx)); + return Js_primitive.some(match.key(idx)); } } @@ -31,7 +31,7 @@ function getItem($$window, key) { var match = $$window.localStorage; if (match !== undefined) { try { - return Caml_option.some(match.getItem(key)); + return Js_primitive.some(match.getItem(key)); } catch (exn){ return undefined; @@ -43,7 +43,7 @@ function getItem($$window, key) { function removeItem($$window, key) { var match = $$window.localStorage; if (match !== undefined) { - return Caml_option.some(match.removeItem(key)); + return Js_primitive.some(match.removeItem(key)); } } @@ -51,7 +51,7 @@ function removeItem($$window, key) { function setItem($$window, key, value) { var match = $$window.localStorage; if (match !== undefined) { - return Caml_option.some(match.setItem(key, value)); + return Js_primitive.some(match.setItem(key, value)); } } diff --git a/lib/js/src-ocaml/web_xmlhttprequest.js b/lib/js/src-ocaml/web_xmlhttprequest.js index 185a969..320a67d 100644 --- a/lib/js/src-ocaml/web_xmlhttprequest.js +++ b/lib/js/src-ocaml/web_xmlhttprequest.js @@ -1,11 +1,11 @@ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; var List = require("bs-platform/lib/js/list.js"); var $$Array = require("bs-platform/lib/js/array.js"); var Block = require("bs-platform/lib/js/block.js"); var Curry = require("bs-platform/lib/js/curry.js"); -var Caml_option = require("bs-platform/lib/js/caml_option.js"); +var Js_primitive = require("bs-platform/lib/js/js_primitive.js"); var Web_formdata = require("./web_formdata.js"); var Caml_primitive = require("bs-platform/lib/js/caml_primitive.js"); var Caml_builtin_exceptions = require("bs-platform/lib/js/caml_builtin_exceptions.js"); @@ -368,7 +368,7 @@ function getAllResponseHeadersAsDict(x) { }; var concat_or_join = function (t1, v, d, t2) { if (d !== undefined) { - return join(t1, v, Caml_option.valFromOption(d), t2); + return join(t1, v, Js_primitive.valFromOption(d), t2); } else { return concat(t1, t2); } @@ -383,7 +383,7 @@ function getAllResponseHeadersAsDict(x) { if (c === 0) { return /* tuple */[ l, - Caml_option.some(d), + Js_primitive.some(d), r ]; } else if (c < 0) { @@ -415,7 +415,7 @@ function getAllResponseHeadersAsDict(x) { var v1 = s1[1]; if (s1[4] >= height(s2)) { var match = split(v1, s2); - return concat_or_join(merge(f, s1[0], match[0]), v1, Curry._3(f, v1, Caml_option.some(s1[2]), match[1]), merge(f, s1[3], match[2])); + return concat_or_join(merge(f, s1[0], match[0]), v1, Curry._3(f, v1, Js_primitive.some(s1[2]), match[1]), merge(f, s1[3], match[2])); } else { exit = 1; } @@ -428,7 +428,7 @@ function getAllResponseHeadersAsDict(x) { if (s2) { var v2 = s2[1]; var match$1 = split(v2, s1); - return concat_or_join(merge(f, match$1[0], s2[0]), v2, Curry._3(f, v2, match$1[1], Caml_option.some(s2[2])), merge(f, match$1[2], s2[3])); + return concat_or_join(merge(f, match$1[0], s2[0]), v2, Curry._3(f, v2, match$1[1], Js_primitive.some(s2[2])), merge(f, match$1[2], s2[3])); } else { throw [ Caml_builtin_exceptions.assert_failure, @@ -525,7 +525,7 @@ function getAllResponseHeadersAsDict(x) { } function getResponseHeader(key, x) { - return Caml_option.null_to_opt(x.getResponse(key)); + return Js_primitive.null_to_opt(x.getResponse(key)); } function open_(method$prime, url, $staropt$star, $staropt$star$1, $staropt$star$2, x) { @@ -680,7 +680,7 @@ function get_responseURL(x) { } function get_responseXML(x) { - return Caml_option.null_to_opt(x.responseXML); + return Js_primitive.null_to_opt(x.responseXML); } function get_status(x) { diff --git a/lib/js/test-ocaml/app_test_client.js b/lib/js/test-ocaml/app_test_client.js index 0707787..10bb3ed 100644 --- a/lib/js/test-ocaml/app_test_client.js +++ b/lib/js/test-ocaml/app_test_client.js @@ -1,5 +1,5 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Test_client = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o= height(s2)) { var match = split(v1, s2); - return concat_or_join(merge(f, s1[0], match[0]), v1, Curry._3(f, v1, Caml_option.some(s1[2]), match[1]), merge(f, s1[3], match[2])); + return concat_or_join(merge(f, s1[0], match[0]), v1, Curry._3(f, v1, Js_primitive.some(s1[2]), match[1]), merge(f, s1[3], match[2])); } else { exit = 1; } @@ -4762,7 +4777,7 @@ function toTask(param) { if (s2) { var v2 = s2[1]; var match$1 = split(v2, s1); - return concat_or_join(merge(f, match$1[0], s2[0]), v2, Curry._3(f, v2, match$1[1], Caml_option.some(s2[2])), merge(f, match$1[2], s2[3])); + return concat_or_join(merge(f, match$1[0], s2[0]), v2, Curry._3(f, v2, match$1[1], Js_primitive.some(s2[2])), merge(f, match$1[2], s2[3])); } else { throw [ Caml_builtin_exceptions.assert_failure, @@ -5255,7 +5270,7 @@ function send(resultToMessage, param) { }; var concat_or_join = function (t1, v, d, t2) { if (d !== undefined) { - return join(t1, v, Caml_option.valFromOption(d), t2); + return join(t1, v, Js_primitive.valFromOption(d), t2); } else { return concat(t1, t2); } @@ -5270,7 +5285,7 @@ function send(resultToMessage, param) { if (c === 0) { return /* tuple */[ l, - Caml_option.some(d), + Js_primitive.some(d), r ]; } else if (c < 0) { @@ -5302,7 +5317,7 @@ function send(resultToMessage, param) { var v1 = s1[1]; if (s1[4] >= height(s2)) { var match = split(v1, s2); - return concat_or_join(merge(f, s1[0], match[0]), v1, Curry._3(f, v1, Caml_option.some(s1[2]), match[1]), merge(f, s1[3], match[2])); + return concat_or_join(merge(f, s1[0], match[0]), v1, Curry._3(f, v1, Js_primitive.some(s1[2]), match[1]), merge(f, s1[3], match[2])); } else { exit = 1; } @@ -5315,7 +5330,7 @@ function send(resultToMessage, param) { if (s2) { var v2 = s2[1]; var match$1 = split(v2, s1); - return concat_or_join(merge(f, match$1[0], s2[0]), v2, Curry._3(f, v2, match$1[1], Caml_option.some(s2[2])), merge(f, match$1[2], s2[3])); + return concat_or_join(merge(f, match$1[0], s2[0]), v2, Curry._3(f, v2, match$1[1], Js_primitive.some(s2[2])), merge(f, match$1[2], s2[3])); } else { throw [ Caml_builtin_exceptions.assert_failure, @@ -5579,23 +5594,22 @@ exports.decodeUri = decodeUri; exports.Progress = Progress; /* expectString Not a pure module */ -},{"./tea_json.js":8,"./web_xmlhttprequest.js":21,"bs-platform/lib/js/block.js":33,"bs-platform/lib/js/caml_builtin_exceptions.js":37,"bs-platform/lib/js/caml_option.js":47,"bs-platform/lib/js/caml_primitive.js":48,"bs-platform/lib/js/curry.js":55,"bs-platform/lib/js/list.js":58}],8:[function(require,module,exports){ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +},{"./tea_json.js":8,"./web_xmlhttprequest.js":21,"bs-platform/lib/js/block.js":33,"bs-platform/lib/js/caml_builtin_exceptions.js":37,"bs-platform/lib/js/caml_primitive.js":47,"bs-platform/lib/js/curry.js":54,"bs-platform/lib/js/js_primitive.js":57,"bs-platform/lib/js/list.js":58}],8:[function(require,module,exports){ +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; var List = require("bs-platform/lib/js/list.js"); var $$Array = require("bs-platform/lib/js/array.js"); var Block = require("bs-platform/lib/js/block.js"); var Curry = require("bs-platform/lib/js/curry.js"); -var Js_dict = require("bs-platform/lib/js/js_dict.js"); +var Js_exn = require("bs-platform/lib/js/js_exn.js"); var Web_json = require("./web_json.js"); var Caml_array = require("bs-platform/lib/js/caml_array.js"); var Pervasives = require("bs-platform/lib/js/pervasives.js"); var Tea_result = require("./tea_result.js"); -var Caml_option = require("bs-platform/lib/js/caml_option.js"); +var Js_primitive = require("bs-platform/lib/js/js_primitive.js"); var Caml_primitive = require("bs-platform/lib/js/caml_primitive.js"); var Caml_exceptions = require("bs-platform/lib/js/caml_exceptions.js"); -var Caml_js_exceptions = require("bs-platform/lib/js/caml_js_exceptions.js"); var Caml_builtin_exceptions = require("bs-platform/lib/js/caml_builtin_exceptions.js"); function height(param) { @@ -5991,7 +6005,7 @@ function concat(t1, t2) { function concat_or_join(t1, v, d, t2) { if (d !== undefined) { - return join(t1, v, Caml_option.valFromOption(d), t2); + return join(t1, v, Js_primitive.valFromOption(d), t2); } else { return concat(t1, t2); } @@ -6007,7 +6021,7 @@ function split(x, param) { if (c === 0) { return /* tuple */[ l, - Caml_option.some(d), + Js_primitive.some(d), r ]; } else if (c < 0) { @@ -6040,7 +6054,7 @@ function merge(f, s1, s2) { var v1 = s1[1]; if (s1[4] >= height(s2)) { var match = split(v1, s2); - return concat_or_join(merge(f, s1[0], match[0]), v1, Curry._3(f, v1, Caml_option.some(s1[2]), match[1]), merge(f, s1[3], match[2])); + return concat_or_join(merge(f, s1[0], match[0]), v1, Curry._3(f, v1, Js_primitive.some(s1[2]), match[1]), merge(f, s1[3], match[2])); } else { exit = 1; } @@ -6053,7 +6067,7 @@ function merge(f, s1, s2) { if (s2) { var v2 = s2[1]; var match$1 = split(v2, s1); - return concat_or_join(merge(f, match$1[0], s2[0]), v2, Curry._3(f, v2, match$1[1], Caml_option.some(s2[2])), merge(f, match$1[2], s2[3])); + return concat_or_join(merge(f, match$1[0], s2[0]), v2, Curry._3(f, v2, match$1[1], Js_primitive.some(s2[2])), merge(f, match$1[2], s2[3])); } else { throw [ Caml_builtin_exceptions.assert_failure, @@ -6331,7 +6345,7 @@ function list(param) { return /* Ok */Block.__(0, [List.map(parse, $$Array.to_list(match[0]))]); } catch (raw_exn){ - var exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + var exn = Js_exn.internalToOCamlException(raw_exn); if (exn[0] === ParseFail) { return /* Error */Block.__(1, ["list -> " + exn[1]]); } else { @@ -6364,7 +6378,7 @@ function array(param) { return /* Ok */Block.__(0, [$$Array.map(parse, match[0])]); } catch (raw_exn){ - var exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + var exn = Js_exn.internalToOCamlException(raw_exn); if (exn[0] === ParseFail) { return /* Error */Block.__(1, ["array -> " + exn[1]]); } else { @@ -6385,9 +6399,9 @@ function keyValuePairs(param) { var o = match[0]; var keys = Object.keys(o); var parse = function (k, l) { - var match = Js_dict.get(o, k); + var match = o[k]; if (match !== undefined) { - var match$1 = Curry._1(decoder, Caml_option.valFromOption(match)); + var match$1 = Curry._1(decoder, match); if (match$1.tag) { throw [ ParseFail, @@ -6413,7 +6427,7 @@ function keyValuePairs(param) { return /* Ok */Block.__(0, [$$Array.fold_right(parse, keys, /* [] */0)]); } catch (raw_exn){ - var exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + var exn = Js_exn.internalToOCamlException(raw_exn); if (exn[0] === ParseFail) { return /* Error */Block.__(1, ["Invalid keyValuePair parsing: " + exn[1]]); } else { @@ -6434,9 +6448,9 @@ function dict(param) { var o = match[0]; var keys = Object.keys(o); var parse = function (k, d) { - var match = Js_dict.get(o, k); + var match = o[k]; if (match !== undefined) { - var match$1 = Curry._1(decoder, Caml_option.valFromOption(match)); + var match$1 = Curry._1(decoder, match); if (match$1.tag) { throw [ ParseFail, @@ -6456,7 +6470,7 @@ function dict(param) { return /* Ok */Block.__(0, [$$Array.fold_right(parse, keys, /* Empty */0)]); } catch (raw_exn){ - var exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + var exn = Js_exn.internalToOCamlException(raw_exn); if (exn[0] === ParseFail) { return /* Error */Block.__(1, ["Invalid dict parsing: " + exn[1]]); } else { @@ -6474,9 +6488,9 @@ function field(key, param) { if (typeof match === "number" || match.tag !== 2) { return /* Error */Block.__(1, ["Non-fieldable value"]); } else { - var match$1 = Js_dict.get(match[0], key); + var match$1 = match[0][key]; if (match$1 !== undefined) { - var o = Curry._1(decoder, Caml_option.valFromOption(match$1)); + var o = Curry._1(decoder, match$1); if (o.tag) { return /* Error */Block.__(1, ["field `" + (key + ("` -> " + o[0]))]); } else { @@ -6517,7 +6531,7 @@ function maybe(param) { if (match.tag) { return /* Ok */Block.__(0, [undefined]); } else { - return /* Ok */Block.__(0, [Caml_option.some(match[0])]); + return /* Ok */Block.__(0, [Js_primitive.some(match[0])]); } })]; } @@ -6833,7 +6847,7 @@ function nullable(decoder) { $$null(undefined), /* :: */[ map$1((function (v) { - return Caml_option.some(v); + return Js_primitive.some(v); }), decoder), /* [] */0 ] @@ -6845,7 +6859,7 @@ function decodeValue(param, value) { return Curry._1(param[0], value); } catch (raw_exn){ - var exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + var exn = Js_exn.internalToOCamlException(raw_exn); if (exn[0] === ParseFail) { return /* Error */Block.__(1, [exn[1]]); } else { @@ -6859,7 +6873,7 @@ function decodeEvent(param, value) { return Curry._1(param[0], value); } catch (raw_exn){ - var exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + var exn = Js_exn.internalToOCamlException(raw_exn); if (exn[0] === ParseFail) { return /* Error */Block.__(1, [exn[1]]); } else { @@ -6964,8 +6978,8 @@ exports.Decoder = Decoder; exports.Encoder = Encoder; /* No side effect */ -},{"./tea_result.js":10,"./web_json.js":17,"bs-platform/lib/js/array.js":32,"bs-platform/lib/js/block.js":33,"bs-platform/lib/js/caml_array.js":36,"bs-platform/lib/js/caml_builtin_exceptions.js":37,"bs-platform/lib/js/caml_exceptions.js":39,"bs-platform/lib/js/caml_js_exceptions.js":44,"bs-platform/lib/js/caml_option.js":47,"bs-platform/lib/js/caml_primitive.js":48,"bs-platform/lib/js/curry.js":55,"bs-platform/lib/js/js_dict.js":56,"bs-platform/lib/js/list.js":58,"bs-platform/lib/js/pervasives.js":59}],9:[function(require,module,exports){ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +},{"./tea_result.js":10,"./web_json.js":17,"bs-platform/lib/js/array.js":32,"bs-platform/lib/js/block.js":33,"bs-platform/lib/js/caml_array.js":36,"bs-platform/lib/js/caml_builtin_exceptions.js":37,"bs-platform/lib/js/caml_exceptions.js":39,"bs-platform/lib/js/caml_primitive.js":47,"bs-platform/lib/js/curry.js":54,"bs-platform/lib/js/js_exn.js":55,"bs-platform/lib/js/js_primitive.js":57,"bs-platform/lib/js/list.js":58,"bs-platform/lib/js/pervasives.js":59}],9:[function(require,module,exports){ +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; var Vdom = require("./vdom.js"); @@ -6973,7 +6987,7 @@ var Block = require("bs-platform/lib/js/block.js"); var Curry = require("bs-platform/lib/js/curry.js"); var Tea_sub = require("./tea_sub.js"); var Tea_json = require("./tea_json.js"); -var Caml_option = require("bs-platform/lib/js/caml_option.js"); +var Js_primitive = require("bs-platform/lib/js/js_primitive.js"); var position = Tea_json.Decoder[/* map2 */17]((function (x, y) { return /* record */[ @@ -6990,7 +7004,7 @@ function registerGlobal(name, key, tagger) { if (match.tag) { return undefined; } else { - return Caml_option.some(Curry._1(tagger, match[0])); + return Js_primitive.some(Curry._1(tagger, match[0])); } }; var handler = /* EventHandlerCallback */Block.__(0, [ @@ -7035,19 +7049,19 @@ exports.downs = downs; exports.ups = ups; /* position Not a pure module */ -},{"./tea_json.js":8,"./tea_sub.js":11,"./vdom.js":13,"bs-platform/lib/js/block.js":33,"bs-platform/lib/js/caml_option.js":47,"bs-platform/lib/js/curry.js":55}],10:[function(require,module,exports){ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +},{"./tea_json.js":8,"./tea_sub.js":11,"./vdom.js":13,"bs-platform/lib/js/block.js":33,"bs-platform/lib/js/curry.js":54,"bs-platform/lib/js/js_primitive.js":57}],10:[function(require,module,exports){ +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; var Block = require("bs-platform/lib/js/block.js"); -var Caml_option = require("bs-platform/lib/js/caml_option.js"); +var Js_primitive = require("bs-platform/lib/js/js_primitive.js"); var Caml_builtin_exceptions = require("bs-platform/lib/js/caml_builtin_exceptions.js"); function result_to_option(param) { if (param.tag) { return undefined; } else { - return Caml_option.some(param[0]); + return Js_primitive.some(param[0]); } } @@ -7055,7 +7069,7 @@ function option_of_result(param) { if (param.tag) { return undefined; } else { - return Caml_option.some(param[0]); + return Js_primitive.some(param[0]); } } @@ -7063,13 +7077,13 @@ function ok(param) { if (param.tag) { return undefined; } else { - return Caml_option.some(param[0]); + return Js_primitive.some(param[0]); } } function error(param) { if (param.tag) { - return Caml_option.some(param[0]); + return Js_primitive.some(param[0]); } } @@ -7140,7 +7154,7 @@ function error_of_any(_param) { if (param) { var hd = param[0]; if (hd.tag) { - return Caml_option.some(hd[0]); + return Js_primitive.some(hd[0]); } else { _param = param[1]; continue ; @@ -7153,7 +7167,7 @@ function error_of_any(_param) { function error_of_first(fst, param) { if (param.tag) { - return Caml_option.some(param[0]); + return Js_primitive.some(param[0]); } else { return error(fst); } @@ -7170,8 +7184,8 @@ exports.error_of_any = error_of_any; exports.error_of_first = error_of_first; /* No side effect */ -},{"bs-platform/lib/js/block.js":33,"bs-platform/lib/js/caml_builtin_exceptions.js":37,"bs-platform/lib/js/caml_option.js":47}],11:[function(require,module,exports){ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +},{"bs-platform/lib/js/block.js":33,"bs-platform/lib/js/caml_builtin_exceptions.js":37,"bs-platform/lib/js/js_primitive.js":57}],11:[function(require,module,exports){ +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; var List = require("bs-platform/lib/js/list.js"); @@ -7366,15 +7380,15 @@ exports.mapFunc = mapFunc; exports.run = run; /* No side effect */ -},{"bs-platform/lib/js/block.js":33,"bs-platform/lib/js/curry.js":55,"bs-platform/lib/js/list.js":58}],12:[function(require,module,exports){ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +},{"bs-platform/lib/js/block.js":33,"bs-platform/lib/js/curry.js":54,"bs-platform/lib/js/list.js":58}],12:[function(require,module,exports){ +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; var Block = require("bs-platform/lib/js/block.js"); var Curry = require("bs-platform/lib/js/curry.js"); var Caml_obj = require("bs-platform/lib/js/caml_obj.js"); var Pervasives = require("bs-platform/lib/js/pervasives.js"); -var Caml_option = require("bs-platform/lib/js/caml_option.js"); +var Js_primitive = require("bs-platform/lib/js/js_primitive.js"); var Caml_builtin_exceptions = require("bs-platform/lib/js/caml_builtin_exceptions.js"); function nothing(param) { @@ -7393,7 +7407,7 @@ function performOpt(toOptionalMessage, param) { } else { var match = Curry._1(toOptionalMessage, param[0]); if (match !== undefined) { - return Curry._1(callbacks[0][/* enqueue */0], Caml_option.valFromOption(match)); + return Curry._1(callbacks[0][/* enqueue */0], Js_primitive.valFromOption(match)); } else { return /* () */0; } @@ -7404,7 +7418,7 @@ function performOpt(toOptionalMessage, param) { function perform(toMessage, task) { return performOpt((function (v) { - return Caml_option.some(Curry._1(toMessage, v)); + return Js_primitive.some(Curry._1(toMessage, v)); }), task); } @@ -7414,7 +7428,7 @@ function attemptOpt(resultToOptionalMessage, param) { return Curry._1(task, (function (value) { var match = Curry._1(resultToOptionalMessage, value); if (match !== undefined) { - return Curry._1(callbacks[0][/* enqueue */0], Caml_option.valFromOption(match)); + return Curry._1(callbacks[0][/* enqueue */0], Js_primitive.valFromOption(match)); } else { return /* () */0; } @@ -7424,7 +7438,7 @@ function attemptOpt(resultToOptionalMessage, param) { function attempt(resultToMessage, task) { return attemptOpt((function (v) { - return Caml_option.some(Curry._1(resultToMessage, v)); + return Js_primitive.some(Curry._1(resultToMessage, v)); }), task); } @@ -7507,7 +7521,7 @@ function toOption(task) { return Curry._1(cb, /* Ok */Block.__(0, [undefined])); })]; }), andThen((function (v) { - var value = Caml_option.some(v); + var value = Js_primitive.some(v); return /* Task */[(function (cb) { return Curry._1(cb, /* Ok */Block.__(0, [value])); })]; @@ -7836,8 +7850,8 @@ exports.testing_deop = testing_deop; exports.testing = testing; /* No side effect */ -},{"bs-platform/lib/js/block.js":33,"bs-platform/lib/js/caml_builtin_exceptions.js":37,"bs-platform/lib/js/caml_obj.js":46,"bs-platform/lib/js/caml_option.js":47,"bs-platform/lib/js/curry.js":55,"bs-platform/lib/js/pervasives.js":59}],13:[function(require,module,exports){ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +},{"bs-platform/lib/js/block.js":33,"bs-platform/lib/js/caml_builtin_exceptions.js":37,"bs-platform/lib/js/caml_obj.js":46,"bs-platform/lib/js/curry.js":54,"bs-platform/lib/js/js_primitive.js":57,"bs-platform/lib/js/pervasives.js":59}],13:[function(require,module,exports){ +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; var List = require("bs-platform/lib/js/list.js"); @@ -7847,7 +7861,7 @@ var $$String = require("bs-platform/lib/js/string.js"); var Caml_obj = require("bs-platform/lib/js/caml_obj.js"); var Web_node = require("./web_node.js"); var Caml_array = require("bs-platform/lib/js/caml_array.js"); -var Caml_option = require("bs-platform/lib/js/caml_option.js"); +var Js_primitive = require("bs-platform/lib/js/js_primitive.js"); var Web_document = require("./web_document.js"); var Caml_builtin_exceptions = require("bs-platform/lib/js/caml_builtin_exceptions.js"); @@ -8094,7 +8108,7 @@ function eventHandler(callbacks, cb) { return (function (ev) { var match = Curry._1(cb[0], ev); if (match !== undefined) { - return Curry._1(callbacks[0][/* enqueue */0], Caml_option.valFromOption(match)); + return Curry._1(callbacks[0][/* enqueue */0], Js_primitive.valFromOption(match)); } else { return /* () */0; } @@ -8105,7 +8119,7 @@ function eventHandler_GetCB(param) { if (param.tag) { var msg = param[0]; return (function (_ev) { - return Caml_option.some(msg); + return Js_primitive.some(msg); }); } else { return param[1]; @@ -8929,8 +8943,8 @@ exports.wrapCallbacks = wrapCallbacks; exports.map = map; /* No side effect */ -},{"./web_document.js":15,"./web_node.js":18,"bs-platform/lib/js/block.js":33,"bs-platform/lib/js/caml_array.js":36,"bs-platform/lib/js/caml_builtin_exceptions.js":37,"bs-platform/lib/js/caml_obj.js":46,"bs-platform/lib/js/caml_option.js":47,"bs-platform/lib/js/curry.js":55,"bs-platform/lib/js/list.js":58,"bs-platform/lib/js/string.js":61}],14:[function(require,module,exports){ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +},{"./web_document.js":15,"./web_node.js":18,"bs-platform/lib/js/block.js":33,"bs-platform/lib/js/caml_array.js":36,"bs-platform/lib/js/caml_builtin_exceptions.js":37,"bs-platform/lib/js/caml_obj.js":46,"bs-platform/lib/js/curry.js":54,"bs-platform/lib/js/js_primitive.js":57,"bs-platform/lib/js/list.js":58,"bs-platform/lib/js/string.js":61}],14:[function(require,module,exports){ +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; var Web_node = require("./web_node.js"); @@ -8973,7 +8987,7 @@ exports.polyfills = polyfills; /* No side effect */ },{"./web_node.js":18,"./web_window.js":19}],15:[function(require,module,exports){ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; @@ -9024,7 +9038,7 @@ exports.$$location = $$location; /* No side effect */ },{}],16:[function(require,module,exports){ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; @@ -9036,7 +9050,7 @@ exports.append = append; /* No side effect */ },{}],17:[function(require,module,exports){ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; var Js_json = require("bs-platform/lib/js/js_json.js"); @@ -9090,8 +9104,8 @@ exports.of_type = of_type; exports.$$null = $$null; /* No side effect */ -},{"bs-platform/lib/js/js_json.js":57}],18:[function(require,module,exports){ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +},{"bs-platform/lib/js/js_json.js":56}],18:[function(require,module,exports){ +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; @@ -9236,7 +9250,7 @@ exports.remove_polyfill = remove_polyfill; /* No side effect */ },{}],19:[function(require,module,exports){ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; @@ -9330,15 +9344,15 @@ exports.requestAnimationFrame_polyfill = requestAnimationFrame_polyfill; /* No side effect */ },{}],20:[function(require,module,exports){ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; -var Caml_option = require("bs-platform/lib/js/caml_option.js"); +var Js_primitive = require("bs-platform/lib/js/js_primitive.js"); function length($$window) { var match = $$window.localStorage; if (match !== undefined) { - return Caml_option.some(match.length); + return Js_primitive.some(match.length); } } @@ -9346,7 +9360,7 @@ function length($$window) { function clear($$window) { var match = $$window.localStorage; if (match !== undefined) { - return Caml_option.some(match.clear()); + return Js_primitive.some(match.clear()); } } @@ -9354,7 +9368,7 @@ function clear($$window) { function key($$window, idx) { var match = $$window.localStorage; if (match !== undefined) { - return Caml_option.some(match.key(idx)); + return Js_primitive.some(match.key(idx)); } } @@ -9363,7 +9377,7 @@ function getItem($$window, key) { var match = $$window.localStorage; if (match !== undefined) { try { - return Caml_option.some(match.getItem(key)); + return Js_primitive.some(match.getItem(key)); } catch (exn){ return undefined; @@ -9375,7 +9389,7 @@ function getItem($$window, key) { function removeItem($$window, key) { var match = $$window.localStorage; if (match !== undefined) { - return Caml_option.some(match.removeItem(key)); + return Js_primitive.some(match.removeItem(key)); } } @@ -9383,7 +9397,7 @@ function removeItem($$window, key) { function setItem($$window, key, value) { var match = $$window.localStorage; if (match !== undefined) { - return Caml_option.some(match.setItem(key, value)); + return Js_primitive.some(match.setItem(key, value)); } } @@ -9396,15 +9410,15 @@ exports.removeItem = removeItem; exports.setItem = setItem; /* No side effect */ -},{"bs-platform/lib/js/caml_option.js":47}],21:[function(require,module,exports){ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +},{"bs-platform/lib/js/js_primitive.js":57}],21:[function(require,module,exports){ +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; var List = require("bs-platform/lib/js/list.js"); var $$Array = require("bs-platform/lib/js/array.js"); var Block = require("bs-platform/lib/js/block.js"); var Curry = require("bs-platform/lib/js/curry.js"); -var Caml_option = require("bs-platform/lib/js/caml_option.js"); +var Js_primitive = require("bs-platform/lib/js/js_primitive.js"); var Web_formdata = require("./web_formdata.js"); var Caml_primitive = require("bs-platform/lib/js/caml_primitive.js"); var Caml_builtin_exceptions = require("bs-platform/lib/js/caml_builtin_exceptions.js"); @@ -9767,7 +9781,7 @@ function getAllResponseHeadersAsDict(x) { }; var concat_or_join = function (t1, v, d, t2) { if (d !== undefined) { - return join(t1, v, Caml_option.valFromOption(d), t2); + return join(t1, v, Js_primitive.valFromOption(d), t2); } else { return concat(t1, t2); } @@ -9782,7 +9796,7 @@ function getAllResponseHeadersAsDict(x) { if (c === 0) { return /* tuple */[ l, - Caml_option.some(d), + Js_primitive.some(d), r ]; } else if (c < 0) { @@ -9814,7 +9828,7 @@ function getAllResponseHeadersAsDict(x) { var v1 = s1[1]; if (s1[4] >= height(s2)) { var match = split(v1, s2); - return concat_or_join(merge(f, s1[0], match[0]), v1, Curry._3(f, v1, Caml_option.some(s1[2]), match[1]), merge(f, s1[3], match[2])); + return concat_or_join(merge(f, s1[0], match[0]), v1, Curry._3(f, v1, Js_primitive.some(s1[2]), match[1]), merge(f, s1[3], match[2])); } else { exit = 1; } @@ -9827,7 +9841,7 @@ function getAllResponseHeadersAsDict(x) { if (s2) { var v2 = s2[1]; var match$1 = split(v2, s1); - return concat_or_join(merge(f, match$1[0], s2[0]), v2, Curry._3(f, v2, match$1[1], Caml_option.some(s2[2])), merge(f, match$1[2], s2[3])); + return concat_or_join(merge(f, match$1[0], s2[0]), v2, Curry._3(f, v2, match$1[1], Js_primitive.some(s2[2])), merge(f, match$1[2], s2[3])); } else { throw [ Caml_builtin_exceptions.assert_failure, @@ -9924,7 +9938,7 @@ function getAllResponseHeadersAsDict(x) { } function getResponseHeader(key, x) { - return Caml_option.null_to_opt(x.getResponse(key)); + return Js_primitive.null_to_opt(x.getResponse(key)); } function open_(method$prime, url, $staropt$star, $staropt$star$1, $staropt$star$2, x) { @@ -10079,7 +10093,7 @@ function get_responseURL(x) { } function get_responseXML(x) { - return Caml_option.null_to_opt(x.responseXML); + return Js_primitive.null_to_opt(x.responseXML); } function get_status(x) { @@ -10211,8 +10225,8 @@ exports.set_onloadend = set_onloadend; exports.get_onloadend = get_onloadend; /* No side effect */ -},{"./web_formdata.js":16,"bs-platform/lib/js/array.js":32,"bs-platform/lib/js/block.js":33,"bs-platform/lib/js/caml_builtin_exceptions.js":37,"bs-platform/lib/js/caml_option.js":47,"bs-platform/lib/js/caml_primitive.js":48,"bs-platform/lib/js/curry.js":55,"bs-platform/lib/js/list.js":58}],22:[function(require,module,exports){ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +},{"./web_formdata.js":16,"bs-platform/lib/js/array.js":32,"bs-platform/lib/js/block.js":33,"bs-platform/lib/js/caml_builtin_exceptions.js":37,"bs-platform/lib/js/caml_primitive.js":47,"bs-platform/lib/js/curry.js":54,"bs-platform/lib/js/js_primitive.js":57,"bs-platform/lib/js/list.js":58}],22:[function(require,module,exports){ +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; var Test_client_drag = require("./test_client_drag.js"); @@ -10255,7 +10269,7 @@ exports.http_task = http_task; /* Test_client_drag Not a pure module */ },{"./test_client_attribute_removal.js":23,"./test_client_btn_update_span.js":24,"./test_client_counter.js":25,"./test_client_counter_debug_beginner.js":26,"./test_client_counter_debug_program.js":27,"./test_client_counter_debug_standard.js":28,"./test_client_drag.js":29,"./test_client_http_task.js":30,"./test_client_on_with_options.js":31}],23:[function(require,module,exports){ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; var List = require("bs-platform/lib/js/list.js"); @@ -10263,7 +10277,7 @@ var Vdom = require("../src-ocaml/vdom.js"); var Block = require("bs-platform/lib/js/block.js"); var Tea_app = require("../src-ocaml/tea_app.js"); var Tea_html = require("../src-ocaml/tea_html.js"); -var Caml_option = require("bs-platform/lib/js/caml_option.js"); +var Js_primitive = require("bs-platform/lib/js/js_primitive.js"); function select(param_0) { return /* Select */[param_0]; @@ -10319,7 +10333,7 @@ function lang(l, is_selected) { function render_languages(selected, languages) { var is_selected = function (selected, language) { if (selected !== undefined) { - return language === Caml_option.valFromOption(selected); + return language === Js_primitive.valFromOption(selected); } else { return false; } @@ -10390,8 +10404,8 @@ exports.view = view; exports.main = main; /* Tea_html Not a pure module */ -},{"../src-ocaml/tea_app.js":1,"../src-ocaml/tea_html.js":5,"../src-ocaml/vdom.js":13,"bs-platform/lib/js/block.js":33,"bs-platform/lib/js/caml_option.js":47,"bs-platform/lib/js/list.js":58}],24:[function(require,module,exports){ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +},{"../src-ocaml/tea_app.js":1,"../src-ocaml/tea_html.js":5,"../src-ocaml/vdom.js":13,"bs-platform/lib/js/block.js":33,"bs-platform/lib/js/js_primitive.js":57,"bs-platform/lib/js/list.js":58}],24:[function(require,module,exports){ +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; var Vdom = require("../src-ocaml/vdom.js"); @@ -10469,7 +10483,7 @@ exports.main = main; /* Tea_html Not a pure module */ },{"../src-ocaml/tea_app.js":1,"../src-ocaml/tea_html.js":5,"../src-ocaml/vdom.js":13,"bs-platform/lib/js/block.js":33}],25:[function(require,module,exports){ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; var Vdom = require("../src-ocaml/vdom.js"); @@ -10557,7 +10571,7 @@ exports.main = main; /* Tea_html Not a pure module */ },{"../src-ocaml/tea_app.js":1,"../src-ocaml/tea_html.js":5,"../src-ocaml/vdom.js":13,"bs-platform/lib/js/block.js":33}],26:[function(require,module,exports){ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; var Vdom = require("../src-ocaml/vdom.js"); @@ -10662,7 +10676,7 @@ exports.main = main; /* Tea_html Not a pure module */ },{"../src-ocaml/tea_debug.js":3,"../src-ocaml/tea_html.js":5,"../src-ocaml/vdom.js":13,"bs-platform/lib/js/block.js":33}],27:[function(require,module,exports){ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; var Vdom = require("../src-ocaml/vdom.js"); @@ -10772,7 +10786,11 @@ function view(model) { ]); } -function partial_arg_004(_model) { +function renderCallback(param) { + return /* () */0; +} + +function partial_arg_005(_model) { return /* NoCmd */0; } @@ -10780,8 +10798,9 @@ var partial_arg = /* record */[ /* init */init, /* update */update, /* view */view, + /* renderCallback */renderCallback, /* subscriptions */subscriptions, - partial_arg_004 + partial_arg_005 ]; function main(param, param$1) { @@ -10794,11 +10813,12 @@ exports.subscriptions = subscriptions; exports.update = update; exports.view_button = view_button; exports.view = view; +exports.renderCallback = renderCallback; exports.main = main; /* Tea_html Not a pure module */ },{"../src-ocaml/tea_debug.js":3,"../src-ocaml/tea_html.js":5,"../src-ocaml/vdom.js":13,"bs-platform/lib/js/block.js":33}],28:[function(require,module,exports){ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; var Vdom = require("../src-ocaml/vdom.js"); @@ -10908,10 +10928,15 @@ function view(model) { ]); } +function renderCallback(param) { + return /* () */0; +} + var partial_arg = /* record */[ /* init */init, /* update */update, /* view */view, + /* renderCallback */renderCallback, /* subscriptions */subscriptions ]; @@ -10925,11 +10950,12 @@ exports.subscriptions = subscriptions; exports.update = update; exports.view_button = view_button; exports.view = view; +exports.renderCallback = renderCallback; exports.main = main; /* Tea_html Not a pure module */ },{"../src-ocaml/tea_debug.js":3,"../src-ocaml/tea_html.js":5,"../src-ocaml/vdom.js":13,"bs-platform/lib/js/block.js":33}],29:[function(require,module,exports){ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; var Vdom = require("../src-ocaml/vdom.js"); @@ -11129,10 +11155,15 @@ function view(model) { ]); } +function renderCallback(param) { + return /* () */0; +} + var partial_arg = /* record */[ /* init */init, /* update */update, /* view */view, + /* renderCallback */renderCallback, /* subscriptions */subscriptions ]; @@ -11151,11 +11182,12 @@ exports.subscriptions = subscriptions; exports.px = px; exports.onMouseDown = onMouseDown; exports.view = view; +exports.renderCallback = renderCallback; exports.main = main; /* onMouseDown Not a pure module */ },{"../src-ocaml/tea_app.js":1,"../src-ocaml/tea_html.js":5,"../src-ocaml/tea_json.js":8,"../src-ocaml/tea_mouse.js":9,"../src-ocaml/tea_result.js":10,"../src-ocaml/vdom.js":13,"bs-platform/lib/js/block.js":33}],30:[function(require,module,exports){ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; var Vdom = require("../src-ocaml/vdom.js"); @@ -11223,6 +11255,10 @@ function som(param) { } } +function renderCallback(param) { + return /* () */0; +} + function partial_arg_000(param) { return /* tuple */[ "nothing", @@ -11230,7 +11266,7 @@ function partial_arg_000(param) { ]; } -function partial_arg_003(param) { +function partial_arg_004(param) { return /* NoSub */0; } @@ -11238,7 +11274,8 @@ var partial_arg = /* record */[ partial_arg_000, /* update */update, /* view */view, - partial_arg_003 + /* renderCallback */renderCallback, + partial_arg_004 ]; function main(param, param$1) { @@ -11252,11 +11289,12 @@ exports.req = req; exports.update = update; exports.view = view; exports.som = som; +exports.renderCallback = renderCallback; exports.main = main; /* Tea_html Not a pure module */ -},{"../src-ocaml/tea_debug.js":3,"../src-ocaml/tea_ex.js":4,"../src-ocaml/tea_html.js":5,"../src-ocaml/tea_http.js":7,"../src-ocaml/tea_task.js":12,"../src-ocaml/vdom.js":13,"bs-platform/lib/js/block.js":33,"bs-platform/lib/js/curry.js":55}],31:[function(require,module,exports){ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +},{"../src-ocaml/tea_debug.js":3,"../src-ocaml/tea_ex.js":4,"../src-ocaml/tea_html.js":5,"../src-ocaml/tea_http.js":7,"../src-ocaml/tea_task.js":12,"../src-ocaml/vdom.js":13,"bs-platform/lib/js/block.js":33,"bs-platform/lib/js/curry.js":54}],31:[function(require,module,exports){ +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; var List = require("bs-platform/lib/js/list.js"); @@ -11374,13 +11412,13 @@ exports.view = view; exports.main = main; /* Tea_html2 Not a pure module */ -},{"../src-ocaml/tea_app.js":1,"../src-ocaml/tea_html2.js":6,"../src-ocaml/tea_json.js":8,"bs-platform/lib/js/block.js":33,"bs-platform/lib/js/caml_format.js":40,"bs-platform/lib/js/curry.js":55,"bs-platform/lib/js/list.js":58}],32:[function(require,module,exports){ +},{"../src-ocaml/tea_app.js":1,"../src-ocaml/tea_html2.js":6,"../src-ocaml/tea_json.js":8,"bs-platform/lib/js/block.js":33,"bs-platform/lib/js/caml_format.js":41,"bs-platform/lib/js/curry.js":54,"bs-platform/lib/js/list.js":58}],32:[function(require,module,exports){ 'use strict'; var Curry = require("./curry.js"); +var Js_exn = require("./js_exn.js"); var Caml_array = require("./caml_array.js"); var Caml_exceptions = require("./caml_exceptions.js"); -var Caml_js_exceptions = require("./caml_js_exceptions.js"); var Caml_builtin_exceptions = require("./caml_builtin_exceptions.js"); function init(l, f) { @@ -11618,7 +11656,7 @@ function sort(cmp, a) { }; } catch (raw_exn){ - var exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + var exn = Js_exn.internalToOCamlException(raw_exn); if (exn[0] === Bottom) { return Caml_array.caml_array_set(a, exn[1], e); } else { @@ -11639,7 +11677,7 @@ function sort(cmp, a) { }; } catch (raw_exn){ - var exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + var exn = Js_exn.internalToOCamlException(raw_exn); if (exn[0] === Bottom) { return exn[1]; } else { @@ -11796,7 +11834,7 @@ exports.stable_sort = stable_sort; exports.fast_sort = fast_sort; /* No side effect */ -},{"./caml_array.js":36,"./caml_builtin_exceptions.js":37,"./caml_exceptions.js":39,"./caml_js_exceptions.js":44,"./curry.js":55}],33:[function(require,module,exports){ +},{"./caml_array.js":36,"./caml_builtin_exceptions.js":37,"./caml_exceptions.js":39,"./curry.js":54,"./js_exn.js":55}],33:[function(require,module,exports){ 'use strict'; @@ -11850,14 +11888,13 @@ exports.polyVar = polyVar; var Bytes = require("./bytes.js"); var Curry = require("./curry.js"); var $$String = require("./string.js"); -var Caml_bytes = require("./caml_bytes.js"); var Pervasives = require("./pervasives.js"); var Caml_string = require("./caml_string.js"); var Caml_builtin_exceptions = require("./caml_builtin_exceptions.js"); function create(n) { var n$1 = n < 1 ? 1 : n; - var s = Caml_bytes.caml_create_bytes(n$1); + var s = Caml_string.caml_create_string(n$1); return /* record */[ /* buffer */s, /* position */0, @@ -11929,7 +11966,7 @@ function resize(b, more) { while((b[/* position */1] + more | 0) > new_len) { new_len = (new_len << 1); }; - var new_buffer = Caml_bytes.caml_create_bytes(new_len); + var new_buffer = Caml_string.caml_create_string(new_len); Bytes.blit(b[/* buffer */0], 0, new_buffer, 0, b[/* position */1]); b[/* buffer */0] = new_buffer; b[/* length */2] = new_len; @@ -11963,7 +12000,7 @@ function add_substring(b, s, offset, len) { } function add_subbytes(b, s, offset, len) { - return add_substring(b, Caml_bytes.bytes_to_string(s), offset, len); + return add_substring(b, Caml_string.bytes_to_string(s), offset, len); } function add_string(b, s) { @@ -11978,7 +12015,7 @@ function add_string(b, s) { } function add_bytes(b, s) { - return add_string(b, Caml_bytes.bytes_to_string(s)); + return add_string(b, Caml_string.bytes_to_string(s)); } function add_buffer(b, bs) { @@ -12187,26 +12224,26 @@ exports.add_channel = add_channel; exports.output_buffer = output_buffer; /* No side effect */ -},{"./bytes.js":35,"./caml_builtin_exceptions.js":37,"./caml_bytes.js":38,"./caml_string.js":49,"./curry.js":55,"./pervasives.js":59,"./string.js":61}],35:[function(require,module,exports){ +},{"./bytes.js":35,"./caml_builtin_exceptions.js":37,"./caml_string.js":48,"./curry.js":54,"./pervasives.js":59,"./string.js":61}],35:[function(require,module,exports){ 'use strict'; var Char = require("./char.js"); var List = require("./list.js"); var Curry = require("./curry.js"); var Caml_obj = require("./caml_obj.js"); -var Caml_bytes = require("./caml_bytes.js"); var Caml_int32 = require("./caml_int32.js"); +var Caml_string = require("./caml_string.js"); var Caml_primitive = require("./caml_primitive.js"); var Caml_builtin_exceptions = require("./caml_builtin_exceptions.js"); function make(n, c) { - var s = Caml_bytes.caml_create_bytes(n); - Caml_bytes.caml_fill_bytes(s, 0, n, c); + var s = Caml_string.caml_create_string(n); + Caml_string.caml_fill_string(s, 0, n, c); return s; } function init(n, f) { - var s = Caml_bytes.caml_create_bytes(n); + var s = Caml_string.caml_create_string(n); for(var i = 0 ,i_finish = n - 1 | 0; i <= i_finish; ++i){ s[i] = Curry._1(f, i); } @@ -12217,17 +12254,17 @@ var empty = []; function copy(s) { var len = s.length; - var r = Caml_bytes.caml_create_bytes(len); - Caml_bytes.caml_blit_bytes(s, 0, r, 0, len); + var r = Caml_string.caml_create_string(len); + Caml_string.caml_blit_bytes(s, 0, r, 0, len); return r; } function to_string(b) { - return Caml_bytes.bytes_to_string(copy(b)); + return Caml_string.bytes_to_string(copy(b)); } function of_string(s) { - return copy(Caml_bytes.bytes_of_string(s)); + return copy(Caml_string.bytes_of_string(s)); } function sub(s, ofs, len) { @@ -12237,19 +12274,19 @@ function sub(s, ofs, len) { "String.sub / Bytes.sub" ]; } else { - var r = Caml_bytes.caml_create_bytes(len); - Caml_bytes.caml_blit_bytes(s, ofs, r, 0, len); + var r = Caml_string.caml_create_string(len); + Caml_string.caml_blit_bytes(s, ofs, r, 0, len); return r; } } function sub_string(b, ofs, len) { - return Caml_bytes.bytes_to_string(sub(b, ofs, len)); + return Caml_string.bytes_to_string(sub(b, ofs, len)); } function extend(s, left, right) { var len = (s.length + left | 0) + right | 0; - var r = Caml_bytes.caml_create_bytes(len); + var r = Caml_string.caml_create_string(len); var match = left < 0 ? /* tuple */[ -left | 0, 0 @@ -12261,7 +12298,7 @@ function extend(s, left, right) { var srcoff = match[0]; var cpylen = Caml_primitive.caml_int_min(s.length - srcoff | 0, len - dstoff | 0); if (cpylen > 0) { - Caml_bytes.caml_blit_bytes(s, srcoff, r, dstoff, cpylen); + Caml_string.caml_blit_bytes(s, srcoff, r, dstoff, cpylen); } return r; } @@ -12273,7 +12310,7 @@ function fill(s, ofs, len, c) { "String.fill / Bytes.fill" ]; } else { - return Caml_bytes.caml_fill_bytes(s, ofs, len, c); + return Caml_string.caml_fill_string(s, ofs, len, c); } } @@ -12284,7 +12321,7 @@ function blit(s1, ofs1, s2, ofs2, len) { "Bytes.blit" ]; } else { - return Caml_bytes.caml_blit_bytes(s1, ofs1, s2, ofs2, len); + return Caml_string.caml_blit_bytes(s1, ofs1, s2, ofs2, len); } } @@ -12295,7 +12332,7 @@ function blit_string(s1, ofs1, s2, ofs2, len) { "String.blit / Bytes.blit_string" ]; } else { - return Caml_bytes.caml_blit_string(s1, ofs1, s2, ofs2, len); + return Caml_string.caml_blit_string(s1, ofs1, s2, ofs2, len); } } @@ -12323,13 +12360,13 @@ function concat(sep, l) { len[0] = len[0] + s.length | 0; return /* () */0; }), l); - var r = Caml_bytes.caml_create_bytes(len[0] + Caml_int32.imul(sep.length, num[0] - 1 | 0) | 0); - Caml_bytes.caml_blit_bytes(hd, 0, r, 0, hd.length); + var r = Caml_string.caml_create_string(len[0] + Caml_int32.imul(sep.length, num[0] - 1 | 0) | 0); + Caml_string.caml_blit_bytes(hd, 0, r, 0, hd.length); var pos = /* record */[/* contents */hd.length]; List.iter((function (s) { - Caml_bytes.caml_blit_bytes(sep, 0, r, pos[0], sep.length); + Caml_string.caml_blit_bytes(sep, 0, r, pos[0], sep.length); pos[0] = pos[0] + sep.length | 0; - Caml_bytes.caml_blit_bytes(s, 0, r, pos[0], s.length); + Caml_string.caml_blit_bytes(s, 0, r, pos[0], s.length); pos[0] = pos[0] + s.length | 0; return /* () */0; }), l[1]); @@ -12342,9 +12379,9 @@ function concat(sep, l) { function cat(s1, s2) { var l1 = s1.length; var l2 = s2.length; - var r = Caml_bytes.caml_create_bytes(l1 + l2 | 0); - Caml_bytes.caml_blit_bytes(s1, 0, r, 0, l1); - Caml_bytes.caml_blit_bytes(s2, 0, r, l1, l2); + var r = Caml_string.caml_create_string(l1 + l2 | 0); + Caml_string.caml_blit_bytes(s1, 0, r, 0, l1); + Caml_string.caml_blit_bytes(s2, 0, r, l1, l2); return r; } @@ -12398,7 +12435,7 @@ function escaped(s) { if (n === s.length) { return copy(s); } else { - var s$prime = Caml_bytes.caml_create_bytes(n); + var s$prime = Caml_string.caml_create_string(n); n = 0; for(var i$1 = 0 ,i_finish$1 = s.length - 1 | 0; i$1 <= i_finish$1; ++i$1){ var c = s[i$1]; @@ -12486,7 +12523,7 @@ function map(f, s) { if (l === 0) { return s; } else { - var r = Caml_bytes.caml_create_bytes(l); + var r = Caml_string.caml_create_string(l); for(var i = 0 ,i_finish = l - 1 | 0; i <= i_finish; ++i){ r[i] = Curry._1(f, s[i]); } @@ -12499,7 +12536,7 @@ function mapi(f, s) { if (l === 0) { return s; } else { - var r = Caml_bytes.caml_create_bytes(l); + var r = Caml_string.caml_create_string(l); for(var i = 0 ,i_finish = l - 1 | 0; i <= i_finish; ++i){ r[i] = Curry._2(f, i, s[i]); } @@ -12641,9 +12678,9 @@ function rcontains_from(s, i, c) { var compare = Caml_obj.caml_compare; -var unsafe_to_string = Caml_bytes.bytes_to_string; +var unsafe_to_string = Caml_string.bytes_to_string; -var unsafe_of_string = Caml_bytes.bytes_of_string; +var unsafe_of_string = Caml_string.bytes_of_string; exports.make = make; exports.init = init; @@ -12681,7 +12718,7 @@ exports.unsafe_to_string = unsafe_to_string; exports.unsafe_of_string = unsafe_of_string; /* No side effect */ -},{"./caml_builtin_exceptions.js":37,"./caml_bytes.js":38,"./caml_int32.js":41,"./caml_obj.js":46,"./caml_primitive.js":48,"./char.js":54,"./curry.js":55,"./list.js":58}],36:[function(require,module,exports){ +},{"./caml_builtin_exceptions.js":37,"./caml_int32.js":42,"./caml_obj.js":46,"./caml_primitive.js":47,"./caml_string.js":48,"./char.js":53,"./curry.js":54,"./list.js":58}],36:[function(require,module,exports){ 'use strict'; var Caml_builtin_exceptions = require("./caml_builtin_exceptions.js"); @@ -12927,140 +12964,7 @@ function get(s, i) { } } -function caml_fill_bytes(s, i, l, c) { - if (l > 0) { - for(var k = i ,k_finish = (l + i | 0) - 1 | 0; k <= k_finish; ++k){ - s[k] = c; - } - return /* () */0; - } else { - return 0; - } -} - -function caml_create_bytes(len) { - if (len < 0) { - throw [ - Caml_builtin_exceptions.invalid_argument, - "String.create" - ]; - } else { - var result = new Array(len); - for(var i = 0 ,i_finish = len - 1 | 0; i <= i_finish; ++i){ - result[i] = /* "\000" */0; - } - return result; - } -} - -function caml_blit_bytes(s1, i1, s2, i2, len) { - if (len > 0) { - if (s1 === s2) { - var s1$1 = s1; - var i1$1 = i1; - var i2$1 = i2; - var len$1 = len; - if (i1$1 < i2$1) { - var range_a = (s1$1.length - i2$1 | 0) - 1 | 0; - var range_b = len$1 - 1 | 0; - var range = range_a > range_b ? range_b : range_a; - for(var j = range; j >= 0; --j){ - s1$1[i2$1 + j | 0] = s1$1[i1$1 + j | 0]; - } - return /* () */0; - } else if (i1$1 > i2$1) { - var range_a$1 = (s1$1.length - i1$1 | 0) - 1 | 0; - var range_b$1 = len$1 - 1 | 0; - var range$1 = range_a$1 > range_b$1 ? range_b$1 : range_a$1; - for(var k = 0; k <= range$1; ++k){ - s1$1[i2$1 + k | 0] = s1$1[i1$1 + k | 0]; - } - return /* () */0; - } else { - return 0; - } - } else { - var off1 = s1.length - i1 | 0; - if (len <= off1) { - for(var i = 0 ,i_finish = len - 1 | 0; i <= i_finish; ++i){ - s2[i2 + i | 0] = s1[i1 + i | 0]; - } - return /* () */0; - } else { - for(var i$1 = 0 ,i_finish$1 = off1 - 1 | 0; i$1 <= i_finish$1; ++i$1){ - s2[i2 + i$1 | 0] = s1[i1 + i$1 | 0]; - } - for(var i$2 = off1 ,i_finish$2 = len - 1 | 0; i$2 <= i_finish$2; ++i$2){ - s2[i2 + i$2 | 0] = /* "\000" */0; - } - return /* () */0; - } - } - } else { - return 0; - } -} - -function bytes_to_string(a) { - var bytes = a; - var i = 0; - var len = a.length; - var s = ""; - var s_len = len; - if (i === 0 && len <= 4096 && len === bytes.length) { - return String.fromCharCode.apply(null, bytes); - } else { - var offset = 0; - while(s_len > 0) { - var next = s_len < 1024 ? s_len : 1024; - var tmp_bytes = new Array(next); - caml_blit_bytes(bytes, offset, tmp_bytes, 0, next); - s = s + String.fromCharCode.apply(null, tmp_bytes); - s_len = s_len - next | 0; - offset = offset + next | 0; - }; - return s; - } -} - -function caml_blit_string(s1, i1, s2, i2, len) { - if (len > 0) { - var off1 = s1.length - i1 | 0; - if (len <= off1) { - for(var i = 0 ,i_finish = len - 1 | 0; i <= i_finish; ++i){ - s2[i2 + i | 0] = s1.charCodeAt(i1 + i | 0); - } - return /* () */0; - } else { - for(var i$1 = 0 ,i_finish$1 = off1 - 1 | 0; i$1 <= i_finish$1; ++i$1){ - s2[i2 + i$1 | 0] = s1.charCodeAt(i1 + i$1 | 0); - } - for(var i$2 = off1 ,i_finish$2 = len - 1 | 0; i$2 <= i_finish$2; ++i$2){ - s2[i2 + i$2 | 0] = /* "\000" */0; - } - return /* () */0; - } - } else { - return 0; - } -} - -function bytes_of_string(s) { - var len = s.length; - var res = new Array(len); - for(var i = 0 ,i_finish = len - 1 | 0; i <= i_finish; ++i){ - res[i] = s.charCodeAt(i); - } - return res; -} - -exports.caml_create_bytes = caml_create_bytes; -exports.caml_fill_bytes = caml_fill_bytes; exports.get = get; -exports.bytes_to_string = bytes_to_string; -exports.caml_blit_bytes = caml_blit_bytes; -exports.caml_blit_string = caml_blit_string; -exports.bytes_of_string = bytes_of_string; /* No side effect */ },{"./caml_builtin_exceptions.js":37}],39:[function(require,module,exports){ @@ -13090,7 +12994,7 @@ function create(str) { return v; } -function caml_is_extension(e) { +function isCamlExceptionOrOpenVariant(e) { if (e === undefined) { return false; } else if (e.tag === 248) { @@ -13108,17 +13012,177 @@ function caml_is_extension(e) { exports.caml_set_oo_id = caml_set_oo_id; exports.caml_fresh_oo_id = caml_fresh_oo_id; exports.create = create; -exports.caml_is_extension = caml_is_extension; +exports.isCamlExceptionOrOpenVariant = isCamlExceptionOrOpenVariant; /* No side effect */ },{}],40:[function(require,module,exports){ 'use strict'; + +function caml_int32_float_of_bits(x) { + var int32 = new Int32Array(/* array */[x]); + var float32 = new Float32Array(int32.buffer); + return float32[0]; +} + +function caml_int32_bits_of_float(x) { + var float32 = new Float32Array(/* array */[x]); + return new Int32Array(float32.buffer)[0]; +} + +function caml_classify_float(x) { + if (isFinite(x)) { + if (Math.abs(x) >= 2.2250738585072014e-308) { + return /* FP_normal */0; + } else if (x !== 0) { + return /* FP_subnormal */1; + } else { + return /* FP_zero */2; + } + } else if (isNaN(x)) { + return /* FP_nan */4; + } else { + return /* FP_infinite */3; + } +} + +function caml_modf_float(x) { + if (isFinite(x)) { + var neg = 1 / x < 0; + var x$1 = Math.abs(x); + var i = Math.floor(x$1); + var f = x$1 - i; + if (neg) { + return /* tuple */[ + -f, + -i + ]; + } else { + return /* tuple */[ + f, + i + ]; + } + } else if (isNaN(x)) { + return /* tuple */[ + NaN, + NaN + ]; + } else { + return /* tuple */[ + 1 / x, + x + ]; + } +} + +function caml_ldexp_float(x, exp) { + var x$prime = x; + var exp$prime = exp; + if (exp$prime > 1023) { + exp$prime -= 1023; + x$prime = x$prime * Math.pow(2, 1023); + if (exp$prime > 1023) { + exp$prime -= 1023; + x$prime = x$prime * Math.pow(2, 1023); + } + + } else if (exp$prime < -1023) { + exp$prime += 1023; + x$prime = x$prime * Math.pow(2, -1023); + } + return x$prime * Math.pow(2, exp$prime); +} + +function caml_frexp_float(x) { + if (x === 0 || !isFinite(x)) { + return /* tuple */[ + x, + 0 + ]; + } else { + var neg = x < 0; + var x$prime = Math.abs(x); + var exp = Math.floor(Math.LOG2E * Math.log(x$prime)) + 1; + x$prime = x$prime * Math.pow(2, -exp); + if (x$prime < 0.5) { + x$prime = x$prime * 2; + exp -= 1; + } + if (neg) { + x$prime = -x$prime; + } + return /* tuple */[ + x$prime, + exp | 0 + ]; + } +} + +function caml_copysign_float(x, y) { + var x$1 = Math.abs(x); + var y$1 = y === 0 ? 1 / y : y; + if (y$1 < 0) { + return -x$1; + } else { + return x$1; + } +} + +function caml_expm1_float(x) { + var y = Math.exp(x); + var z = y - 1; + if (Math.abs(x) > 1) { + return z; + } else if (z === 0) { + return x; + } else { + return x * z / Math.log(y); + } +} + +function caml_hypot_float(x, y) { + var x0 = Math.abs(x); + var y0 = Math.abs(y); + var a = Math.max(x0, y0); + var b = Math.min(x0, y0) / ( + a !== 0 ? a : 1 + ); + return a * Math.sqrt(1 + b * b); +} + +function caml_log10_float(x) { + return Math.LOG10E * Math.log(x); +} + +exports.caml_int32_float_of_bits = caml_int32_float_of_bits; +exports.caml_int32_bits_of_float = caml_int32_bits_of_float; +exports.caml_classify_float = caml_classify_float; +exports.caml_modf_float = caml_modf_float; +exports.caml_ldexp_float = caml_ldexp_float; +exports.caml_frexp_float = caml_frexp_float; +exports.caml_copysign_float = caml_copysign_float; +exports.caml_expm1_float = caml_expm1_float; +exports.caml_hypot_float = caml_hypot_float; +exports.caml_log10_float = caml_log10_float; +/* No side effect */ + +},{}],41:[function(require,module,exports){ +'use strict'; + +var Curry = require("./curry.js"); var Caml_int32 = require("./caml_int32.js"); var Caml_int64 = require("./caml_int64.js"); var Caml_utils = require("./caml_utils.js"); var Caml_builtin_exceptions = require("./caml_builtin_exceptions.js"); +function caml_failwith(s) { + throw [ + Caml_builtin_exceptions.failure, + s + ]; +} + function parse_digit(c) { if (c >= 65) { if (c >= 97) { @@ -13157,80 +13221,40 @@ function parse_sign_and_base(s) { var sign = 1; var base = /* Dec */2; var i = 0; - var match = s.charCodeAt(i); - switch (match) { - case 43 : - i = i + 1 | 0; - break; - case 44 : - break; - case 45 : - sign = -1; - i = i + 1 | 0; - break; - default: - + if (s[i] === "-") { + sign = -1; + i = i + 1 | 0; } - if (s[i] === "0") { - var match$1 = s.charCodeAt(i + 1 | 0); + var match = s.charCodeAt(i); + var match$1 = s.charCodeAt(i + 1 | 0); + if (match === 48) { if (match$1 >= 89) { - if (match$1 >= 111) { - if (match$1 < 121) { - switch (match$1 - 111 | 0) { - case 0 : - base = /* Oct */0; - i = i + 2 | 0; - break; - case 6 : - i = i + 2 | 0; - break; - case 1 : - case 2 : - case 3 : - case 4 : - case 5 : - case 7 : - case 8 : - break; - case 9 : - base = /* Hex */1; - i = i + 2 | 0; - break; - + if (match$1 !== 98) { + if (match$1 !== 111) { + if (match$1 === 120) { + base = /* Hex */1; + i = i + 2 | 0; } + + } else { + base = /* Oct */0; + i = i + 2 | 0; } - - } else if (match$1 === 98) { + } else { base = /* Bin */3; i = i + 2 | 0; } - } else if (match$1 !== 66) { - if (match$1 >= 79) { - switch (match$1 - 79 | 0) { - case 0 : - base = /* Oct */0; - i = i + 2 | 0; - break; - case 6 : - i = i + 2 | 0; - break; - case 1 : - case 2 : - case 3 : - case 4 : - case 5 : - case 7 : - case 8 : - break; - case 9 : - base = /* Hex */1; - i = i + 2 | 0; - break; - + if (match$1 !== 79) { + if (match$1 >= 88) { + base = /* Hex */1; + i = i + 2 | 0; } + + } else { + base = /* Oct */0; + i = i + 2 | 0; } - } else { base = /* Bin */3; i = i + 2 | 0; @@ -13884,8 +13908,8 @@ function caml_format_float(fmt, x) { return finish_formatting(f, s); } -function float_of_string (s,exn){ - +var float_of_string = ( + function (s, caml_failwith) { var res = +s; if ((s.length > 0) && (res === res)) return res; @@ -13893,20 +13917,26 @@ function float_of_string (s,exn){ res = +s; if (((s.length > 0) && (res === res)) || /^[+-]?nan$/i.test(s)) { return res; - }; + } + ; + if (/^ *0x[0-9a-f_]+p[+-]?[0-9_]+/i.test(s)) { + var pidx = s.indexOf('p'); + pidx = (pidx == -1) ? s.indexOf('P') : pidx; + var exp = +s.substring(pidx + 1); + res = +s.substring(0, pidx); + return res * Math.pow(2, exp); + } if (/^\+?inf(inity)?$/i.test(s)) return Infinity; if (/^-inf(inity)?$/i.test(s)) return -Infinity; - throw exn; + caml_failwith("float_of_string"); +} -}; +); function caml_float_of_string(s) { - return float_of_string(s, [ - Caml_builtin_exceptions.failure, - "float_of_string" - ]); + return Curry._2(float_of_string, s, caml_failwith); } var caml_nativeint_format = caml_format_int; @@ -13927,9 +13957,9 @@ exports.caml_int_of_string = caml_int_of_string; exports.caml_int32_of_string = caml_int32_of_string; exports.caml_int64_of_string = caml_int64_of_string; exports.caml_nativeint_of_string = caml_nativeint_of_string; -/* No side effect */ +/* float_of_string Not a pure module */ -},{"./caml_builtin_exceptions.js":37,"./caml_int32.js":41,"./caml_int64.js":42,"./caml_utils.js":51}],41:[function(require,module,exports){ +},{"./caml_builtin_exceptions.js":37,"./caml_int32.js":42,"./caml_int64.js":43,"./caml_utils.js":50,"./curry.js":54}],42:[function(require,module,exports){ 'use strict'; var Caml_builtin_exceptions = require("./caml_builtin_exceptions.js"); @@ -13973,7 +14003,7 @@ exports.caml_nativeint_bswap = caml_nativeint_bswap; exports.imul = imul; /* imul Not a pure module */ -},{"./caml_builtin_exceptions.js":37}],42:[function(require,module,exports){ +},{"./caml_builtin_exceptions.js":37}],43:[function(require,module,exports){ 'use strict'; var Caml_int32 = require("./caml_int32.js"); @@ -14334,18 +14364,24 @@ function to_float(param) { return param[/* hi */0] * (0x100000000) + param[/* lo */1]; } +var two_ptr_32_dbl = Math.pow(2, 32); + +var two_ptr_63_dbl = Math.pow(2, 63); + +var neg_two_ptr_63 = -Math.pow(2, 63); + function of_float(x) { if (isNaN(x) || !isFinite(x)) { return zero; - } else if (x <= -9.22337203685477581e+18) { + } else if (x <= neg_two_ptr_63) { return min_int; - } else if (x + 1 >= 9.22337203685477581e+18) { + } else if (x + 1 >= two_ptr_63_dbl) { return max_int; } else if (x < 0) { return neg(of_float(-x)); } else { - var hi = x / 4294967296 | 0; - var lo = x % 4294967296 | 0; + var hi = x / two_ptr_32_dbl | 0; + var lo = x % two_ptr_32_dbl | 0; return /* record */[ /* hi */hi, /* lo */(lo >>> 0) @@ -14481,32 +14517,32 @@ function to_int32(x) { } function to_hex(x) { - var x_lo = x[/* lo */1]; - var x_hi = x[/* hi */0]; var aux = function (v) { return (v >>> 0).toString(16); }; + var match = x[/* hi */0]; + var match$1 = x[/* lo */1]; var exit = 0; - if (x_hi !== 0 || x_lo !== 0) { + if (match !== 0 || match$1 !== 0) { exit = 1; } else { return "0"; } if (exit === 1) { - if (x_lo !== 0) { - if (x_hi !== 0) { - var lo = aux(x_lo); + if (match$1 !== 0) { + if (match !== 0) { + var lo = aux(x[/* lo */1]); var pad = 8 - lo.length | 0; if (pad <= 0) { - return aux(x_hi) + lo; + return aux(x[/* hi */0]) + lo; } else { - return aux(x_hi) + (Caml_utils.repeat(pad, "0") + lo); + return aux(x[/* hi */0]) + (Caml_utils.repeat(pad, "0") + lo); } } else { - return aux(x_lo); + return aux(x[/* lo */1]); } } else { - return aux(x_hi) + "00000000"; + return aux(x[/* hi */0]) + "00000000"; } } @@ -14519,15 +14555,24 @@ function discard_sign(x) { ]; } -function float_of_bits (x){ - return new Float64Array(new Int32Array([x[1],x[0]]).buffer)[0] -}; +function float_of_bits(x) { + var int32 = new Int32Array(/* array */[ + x[/* lo */1], + x[/* hi */0] + ]); + return new Float64Array(int32.buffer)[0]; +} function bits_of_float(x) { - var buf = (new Int32Array(new Float64Array([x]).buffer)); + var u = new Float64Array(/* array */[x]); + var int32 = new Int32Array(u.buffer); + var x$1 = int32[1]; + var hi = x$1; + var x$2 = int32[0]; + var lo = x$2; return /* record */[ - /* hi */buf[1], - /* lo */(buf[0] >>> 0) + /* hi */hi, + /* lo */(lo >>> 0) ]; } @@ -14574,20 +14619,25 @@ exports.to_float = to_float; exports.of_float = of_float; exports.div = div; exports.mod_ = mod_; +exports.div_mod = div_mod; exports.compare = compare; +exports.to_hex = to_hex; +exports.discard_sign = discard_sign; exports.float_of_bits = float_of_bits; exports.bits_of_float = bits_of_float; exports.get64 = get64; -exports.div_mod = div_mod; -exports.to_hex = to_hex; -exports.discard_sign = discard_sign; -/* Caml_int32 Not a pure module */ +/* two_ptr_32_dbl Not a pure module */ -},{"./caml_builtin_exceptions.js":37,"./caml_int32.js":41,"./caml_primitive.js":48,"./caml_utils.js":51}],43:[function(require,module,exports){ +},{"./caml_builtin_exceptions.js":37,"./caml_int32.js":42,"./caml_primitive.js":47,"./caml_utils.js":50}],44:[function(require,module,exports){ (function (process){ 'use strict'; var Curry = require("./curry.js"); +var Caml_builtin_exceptions = require("./caml_builtin_exceptions.js"); + +function $caret(prim, prim$1) { + return prim + prim$1; +} var stdout = /* record */[ /* buffer */"", @@ -14619,6 +14669,20 @@ var stderr = /* record */[ }) ]; +function caml_ml_open_descriptor_in(i) { + throw [ + Caml_builtin_exceptions.failure, + "caml_ml_open_descriptor_in not implemented" + ]; +} + +function caml_ml_open_descriptor_out(i) { + throw [ + Caml_builtin_exceptions.failure, + "caml_ml_open_descriptor_out not implemented" + ]; +} + function caml_ml_flush(oc) { if (oc[/* buffer */0] !== "") { Curry._2(oc[/* output */1], oc, oc[/* buffer */0]); @@ -14629,6 +14693,11 @@ function caml_ml_flush(oc) { } } +var node_std_output = (function (s){ + return (typeof process !== "undefined") && process.stdout && (process.stdout.write(s), true); + } +); + function caml_ml_output(oc, str, offset, len) { var str$1 = offset === 0 && len === str.length ? str : str.slice(offset, len); if (( (typeof process !== "undefined") && process.stdout && process.stdout.write ) && oc === stdout) { @@ -14651,6 +14720,20 @@ function caml_ml_output_char(oc, $$char) { return caml_ml_output(oc, String.fromCharCode($$char), 0, 1); } +function caml_ml_input(ic, bytes, offset, len) { + throw [ + Caml_builtin_exceptions.failure, + "caml_ml_input ic not implemented" + ]; +} + +function caml_ml_input_char(ic) { + throw [ + Caml_builtin_exceptions.failure, + "caml_ml_input_char not implemnted" + ]; +} + function caml_ml_out_channels_list(param) { return /* :: */[ stdout, @@ -14663,55 +14746,31 @@ function caml_ml_out_channels_list(param) { var stdin = undefined; +exports.$caret = $caret; exports.stdin = stdin; exports.stdout = stdout; exports.stderr = stderr; +exports.caml_ml_open_descriptor_in = caml_ml_open_descriptor_in; +exports.caml_ml_open_descriptor_out = caml_ml_open_descriptor_out; exports.caml_ml_flush = caml_ml_flush; +exports.node_std_output = node_std_output; exports.caml_ml_output = caml_ml_output; exports.caml_ml_output_char = caml_ml_output_char; +exports.caml_ml_input = caml_ml_input; +exports.caml_ml_input_char = caml_ml_input_char; exports.caml_ml_out_channels_list = caml_ml_out_channels_list; -/* No side effect */ +/* node_std_output Not a pure module */ }).call(this,require('_process')) -},{"./curry.js":55,"_process":62}],44:[function(require,module,exports){ +},{"./caml_builtin_exceptions.js":37,"./curry.js":54,"_process":62}],45:[function(require,module,exports){ 'use strict'; -var Caml_option = require("./caml_option.js"); -var Caml_exceptions = require("./caml_exceptions.js"); - -var $$Error = Caml_exceptions.create("Caml_js_exceptions.Error"); - -function internalToOCamlException(e) { - if (Caml_exceptions.caml_is_extension(e)) { - return e; - } else { - return [ - $$Error, - e - ]; - } -} -function caml_as_js_exn(exn) { - if (exn[0] === $$Error) { - return Caml_option.some(exn[1]); - } - +function not_implemented(s) { + var str = s + " not implemented by BuckleScript yet\n"; + throw new Error(str); } -exports.$$Error = $$Error; -exports.internalToOCamlException = internalToOCamlException; -exports.caml_as_js_exn = caml_as_js_exn; -/* No side effect */ - -},{"./caml_exceptions.js":39,"./caml_option.js":47}],45:[function(require,module,exports){ -'use strict'; - - -function not_implemented (s){ - throw new Error(s + " not implemented by BuckleScript yet\n") -}; - exports.not_implemented = not_implemented; /* No side effect */ @@ -14774,7 +14833,7 @@ function caml_update_dummy(x, y) { } } -function for_in (o,foo){ +var for_in = function (o,foo){ for (var x in o) { foo(x) } }; @@ -15202,99 +15261,7 @@ exports.caml_max = caml_max; exports.caml_obj_set_tag = caml_obj_set_tag; /* No side effect */ -},{"./block.js":33,"./caml_builtin_exceptions.js":37,"./caml_primitive.js":48}],47:[function(require,module,exports){ -'use strict'; - - -var undefinedHeader = /* array */[]; - -function some(x) { - if (x === undefined) { - var block = /* tuple */[ - undefinedHeader, - 0 - ]; - block.tag = 256; - return block; - } else if (x !== null && x[0] === undefinedHeader) { - var nid = x[1] + 1 | 0; - var block$1 = /* tuple */[ - undefinedHeader, - nid - ]; - block$1.tag = 256; - return block$1; - } else { - return x; - } -} - -function nullable_to_opt(x) { - if (x === null || x === undefined) { - return undefined; - } else { - return some(x); - } -} - -function undefined_to_opt(x) { - if (x === undefined) { - return undefined; - } else { - return some(x); - } -} - -function null_to_opt(x) { - if (x === null) { - return undefined; - } else { - return some(x); - } -} - -function valFromOption(x) { - if (x !== null && x[0] === undefinedHeader) { - var depth = x[1]; - if (depth === 0) { - return undefined; - } else { - return /* tuple */[ - undefinedHeader, - depth - 1 | 0 - ]; - } - } else { - return x; - } -} - -function option_get(x) { - if (x === undefined) { - return undefined; - } else { - return valFromOption(x); - } -} - -function option_get_unwrap(x) { - if (x === undefined) { - return undefined; - } else { - return valFromOption(x)[1]; - } -} - -exports.nullable_to_opt = nullable_to_opt; -exports.undefined_to_opt = undefined_to_opt; -exports.null_to_opt = null_to_opt; -exports.valFromOption = valFromOption; -exports.some = some; -exports.option_get = option_get; -exports.option_get_unwrap = option_get_unwrap; -/* No side effect */ - -},{}],48:[function(require,module,exports){ +},{"./block.js":33,"./caml_builtin_exceptions.js":37,"./caml_primitive.js":47}],47:[function(require,module,exports){ 'use strict'; @@ -15378,34 +15345,6 @@ function caml_bytes_compare(s1, s2) { } } -function caml_bytes_equal(s1, s2) { - var len1 = s1.length; - var len2 = s2.length; - if (len1 === len2) { - var s1$1 = s1; - var s2$1 = s2; - var _off = 0; - var len = len1; - while(true) { - var off = _off; - if (off === len) { - return true; - } else { - var a = s1$1[off]; - var b = s2$1[off]; - if (a === b) { - _off = off + 1 | 0; - continue ; - } else { - return false; - } - } - }; - } else { - return false; - } -} - function caml_bool_min(x, y) { if (x) { return y; @@ -15507,7 +15446,6 @@ var caml_nativeint_compare = caml_int_compare; var caml_int32_compare = caml_int_compare; exports.caml_bytes_compare = caml_bytes_compare; -exports.caml_bytes_equal = caml_bytes_equal; exports.caml_int_compare = caml_int_compare; exports.caml_bool_compare = caml_bool_compare; exports.caml_float_compare = caml_float_compare; @@ -15528,11 +15466,15 @@ exports.caml_nativeint_max = caml_nativeint_max; exports.caml_int32_max = caml_int32_max; /* No side effect */ -},{}],49:[function(require,module,exports){ +},{}],48:[function(require,module,exports){ 'use strict'; var Caml_builtin_exceptions = require("./caml_builtin_exceptions.js"); +function string_of_char(prim) { + return String.fromCharCode(prim); +} + function caml_string_get(s, i) { if (i >= s.length || i < 0) { throw [ @@ -15544,6 +15486,150 @@ function caml_string_get(s, i) { } } +function caml_create_string(len) { + if (len < 0) { + throw [ + Caml_builtin_exceptions.invalid_argument, + "String.create" + ]; + } else { + var result = new Array(len); + for(var i = 0 ,i_finish = len - 1 | 0; i <= i_finish; ++i){ + result[i] = /* "\000" */0; + } + return result; + } +} + +function caml_fill_string(s, i, l, c) { + if (l > 0) { + for(var k = i ,k_finish = (l + i | 0) - 1 | 0; k <= k_finish; ++k){ + s[k] = c; + } + return /* () */0; + } else { + return 0; + } +} + +function caml_blit_string(s1, i1, s2, i2, len) { + if (len > 0) { + var off1 = s1.length - i1 | 0; + if (len <= off1) { + for(var i = 0 ,i_finish = len - 1 | 0; i <= i_finish; ++i){ + s2[i2 + i | 0] = s1.charCodeAt(i1 + i | 0); + } + return /* () */0; + } else { + for(var i$1 = 0 ,i_finish$1 = off1 - 1 | 0; i$1 <= i_finish$1; ++i$1){ + s2[i2 + i$1 | 0] = s1.charCodeAt(i1 + i$1 | 0); + } + for(var i$2 = off1 ,i_finish$2 = len - 1 | 0; i$2 <= i_finish$2; ++i$2){ + s2[i2 + i$2 | 0] = /* "\000" */0; + } + return /* () */0; + } + } else { + return 0; + } +} + +function caml_blit_bytes(s1, i1, s2, i2, len) { + if (len > 0) { + if (s1 === s2) { + var s1$1 = s1; + var i1$1 = i1; + var i2$1 = i2; + var len$1 = len; + if (i1$1 < i2$1) { + var range_a = (s1$1.length - i2$1 | 0) - 1 | 0; + var range_b = len$1 - 1 | 0; + var range = range_a > range_b ? range_b : range_a; + for(var j = range; j >= 0; --j){ + s1$1[i2$1 + j | 0] = s1$1[i1$1 + j | 0]; + } + return /* () */0; + } else if (i1$1 > i2$1) { + var range_a$1 = (s1$1.length - i1$1 | 0) - 1 | 0; + var range_b$1 = len$1 - 1 | 0; + var range$1 = range_a$1 > range_b$1 ? range_b$1 : range_a$1; + for(var k = 0; k <= range$1; ++k){ + s1$1[i2$1 + k | 0] = s1$1[i1$1 + k | 0]; + } + return /* () */0; + } else { + return 0; + } + } else { + var off1 = s1.length - i1 | 0; + if (len <= off1) { + for(var i = 0 ,i_finish = len - 1 | 0; i <= i_finish; ++i){ + s2[i2 + i | 0] = s1[i1 + i | 0]; + } + return /* () */0; + } else { + for(var i$1 = 0 ,i_finish$1 = off1 - 1 | 0; i$1 <= i_finish$1; ++i$1){ + s2[i2 + i$1 | 0] = s1[i1 + i$1 | 0]; + } + for(var i$2 = off1 ,i_finish$2 = len - 1 | 0; i$2 <= i_finish$2; ++i$2){ + s2[i2 + i$2 | 0] = /* "\000" */0; + } + return /* () */0; + } + } + } else { + return 0; + } +} + +function bytes_of_string(s) { + var len = s.length; + var res = new Array(len); + for(var i = 0 ,i_finish = len - 1 | 0; i <= i_finish; ++i){ + res[i] = s.charCodeAt(i); + } + return res; +} + +function bytes_to_string(a) { + var bytes = a; + var i = 0; + var len = a.length; + var s = ""; + var s_len = len; + if (i === 0 && len <= 4096 && len === bytes.length) { + return String.fromCharCode.apply(null, bytes); + } else { + var offset = 0; + while(s_len > 0) { + var next = s_len < 1024 ? s_len : 1024; + var tmp_bytes = new Array(next); + caml_blit_bytes(bytes, offset, tmp_bytes, 0, next); + s = s + String.fromCharCode.apply(null, tmp_bytes); + s_len = s_len - next | 0; + offset = offset + next | 0; + }; + return s; + } +} + +function caml_string_of_char_array(chars) { + var len = chars.length; + var bytes = new Array(len); + for(var i = 0 ,i_finish = len - 1 | 0; i <= i_finish; ++i){ + bytes[i] = chars[i]; + } + return bytes_to_string(bytes); +} + +function caml_is_printable(c) { + if (c > 31) { + return c < 127; + } else { + return false; + } +} + function caml_string_get16(s, i) { return s.charCodeAt(i) + (s.charCodeAt(i + 1 | 0) << 8) | 0; } @@ -15563,36 +15649,47 @@ function get(s, i) { } } +exports.bytes_of_string = bytes_of_string; +exports.bytes_to_string = bytes_to_string; +exports.caml_is_printable = caml_is_printable; +exports.caml_string_of_char_array = caml_string_of_char_array; exports.caml_string_get = caml_string_get; +exports.caml_create_string = caml_create_string; +exports.caml_fill_string = caml_fill_string; +exports.caml_blit_string = caml_blit_string; +exports.caml_blit_bytes = caml_blit_bytes; exports.caml_string_get16 = caml_string_get16; exports.caml_string_get32 = caml_string_get32; +exports.string_of_char = string_of_char; exports.get = get; /* No side effect */ -},{"./caml_builtin_exceptions.js":37}],50:[function(require,module,exports){ +},{"./caml_builtin_exceptions.js":37}],49:[function(require,module,exports){ (function (process){ 'use strict'; var Caml_builtin_exceptions = require("./caml_builtin_exceptions.js"); function caml_sys_getenv(s) { - if (typeof process === "undefined" || (process.env) === undefined) { - throw Caml_builtin_exceptions.not_found; - } else { - var match = (process.env)[s]; - if (match !== undefined) { - return match; + var match = typeof (process) === "undefined" ? undefined : (process); + if (match !== undefined) { + var match$1 = match.env[s]; + if (match$1 !== undefined) { + return match$1; } else { throw Caml_builtin_exceptions.not_found; } + } else { + throw Caml_builtin_exceptions.not_found; } } function caml_sys_time(param) { - if (typeof process === "undefined" || (process.uptime) === undefined) { - return -1; + var match = typeof (process) === "undefined" ? undefined : (process); + if (match !== undefined) { + return match.uptime(); } else { - return process.uptime(); + return -1; } } @@ -15605,40 +15702,42 @@ function caml_sys_system_command(_cmd) { } function caml_sys_getcwd(param) { - if (typeof process === "undefined") { - return "/"; + var match = typeof (process) === "undefined" ? undefined : (process); + if (match !== undefined) { + return match.cwd(); } else { - return process.cwd(); + return "/"; } } -function caml_sys_get_argv(param) { - if (typeof process === "undefined") { - return /* tuple */[ - "", - /* array */[""] - ]; - } else { - var argv = (process.argv); - if (argv == null) { +function caml_sys_get_argv(param) { + var match = typeof (process) === "undefined" ? undefined : (process); + if (match !== undefined) { + if (match.argv == null) { return /* tuple */[ "", /* array */[""] ]; } else { return /* tuple */[ - argv[0], - argv + match.argv[0], + match.argv ]; } + } else { + return /* tuple */[ + "", + /* array */[""] + ]; } } function caml_sys_exit(exit_code) { - if (typeof process !== "undefined") { - return process.exit(exit_code); + var match = typeof (process) === "undefined" ? undefined : (process); + if (match !== undefined) { + return match.exit(exit_code); } else { - return 0; + return /* () */0; } } @@ -15668,25 +15767,23 @@ exports.caml_sys_file_exists = caml_sys_file_exists; /* No side effect */ }).call(this,require('_process')) -},{"./caml_builtin_exceptions.js":37,"_process":62}],51:[function(require,module,exports){ +},{"./caml_builtin_exceptions.js":37,"_process":62}],50:[function(require,module,exports){ 'use strict'; -function repeat (count,self){ - if (self.repeat){ - return self.repeat(count) - } - if (self.length == 0 || count == 0) { +var repeat = ( (String.prototype.repeat && function (count,self){return self.repeat(count)}) || + function(count , self) { + if (self.length == 0 || count == 0) { return ''; } - // Ensuring count is a 31-bit integer allows us to heavily optimize the - // main part. But anyway, most current (August 2014) browsers can't handle - // strings 1 << 28 chars or longer, so: - if (self.length * count >= 1 << 28) { + // Ensuring count is a 31-bit integer allows us to heavily optimize the + // main part. But anyway, most current (August 2014) browsers can't handle + // strings 1 << 28 chars or longer, so: + if (self.length * count >= 1 << 28) { throw new RangeError('repeat count must not overflow maximum string size'); - } - var rpt = ''; - for (;;) { + } + var rpt = ''; + for (;;) { if ((count & 1) == 1) { rpt += self; } @@ -15695,15 +15792,15 @@ function repeat (count,self){ break; } self += self; + } + return rpt; } - return rpt; - -}; +); exports.repeat = repeat; -/* No side effect */ +/* repeat Not a pure module */ -},{}],52:[function(require,module,exports){ +},{}],51:[function(require,module,exports){ 'use strict'; var Char = require("./char.js"); @@ -15711,17 +15808,18 @@ var Block = require("./block.js"); var Bytes = require("./bytes.js"); var Curry = require("./curry.js"); var $$Buffer = require("./buffer.js"); +var Js_exn = require("./js_exn.js"); var $$String = require("./string.js"); var Caml_io = require("./caml_io.js"); var Caml_obj = require("./caml_obj.js"); var Caml_bytes = require("./caml_bytes.js"); +var Caml_float = require("./caml_float.js"); var Caml_int32 = require("./caml_int32.js"); var Pervasives = require("./pervasives.js"); var Caml_format = require("./caml_format.js"); var Caml_string = require("./caml_string.js"); var Caml_primitive = require("./caml_primitive.js"); var Caml_exceptions = require("./caml_exceptions.js"); -var Caml_js_exceptions = require("./caml_js_exceptions.js"); var Caml_builtin_exceptions = require("./caml_builtin_exceptions.js"); var CamlinternalFormatBasics = require("./camlinternalFormatBasics.js"); @@ -15743,7 +15841,7 @@ function rev_char_set(char_set) { for(var i = 0; i <= 31; ++i){ char_set$prime[i] = Pervasives.char_of_int(Caml_string.get(char_set, i) ^ 255); } - return Caml_bytes.bytes_to_string(char_set$prime); + return Caml_string.bytes_to_string(char_set$prime); } function is_in_char_set(char_set, c) { @@ -15866,7 +15964,7 @@ function buffer_check_size(buf, overhead) { var min_len = buf[/* ind */0] + overhead | 0; if (min_len > len) { var new_len = Caml_primitive.caml_int_max((len << 1), min_len); - var new_str = Caml_bytes.caml_create_bytes(new_len); + var new_str = Caml_string.caml_create_string(new_len); Bytes.blit(buf[/* bytes */1], 0, new_str, 0, len); buf[/* bytes */1] = new_str; return /* () */0; @@ -16234,7 +16332,7 @@ function string_of_formatting_lit(formatting_lit) { case 1 : return formatting_lit[0]; case 2 : - return "@" + Caml_bytes.bytes_to_string(Bytes.make(1, formatting_lit[0])); + return "@" + Caml_string.bytes_to_string(Bytes.make(1, formatting_lit[0])); } } @@ -16525,7 +16623,7 @@ function bprint_fmt(buf, fmt) { function string_of_fmt(fmt) { var buf = /* record */[ /* ind */0, - /* bytes */Caml_bytes.caml_create_bytes(16) + /* bytes */Caml_string.caml_create_string(16) ]; bprint_fmt(buf, fmt); return buffer_contents(buf); @@ -18346,7 +18444,7 @@ function fix_padding(padty, width, str) { break; } - return Caml_bytes.bytes_to_string(res); + return Caml_string.bytes_to_string(res); } } @@ -18383,7 +18481,7 @@ function fix_int_precision(prec, str) { var res = Bytes.make(prec$1 + 2 | 0, /* "0" */48); res[1] = Caml_string.get(str, 1); $$String.blit(str, 2, res, (prec$1 - len | 0) + 4 | 0, len - 2 | 0); - return Caml_bytes.bytes_to_string(res); + return Caml_string.bytes_to_string(res); } else { exit = 2; } @@ -18413,7 +18511,7 @@ function fix_int_precision(prec, str) { var res$1 = Bytes.make(prec$1 + 1 | 0, /* "0" */48); res$1[0] = c; $$String.blit(str, 1, res$1, (prec$1 - len | 0) + 2 | 0, len - 1 | 0); - return Caml_bytes.bytes_to_string(res$1); + return Caml_string.bytes_to_string(res$1); } else { return str; } @@ -18421,7 +18519,7 @@ function fix_int_precision(prec, str) { if (prec$1 > len) { var res$2 = Bytes.make(prec$1, /* "0" */48); $$String.blit(str, 0, res$2, prec$1 - len | 0, len); - return Caml_bytes.bytes_to_string(res$2); + return Caml_string.bytes_to_string(res$2); } else { return str; } @@ -18593,7 +18691,7 @@ function format_of_aconv(iconv, c) { break; } - return $$String.concat(Caml_bytes.bytes_to_string(Bytes.make(1, c)), seps); + return $$String.concat(Caml_string.bytes_to_string(Bytes.make(1, c)), seps); } function format_of_fconv(fconv, prec) { @@ -18604,7 +18702,7 @@ function format_of_fconv(fconv, prec) { var symb = char_of_fconv(fconv); var buf = /* record */[ /* ind */0, - /* bytes */Caml_bytes.caml_create_bytes(16) + /* bytes */Caml_string.caml_create_string(16) ]; buffer_add_char(buf, /* "%" */37); bprint_fconv_flag(buf, fconv); @@ -18662,7 +18760,7 @@ function convert_float(fconv, prec, x) { } }; }; - var match = Pervasives.classify_float(x); + var match = Caml_float.caml_classify_float(x); if (match !== 3) { if (match >= 4) { return "nan"; @@ -18692,7 +18790,7 @@ function format_caml_char(c) { function string_of_fmtty(fmtty) { var buf = /* record */[ /* ind */0, - /* bytes */Caml_bytes.caml_create_bytes(16) + /* bytes */Caml_string.caml_create_string(16) ]; bprint_fmtty(buf, fmtty); return buffer_contents(buf); @@ -19574,7 +19672,7 @@ function open_box_of_string(str) { indent = Caml_format.caml_int_of_string($$String.sub(str, nstart, nend - nstart | 0)); } catch (raw_exn){ - var exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + var exn = Js_exn.internalToOCamlException(raw_exn); if (exn[0] === Caml_builtin_exceptions.failure) { indent = invalid_box(/* () */0); } else { @@ -20328,7 +20426,7 @@ function fmt_ebb_of_string(legacy_behavior, str) { } catch (raw_exn){ - var exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + var exn = Js_exn.internalToOCamlException(raw_exn); if (exn === Caml_builtin_exceptions.not_found || exn[0] === Caml_builtin_exceptions.failure) { match$7 = /* tuple */[ str_ind$1, @@ -20385,7 +20483,7 @@ function fmt_ebb_of_string(legacy_behavior, str) { } catch (raw_exn$1){ - var exn$1 = Caml_js_exceptions.internalToOCamlException(raw_exn$1); + var exn$1 = Js_exn.internalToOCamlException(raw_exn$1); if (exn$1 === Caml_builtin_exceptions.not_found || exn$1[0] === Caml_builtin_exceptions.failure) { match$13 = undefined; } else { @@ -21920,7 +22018,7 @@ function fmt_ebb_of_string(legacy_behavior, str) { return /* () */0; } catch (raw_exn){ - var exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + var exn = Js_exn.internalToOCamlException(raw_exn); if (exn[0] === Caml_builtin_exceptions.failure) { return /* () */0; } else { @@ -22067,7 +22165,7 @@ exports.trans = trans; exports.recast = recast; /* No side effect */ -},{"./block.js":33,"./buffer.js":34,"./bytes.js":35,"./caml_builtin_exceptions.js":37,"./caml_bytes.js":38,"./caml_exceptions.js":39,"./caml_format.js":40,"./caml_int32.js":41,"./caml_io.js":43,"./caml_js_exceptions.js":44,"./caml_obj.js":46,"./caml_primitive.js":48,"./caml_string.js":49,"./camlinternalFormatBasics.js":53,"./char.js":54,"./curry.js":55,"./pervasives.js":59,"./string.js":61}],53:[function(require,module,exports){ +},{"./block.js":33,"./buffer.js":34,"./bytes.js":35,"./caml_builtin_exceptions.js":37,"./caml_bytes.js":38,"./caml_exceptions.js":39,"./caml_float.js":40,"./caml_format.js":41,"./caml_int32.js":42,"./caml_io.js":44,"./caml_obj.js":46,"./caml_primitive.js":47,"./caml_string.js":48,"./camlinternalFormatBasics.js":52,"./char.js":53,"./curry.js":54,"./js_exn.js":55,"./pervasives.js":59,"./string.js":61}],52:[function(require,module,exports){ 'use strict'; var Block = require("./block.js"); @@ -22297,10 +22395,10 @@ exports.erase_rel = erase_rel; exports.concat_fmt = concat_fmt; /* No side effect */ -},{"./block.js":33}],54:[function(require,module,exports){ +},{"./block.js":33}],53:[function(require,module,exports){ 'use strict'; -var Caml_bytes = require("./caml_bytes.js"); +var Caml_string = require("./caml_string.js"); var Caml_builtin_exceptions = require("./caml_builtin_exceptions.js"); function chr(n) { @@ -22357,21 +22455,16 @@ function escaped(c) { } switch (exit) { case 1 : - var s = [ - 0, - 0, - 0, - 0 - ]; + var s = Caml_string.caml_create_string(4); s[0] = /* "\\" */92; s[1] = 48 + (c / 100 | 0) | 0; s[2] = 48 + (c / 10 | 0) % 10 | 0; s[3] = 48 + c % 10 | 0; - return Caml_bytes.bytes_to_string(s); + return Caml_string.bytes_to_string(s); case 2 : - var s$1 = [0]; + var s$1 = Caml_string.caml_create_string(1); s$1[0] = c; - return Caml_bytes.bytes_to_string(s$1); + return Caml_string.bytes_to_string(s$1); } } @@ -22403,7 +22496,7 @@ exports.uppercase = uppercase; exports.compare = compare; /* No side effect */ -},{"./caml_builtin_exceptions.js":37,"./caml_bytes.js":38}],55:[function(require,module,exports){ +},{"./caml_builtin_exceptions.js":37,"./caml_string.js":48}],54:[function(require,module,exports){ 'use strict'; var Caml_array = require("./caml_array.js"); @@ -22968,98 +23061,68 @@ exports._8 = _8; exports.__8 = __8; /* No side effect */ -},{"./caml_array.js":36}],56:[function(require,module,exports){ +},{"./caml_array.js":36}],55:[function(require,module,exports){ 'use strict'; -var Caml_option = require("./caml_option.js"); +var Caml_exceptions = require("./caml_exceptions.js"); + +var $$Error = Caml_exceptions.create("Js_exn.Error"); -function get(dict, k) { - if ((k in dict)) { - return Caml_option.some(dict[k]); +function internalToOCamlException(e) { + if (Caml_exceptions.isCamlExceptionOrOpenVariant(e)) { + return e; + } else { + return [ + $$Error, + e + ]; } - } -function unsafeDeleteKey (dict,key){ - delete dict[key]; - return 0 - }; +function raiseError(str) { + throw new Error(str); +} -function entries(dict) { - var keys = Object.keys(dict); - var l = keys.length; - var values = new Array(l); - for(var i = 0 ,i_finish = l - 1 | 0; i <= i_finish; ++i){ - var key = keys[i]; - values[i] = /* tuple */[ - key, - dict[key] - ]; - } - return values; +function raiseEvalError(str) { + throw new EvalError(str); } -function values(dict) { - var keys = Object.keys(dict); - var l = keys.length; - var values$1 = new Array(l); - for(var i = 0 ,i_finish = l - 1 | 0; i <= i_finish; ++i){ - values$1[i] = dict[keys[i]]; - } - return values$1; +function raiseRangeError(str) { + throw new RangeError(str); } -function fromList(entries) { - var dict = { }; - var _param = entries; - while(true) { - var param = _param; - if (param) { - var match = param[0]; - dict[match[0]] = match[1]; - _param = param[1]; - continue ; - } else { - return dict; - } - }; +function raiseReferenceError(str) { + throw new ReferenceError(str); } -function fromArray(entries) { - var dict = { }; - var l = entries.length; - for(var i = 0 ,i_finish = l - 1 | 0; i <= i_finish; ++i){ - var match = entries[i]; - dict[match[0]] = match[1]; - } - return dict; +function raiseSyntaxError(str) { + throw new SyntaxError(str); } -function map(f, source) { - var target = { }; - var keys = Object.keys(source); - var l = keys.length; - for(var i = 0 ,i_finish = l - 1 | 0; i <= i_finish; ++i){ - var key = keys[i]; - target[key] = f(source[key]); - } - return target; +function raiseTypeError(str) { + throw new TypeError(str); } -exports.get = get; -exports.unsafeDeleteKey = unsafeDeleteKey; -exports.entries = entries; -exports.values = values; -exports.fromList = fromList; -exports.fromArray = fromArray; -exports.map = map; +function raiseUriError(str) { + throw new URIError(str); +} + +exports.$$Error = $$Error; +exports.internalToOCamlException = internalToOCamlException; +exports.raiseError = raiseError; +exports.raiseEvalError = raiseEvalError; +exports.raiseRangeError = raiseRangeError; +exports.raiseReferenceError = raiseReferenceError; +exports.raiseSyntaxError = raiseSyntaxError; +exports.raiseTypeError = raiseTypeError; +exports.raiseUriError = raiseUriError; /* No side effect */ -},{"./caml_option.js":47}],57:[function(require,module,exports){ +},{"./caml_exceptions.js":39}],56:[function(require,module,exports){ 'use strict'; var Block = require("./block.js"); -var Caml_option = require("./caml_option.js"); +var Js_primitive = require("./js_primitive.js"); function classify(x) { var ty = typeof x; @@ -23120,7 +23183,7 @@ function decodeNumber(json) { function decodeObject(json) { if (typeof json === "object" && !Array.isArray(json) && json !== null) { - return Caml_option.some(json); + return Js_primitive.some(json); } } @@ -23156,7 +23219,99 @@ exports.decodeBoolean = decodeBoolean; exports.decodeNull = decodeNull; /* No side effect */ -},{"./block.js":33,"./caml_option.js":47}],58:[function(require,module,exports){ +},{"./block.js":33,"./js_primitive.js":57}],57:[function(require,module,exports){ +'use strict'; + + +var undefinedHeader = /* array */[]; + +function some(x) { + if (x === undefined) { + var block = /* tuple */[ + undefinedHeader, + 0 + ]; + block.tag = 256; + return block; + } else if (x !== null && x[0] === undefinedHeader) { + var nid = x[1] + 1 | 0; + var block$1 = /* tuple */[ + undefinedHeader, + nid + ]; + block$1.tag = 256; + return block$1; + } else { + return x; + } +} + +function nullable_to_opt(x) { + if (x === null || x === undefined) { + return undefined; + } else { + return some(x); + } +} + +function undefined_to_opt(x) { + if (x === undefined) { + return undefined; + } else { + return some(x); + } +} + +function null_to_opt(x) { + if (x === null) { + return undefined; + } else { + return some(x); + } +} + +function valFromOption(x) { + if (x !== null && x[0] === undefinedHeader) { + var depth = x[1]; + if (depth === 0) { + return undefined; + } else { + return /* tuple */[ + undefinedHeader, + depth - 1 | 0 + ]; + } + } else { + return x; + } +} + +function option_get(x) { + if (x === undefined) { + return undefined; + } else { + return valFromOption(x); + } +} + +function option_get_unwrap(x) { + if (x === undefined) { + return undefined; + } else { + return valFromOption(x)[1]; + } +} + +exports.nullable_to_opt = nullable_to_opt; +exports.undefined_to_opt = undefined_to_opt; +exports.null_to_opt = null_to_opt; +exports.valFromOption = valFromOption; +exports.some = some; +exports.option_get = option_get; +exports.option_get_unwrap = option_get_unwrap; +/* No side effect */ + +},{}],58:[function(require,module,exports){ 'use strict'; var Curry = require("./curry.js"); @@ -24771,13 +24926,12 @@ exports.sort_uniq = sort_uniq; exports.merge = merge; /* No side effect */ -},{"./caml_builtin_exceptions.js":37,"./caml_obj.js":46,"./curry.js":55,"./pervasives.js":59}],59:[function(require,module,exports){ +},{"./caml_builtin_exceptions.js":37,"./caml_obj.js":46,"./curry.js":54,"./pervasives.js":59}],59:[function(require,module,exports){ 'use strict'; var Curry = require("./curry.js"); var Caml_io = require("./caml_io.js"); var Caml_sys = require("./caml_sys.js"); -var Caml_bytes = require("./caml_bytes.js"); var Caml_format = require("./caml_format.js"); var Caml_string = require("./caml_string.js"); var Caml_exceptions = require("./caml_exceptions.js"); @@ -24815,22 +24969,6 @@ function lnot(x) { var min_int = -2147483648; -function classify_float(x) { - if (isFinite(x)) { - if (Math.abs(x) >= 2.2250738585072014e-308) { - return /* FP_normal */0; - } else if (x !== 0) { - return /* FP_subnormal */1; - } else { - return /* FP_zero */2; - } - } else if (isNaN(x)) { - return /* FP_nan */4; - } else { - return /* FP_infinite */3; - } -} - function char_of_int(n) { if (n < 0 || n > 255) { throw [ @@ -24912,7 +25050,7 @@ var stdout = Caml_io.stdout; var stderr = Caml_io.stderr; function open_out_gen(mode, perm, name) { - return Caml_missing_polyfill.not_implemented("caml_ml_open_descriptor_out"); + return Caml_io.caml_ml_open_descriptor_out(Caml_missing_polyfill.not_implemented("caml_sys_open")); } function open_out(name) { @@ -25021,7 +25159,7 @@ function close_out_noerr(oc) { } function open_in_gen(mode, perm, name) { - return Caml_missing_polyfill.not_implemented("caml_ml_open_descriptor_in"); + return Caml_io.caml_ml_open_descriptor_in(Caml_missing_polyfill.not_implemented("caml_sys_open")); } function open_in(name) { @@ -25086,9 +25224,9 @@ function really_input(ic, s, ofs, len) { } function really_input_string(ic, len) { - var s = Caml_bytes.caml_create_bytes(len); + var s = Caml_string.caml_create_string(len); really_input(ic, s, 0, len); - return Caml_bytes.bytes_to_string(s); + return Caml_string.bytes_to_string(s); } function input_line(chan) { @@ -25099,7 +25237,7 @@ function input_line(chan) { if (param) { var hd = param[0]; var len = hd.length; - Caml_bytes.caml_blit_bytes(hd, 0, buf, pos - len | 0, len); + Caml_string.caml_blit_bytes(hd, 0, buf, pos - len | 0, len); _param = param[1]; _pos = pos - len | 0; continue ; @@ -25115,17 +25253,17 @@ function input_line(chan) { var n = Caml_missing_polyfill.not_implemented("caml_ml_input_scan_line"); if (n === 0) { if (accu) { - return build_result(Caml_bytes.caml_create_bytes(len), len, accu); + return build_result(Caml_string.caml_create_string(len), len, accu); } else { throw Caml_builtin_exceptions.end_of_file; } } else if (n > 0) { - var res = Caml_bytes.caml_create_bytes(n - 1 | 0); + var res = Caml_string.caml_create_string(n - 1 | 0); Caml_missing_polyfill.not_implemented("caml_ml_input"); - Caml_missing_polyfill.not_implemented("caml_ml_input_char"); + Caml_io.caml_ml_input_char(chan); if (accu) { var len$1 = (len + n | 0) - 1 | 0; - return build_result(Caml_bytes.caml_create_bytes(len$1), len$1, /* :: */[ + return build_result(Caml_string.caml_create_string(len$1), len$1, /* :: */[ res, accu ]); @@ -25133,7 +25271,7 @@ function input_line(chan) { return res; } } else { - var beg = Caml_bytes.caml_create_bytes(-n | 0); + var beg = Caml_string.caml_create_string(-n | 0); Caml_missing_polyfill.not_implemented("caml_ml_input"); _len = len - n | 0; _accu = /* :: */[ @@ -25144,7 +25282,7 @@ function input_line(chan) { } }; }; - return Caml_bytes.bytes_to_string(scan(/* [] */0, 0)); + return Caml_string.bytes_to_string(scan(/* [] */0, 0)); } function close_in_noerr(ic) { @@ -25280,13 +25418,9 @@ function set_binary_mode_out(prim, prim$1) { return Caml_missing_polyfill.not_implemented("caml_ml_set_binary_mode"); } -function input_char(prim) { - return Caml_missing_polyfill.not_implemented("caml_ml_input_char"); -} +var input_char = Caml_io.caml_ml_input_char; -function input_byte(prim) { - return Caml_missing_polyfill.not_implemented("caml_ml_input_char"); -} +var input_byte = Caml_io.caml_ml_input_char; function input_binary_int(prim) { return Caml_missing_polyfill.not_implemented("caml_ml_input_int"); @@ -25357,7 +25491,6 @@ exports.max_int = max_int; exports.min_int = min_int; exports.lnot = lnot; exports.epsilon_float = epsilon_float; -exports.classify_float = classify_float; exports.char_of_int = char_of_int; exports.string_of_bool = string_of_bool; exports.bool_of_string = bool_of_string; @@ -25427,7 +25560,7 @@ exports.unsafe_really_input = unsafe_really_input; exports.do_at_exit = do_at_exit; /* No side effect */ -},{"./caml_builtin_exceptions.js":37,"./caml_bytes.js":38,"./caml_exceptions.js":39,"./caml_format.js":40,"./caml_io.js":43,"./caml_missing_polyfill.js":45,"./caml_string.js":49,"./caml_sys.js":50,"./camlinternalFormatBasics.js":53,"./curry.js":55}],60:[function(require,module,exports){ +},{"./caml_builtin_exceptions.js":37,"./caml_exceptions.js":39,"./caml_format.js":41,"./caml_io.js":44,"./caml_missing_polyfill.js":45,"./caml_string.js":48,"./caml_sys.js":49,"./camlinternalFormatBasics.js":52,"./curry.js":54}],60:[function(require,module,exports){ 'use strict'; var Curry = require("./curry.js"); @@ -25511,30 +25644,29 @@ exports.kbprintf = kbprintf; exports.kprintf = kprintf; /* No side effect */ -},{"./buffer.js":34,"./camlinternalFormat.js":52,"./curry.js":55,"./pervasives.js":59}],61:[function(require,module,exports){ +},{"./buffer.js":34,"./camlinternalFormat.js":51,"./curry.js":54,"./pervasives.js":59}],61:[function(require,module,exports){ 'use strict'; var List = require("./list.js"); var Bytes = require("./bytes.js"); -var Caml_bytes = require("./caml_bytes.js"); var Caml_int32 = require("./caml_int32.js"); +var Caml_string = require("./caml_string.js"); var Caml_primitive = require("./caml_primitive.js"); -var Caml_builtin_exceptions = require("./caml_builtin_exceptions.js"); function make(n, c) { - return Caml_bytes.bytes_to_string(Bytes.make(n, c)); + return Caml_string.bytes_to_string(Bytes.make(n, c)); } function init(n, f) { - return Caml_bytes.bytes_to_string(Bytes.init(n, f)); + return Caml_string.bytes_to_string(Bytes.init(n, f)); } function copy(s) { - return Caml_bytes.bytes_to_string(Bytes.copy(Caml_bytes.bytes_of_string(s))); + return Caml_string.bytes_to_string(Bytes.copy(Caml_string.bytes_of_string(s))); } function sub(s, ofs, len) { - return Caml_bytes.bytes_to_string(Bytes.sub(Caml_bytes.bytes_of_string(s), ofs, len)); + return Caml_string.bytes_to_string(Bytes.sub(Caml_string.bytes_of_string(s), ofs, len)); } function concat(sep, l) { @@ -25547,36 +25679,36 @@ function concat(sep, l) { len[0] = len[0] + s.length | 0; return /* () */0; }), l); - var r = Caml_bytes.caml_create_bytes(len[0] + Caml_int32.imul(sep.length, num[0] - 1 | 0) | 0); - Caml_bytes.caml_blit_string(hd, 0, r, 0, hd.length); + var r = Caml_string.caml_create_string(len[0] + Caml_int32.imul(sep.length, num[0] - 1 | 0) | 0); + Caml_string.caml_blit_string(hd, 0, r, 0, hd.length); var pos = /* record */[/* contents */hd.length]; List.iter((function (s) { - Caml_bytes.caml_blit_string(sep, 0, r, pos[0], sep.length); + Caml_string.caml_blit_string(sep, 0, r, pos[0], sep.length); pos[0] = pos[0] + sep.length | 0; - Caml_bytes.caml_blit_string(s, 0, r, pos[0], s.length); + Caml_string.caml_blit_string(s, 0, r, pos[0], s.length); pos[0] = pos[0] + s.length | 0; return /* () */0; }), l[1]); - return Caml_bytes.bytes_to_string(r); + return Caml_string.bytes_to_string(r); } else { return ""; } } function iter(f, s) { - return Bytes.iter(f, Caml_bytes.bytes_of_string(s)); + return Bytes.iter(f, Caml_string.bytes_of_string(s)); } function iteri(f, s) { - return Bytes.iteri(f, Caml_bytes.bytes_of_string(s)); + return Bytes.iteri(f, Caml_string.bytes_of_string(s)); } function map(f, s) { - return Caml_bytes.bytes_to_string(Bytes.map(f, Caml_bytes.bytes_of_string(s))); + return Caml_string.bytes_to_string(Bytes.map(f, Caml_string.bytes_of_string(s))); } function mapi(f, s) { - return Caml_bytes.bytes_to_string(Bytes.mapi(f, Caml_bytes.bytes_of_string(s))); + return Caml_string.bytes_to_string(Bytes.mapi(f, Caml_string.bytes_of_string(s))); } function is_space(param) { @@ -25592,7 +25724,7 @@ function trim(s) { if (s === "" || !(is_space(s.charCodeAt(0)) || is_space(s.charCodeAt(s.length - 1 | 0)))) { return s; } else { - return Caml_bytes.bytes_to_string(Bytes.trim(Caml_bytes.bytes_of_string(s))); + return Caml_string.bytes_to_string(Bytes.trim(Caml_string.bytes_of_string(s))); } } @@ -25626,132 +25758,54 @@ function escaped(s) { }; }; if (needs_escape(0)) { - return Caml_bytes.bytes_to_string(Bytes.escaped(Caml_bytes.bytes_of_string(s))); + return Caml_string.bytes_to_string(Bytes.escaped(Caml_string.bytes_of_string(s))); } else { return s; } } -function index_rec(s, lim, _i, c) { - while(true) { - var i = _i; - if (i >= lim) { - throw Caml_builtin_exceptions.not_found; - } else if (s.charCodeAt(i) === c) { - return i; - } else { - _i = i + 1 | 0; - continue ; - } - }; -} - function index(s, c) { - return index_rec(s, s.length, 0, c); -} - -function index_from(s, i, c) { - var l = s.length; - if (i < 0 || i > l) { - throw [ - Caml_builtin_exceptions.invalid_argument, - "String.index_from / Bytes.index_from" - ]; - } else { - return index_rec(s, l, i, c); - } + return Bytes.index(Caml_string.bytes_of_string(s), c); } -function rindex_rec(s, _i, c) { - while(true) { - var i = _i; - if (i < 0) { - throw Caml_builtin_exceptions.not_found; - } else if (s.charCodeAt(i) === c) { - return i; - } else { - _i = i - 1 | 0; - continue ; - } - }; +function rindex(s, c) { + return Bytes.rindex(Caml_string.bytes_of_string(s), c); } -function rindex(s, c) { - return rindex_rec(s, s.length - 1 | 0, c); +function index_from(s, i, c) { + return Bytes.index_from(Caml_string.bytes_of_string(s), i, c); } function rindex_from(s, i, c) { - if (i < -1 || i >= s.length) { - throw [ - Caml_builtin_exceptions.invalid_argument, - "String.rindex_from / Bytes.rindex_from" - ]; - } else { - return rindex_rec(s, i, c); - } + return Bytes.rindex_from(Caml_string.bytes_of_string(s), i, c); } -function contains_from(s, i, c) { - var l = s.length; - if (i < 0 || i > l) { - throw [ - Caml_builtin_exceptions.invalid_argument, - "String.contains_from / Bytes.contains_from" - ]; - } else { - try { - index_rec(s, l, i, c); - return true; - } - catch (exn){ - if (exn === Caml_builtin_exceptions.not_found) { - return false; - } else { - throw exn; - } - } - } +function contains(s, c) { + return Bytes.contains(Caml_string.bytes_of_string(s), c); } -function contains(s, c) { - return contains_from(s, 0, c); +function contains_from(s, i, c) { + return Bytes.contains_from(Caml_string.bytes_of_string(s), i, c); } function rcontains_from(s, i, c) { - if (i < 0 || i >= s.length) { - throw [ - Caml_builtin_exceptions.invalid_argument, - "String.rcontains_from / Bytes.rcontains_from" - ]; - } else { - try { - rindex_rec(s, i, c); - return true; - } - catch (exn){ - if (exn === Caml_builtin_exceptions.not_found) { - return false; - } else { - throw exn; - } - } - } + return Bytes.rcontains_from(Caml_string.bytes_of_string(s), i, c); } function uppercase(s) { - return Caml_bytes.bytes_to_string(Bytes.uppercase(Caml_bytes.bytes_of_string(s))); + return Caml_string.bytes_to_string(Bytes.uppercase(Caml_string.bytes_of_string(s))); } function lowercase(s) { - return Caml_bytes.bytes_to_string(Bytes.lowercase(Caml_bytes.bytes_of_string(s))); + return Caml_string.bytes_to_string(Bytes.lowercase(Caml_string.bytes_of_string(s))); } function capitalize(s) { - return Caml_bytes.bytes_to_string(Bytes.capitalize(Caml_bytes.bytes_of_string(s))); + return Caml_string.bytes_to_string(Bytes.capitalize(Caml_string.bytes_of_string(s))); } function uncapitalize(s) { - return Caml_bytes.bytes_to_string(Bytes.uncapitalize(Caml_bytes.bytes_of_string(s))); + return Caml_string.bytes_to_string(Bytes.uncapitalize(Caml_string.bytes_of_string(s))); } var compare = Caml_primitive.caml_string_compare; @@ -25787,7 +25841,7 @@ exports.uncapitalize = uncapitalize; exports.compare = compare; /* No side effect */ -},{"./bytes.js":35,"./caml_builtin_exceptions.js":37,"./caml_bytes.js":38,"./caml_int32.js":41,"./caml_primitive.js":48,"./list.js":58}],62:[function(require,module,exports){ +},{"./bytes.js":35,"./caml_int32.js":42,"./caml_primitive.js":47,"./caml_string.js":48,"./list.js":58}],62:[function(require,module,exports){ // shim for using process in browser var process = module.exports = {}; diff --git a/lib/js/test-ocaml/test_client.js b/lib/js/test-ocaml/test_client.js index 807b7ef..df5c8aa 100644 --- a/lib/js/test-ocaml/test_client.js +++ b/lib/js/test-ocaml/test_client.js @@ -1,4 +1,4 @@ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; var Test_client_drag = require("./test_client_drag.js"); diff --git a/lib/js/test-ocaml/test_client_attribute_removal.js b/lib/js/test-ocaml/test_client_attribute_removal.js index 71d3d5e..0eeb948 100644 --- a/lib/js/test-ocaml/test_client_attribute_removal.js +++ b/lib/js/test-ocaml/test_client_attribute_removal.js @@ -1,4 +1,4 @@ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; var List = require("bs-platform/lib/js/list.js"); @@ -6,7 +6,7 @@ var Vdom = require("../src-ocaml/vdom.js"); var Block = require("bs-platform/lib/js/block.js"); var Tea_app = require("../src-ocaml/tea_app.js"); var Tea_html = require("../src-ocaml/tea_html.js"); -var Caml_option = require("bs-platform/lib/js/caml_option.js"); +var Js_primitive = require("bs-platform/lib/js/js_primitive.js"); function select(param_0) { return /* Select */[param_0]; @@ -62,7 +62,7 @@ function lang(l, is_selected) { function render_languages(selected, languages) { var is_selected = function (selected, language) { if (selected !== undefined) { - return language === Caml_option.valFromOption(selected); + return language === Js_primitive.valFromOption(selected); } else { return false; } diff --git a/lib/js/test-ocaml/test_client_btn_update_span.js b/lib/js/test-ocaml/test_client_btn_update_span.js index 00295d5..3c04ccc 100644 --- a/lib/js/test-ocaml/test_client_btn_update_span.js +++ b/lib/js/test-ocaml/test_client_btn_update_span.js @@ -1,4 +1,4 @@ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; var Vdom = require("../src-ocaml/vdom.js"); diff --git a/lib/js/test-ocaml/test_client_counter.js b/lib/js/test-ocaml/test_client_counter.js index b9c6af6..bb07181 100644 --- a/lib/js/test-ocaml/test_client_counter.js +++ b/lib/js/test-ocaml/test_client_counter.js @@ -1,4 +1,4 @@ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; var Vdom = require("../src-ocaml/vdom.js"); diff --git a/lib/js/test-ocaml/test_client_counter_debug_beginner.js b/lib/js/test-ocaml/test_client_counter_debug_beginner.js index 11c33f7..5373de5 100644 --- a/lib/js/test-ocaml/test_client_counter_debug_beginner.js +++ b/lib/js/test-ocaml/test_client_counter_debug_beginner.js @@ -1,4 +1,4 @@ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; var Vdom = require("../src-ocaml/vdom.js"); diff --git a/lib/js/test-ocaml/test_client_counter_debug_program.js b/lib/js/test-ocaml/test_client_counter_debug_program.js index bca896c..f4225ca 100644 --- a/lib/js/test-ocaml/test_client_counter_debug_program.js +++ b/lib/js/test-ocaml/test_client_counter_debug_program.js @@ -1,4 +1,4 @@ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; var Vdom = require("../src-ocaml/vdom.js"); @@ -108,7 +108,11 @@ function view(model) { ]); } -function partial_arg_004(_model) { +function renderCallback(param) { + return /* () */0; +} + +function partial_arg_005(_model) { return /* NoCmd */0; } @@ -116,8 +120,9 @@ var partial_arg = /* record */[ /* init */init, /* update */update, /* view */view, + /* renderCallback */renderCallback, /* subscriptions */subscriptions, - partial_arg_004 + partial_arg_005 ]; function main(param, param$1) { @@ -130,5 +135,6 @@ exports.subscriptions = subscriptions; exports.update = update; exports.view_button = view_button; exports.view = view; +exports.renderCallback = renderCallback; exports.main = main; /* Tea_html Not a pure module */ diff --git a/lib/js/test-ocaml/test_client_counter_debug_standard.js b/lib/js/test-ocaml/test_client_counter_debug_standard.js index ef2ad6b..0ca53fb 100644 --- a/lib/js/test-ocaml/test_client_counter_debug_standard.js +++ b/lib/js/test-ocaml/test_client_counter_debug_standard.js @@ -1,4 +1,4 @@ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; var Vdom = require("../src-ocaml/vdom.js"); @@ -108,10 +108,15 @@ function view(model) { ]); } +function renderCallback(param) { + return /* () */0; +} + var partial_arg = /* record */[ /* init */init, /* update */update, /* view */view, + /* renderCallback */renderCallback, /* subscriptions */subscriptions ]; @@ -125,5 +130,6 @@ exports.subscriptions = subscriptions; exports.update = update; exports.view_button = view_button; exports.view = view; +exports.renderCallback = renderCallback; exports.main = main; /* Tea_html Not a pure module */ diff --git a/lib/js/test-ocaml/test_client_drag.js b/lib/js/test-ocaml/test_client_drag.js index 2030eed..87da12e 100644 --- a/lib/js/test-ocaml/test_client_drag.js +++ b/lib/js/test-ocaml/test_client_drag.js @@ -1,4 +1,4 @@ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; var Vdom = require("../src-ocaml/vdom.js"); @@ -198,10 +198,15 @@ function view(model) { ]); } +function renderCallback(param) { + return /* () */0; +} + var partial_arg = /* record */[ /* init */init, /* update */update, /* view */view, + /* renderCallback */renderCallback, /* subscriptions */subscriptions ]; @@ -220,5 +225,6 @@ exports.subscriptions = subscriptions; exports.px = px; exports.onMouseDown = onMouseDown; exports.view = view; +exports.renderCallback = renderCallback; exports.main = main; /* onMouseDown Not a pure module */ diff --git a/lib/js/test-ocaml/test_client_http_task.js b/lib/js/test-ocaml/test_client_http_task.js index b988654..2c308b8 100644 --- a/lib/js/test-ocaml/test_client_http_task.js +++ b/lib/js/test-ocaml/test_client_http_task.js @@ -1,4 +1,4 @@ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; var Vdom = require("../src-ocaml/vdom.js"); @@ -66,6 +66,10 @@ function som(param) { } } +function renderCallback(param) { + return /* () */0; +} + function partial_arg_000(param) { return /* tuple */[ "nothing", @@ -73,7 +77,7 @@ function partial_arg_000(param) { ]; } -function partial_arg_003(param) { +function partial_arg_004(param) { return /* NoSub */0; } @@ -81,7 +85,8 @@ var partial_arg = /* record */[ partial_arg_000, /* update */update, /* view */view, - partial_arg_003 + /* renderCallback */renderCallback, + partial_arg_004 ]; function main(param, param$1) { @@ -95,5 +100,6 @@ exports.req = req; exports.update = update; exports.view = view; exports.som = som; +exports.renderCallback = renderCallback; exports.main = main; /* Tea_html Not a pure module */ diff --git a/lib/js/test-ocaml/test_client_on_with_options.js b/lib/js/test-ocaml/test_client_on_with_options.js index a675d6f..e153520 100644 --- a/lib/js/test-ocaml/test_client_on_with_options.js +++ b/lib/js/test-ocaml/test_client_on_with_options.js @@ -1,4 +1,4 @@ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; var List = require("bs-platform/lib/js/list.js"); diff --git a/lib/js/test-ocaml/tester.js b/lib/js/test-ocaml/tester.js index f5ea6e2..93dfdf9 100644 --- a/lib/js/test-ocaml/tester.js +++ b/lib/js/test-ocaml/tester.js @@ -1,4 +1,4 @@ -// Generated by BUCKLESCRIPT VERSION 4.0.18, PLEASE EDIT WITH CARE +// Generated by BUCKLESCRIPT VERSION 4.0.7, PLEASE EDIT WITH CARE 'use strict'; From 8f0b10656d80fabadfd5ecc43891e38f1b87ec9b Mon Sep 17 00:00:00 2001 From: Paul Biggar Date: Wed, 31 Jul 2019 16:58:17 -0700 Subject: [PATCH 4/4] Add renderCallback to README --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index e84e805..39f2e42 100644 --- a/README.md +++ b/README.md @@ -117,6 +117,7 @@ let main = model = init (); (* Since model is a set value here, we call our init function to generate that value *) update; view; + renderCallback = (fun _ -> ()) } ```