alienbot has quit [Remote host closed the connection]
brunoro_ has quit [Ping timeout: 256 seconds]
brunoro_ has joined #ocaml
pierpa has joined #ocaml
orbifx-m2 has joined #ocaml
brunoro_ has quit [Ping timeout: 246 seconds]
orbifx-m has quit [Ping timeout: 250 seconds]
balod has joined #ocaml
balod has quit [Remote host closed the connection]
TarVanim_ has joined #ocaml
TarVanimelde has quit [Ping timeout: 258 seconds]
balod has joined #ocaml
copy` has joined #ocaml
mfp has joined #ocaml
brunoro_ has joined #ocaml
TarVanim_ has quit [Quit: TarVanim_]
FreeBirdLjj has joined #ocaml
govg has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 250 seconds]
TarVanimelde has joined #ocaml
brunoro_ has quit [Ping timeout: 265 seconds]
brunoro_ has joined #ocaml
AlexDenisov has joined #ocaml
AlexDeni_ has quit [Ping timeout: 265 seconds]
brunoro_ has quit [Ping timeout: 240 seconds]
brunoro_ has joined #ocaml
brunoro_ has quit [Ping timeout: 250 seconds]
troydm has quit [Ping timeout: 250 seconds]
brunoro_ has joined #ocaml
Simn has joined #ocaml
AlexDeni_ has joined #ocaml
AlexDenisov has quit [Read error: Connection reset by peer]
orbifx has quit [Ping timeout: 268 seconds]
zpe has joined #ocaml
brunoro_ has quit [Ping timeout: 250 seconds]
balod has quit [Remote host closed the connection]
balod has joined #ocaml
AlexDenisov has joined #ocaml
TarVanimelde has quit [Quit: Leaving]
AlexDeni_ has quit [Ping timeout: 246 seconds]
Sim_n has joined #ocaml
TarVanimelde has joined #ocaml
Simn has quit [Ping timeout: 246 seconds]
kamog has quit [Ping timeout: 260 seconds]
AlexDeni_ has joined #ocaml
AlexDenisov has quit [Ping timeout: 250 seconds]
orbifx-m2 has quit [Remote host closed the connection]
malc_ has joined #ocaml
brunoro_ has joined #ocaml
shinnya has joined #ocaml
silver has joined #ocaml
sillyotter has joined #ocaml
sillyotter has quit [Client Quit]
Algebr` has joined #ocaml
brunoro_ has quit [Ping timeout: 244 seconds]
orbifx has joined #ocaml
brunoro_ has joined #ocaml
brunoro_ has quit [Ping timeout: 244 seconds]
Onemorenickname has joined #ocaml
brunoro_ has joined #ocaml
Algebr` has quit [Ping timeout: 260 seconds]
alienbot has joined #ocaml
brunoro_ has quit [Ping timeout: 252 seconds]
troydm has joined #ocaml
cdidd has quit [Ping timeout: 260 seconds]
AlexDeni_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Onemorenickname>
hi people
<Onemorenickname>
is it possible to have two mutually recursive types in different files ?
ocaml527 has joined #ocaml
cdidd has joined #ocaml
zirman has joined #ocaml
zirman has joined #ocaml
zirman has quit [Changing host]
jnavila has joined #ocaml
<ocaml527>
Question about recursive calls
brunoro_ has joined #ocaml
TarVanim_ has joined #ocaml
TarVanimelde has quit [Ping timeout: 268 seconds]
Sim_n has quit [Quit: Leaving]
brunoro_ has quit [Ping timeout: 256 seconds]
zirman has quit [Remote host closed the connection]
brunoro_ has joined #ocaml
<zozozo>
Onemorenickname: afaik it's not possible
<Onemorenickname>
zozozo : I see
<zozozo>
One solution is to make one type polymorphic and instantiate it with the other afterwards
<Onemorenickname>
i found some things with making polymorphic types or modules
<Onemorenickname>
but the problem is that it's not only two mutually recursive types
<Onemorenickname>
and it becomes ugly quite quickly with polymorphism
<zozozo>
Then define all types in the same file ?
<Onemorenickname>
i guess that's what i will do
<Onemorenickname>
but i would have like to have the functions manipulating a type and that type to be in the same file
<zozozo>
Well, you can have one big file where you define the types, and then in that file done modules for manipulating the types
<Onemorenickname>
i don't understand what you mean by "in that file done modules for manipulating the types"
<orbifx>
quit
<zozozo>
In that file, *define modules...
orbifx has quit [Quit: WeeChat 1.6]
<zozozo>
Sorry I'm on my phone, it's not easy to type long sentences
<Onemorenickname>
that's what i've done at the beginning, but my file got quite long, hence the need for separating files
<Onemorenickname>
i guess it cant be helped
<zozozo>
How long ? I personally have a 2 or 3 thousand line file somewhere where I do that
<ocaml527>
Expr( string, Expr, Expr) -> find string (callrecursive Expr) (callrecursive Expr) How do I make such recursive calls ? That call is syntactically wrong.
<ocaml527>
Anyone willing to proffer advice.
<companion_cube>
this is not even a function, where do you write it?
<ocaml527>
That is one pattern in the function.
<companion_cube>
ah, one of the branches?
<ocaml527>
Yes
<companion_cube>
looks ok then, except for the fact that Expr should be either a ternary constructor, or a nullary one,m but not both
<companion_cube>
you might want `Expr (s, e1, e2) -> find s (callrecursive e1) (callrecursive e2)`
<companion_cube>
(lowercase names for variables)
<ocaml527>
Ok. e1 and e2 will be computed first ?
<ocaml527>
find depends on the results of those two computations.
<companion_cube>
(callrecursive e{1,2}) will be computed before find, yes
<companion_cube>
but you should probably use `let` to make the evaluation order clear if it's significant
<ocaml527>
That is what I don't know. e1 and e2 are independent.
<ocaml527>
Don't want let if this is fine.
<companion_cube>
I'm not sure I follow. e1 and e2 are already values; callrecursive e1 (resp. e2) will be computed before the call to find
<companion_cube>
that's all that OCaml guarantees
<ocaml527>
Results of (callrecursive e1) and (callrecursive e2) are find's parameters.. But these two calls are totally separate. One is not the other's param.
<companion_cube>
indeed
<companion_cube>
they are computed in an unspecified order, then their results are fed to find
<ocaml527>
Let me try then. Ok
<companion_cube>
sorry, got to leave :s
<Onemorenickname>
zozozo : How do you browse that 2/3k lines file ?
<zozozo>
Onemorenickname: I split code in separate modules
<zozozo>
Also, it's mainly boilerplate code
<ocaml527>
Just tried. Doesn't match (Op ("mod", Op ("and", Op ("mul", Value (-1), Value (-5)), Value (-1)), Value (-1)))\
brunoro_ has quit [Ping timeout: 260 seconds]
brunoro_ has joined #ocaml
octachron has joined #ocaml
Onemorenickname has quit [Read error: Connection reset by peer]
brunoro_ has quit [Ping timeout: 256 seconds]
jbrown has quit [Ping timeout: 246 seconds]
TarVanim_ has quit [Quit: TarVanim_]
jnavila has quit [Remote host closed the connection]
jnavila has joined #ocaml
zirman has joined #ocaml
hyperboreean has quit [Remote host closed the connection]
jbrown has joined #ocaml
zirman has quit [Ping timeout: 256 seconds]
zirman has joined #ocaml
zirman has joined #ocaml
zirman has quit [Changing host]
TarVanimelde has joined #ocaml
brunoro_ has joined #ocaml
brunoro_ has quit [Ping timeout: 260 seconds]
brunoro_ has joined #ocaml
jnavila has quit [Ping timeout: 260 seconds]
Anarchos has joined #ocaml
adi___ has quit [Ping timeout: 260 seconds]
adi____ has joined #ocaml
zirman has quit [Remote host closed the connection]
zirman has joined #ocaml
Simn has joined #ocaml
malc_` has joined #ocaml
ocaml527 has quit [Ping timeout: 260 seconds]
malc_ has quit [Ping timeout: 268 seconds]
zirman has quit [Remote host closed the connection]
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
<theblatte>
any way to tell opam to compile OCaml without Graphics support?
<theblatte>
the x11 dependency is causing issues in Homebrew...
TarVanim_ has joined #ocaml
AlexDenisov has joined #ocaml
TarVanimelde has quit [Ping timeout: 248 seconds]
brunoro_ has quit [Ping timeout: 260 seconds]
<theblatte>
opam insists on enabling Graphics support even when x11 is not available it seems
brunoro_ has joined #ocaml
alienbot has quit [Remote host closed the connection]
brunoro_ has quit [Ping timeout: 250 seconds]
brunoro_ has joined #ocaml
brunoro_ has quit [Ping timeout: 250 seconds]
brunoro_ has joined #ocaml
<lobo>
is it possible to tell opam to ignore the lock file, when another instance is running? i'm calling "opam config var share" to find merlin/ocp-indent in my vimrc. but this fails and times out, when i run an opam upgrade in another terminal
xavierm02 has joined #ocaml
<xavierm02>
Hi. I'm trying to have several implementations of a structure (i_1, i_2, ...), including a lazy one (i_0). To do this, I have a class c and one subclass per implementation (c_0, c_1, ...), and those classes' constructors have type i_k -> c_k. The lazy implementation can also be built from any thing of type c, i.e., there is a constructor c_k -> i_0.
<xavierm02>
Then, for binary function X -> X -> X, I build have one implementation per target implementation of X, i.e. a function f_i : c -> c -> c_i. And everything is working well but I can't find a way to make f_i know when its arguments of type c are in fact of type c_i and so it can do the operation more efficiently.
<xavierm02>
The simplest way would be to have a method of c of type (I0 of i0 | I1 of i1 | ...) but that wouldn't allow adding new implementations. The next try would be to try the same thing using polymorphic variants, but then the class c becomes polymorphic and so the lazy implementation i_0 also becomes polymorphic and then you can only use the constructor c_k -> i_0 for one k per term of type i_0, i.e. you can't do lazy things on objects with
balod has quit [Remote host closed the connection]
<siaw23>
i am getting “The constructor :: does not belong to type llist” and don’t know what the problem is.
ahf has joined #ocaml
brunoro_ has joined #ocaml
<zozozo>
siaw23: when you write [1;2;3] it is equivalent to 1 :: 2 :: 3 :: [], where :: and [] are the two list constructors, so naturally [1;2;3] should have the type int list, however, your function expect something of type _ llist
<zozozo>
since :: cannot build a value of type _ llist, the type checker complains
xavierm02 has quit [Quit: Page closed]
<zozozo>
you probably want : LCons(1, LCons(2, LCons(3, LNil))) instead
<siaw23>
zozozo: LCons(1, LCons(2, LCons(3, LNil))) would be the value of the list argument?
<zozozo>
well it is a value of type int llist
<zozozo>
ah sorry, I misread
<zozozo>
so something more like LCons(1, (fun () -> LCons (2, (fun () -> ...))))
<siaw23>
zozozo: i mean “let x” instead of “val x”
<zozozo>
siaw23: won't work
<zozozo>
List.map operates on values of type 'a list
<zozozo>
here you give it a int llist
<siaw23>
zozozo: how can i print the variable in this case?
<zozozo>
well, I see two ways : either you write a function to transform an arbitrary 'a llist into a 'a list, and then print the list using code similar to what you pasted above, or you write a printing function that works on llists
yomimono has quit [Ping timeout: 260 seconds]
<siaw23>
ufff
<siaw23>
ocaml is hard
<siaw23>
if not complicated
<zozozo>
well, why are you defining a new type for lists ?
<zozozo>
well lazy lists I assume
<siaw23>
it’s from an excecise from school that i’m trying to undersetand
kakadu has quit [Remote host closed the connection]
<zozozo>
well, if you define a new type, it follows that there is (almost) no function that can make use of the specifics of that type, so you have to redo some stuff like printing