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
rzmt has quit [Ping timeout: 240 seconds]
rzmt has joined #ocaml
spew has quit [Quit: Connection closed for inactivity]
Haudegen has quit [Quit: Bin weg.]
vicfred has joined #ocaml
mfp has quit [Ping timeout: 250 seconds]
bartholin has quit [Ping timeout: 276 seconds]
bartholin has joined #ocaml
ziyourenxiang_ has joined #ocaml
ziyourenxiang has quit [Ping timeout: 246 seconds]
tormen_ has joined #ocaml
ziyourenxiang has joined #ocaml
tormen has quit [Ping timeout: 240 seconds]
ziyourenxiang_ has quit [Ping timeout: 268 seconds]
ziyourenxiang_ has joined #ocaml
ziyourenxiang has quit [Ping timeout: 265 seconds]
c4rc4s has joined #ocaml
gravicappa has joined #ocaml
narimiran has joined #ocaml
c4rc4s has quit [Quit: Adios]
c4rc4s has joined #ocaml
ggole has joined #ocaml
nullifidian has joined #ocaml
oni-on-ion has quit [Remote host closed the connection]
oni-on-ion has joined #ocaml
jao has quit [Remote host closed the connection]
narimiran has quit [Ping timeout: 250 seconds]
ygrek has joined #ocaml
domovoy_ has quit [Quit: Leaving]
jao has joined #ocaml
Haudegen has joined #ocaml
Serpent7776 has joined #ocaml
asdasd has joined #ocaml
bartholin has quit [Remote host closed the connection]
asdasd has quit [Remote host closed the connection]
jao has quit [Ping timeout: 276 seconds]
_whitelogger has joined #ocaml
ygrek has quit [Remote host closed the connection]
kakadu_ has quit [Ping timeout: 268 seconds]
kakadu_ has joined #ocaml
kakadu_ has quit [Ping timeout: 268 seconds]
kakadu has joined #ocaml
stux|RC has quit [Read error: Connection reset by peer]
stux|RC has joined #ocaml
mfp has joined #ocaml
dborisog has joined #ocaml
narimiran has joined #ocaml
jco has joined #ocaml
ziyourenxiang__ has joined #ocaml
ziyourenxiang_ has quit [Ping timeout: 265 seconds]
iovec has joined #ocaml
jao has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
spew has joined #ocaml
tane has joined #ocaml
jao has quit [Remote host closed the connection]
<narimiran> what does the "Unbound record field out_queue" mean?
<narimiran> i have a record from another module, where one of its fields is that `out_queue`
<narimiran> what i'm trying to do is stuff like `Queue.is_empty comp.out_queue` - the error is thrown here
<narimiran> i can work around it if in that module i define some proc that basically does that, and then i call that proc. is that the way to go?
jao has joined #ocaml
<companion_cube> no, you can also write `comp.Other_module.out_queue`
<companion_cube> qualified record syntax
<octachron> Or you can open the module defining the record type. This is necessary because record fields live in the module that defined them.
<narimiran> thank you guys!
<narimiran> btw, in the same file `while Queue.length comp.out_queue > 0 do ...` seems to be ok as it is :/
Haudegen has joined #ocaml
<octachron> This is type-guided disambiguation: if the compiler as learned the type of `comp`, it has more info when looking for the record field
<narimiran> aha!
jao has quit [Remote host closed the connection]
<companion_cube> don't open is you can avoid it
<companion_cube> (that's my rule of thumb)
<narimiran> yeah, i can avoid it
<ggole> You can use disambiguation without opening modules though: fun (record : Foo.t) -> <use the fields of record unqualified here>
<ggole> The inconsistency of of annotating records but not other things is a bit annoying, but it works well enough.
gareppa has joined #ocaml
webshinra has joined #ocaml
dborisog has quit [Ping timeout: 268 seconds]
Serpent7776 has quit [Quit: Leaving]
jaar has joined #ocaml
peddie has quit [Ping timeout: 250 seconds]
psacrifice has quit [Quit: ZNC 1.7.1 - https://znc.in]
smazga has joined #ocaml
ziyourenxiang__ has quit [Ping timeout: 268 seconds]
jao has joined #ocaml
jao has quit [Remote host closed the connection]
jao has joined #ocaml
gareppa has quit [Quit: Leaving]
gareppa has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
gareppa has quit [Quit: Leaving]
gareppa has joined #ocaml
minusoneplusone has joined #ocaml
<minusoneplusone> could anybody help me understand why this happens?
<minusoneplusone> i can fix this by myself, but i'd have to understand why this thing is happening at first
<companion_cube> what's lazyfun?
jco has quit [Quit: WeeChat 2.6]
<minusoneplusone> lazy functions
<companion_cube> yeah but what does that mean? :D
<minusoneplusone> just anonymous functions where arguments are not evaluated when the function application happens
<minusoneplusone> but later when the argument symbol is found
<minusoneplusone> i wrote about the difference here
<minusoneplusone> `let f = lazyfun n -> n + 1 in f 1` returns 2 just like it would in a normal fun
<minusoneplusone> but uses lazy evaluation.
<minusoneplusone> in a normal `fun` (eager evaluation) the symbol n is bound to the value 1 just as soon as the call to the function f happens
<minusoneplusone> in lazy evaluation the AST expression is bound instead of a reduced value, and it is carried on in the evaluation until it is looked up in the evaluation of the function body
<zozozo> So basically, call by name ?
<companion_cube> minusoneplusone: if you're doing a minicaml, why not have lazy values, rather than lazy functions?
mfp has quit [Ping timeout: 240 seconds]
<minusoneplusone> i have lazy values
<minusoneplusone> with `let lazy`
<minusoneplusone> that work correctly
<minusoneplusone> should i drop lazy functions completely? and just use lazy values? (arguments are always evaluated in an eager way but the function is defined as lazy) ???
<companion_cube> I don't know, really
<minusoneplusone> lol
Ankhers has quit [Quit: ZNC 1.7.2 - https://znc.in]
Ankhers has joined #ocaml
oni-on-ion has quit [Remote host closed the connection]
oni-on-ion has joined #ocaml
rotucer has joined #ocaml
minusoneplusone has quit [Ping timeout: 246 seconds]
Haudegen has joined #ocaml
minusoneplusone has joined #ocaml
kakadu has quit [Remote host closed the connection]
minusoneplusone has quit [Remote host closed the connection]
Ankhers has quit [Quit: ZNC 1.7.3 - https://znc.in]
Ankhers has joined #ocaml
oni-on-ion has quit [Ping timeout: 252 seconds]
gareppa has quit [Quit: Leaving]
oni-on-ion has joined #ocaml
bitwinery has joined #ocaml
kakadu has joined #ocaml
bitwinery has quit [Remote host closed the connection]
bitwinery has joined #ocaml
jaar has quit [Ping timeout: 268 seconds]
tsuyoshi has joined #ocaml
ggole has quit [Quit: Leaving]
<tsuyoshi> I'm trying to get some old code compiling, and I'm running into this new Bytes/String distinction
<tsuyoshi> it makes sense to have read-only strings, but the Bytes type is still using chars... I don't get it
<tsuyoshi> I would think the point was to move to utf-8 strings and then have a unicode code point type? is the "char" in ocaml meant to be a byte, i.e. an integer 0-255?
<companion_cube> `char` is a byte, yes
<companion_cube> for a unicode point, there's `Uchar.t`
<companion_cube> (in the stdlib, or in `uchar` on old versions)
<tsuyoshi> ok, I understand
<tsuyoshi> should I be using Bytes at all?
<companion_cube> if you mutate strings or do IO, sure
<companion_cube> (typically, for managing IO buffers)
<companion_cube> otherwise, normal values should be strings, if you carry text around
<tsuyoshi> well I guess my question is, should I be mutating strings?
<companion_cube> now you should really really not!
<tsuyoshi> like if I convert a string into bytes, mutate it, convert it back into a string
<companion_cube> I mean, -safe-string is the bomb (and it's the default now)
<tsuyoshi> oh ok
<companion_cube> you should not do that with `Bytes.unsafe_to_string` :D
<companion_cube> I mean, the rule is simple: a string must not be mutated
<tsuyoshi> am I right in thinking the long-term plan is to have utf-8 strings?
<companion_cube> bytes->string is only useful when you promise never to use the bytes again
<companion_cube> they're already utf-8, in a sense… or they should be
<tsuyoshi> they used to be latin-1 (haven't used ocaml in about 10 years)
<tsuyoshi> but I'll just change this code to stop mutating stuff
<companion_cube> ah that's dead now (latin1)
<companion_cube> string literals should be utf8
TC01 has quit [Ping timeout: 240 seconds]
Hrundi_V_Bakshi has joined #ocaml
TC01 has joined #ocaml
jnavila has joined #ocaml
<tsuyoshi> huh... String module is pretty bare-bones
<Armael> you can use the "astring" library for an extended (ascii) string library, and the uu* libraries by daniel bunzli for unicode manipulation
<tsuyoshi> this old code uses camomile, how does that fit in? should I migrate away from it?
<Armael> ah, in that case I think you can probably stick to camomile
jao has quit [Ping timeout: 240 seconds]
porchetta has quit [Ping timeout: 268 seconds]
<tsuyoshi> oh, |> is in stdlib now, nice
porchetta has joined #ocaml
bartholin has joined #ocaml
porchetta has quit [Ping timeout: 250 seconds]
<companion_cube> it's been a while :)
<companion_cube> and @@ too
porchetta has joined #ocaml
<narimiran> wait, there was a time when ocaml didn't have |> ?
<companion_cube> yep
<tsuyoshi> it was very common to just put a definition for |> at the top of a source file
minusoneplusone has joined #ocaml
<narimiran> so one day we might even get `>>` :) (yeah, companion_cube, i use CCFun.%> a lot :))
<companion_cube> ahahah I don't
<companion_cube> oh well :D
<tsuyoshi> it's really amazing how fast the ocaml compiler is
<delysin> is batteries used that much anymore?
<Armael> not that much no
<Armael> well it's quite solid but doesn't evolve that much nowadays
kakadu has quit [Ping timeout: 245 seconds]
kakadu_ has joined #ocaml
rosterok has joined #ocaml
narimiran has quit [Ping timeout: 252 seconds]
kakadu has joined #ocaml
kakadu_ has quit [Ping timeout: 268 seconds]
vicfred has quit [Remote host closed the connection]
vicfred has joined #ocaml
vicfred has quit [Max SendQ exceeded]
vicfred has joined #ocaml
vicfred has quit [Max SendQ exceeded]
vicfred has joined #ocaml
gravicappa has quit [Ping timeout: 246 seconds]
minusoneplusone has quit [Ping timeout: 268 seconds]
madroach_ has quit [Read error: Connection reset by peer]
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
madroach has joined #ocaml
jnavila has quit [Ping timeout: 246 seconds]
jao has joined #ocaml
vicfred has quit [Quit: Leaving]
rosterok has quit [Quit: Connection closed for inactivity]
ziyourenxiang__ has joined #ocaml
jao has quit [Remote host closed the connection]
madroach has quit [Quit: leaving]
jao has joined #ocaml
smazga has quit [Quit: leaving]
tane has quit [Quit: Leaving]
kakadu has quit [Remote host closed the connection]