adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.09 release notes: https://caml.inria.fr/pub/distrib/ocaml-4.09/notes/Changes | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
barockobamo has quit [Remote host closed the connection]
jao has quit [Remote host closed the connection]
jao has joined #ocaml
smazga has quit [Quit: leaving]
<Leonidas> spew: to me it is weird that apply takes a `('a -> 'b) Applicative.t`
<Leonidas> but I guess, I also never tried to write something that is a (nontrivial) monad, I just used one, so maybe writing something that would adhere to the Laws of Robotics^WMonads would confuse me similarly.
dogui has quit [Ping timeout: 265 seconds]
dogui has joined #ocaml
spew has quit [Quit: Connection closed for inactivity]
jao has quit [Remote host closed the connection]
mfp has quit [Ping timeout: 250 seconds]
Haudegen has quit [Quit: Bin weg.]
iovec has quit [Quit: Connection closed for inactivity]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 250 seconds]
bartholin has quit [Ping timeout: 245 seconds]
bartholin has joined #ocaml
jao has joined #ocaml
jao is now known as Guest23569
Guest23569 has quit [Remote host closed the connection]
tormen has joined #ocaml
tormen_ has quit [Ping timeout: 250 seconds]
jao- has joined #ocaml
gravicappa has joined #ocaml
ggole has joined #ocaml
narimiran has joined #ocaml
ygrek__ has joined #ocaml
dborisog has joined #ocaml
mbuf has joined #ocaml
jnavila has joined #ocaml
jnavila has quit [Ping timeout: 246 seconds]
mbuf has quit [Quit: Leaving]
jao- has quit [Ping timeout: 268 seconds]
mbuf has joined #ocaml
Serpent7776 has joined #ocaml
vicfred has quit [Quit: Leaving]
ygrek__ has quit [Ping timeout: 276 seconds]
bartholin has quit [Remote host closed the connection]
<dborisog> Hi, I have a question related to HTML handling in Ocsigen (and type-system yet to become native, thus error messages are difficult to understand). I failed to generate a table, and I'm wondering if you can give me few tips.
<dborisog> let%shared indicator_block ccode = Eliom_content.Html.D.( let%lwt indicators = country_indicators ccode in let indicators = List.map ( fun (year, pt, res) ->  tr [ D.td [ D.txt ( Int32.to_string year       ) ]    ; D.td [ D.txt ( float_option_to_string pt  ) ] ; D.td [ D.txt ( float_option_to_string res ) ] ]) indicators in Lwt.return  [ D.h2 [ D.txt "Indicators" ]  ; D.table [ D.tr [ D.th [ D.txt "Year"] ; D.th [ D.txt "PT"] ; D.t
<dborisog> h [ D.txt "RES"] ] ] ])
Haudegen has joined #ocaml
<dborisog> I'm sorry for poorly formatted and long piece of code. It works, and produces a single row table, the table head.
<dborisog> However, I do not understand how can I add the content part, the table body, that I prepare in "indicators" value.
<octachron_> Did you try to just append your table head to indicators? Something like "D.Table (head :: indicators)"?
<dborisog> I tried something like this before, D.table ([ D.tr [ D.th [ D.txt "Year"] ; D.th [ D.txt "RES"]]] :: indicators) produces the following error: This expression has type 'a list but an expression was expected of type ([< Html_types.table_content_fun ] as 'b) Eliom_content.Html.D.elt = 'b Eliom_content.Html.elt
<dborisog> The processing of <ul> and <li> tags in Ocsigen are processed as [ul li_list_block], by following this logic, I need to use [tbody tr_list_block], but it seems tbody is not supported.
<dborisog> which means, if Ocsigen does not support adding content rows as a block to an existing table, I need to preprocess the join of the head block with the content block, and apply [table] function to the all_rows_block, e.g. [table all_rows_block]
<dborisog> octachron_: thank you. The suggested line of thinking worked. the following addition (the table_rows piece) produced the HTML table.
<dborisog> in let table_rows = D.tr [ D.th [ D.txt "Year"] ; D.th [ D.txt "RES"] ] :: indicators in Lwt.return [ D.h2 [ D.txt "Indicators" ] ; D.table table_rows ])
mfp has joined #ocaml
<Nikkel> What do I do with an error »[eliom:client] unique node without id attribute«? I'm using bootstrap-select to generate a nicer select menu from a normal Html.R.select which gets the options within from the React model
<dborisog> Nikkel: in the code examples I've seen "a_class" used to to control classes of the generated HTML classes. Both a_class and a_id are present here https://ocsigen.org/tyxml/dev/api/Html_sigs.T
<dborisog> * HTML tags
<dborisog> Therefore, the logic suggests to build the HTML tree with bootstra-friendly classes and Ids, and Bootstrap CSS ans JS would manage presnetation and dynamics. Not sure about mobile part of Ocsigen
<Nikkel> I don't really think that's the issue
<Nikkel> Maybe eliom has a problem with removing the generated html between model updates
runawayfive has quit [Quit: M-muh logs...]
<Nikkel> How do I call jQuery using Js_of_ocaml.Js.Unsafe?
<Nikkel> I'm trying Js.Unsafe.fun_call "jQuery" [|Js.Unsafe.inject @@ "#" ^ ~%select_id|] , but it seems jQuery is not a function
<Nikkel> so should I get the object instead, and how do I get the jQuery object?
<Nikkel> oh, maybe Unsafe.variable
kleisli has quit [Read error: Connection reset by peer]
kleisli has joined #ocaml
barockobamo has joined #ocaml
dhil has joined #ocaml
free_beard has joined #ocaml
_whitelogger has joined #ocaml
dhil has quit [Ping timeout: 250 seconds]
dhil has joined #ocaml
sz0 has joined #ocaml
barockobamo has quit [Quit: Leaving]
mbuf has quit [Read error: Connection reset by peer]
Haudegen has quit [Quit: Bin weg.]
spew has joined #ocaml
Plazma has joined #ocaml
jao has joined #ocaml
Serpent7776 has quit [Quit: Leaving]
Haudegen has joined #ocaml
Plazma has left #ocaml [#ocaml]
sz0 has quit [Quit: Connection closed for inactivity]
dhil has quit [Ping timeout: 240 seconds]
<porchetta> where can I find the formal specification of the ocaml grammar?
<theblatte> I think it's in the OCaml documentation?
<theblatte> eg pieced together from the sections in http://caml.inria.fr/pub/docs/manual-ocaml/language.html
narimiran has quit [Quit: leaving]
dhil has joined #ocaml
oni-on-ion has joined #ocaml
unyu has quit [Ping timeout: 276 seconds]
gareppa has joined #ocaml
unyu has joined #ocaml
gareppa has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
rustik has joined #ocaml
rustik has quit [Read error: Connection reset by peer]
rustik has joined #ocaml
rustik has quit [Read error: Connection reset by peer]
madroach has quit [Ping timeout: 264 seconds]
Serpent7776 has joined #ocaml
ziyourenxiang has quit [Ping timeout: 250 seconds]
madroach has joined #ocaml
smazga has joined #ocaml
bartholin has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
dhil has quit [Quit: Quit]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
free_beard has quit [Remote host closed the connection]
dborisog has quit [Ping timeout: 250 seconds]
Haudegen has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 250 seconds]
kakadu_ has quit [Remote host closed the connection]
ggole has quit [Quit: Leaving]
sarna has quit [Quit: bye]
sarna has joined #ocaml
Haudegen has quit [Quit: No Ping reply in 180 seconds.]
Haudegen has joined #ocaml
gravicappa has quit [Ping timeout: 250 seconds]
kakadu has joined #ocaml
jnavila has joined #ocaml
rzmt has joined #ocaml
<rzmt> Hi, why would i get error "Error: Unbound value List.filter_map" when using List.filter_map. List.map seems to work fine. I'm looking at this doc https://caml.inria.fr/pub/docs/manual-ocaml/libref/List.html
<companion_cube> what version of OCaml do you use?
<rzmt> ocaml 4.07.0 and dune 1.11.3
<oni-on-ion> ok the page says filter_map is added in 4.08
<rzmt> ah makes sense
<rzmt> Perhaps there is function with type 'a option list -> 'a list, which filters out the None values?
<oni-on-ion> could you `opam switch 4.08.0` ?
<rzmt> Actually i think i'll handle the option type in different fashion. But thanks for help
<companion_cube> use containers or Base, both have this function
kakadu has quit [Ping timeout: 276 seconds]
kakadu_ has joined #ocaml
jnavila has quit [Remote host closed the connection]
Hrundi_V_Bakshi has joined #ocaml
iZsh_ has joined #ocaml
iZsh has quit [Ping timeout: 245 seconds]
vicfred has joined #ocaml
bitwinery has joined #ocaml
kotrcka has joined #ocaml
unyu has quit [Quit: brb]
unyu has joined #ocaml
Serpent7776 has quit [Quit: leaving]
vicfred has quit [Quit: Leaving]
kakadu_ has quit [Remote host closed the connection]
bitwinery has quit [Quit: Leaving]
Desetude has joined #ocaml
<Desetude> Is there a higher order function that is like map but each element in the source list generates a list which is then unioned with all the other generated lists
<Desetude> like a one-to-many map function
ziyourenxiang has joined #ocaml
smazga has quit [Quit: leaving]
vicfred has joined #ocaml
<companion_cube> List.flat_map, in several alternative libraries
<Desetude> Great thanks