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
VincentCordobes has quit [Ping timeout: 245 seconds]
VincentCordobes has joined #ocaml
VincentCordobes has quit [Ping timeout: 245 seconds]
brettgilio has quit [Ping timeout: 268 seconds]
oni-on-ion has quit [Ping timeout: 260 seconds]
VincentCordobes has joined #ocaml
VincentCordobes has quit [Ping timeout: 248 seconds]
oni-on-ion has joined #ocaml
VincentCordobes has joined #ocaml
kleisli has joined #ocaml
VincentCordobes has quit [Ping timeout: 260 seconds]
VincentCordobes has joined #ocaml
brettgilio has joined #ocaml
VincentCordobes has quit [Ping timeout: 260 seconds]
VincentCordobes has joined #ocaml
VincentCordobes has quit [Ping timeout: 260 seconds]
VincentCordobes has joined #ocaml
VincentCordobes has quit [Ping timeout: 252 seconds]
VincentCordobes has joined #ocaml
VincentCordobes has quit [Ping timeout: 245 seconds]
VincentCordobes has joined #ocaml
VincentCordobes has quit [Ping timeout: 245 seconds]
VincentCordobes has joined #ocaml
VincentCordobes has quit [Ping timeout: 246 seconds]
VincentCordobes has joined #ocaml
VincentCordobes has quit [Ping timeout: 260 seconds]
VincentCordobes has joined #ocaml
VincentCordobes has quit [Ping timeout: 252 seconds]
tormen_ has joined #ocaml
tormen has quit [Ping timeout: 268 seconds]
VincentCordobes has joined #ocaml
VincentCordobes has quit [Ping timeout: 248 seconds]
VincentCordobes has joined #ocaml
VincentCordobes has quit [Ping timeout: 246 seconds]
VincentCordobes has joined #ocaml
VincentCordobes has quit [Ping timeout: 260 seconds]
mbuf has joined #ocaml
zwindl has quit [Quit: reboot or OOMed]
abc_ has joined #ocaml
gravicappa has joined #ocaml
_whitelogger has joined #ocaml
_whitelogger has joined #ocaml
ggole has joined #ocaml
dborisog has joined #ocaml
_whitelogger has joined #ocaml
kleisli has quit [Ping timeout: 258 seconds]
gravicappa has quit [Ping timeout: 260 seconds]
gravicappa has joined #ocaml
Haudegen has joined #ocaml
Nikkel has quit [Ping timeout: 248 seconds]
Nikkel has joined #ocaml
bacam has quit [Ping timeout: 252 seconds]
bacam has joined #ocaml
kakadu has quit [Remote host closed the connection]
kakadu has joined #ocaml
Nikkel has quit [Ping timeout: 248 seconds]
<dborisog> In the following code I'm trying to split (TyXML/Eliom) SVG construction into functional blocks and merge these within the function "line".
<dborisog> let plot ~s:s = Svg.D.[rect ~a:[..] [title]];;
<dborisog> let axes ~s:s ~m:m = Svg.D.[line ~a:[..] [title] ; line ~a:[..] [title]];;
<dborisog> let area ~s:s ~m:m = Svg.D.[rect ~a:[..] [title]];;
<dborisog> let line ~s:s ~m:m = Html.D.svg ~a:[..] ( plot ~s:s ; area ~s:s ~m:m ; axes ~s:s ~m:m );;
<dborisog> However, only the last block in the "line" function becomes visible, while others are not being constructed. Is there a syntactic rule I am missing or misuing that would allow to have all three blocks constructed?
bartholin has quit [Quit: Leaving]
oni-on-ion has quit [Remote host closed the connection]
oni-on-ion has joined #ocaml
Nikkel has joined #ocaml
mbuf has quit [Quit: Leaving]
<ggole> The effectful sequence being passed as the second argument to Html.D.svg looks pretty suspicious
<ggole> Maybe that's supposed to be a list or something
<ggole> (As a side note, where a label and the name of the argument are the same you can use ~name as a shortcut: that is, ~s instead of ~s:s.)
<dborisog> let line ~s:s ~m:m = Html.D.svg ~a:[..] [ plot ~s:s ; area ~s:s ~m:m ; axes ~s:s ~m:m ];;
<dborisog> returns
<dborisog> Thank you for the tip in the argument's label-name
<dborisog> Error: This expression has type [> Svg_types.rect ] Eliom_content.Svg.D.elt list but an expression was expected of type ([< Html_types.svg_content ] as 'a) Eliom_content.Svg.D.Raw.elt = 'a Eliom_content.Svg.elt
<dborisog> (that's regarding plot ~s:s bit)
<ggole> Seems likely that you need a way of turning a list of elts into a elt
<dborisog> Or to have some sort of a wrapper, but I'm still rather clumsy while working with the documentation ( http://ocsigen.org/tyxml/4.3.0/api/Svg_types#TYPEsvg_content ).
<ggole> Wow, that's quite the pile of stuff
<dborisog> TyXML is a rather interesting library that allows programmatic construction of HTML and SVG trees. Developed by Drup for Ocsigen project, who is also present in this chat )
ygrek has joined #ocaml
ygrek has quit [Remote host closed the connection]
ygrek has joined #ocaml
_whitelogger has joined #ocaml
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 260 seconds]
_whitelogger has joined #ocaml
ygrek has quit [Ping timeout: 268 seconds]
vicfred has quit [Ping timeout: 260 seconds]
rotucer has joined #ocaml
Anarchos has joined #ocaml
rotucer has quit [Read error: Connection reset by peer]
rotucer has joined #ocaml
Anarchos has quit [Read error: Connection reset by peer]
Anarchos has joined #ocaml
Anarchos has quit [Client Quit]
rotucer has quit [Read error: Connection reset by peer]
rotucer has joined #ocaml
rotucer has quit [Read error: Connection reset by peer]
rotucer has joined #ocaml
<Drup> dborisog: either all your elements are lists (what you did with Svg.[ ... ]), and you concatenate them to form a list of elements, or you have single elements and you make a list of them
<Drup> don't mix both :p
rotucer has quit [Read error: Connection reset by peer]
rotucer has joined #ocaml
<dborisog> The following line worked (it seems I have missed this combination of my monkey-style programming)
<dborisog> Thank you!
<dborisog> let line ~s:s ~m:m = Html.D.svg ~a:[..] ( (plot ~s:s) @ (area ~s:s ~m:m) @ (axes ~s:s ~m:m) )
<dborisog> And now I understand why, in one of the combinations, the line function (producing two elements) have been returning the last element only.
rotucer has quit [Read error: Connection reset by peer]
rotucer has joined #ocaml
rotucer has quit [Ping timeout: 240 seconds]
rotucer has joined #ocaml
rotucer has quit [Ping timeout: 268 seconds]
rotucer has joined #ocaml
brettgilio has quit [Quit: Quit]
vicfred has joined #ocaml
_whitelogger has joined #ocaml
dckc has quit [Ping timeout: 268 seconds]
dckc has joined #ocaml
jco has joined #ocaml
<jco> Hello
<jco> whet I'd like to do is to add a position p as argument to the VertLee module and change the compare function so as to include this position p in it
<jco> is this feasible?
<jco> basically adding an argument of type position to the module
kleisli has joined #ocaml
rotucer has quit [Quit: Quit]
brettgilio has joined #ocaml
<def`> jco: It seems you would like to parametrize the module by an argument of type position ?
kark has joined #ocaml
<def`> You can so with a module VertLee (P : sig val p : position end) : Set.OrderedType with type t = position = struct ... P.p ... end
<def`> (a functor)
jco has quit [Quit: WeeChat 2.6]
jco has joined #ocaml
<jco> thank you def` !
ggole has quit [Quit: Leaving]
dborisog has quit [Ping timeout: 240 seconds]
vicfred has quit [Quit: Leaving]
<jco> def`: if I'd like to use the above module with different values of P.p does this indicate I have to create a new module each time?
<jco> for example I could write a function that would return a new module P with a specific value for P.p?
<def`> Yes you need to do that
gravicappa has quit [Ping timeout: 268 seconds]
<def`> What you are trying to achieve?
ygrek has joined #ocaml
<jco> great! I'm trying to sort vertices for Lee's algorithm
<jco> I'm using a set to extract the min element at each iteration
<jco> def`: do you have an idea how to make such a function?
<jco> I tried this : let make vsetlee p =
<jco> module VertLee (module P = let p = p) in module VSetLee = Set.Make (VertLee)
<jco> but the syntax is incorrect
<def`> jco: use Array.sort or List.compare for sorting
<def`> List.sort sorry
<def`> Using a module is possible but is likely the wrong abstraction.
<def`> If you still need parametric modules, look for functors and first-class module in the manual
<jco> yes I tried it but I wanted to try this way
<jco> for fun
brettgilio has quit [Ping timeout: 260 seconds]
kakadu_ has joined #ocaml
<jco> well yes it seems a bit too elaborated, I'll stick with List.sort
jco has quit [Quit: WeeChat 2.6]
gravicappa has joined #ocaml
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 260 seconds]
brettgilio has joined #ocaml
<Leonidas> amusing to see an post by objmagic
gravicappa has quit [Ping timeout: 240 seconds]
Palpares has joined #ocaml
kakadu__ has joined #ocaml
kakadu_ has quit [Ping timeout: 258 seconds]
kakadu_ has joined #ocaml
kakadu__ has quit [Ping timeout: 260 seconds]
ygrek_ has joined #ocaml
ygrek has quit [Ping timeout: 268 seconds]
ygrek_ has quit [Ping timeout: 260 seconds]
unyu has quit [Ping timeout: 246 seconds]
_whitelogger has joined #ocaml
brettgilio has quit [Ping timeout: 260 seconds]
kakadu_ has quit [Remote host closed the connection]
unyu has joined #ocaml
unyu has quit [Remote host closed the connection]
unyu has joined #ocaml
unyu has quit [Client Quit]
unyu has joined #ocaml
nullcone has joined #ocaml
vicfred has joined #ocaml