Ok, errors were shown as soon as I started to type
I followed directly @OvermindDL1’s tutorial http://blog.overminddl1.com/posts/bucklescript-tea-game-overbots-pt1-setup/
For the file
open Tea
open Overbots_types
let init () =
let model = {
msgs = [];
resource_values = Overbots_resource.init_resource_values;
bool_flags = init_bool_flags;
int_flags = init_int_flags;
} in
(model, Cmd.none)
let update model = function
| NothingYet -> (model, Cmd.none)
let subscriptions _model =
Sub.none
type model = {
msgs : game_msg list;
resource_values : resource_value ResourceMap.t;
bool_flags : bool_flags;
int_flags : int_flags;
}
let main =
App.standardProgram {
init;
update;
view = Overbots_view.view;
subscriptions;
}
I get those errors
with this .merlin
content
####{BSB GENERATED: NO EDIT
FLG -ppx /Users/bartosz/Documents/OCaml/overbots/node_modules/bs-platform/bin/bsppx.exe
S /Users/bartosz/Documents/OCaml/overbots/node_modules/bs-platform/lib/ocaml
B /Users/bartosz/Documents/OCaml/overbots/node_modules/bs-platform/lib/ocaml
FLG -nostdlib -no-alias-deps -color always -w -40+6+7+27+32..39+44+45
S /Users/bartosz/Documents/OCaml/overbots/node_modules/bucklescript-tea/lib/ocaml
B /Users/bartosz/Documents/OCaml/overbots/node_modules/bucklescript-tea/lib/ocaml
S src
B lib/bs/src
####BSB GENERATED: NO EDIT}
Although it all compiles nicely!
And even if I make a typo, or forget to write something, compiler nicely prints relevant easy to fix error.
PS. Strangely enough, after simply cloning overbots
repo doing npm install
and then npm run build
I get first in this file node_modules/bucklescript-tea/src/tea_json.ml
errors
Error: Unbound value reify_type
Hint: Did you mean reifyType?
ninja: build stopped: subcommand failed.
But after fixing them there I get anther error
File "overbots/src/overbots.ml", line 19, characters 23-46:
Error: Unbound module Ex
ninja: build stopped: subcommand failed.
And I think that what Bucklescript is lacking most is good tutorials showing how to write simple apps. A Phoenix + Bucklescript ( + maybe React/Vue/whatever) simple Todo crud app with ie. some websockets usage would be something that could really help with adoption of Bucklescript.
PPS. For me Phoenix and Elm, a real use case (pt. 1) · bigardone.dev was enough to boost my ELM knowledge to a level where I can write a mildly complicated app that has real world usage (internal in company but still)
And another big thanks from my side to @bigardone for that tutorial