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>
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]
<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