adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.06.0 release notes: https://caml.inria.fr/pub/distrib/ocaml-4.06/notes/Changes | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
mk9 has quit [Quit: mk9]
mcspud has quit [Remote host closed the connection]
caltelt_ has quit [Ping timeout: 264 seconds]
mcspud has joined #ocaml
zolk3ri has quit [Remote host closed the connection]
shinnya has quit [Ping timeout: 264 seconds]
spew has quit [Quit: Connection closed for inactivity]
halogenandtoast has joined #ocaml
halogena1dtoast has joined #ocaml
halogenandtoast has quit [Ping timeout: 264 seconds]
gtrak has joined #ocaml
silver has quit [Read error: Connection reset by peer]
gtrak has quit [Ping timeout: 268 seconds]
ygrek has quit [Ping timeout: 248 seconds]
caltelt_ has joined #ocaml
pierpal has joined #ocaml
pierpal has quit [Ping timeout: 240 seconds]
mcspud is now known as cockbot
cockbot is now known as mcspud
shinnya has joined #ocaml
malina has joined #ocaml
pierpal has joined #ocaml
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
shinnya has quit [Ping timeout: 248 seconds]
kvda has joined #ocaml
mfp has quit [Ping timeout: 256 seconds]
tormen_ has joined #ocaml
tormen has quit [Ping timeout: 240 seconds]
Denommus has joined #ocaml
pierpa has quit [Quit: Page closed]
jbrown has quit [Ping timeout: 245 seconds]
jao has quit [Ping timeout: 264 seconds]
Denommus has quit [Remote host closed the connection]
mbuf has joined #ocaml
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
pierpal has quit [Ping timeout: 240 seconds]
kvda has joined #ocaml
MercurialAlchemi has joined #ocaml
cbot has quit [Quit: Leaving]
wklm has joined #ocaml
groovy2shoes has quit [Ping timeout: 260 seconds]
maufred has quit [Quit: WeeChat 1.9]
maufred has joined #ocaml
caltelt_ has quit [Ping timeout: 256 seconds]
wklm has quit [Ping timeout: 264 seconds]
mbuf has quit [Remote host closed the connection]
mbuf has joined #ocaml
Haudegen has joined #ocaml
groovy2shoes has joined #ocaml
dhil has joined #ocaml
freyr has joined #ocaml
lokydor_ has joined #ocaml
lokydor has quit [Ping timeout: 240 seconds]
wklm has joined #ocaml
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<ehirdoy> I failed to build with 'let%lwt'. How/what libs to append?
kvda has joined #ocaml
halogena1dtoast is now known as halogenandtoast
<discord3> <mseri> What error do you get? To use that syntax you need the lwt-ppx rewirter
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<ehirdoy> discord3: I didn't know how to add preprocess in jbuild. Now I put (preprocess (pps (lwt.ppx))) instead of in (libraries). It seems working. Thanks
<xvilka> if I have a some calculation for lets say Int32, like (a lsr 16) + (b lsl 32) land 65535, how I can in a short form convert constants 16, 65535 to Int32?
flodin1 has quit [Quit: WeeChat 2.1]
<reynir> 16l IIRC
<reynir> Yes
<reynir> and 16L for int64 :)
barcabuona has joined #ocaml
<xvilka> wow
<xvilka> that was unexpected, thank you
kvda has joined #ocaml
<xvilka> one more question, I have a record with mutable fields, but want to write a function alike "let func mut_field = ... mut_field <- some", where I will apply this func alike "func rec.mut_field" instead of doing the same code multiple times in { mut_field1 <- ... }
<xvilka> how to specify that function argument is mutable record field?
<xvilka> nvm, rewrote code
<xvilka> seems impossible
barcabuona has quit [Quit: WeeChat 2.1]
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
argent_smith has joined #ocaml
tarptaeya has joined #ocaml
malina has quit [Ping timeout: 248 seconds]
freyr has quit [Ping timeout: 248 seconds]
kvda has joined #ocaml
kvda has quit [Client Quit]
inr has quit [Quit: WeeChat 2.1]
inr has joined #ocaml
freyr69 has joined #ocaml
malina has joined #ocaml
<flux[m]> xvilka: yes, impossible. if you can instead of mutable fields use 'ref', then you can pass that ref to a function.
zolk3ri has joined #ocaml
gareppa has joined #ocaml
mk9 has joined #ocaml
gareppa has quit [Remote host closed the connection]
mk9 has quit [Quit: mk9]
ziyourenxiang has joined #ocaml
mk9 has joined #ocaml
mk9 has quit [Quit: mk9]
mengu has joined #ocaml
mfp has joined #ocaml
dhil has quit [Ping timeout: 276 seconds]
tarptaeya has quit [Remote host closed the connection]
tarptaeya has joined #ocaml
Haudegen has quit [Remote host closed the connection]
mengu has quit [Remote host closed the connection]
mengu has joined #ocaml
Haudegen has joined #ocaml
zolk3ri has quit [Ping timeout: 248 seconds]
madroach has joined #ocaml
jao has joined #ocaml
zolk3ri has joined #ocaml
Lucretia has joined #ocaml
<Lucretia> hi, just trying out the interactive tutorial, lesson 2 step 3 doesn't work
pierpal has joined #ocaml
<lyxia> Lucretia: define "doesn't work"
dhil has joined #ocaml
<Lucretia> gives errors
<Lucretia> # print_int 3;;
<Lucretia> - : unit = <unknown constructor>
zolk3ri has quit [Ping timeout: 245 seconds]
zolk3ri has joined #ocaml
<lyxia> it seems to have been broken for a while https://github.com/OCamlPro/tryocaml/issues/155
<Lucretia> ok
<discord3> <Christophe> Another issue found out tht it prints to javascript console
<Lucretia> vertainly does
<Lucretia> c
gtrak has joined #ocaml
shinnya has joined #ocaml
mbuf has quit [Quit: Leaving]
zv has quit [Ping timeout: 265 seconds]
tarptaeya has quit [Ping timeout: 265 seconds]
_andre has joined #ocaml
malina has quit [Ping timeout: 240 seconds]
zv has joined #ocaml
gtrak has quit [Ping timeout: 265 seconds]
tarptaeya has joined #ocaml
mengu has quit [Read error: Connection reset by peer]
mengu has joined #ocaml
spew has joined #ocaml
dhil has quit [Ping timeout: 268 seconds]
dhil has joined #ocaml
Haudegen has quit [Remote host closed the connection]
wklm has quit [Quit: Lost terminal]
gareppa has joined #ocaml
dtornabene has joined #ocaml
jbrown has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 240 seconds]
gtrak has joined #ocaml
neatonk has joined #ocaml
gtrak has quit [Ping timeout: 260 seconds]
gareppa has quit [Quit: Leaving]
zv has quit [Ping timeout: 260 seconds]
gtrak has joined #ocaml
zv has joined #ocaml
<ELLIOTTCABLE> o7
<ELLIOTTCABLE> Is there a method like String.concat that operates on a reverse list?
<Fardale> ELLIOTTCABLE: what do you mean by reverse list ?
jmiven has quit [Quit: co'o]
<ELLIOTTCABLE> I'm constructing an accumulated list of strings, on each iteration doing something like `new_str :: acc`
jmiven has joined #ocaml
<ELLIOTTCABLE> and when the (imperative 🤮) iteration is complete, I thus have a reversed list of strings, that I then want to efficiently concatenate into one string
<octachron> ELLIOTTCABLE, there is Buffer in the stdlib for this kind of task
<ELLIOTTCABLE> `let acc = []; "a" :: acc; "b" :: acc; "c" :: acc;`, now I want `Magic.method acc` to be `"abc"`
<ELLIOTTCABLE> octachron: I'll look! Thanks!
<ELLIOTTCABLE> oh, using Core, for context. thanks RWO
<octachron> otherwise reversing the list with List.rev should be fine too?
<ELLIOTTCABLE> I'd think that'd be slow, but that was what I was about to write down anyway
malina has joined #ocaml
<Armael> can't you use Buffer even if you're using Core ?
<ELLIOTTCABLE> probably — I just forgot to mention it
steenuil_ has joined #ocaml
steenuil has quit [Ping timeout: 240 seconds]
Denommus has joined #ocaml
shinnya has quit [Ping timeout: 265 seconds]
Denommus has quit [Read error: Connection reset by peer]
freyr69 has quit [Remote host closed the connection]
mengu has quit [Read error: Connection reset by peer]
mengu has joined #ocaml
tarptaeya has quit [Quit: Konversation terminated!]
Denommus has joined #ocaml
<discord3> <Christophe> you could always fold I guess: List. fold_left (fun acc x -> x^acc) l
<discord3> <Christophe> but since octachron says Buffer is made for that you should follow his advice :)
jrslepak has joined #ocaml
<Drup> Christophe O(n²)
<discord3> <Christophe> I know, I'm just trying to answer the question literally :)
<Drup> But it's a bad answer, the complexity is terrible :D
<Drup> Using List.rev is faster
<discord3> <Perry> Sometimes n^2 doesn't matter. Like if you're dong this once in a long running program on a list of size 10.
<discord3> <Christophe> you still need to concatenate after, isn't that what is expensive?
<Drup> If n² doesn't matter, then List.rev doesn't matter either, and it's better x)
<companion_cube> I think String.concat is more efficient, right?
<companion_cube> it computes the size of the result first
<Drup> Pretty sure it just stuffs things in a buffer
<Drup> (aka, O(n))
<discord3> <Christophe> yeah, making a buffer straight rather than a list sounds like the best option anyway
<companion_cube> no, String.concat does a series of blits into a pre-allocated buffer of the right size
tokomak has joined #ocaml
shinnya has joined #ocaml
<discord3> <Christophe> I actually don't really know the complexity of stdlib functions, is it documented somewhere?
<companion_cube> it's not always documented, sadly
<companion_cube> although it's generally the best complexity possible for the corresponding data structure
<companion_cube> what isn't documented, and should be, is tail-rec-ness
dhil has quit [Ping timeout: 240 seconds]
<discord3> <Christophe> for the corresponding data structure, it means we should know the internal representation.
<Drup> That's usually explicit though
<companion_cube> exactly, it's pretty clear taht Hashtbl is a hash table :-)
<companion_cube> Map/Set are less explicit, but it's said that they're AVL trees
<discord3> <Christophe> For instance, I remember our teacher saying that the concatenation of two lists, seen as stacks, is linear in the size of the first list, but there might be some trick to make it constant time...
halogenandtoast has quit [Ping timeout: 256 seconds]
<companion_cube> there is no such trick with chained lists :p
<discord3> <Christophe> And still, it assumes you know the complexity of all those data structures
<companion_cube> well PRs to update the docs would probably be welcome :-)
dhil has joined #ocaml
<discord3> <Christophe> That would be my pleasure, alas, I don't have the answer to those questions :)
<ELLIOTTCABLE> god this lexer is becoming an eldritch horror
<ELLIOTTCABLE> if I have a type with `[@@deriving show]`, and I want to print a *list* of them, how do I go about doing so?
<ELLIOTTCABLE> do I need to create an explicit type for `list_of_bleh` or whatever so I can add `[@@deriving show]` to `list_of_bleh` as well?
<companion_cube> [%show : foo list]
<companion_cube> I think
<ELLIOTTCABLE> ooooooo duh
<ELLIOTTCABLE> thanks, companion_cube
<companion_cube> cf the readme in https://github.com/ocaml-ppx/ppx_deriving
al-damiri has joined #ocaml
mengu has quit [Read error: Connection reset by peer]
mengu has joined #ocaml
jao has quit [Remote host closed the connection]
jao has joined #ocaml
mk9 has joined #ocaml
tane has joined #ocaml
dtornabene has quit [Read error: Connection reset by peer]
inr_ has joined #ocaml
inr__ has joined #ocaml
inr has quit [Ping timeout: 260 seconds]
inr_ has quit [Ping timeout: 248 seconds]
ratschance has joined #ocaml
<discord3> <Perry> Why write a lexer by hand? They are always messy that way.
<companion_cube> argh, why does ppx-deriving now require 4.04 ???: /
<discord3> <ELLIOTTCABLE> @Perry I'm using sedlex; but I couldn't figure out a good way to handle nested block-comments
<discord3> <ELLIOTTCABLE> frankly I was planning to Get It Working, and then post a begging sadface post on Stack Overflow asking for help refactoring it.
<discord3> <ELLIOTTCABLE> just pushed a working/tested impl, lemme link it
<Drup> Just have several lexer calling each others
<discord3> <ELLIOTTCABLE> there's my monstrosity. refactoring tips welcome, though I don't expect anybody from here to go waste their time reading it in detail rrofl
<discord3> <ELLIOTTCABLE> the horrific block-comment-consuming algorithm is what I am most unhappy with, but hey, it passes my tests rn, sooo
<companion_cube> gnnnnnn, ok, it's because of an issue on 4.03…
<discord3> <ELLIOTTCABLE> oops
<companion_cube> every time I'm thinking I should get modern and use ppx, I find a problem -_-
mengu has quit [Remote host closed the connection]
mk9 has quit [Quit: mk9]
SomeDamnBody has joined #ocaml
<SomeDamnBody> Hey is there documentation on pretty printer string specifiers somewhere?
<Drup> SomeDamnBody: top of the Printf module, Bottom of the Format one
btbytes has joined #ocaml
neatonk has quit [Ping timeout: 260 seconds]
malina has quit [Ping timeout: 268 seconds]
mengu has joined #ocaml
zv has quit [Ping timeout: 260 seconds]
lix has quit [Ping timeout: 240 seconds]
lix has joined #ocaml
dtornabene has joined #ocaml
mengu has quit [Ping timeout: 240 seconds]
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
jnavila has joined #ocaml
ziyourenxiang has quit [Ping timeout: 276 seconds]
moei has quit [Quit: Leaving...]
zv has joined #ocaml
neatonk has joined #ocaml
shinnya has quit [Ping timeout: 245 seconds]
orbifx has joined #ocaml
cryptocat1094 has joined #ocaml
silver has joined #ocaml
silver has quit [Max SendQ exceeded]
silver has joined #ocaml
mk9 has joined #ocaml
isd has joined #ocaml
tane has quit [Quit: Leaving]
orbifx has quit [Ping timeout: 245 seconds]
moei has joined #ocaml
tane has joined #ocaml
SomeDamnBody has quit [Ping timeout: 245 seconds]
mk9 has quit [Quit: mk9]
ygrek has joined #ocaml
mk9 has joined #ocaml
btbytes has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
btbytes has joined #ocaml
larhat has joined #ocaml
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
jbrown has quit [Ping timeout: 256 seconds]
btbytes has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
btbytes has joined #ocaml
btbytes has quit [Client Quit]
jbrown has joined #ocaml
mk9 has quit [Quit: mk9]
malina has joined #ocaml
mengu has joined #ocaml
dhil has quit [Ping timeout: 264 seconds]
caltelt has quit [Ping timeout: 248 seconds]
halogenandtoast has joined #ocaml
caltelt has joined #ocaml
halogenandtoast has quit [Ping timeout: 248 seconds]
Jesin has quit [Quit: Leaving]
freyr69 has joined #ocaml
freyr69 has quit [Remote host closed the connection]
Anarchos has joined #ocaml
SomeDamnBody has joined #ocaml
cobbal has left #ocaml [#ocaml]
mk9 has joined #ocaml
soupladler has joined #ocaml
ratschance has quit [Ping timeout: 248 seconds]
btbytes has joined #ocaml
shinnya has joined #ocaml
mk9 has quit [Quit: mk9]
Jesin has joined #ocaml
mengu has quit [Remote host closed the connection]
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
btbytes has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jnavila has quit [Ping timeout: 240 seconds]
dxtr has left #ocaml ["ERC (IRC client for Emacs 25.2.2)"]
mengu has joined #ocaml
pierpa has joined #ocaml
mk9 has joined #ocaml
isd has quit [Ping timeout: 256 seconds]
cryptocat1094 has quit [Quit: gtg]
malina has quit [Ping timeout: 260 seconds]
jnavila has joined #ocaml
tane has quit [Read error: Connection reset by peer]
_andre has quit [Quit: leaving]
keep_learning has quit [Ping timeout: 256 seconds]
soupladler has quit [Ping timeout: 276 seconds]
mk9 has quit [Quit: mk9]
mengu has quit [Remote host closed the connection]
mk9 has joined #ocaml
donviszneki has joined #ocaml
<donviszneki> hi all :) is it possible to bind a variant constructor locally?
<donviszneki> the only way i can figure to do it is by opening the entire module
mk9 has quit [Client Quit]
mk9 has joined #ocaml
soupladler has joined #ocaml
<steenuil_> I think you can do something like type x = M.x = A | B of int
steenuil_ is now known as steenuil
btbytes has joined #ocaml
jnavila has quit [Remote host closed the connection]
spew has quit []
iitalics has joined #ocaml
mk9 has quit [Quit: mk9]
SomeDamnBody has quit [Ping timeout: 264 seconds]
argent_smith has quit [Quit: Leaving.]
btbytes has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tokomak has quit [Ping timeout: 265 seconds]
btbytes has joined #ocaml
iitalics has quit [Quit: WeeChat 2.1]
isd has joined #ocaml
larhat has quit [Quit: Leaving.]
neatonk has quit [Ping timeout: 260 seconds]
neatonk has joined #ocaml
Anarchos has quit [Read error: Connection reset by peer]
Anarchos has joined #ocaml
gtrak has quit [Ping timeout: 264 seconds]
donviszneki has quit [Ping timeout: 248 seconds]
neatonk has quit [Ping timeout: 256 seconds]
soupladler has quit [Quit: Lost terminal]
SomeDamnBody has joined #ocaml
Anarchos has quit [Quit: Vision[0.10.2]: i've been blurred!]
donviszneki has joined #ocaml
rostero_ has joined #ocaml
sz0 has joined #ocaml
btbytes has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
btbytes has joined #ocaml
dedgrant_ has joined #ocaml
ziyourenxiang has joined #ocaml
dedgrant has quit [Ping timeout: 268 seconds]
ziyourenxiang has quit [Ping timeout: 240 seconds]
halogenandtoast has joined #ocaml
caltelt_ has joined #ocaml
btbytes has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
btbytes has joined #ocaml
btbytes has quit [Client Quit]
btbytes has joined #ocaml
btbytes has quit [Client Quit]
btbytes has joined #ocaml
btbytes has quit [Client Quit]
btbytes has joined #ocaml
Jesin has quit [Quit: Leaving]
spew has joined #ocaml
btbytes has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mengu has joined #ocaml
mengu has quit [Remote host closed the connection]