simn__ has quit [Read error: Connection reset by peer]
petroav has joined #ocaml
petroav has quit [Remote host closed the connection]
sh0t has quit [Remote host closed the connection]
cthuluh has quit [Ping timeout: 268 seconds]
cthuluh has joined #ocaml
silver has quit [Read error: Connection reset by peer]
nomicflux has joined #ocaml
d0nn1e has quit [Ping timeout: 268 seconds]
d0nn1e has joined #ocaml
mfp has quit [Ping timeout: 250 seconds]
TarVanimelde has joined #ocaml
timclassic has quit [Remote host closed the connection]
diamaths[m] has quit [Read error: Connection reset by peer]
regnt[m] has quit [Read error: Connection reset by peer]
Guest23668[m] has quit [Read error: Connection reset by peer]
M-ErkkiSeppl has quit [Read error: Connection reset by peer]
M-jimt has quit [Write error: Connection reset by peer]
XC[m] has quit [Read error: Connection reset by peer]
barkmadley[m] has quit [Read error: Connection reset by peer]
M-Illandan has quit [Write error: Connection reset by peer]
aspiwack[m] has quit [Read error: Connection reset by peer]
srenatus[m] has quit [Read error: Connection reset by peer]
na9da[m] has quit [Read error: Connection reset by peer]
dfeldman[m] has quit [Write error: Connection reset by peer]
M-pesterhazy has quit [Write error: Connection reset by peer]
M-martinklepsch has quit [Write error: Connection reset by peer]
lpw25[m] has quit [Remote host closed the connection]
Bluddy[m] has quit [Read error: Connection reset by peer]
regnat[m] has quit [Write error: Connection reset by peer]
matth[m] has quit [Write error: Connection reset by peer]
michbad has joined #ocaml
malina has quit [Quit: Throwing apples of Montserrat]
wu_ng has joined #ocaml
michbad has quit [Remote host closed the connection]
ygrek has quit [Ping timeout: 244 seconds]
lpw25[m] has joined #ocaml
nomicflux has quit [Quit: nomicflux]
dmbaturin has quit [Ping timeout: 240 seconds]
dmbaturin has joined #ocaml
diamaths[m] has joined #ocaml
M-jimt has joined #ocaml
regnat[m] has joined #ocaml
M-martinklepsch has joined #ocaml
timclassic has joined #ocaml
na9da[m] has joined #ocaml
XC[m] has joined #ocaml
aspiwack[m] has joined #ocaml
Bluddy[m] has joined #ocaml
regnt[m] has joined #ocaml
dfeldman[m] has joined #ocaml
M-pesterhazy has joined #ocaml
M-Illandan has joined #ocaml
srenatus[m] has joined #ocaml
matth[m] has joined #ocaml
Guest23668[m] has joined #ocaml
M-ErkkiSeppl has joined #ocaml
barkmadley[m] has joined #ocaml
zpe has joined #ocaml
fraggle_ has quit [Ping timeout: 246 seconds]
zpe has quit [Ping timeout: 258 seconds]
tmtwd has joined #ocaml
troydm has quit [Ping timeout: 250 seconds]
fraggle_ has joined #ocaml
trepta has joined #ocaml
nomicflux has joined #ocaml
tmtwd has quit [Quit: Leaving]
atsampson has quit [Ping timeout: 240 seconds]
pierpa has quit [Ping timeout: 260 seconds]
atsampson has joined #ocaml
axiles_ has quit [Ping timeout: 268 seconds]
axiles_ has joined #ocaml
jao has quit [Ping timeout: 250 seconds]
zpe has joined #ocaml
zpe has quit [Ping timeout: 260 seconds]
trepta7 has joined #ocaml
trepta7 has quit [Read error: Connection reset by peer]
fraggle_ has quit [Ping timeout: 246 seconds]
larhat has quit [Quit: Leaving.]
trepta7 has joined #ocaml
trepta7 has quit [Remote host closed the connection]
trepta7 has joined #ocaml
average has quit [Ping timeout: 260 seconds]
fraggle_ has joined #ocaml
fraggle_ has quit [Ping timeout: 260 seconds]
average has joined #ocaml
fraggle_ has joined #ocaml
pyon has joined #ocaml
nomicflux has quit [Ping timeout: 246 seconds]
MercurialAlchemi has joined #ocaml
pyx has joined #ocaml
pyx has quit [Client Quit]
fraggle_ has quit [Ping timeout: 250 seconds]
groovy2shoes has quit [Quit: Leaving]
lukky513 has quit [Ping timeout: 248 seconds]
lyxia has quit [Ping timeout: 248 seconds]
companion_cube has quit [Ping timeout: 248 seconds]
Nazral has quit [Ping timeout: 248 seconds]
lyxia has joined #ocaml
companion_cube has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 245 seconds]
Nazral has joined #ocaml
lukky513 has joined #ocaml
fraggle_ has joined #ocaml
zpe has joined #ocaml
zpe has quit [Remote host closed the connection]
barkmadley[m] has quit [Ping timeout: 240 seconds]
regnat[m] has quit [Ping timeout: 245 seconds]
lpw25[m] has quit [Ping timeout: 245 seconds]
srenatus[m] has quit [Ping timeout: 245 seconds]
M-ErkkiSeppl has quit [Ping timeout: 260 seconds]
aspiwack[m] has quit [Ping timeout: 260 seconds]
M-martinklepsch has quit [Ping timeout: 246 seconds]
Bluddy[m] has quit [Ping timeout: 240 seconds]
timclassic has quit [Ping timeout: 240 seconds]
diamaths[m] has quit [Ping timeout: 260 seconds]
matth[m] has quit [Ping timeout: 250 seconds]
M-Illandan has quit [Ping timeout: 250 seconds]
XC[m] has quit [Ping timeout: 260 seconds]
regnt[m] has quit [Ping timeout: 260 seconds]
dfeldman[m] has quit [Ping timeout: 260 seconds]
M-pesterhazy has quit [Ping timeout: 260 seconds]
na9da[m] has quit [Ping timeout: 260 seconds]
M-jimt has quit [Ping timeout: 260 seconds]
Guest23668[m] has quit [Ping timeout: 260 seconds]
copy` has quit [Quit: Connection closed for inactivity]
MercurialAlchemi has joined #ocaml
libertas has quit [Ping timeout: 248 seconds]
tormen_ has joined #ocaml
libertas has joined #ocaml
freusque has joined #ocaml
rwmjones has joined #ocaml
ra4king1 has joined #ocaml
tormen has quit [Ping timeout: 260 seconds]
rwmjones|afk has quit [Ping timeout: 244 seconds]
ra4king has quit [Ping timeout: 244 seconds]
ra4king1 is now known as ra4king
trepta has quit [Ping timeout: 246 seconds]
trepta7 has quit [Ping timeout: 265 seconds]
freusque has quit [Ping timeout: 250 seconds]
alfredo has joined #ocaml
djellemah_ has joined #ocaml
malc_ has joined #ocaml
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ocaml595 has joined #ocaml
<ocaml595>
Can anyone help me find out how to end this function when the full string is processed ? http://pastebin.com/R4J4tQ48
djellemah has quit [Ping timeout: 240 seconds]
djellemah_ has quit [Ping timeout: 260 seconds]
FreeBirdLjj has joined #ocaml
michbad has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 244 seconds]
<ocaml595>
How is the recursion stopped when the string processing has ended ?
<ocaml595>
and the list returned
aspiwack[m] has joined #ocaml
timclassic has joined #ocaml
regnt[m] has joined #ocaml
Bluddy[m] has joined #ocaml
larhat has joined #ocaml
timclassic has quit [Ping timeout: 240 seconds]
Bluddy[m] has quit [Ping timeout: 258 seconds]
regnt[m] has quit [Ping timeout: 258 seconds]
aspiwack[m] has quit [Ping timeout: 258 seconds]
djellemah has joined #ocaml
djellemah_ has joined #ocaml
mloy has quit [Ping timeout: 260 seconds]
Simn has joined #ocaml
tizoc has quit [Ping timeout: 250 seconds]
ygrek has joined #ocaml
michbad_ has joined #ocaml
ohama has quit [Ping timeout: 244 seconds]
michbad has quit [Ping timeout: 250 seconds]
mloy has joined #ocaml
tizoc has joined #ocaml
ohama has joined #ocaml
freusque has joined #ocaml
mloy has quit [Ping timeout: 260 seconds]
mloy has joined #ocaml
axiles_ has quit [Ping timeout: 246 seconds]
michbad_ has quit [Remote host closed the connection]
maattdd has joined #ocaml
AlexDenisov has joined #ocaml
axiles_ has joined #ocaml
AltGr has joined #ocaml
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 265 seconds]
mfp has joined #ocaml
malc_ has quit [Ping timeout: 256 seconds]
Mercuria1Alchemi has joined #ocaml
cthuluh has quit [Ping timeout: 256 seconds]
MercurialAlchemi has quit [Ping timeout: 250 seconds]
<freehck>
ocaml595: what is "insert"?
<freehck>
This function is not defined.
<freehck>
Maybe it would be more useful if you write what this function's supposed to do.
cthuluh has joined #ocaml
lpw25[m] has joined #ocaml
djellemah_ has quit [Ping timeout: 250 seconds]
noddy has quit [Ping timeout: 240 seconds]
jnavila has joined #ocaml
<flux>
he actually defined it a while back
<flux>
let insert l a = if List.mem_assoc a l then let n = List.assoc a l in (a, n+1)::(List.remove_assoc a l) else (a, 1)::l
fraggle_ has quit [Quit: -ENOBRAIN]
fraggle_ has joined #ocaml
<companion_cube>
o/
<zozozo>
the insert_at_end seems to only take into account chars with even positions in the opriginal string (because i is incremented, and c is subbed, strangely)
noddy has joined #ocaml
<zozozo>
ocaml595: what should the semantics of your function be ?
ocabot has quit [Remote host closed the connection]
ocabot has joined #ocaml
<nullx002>
jmiven: in pdf or epub? it is easy to convert that way... or else i have to wget it first and than have to convert it to local copy
yomimono has joined #ocaml
th5 has joined #ocaml
d0nn1e has quit [Ping timeout: 260 seconds]
d0nn1e has joined #ocaml
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ryanartecona has joined #ocaml
madroach has quit [Ping timeout: 264 seconds]
marsam has joined #ocaml
t4nk634 has quit [Ping timeout: 260 seconds]
madroach has joined #ocaml
Mercuria1Alchemi has joined #ocaml
AlexDenisov has joined #ocaml
FreeBirdLjj has joined #ocaml
agarwal1975 has quit [Quit: agarwal1975]
malc_ has joined #ocaml
copy` has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 260 seconds]
nomicflux has joined #ocaml
larhat has quit [Quit: Leaving.]
orbifx-m has joined #ocaml
<orbifx-m>
Is is possible to declare a nested record without having first declare a type?
<flux>
you mean type foo = { foo : foo option } ?
<flux>
oh, I misunderstood
<zozozo>
there's the recent inline record type
<flux>
can you use it within records?
<zozozo>
don't think so
<orbifx-m>
type t = { a = { b = float } }
<flux>
right, so the answer is: you can use nested records with sum types, but not otherwise
<zozozo>
orbifx-m: afail, you cannot do that, you have to give a name to the internal type
<flux>
type foo = Foo of { a : int }
<zozozo>
*afaik
<flux>
if you have recent enough ocaml
<flux>
but note that this is not the same as defining the type
<flux>
basically it's a performance optimization
<orbifx-m>
?
<flux>
type r = { a : int } type foo = Foo of r is less memory-efficient than type foo = Foo of { a : int }, but the latter prohibits you from. ie pattern matching the record only and then returning it
<flux>
so this works only for the first: let take_r foo = match foo with Foo x -> x
<zozozo>
it seems to me like it could be solved using a type annotation on mk_aux, but I can't seem to find the right syntax
slash^ has quit [Read error: Connection reset by peer]
<flux>
yeah, functions taking gadt parameters must always be annotated
<zozozo>
right, but I don't knwo how to write the correct annotation
<flux>
let foo : type x. x typ -> x = fun gadt -> blabla
<zozozo>
problem is that it's the other way around
<zozozo>
I'd like : let foo : type x. int -> x foobar (with x = [< `A | `B ])
<flux>
isn't that pretty normal return value
<flux>
let foo : int -> [<`A | `B] = fun i -> return Foo
<flux>
s/return // :)
<flux>
so perhaps the problem is rather that the type of mk_aux gets bound by previous uses of it
<flux>
as you mention ;)
<zozozo>
indeed, if I remove the earlier call, the right type is inferred
ryanartecona has joined #ocaml
<flux>
maybe you can break the loop by definin mk_aux beforehand, and passing mk_val as a parameter to it
<flux>
not sure if there's another solution that doesn't involve recursive modules
<flux>
do you know the recursive modules solution?
<zozozo>
I'd like to avoid it if possible
<zozozo>
in the worst case, I can always define the function twice, :/
<flux>
then I suggest you try the mk_aux mk_val -trick
<zozozo>
alright, that worked
AlexRussia has quit [Ping timeout: 258 seconds]
<zozozo>
still a bit sad that a call to the function trumps the rightly inferred type
<companion_cube>
I still think you can annotate
<flux>
I understand recursive bindings can be tricky to type-infer, that's why it's limited
<zozozo>
companion_cube: if you have a solution, I'm all ears, ^^
<companion_cube>
have you tried with `type a. …` ?
<flux>
I don't think type a. is applicaple as it's one exact type
<flux>
zozozo, so you're writing some ocaml datastructure walker?
<zozozo>
well, kinda yup
<zozozo>
the goal is to output the actual memory representation to some kind of graph
<zozozo>
in order to show easily how things are represented in ocaml
<zozozo>
and since I was at it, I found it fun to use gadts to express some of the invariants on the representation
<flux>
and not regretting it too much yet?-)
agarwal1975 has joined #ocaml
<zozozo>
nope
Mercuria1Alchemi has quit [Ping timeout: 265 seconds]
<zozozo>
companion_cube: I tried with the type a, but 1) without constraint it obviously fails (because it'd be wrong) 2) with constraint I get syntax errors
<companion_cube>
interesting
malina has joined #ocaml
<zozozo>
hm.. maybe I could write some small self-contained example to reproduce and ask for advice on the mailing list ? to see if someone can come up with a working annotation ?
diamaths[m] has quit [Read error: Connection reset by peer]
regnat[m] has quit [Read error: Connection reset by peer]
timclassic has quit [Read error: Connection reset by peer]
dfeldman[m] has quit [Read error: Connection reset by peer]
regnt[m] has quit [Write error: Connection reset by peer]
M-Illandan has quit [Write error: Connection reset by peer]
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<flux>
pretty sure it's not doable.. :)
agarwal1975 has joined #ocaml
<companion_cube>
it means some types are inferrable but not annotable?
<zozozo>
that would strike me as odd
<flux>
they are not inferrable nor annotable in case of recursive definitions.
<zozozo>
or even a bug or missing feature
octachron has joined #ocaml
<companion_cube>
flux: this is weird, though
yomimono has quit [Ping timeout: 248 seconds]
<octachron>
zozozo, I got an "this expression is not allowed in let rec" error with your example
<flux>
I wonder though if there was some way to express type constraints in function definitions, though
<zozozo>
octachron: weird.. I tested on ocaml 4.02.3, 4.03.0 and 4.04.0 and got the wrong inferred type error
<zozozo>
what version did you try with ?
<octachron>
4.04?
<octachron>
but anyway after adding an argument to to bar, the right problem is triggered
<zozozo>
I'm on 4.04.0+flambda and I dont get that error
<zozozo>
well I'll adapt my example then
<octachron>
and I think that the right type annotation is : "let rec foo: 'a. int -> ([< `A | ` B ] as 'a) foo = Foo i … "
<zozozo>
octachron: it works ! thanks a lot
isd has quit [Ping timeout: 256 seconds]
jnavila has quit [Ping timeout: 256 seconds]
rossberg has quit [Ping timeout: 268 seconds]
FreeBirdLjj has joined #ocaml
isd has joined #ocaml
pierpa has quit [Remote host closed the connection]
pierpa has joined #ocaml
<octachron>
(At the same time, I am not completely convinced that this annotation should work since 'a is not completely polymorphic in this context)
<zozozo>
seems like in my example it's enough
yomimono has joined #ocaml
<flux>
octachron, my fault was trying to use type x . .. as x, it seems my internal model on these types does not yet match ocaml's :)
marsam has quit [Remote host closed the connection]
rossberg has joined #ocaml
lpw25[m] has joined #ocaml
<zozozo>
is there any reference out there about the memory representation of advanced structures (such as closures, lazy values, etc..) ?
<zozozo>
nevermind, I found something
<octachron>
flux, it is one of the (very) few cases where one cannot replace "'a." by "type a."
<octachron>
I probably should check if I can find other cases, otherwise the example would be a worthwile addition to the manual
maurer has quit [Ping timeout: 248 seconds]
tristero has quit [Quit: WeeChat 1.6]
tristero has joined #ocaml
freusque has quit [Ping timeout: 248 seconds]
<zozozo>
does physical equality not work on values outside the heap ? or rather on ocaml blocks with tag 1001 ?
<companion_cube>
it works on anything, afaik
<companion_cube>
it translated as pointer equality
<companion_cube>
well, word equality
<zozozo>
hu.. I have strange results when trying to analyze closures
<companion_cube>
how do you mean?
<zozozo>
in my case, two partial applications g1 and g2 of a function f have pointers to outside_the_heap blocks (which should be the function code if I'm not mistaken) that are not equal...
<zozozo>
anyway, you can see that all blocks with tag 1001 are different, which is what surprises me...
<zozozo>
and I'm testing with ocaml 4.02.3 so no flambda black magic
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
<companion_cube>
you might try to get the address of closures and compare with memory map of the binary
<companion_cube>
(forgot the name of the tool doing that)
zirman has quit [Ping timeout: 258 seconds]
kakadu has quit [Remote host closed the connection]
rossberg has quit [Ping timeout: 246 seconds]
th5 has quit [Remote host closed the connection]
<zozozo>
companion_cube: do you know how to compile and call C code functions (as external) in utop ? (I'm trying to follow the examples of the oreilly book linked above that defines an inspect function in C)
rossberg has joined #ocaml
rgrinberg has quit [Remote host closed the connection]
rgrinberg has joined #ocaml
zirman has joined #ocaml
zirman has quit [Changing host]
zirman has joined #ocaml
thizanne has quit [Remote host closed the connection]
d0nn1e has quit [Ping timeout: 260 seconds]
zirman has quit [Remote host closed the connection]
ryanartecona has quit [Quit: ryanartecona]
zirman has joined #ocaml
zirman has joined #ocaml
zirman has quit [Changing host]
zirman has quit [Ping timeout: 250 seconds]
octachron has quit [Quit: Leaving]
michbad has quit [Remote host closed the connection]
FreeBirdLjj has quit [Remote host closed the connection]