companion_cube changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.11 release notes: https://caml.inria.fr/pub/distrib/ocaml-4.11/notes/Changes | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
vicfred has joined #ocaml
raver has quit [Ping timeout: 264 seconds]
Haudegen has quit [Ping timeout: 265 seconds]
mxns has joined #ocaml
ygrek has quit [Remote host closed the connection]
mxns has quit [Ping timeout: 256 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 272 seconds]
ygrek has joined #ocaml
Tuplanolla has quit [Quit: Leaving.]
mxns has joined #ocaml
mxns has quit [Ping timeout: 240 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 272 seconds]
zolk3ri has quit [Remote host closed the connection]
mxns has joined #ocaml
mxns has quit [Ping timeout: 240 seconds]
zolk3ri has joined #ocaml
rock64 has quit [Ping timeout: 265 seconds]
rock64 has joined #ocaml
mxns has joined #ocaml
mxns has quit [Ping timeout: 265 seconds]
osa1_ has joined #ocaml
mxns has joined #ocaml
osa1 has quit [Ping timeout: 265 seconds]
mxns has quit [Quit: ZNC 1.8.2 - https://znc.in]
mxns has joined #ocaml
mxns has quit [Ping timeout: 272 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 264 seconds]
ygrek has quit [Remote host closed the connection]
mxns has joined #ocaml
mxns has quit [Ping timeout: 256 seconds]
mxns has joined #ocaml
zebrag has quit [Quit: Konversation terminated!]
mxns has quit [Ping timeout: 264 seconds]
robmyers has quit [Ping timeout: 258 seconds]
waleee-cl has quit [Read error: Connection reset by peer]
cqc has quit [Read error: Connection reset by peer]
stylewarning has quit [Read error: Connection reset by peer]
nullcone has quit [Read error: Connection reset by peer]
stylewarning has joined #ocaml
nullcone has joined #ocaml
cqc has joined #ocaml
mxns has joined #ocaml
waleee-cl has joined #ocaml
robmyers has joined #ocaml
infinity0 has quit [Remote host closed the connection]
mxns has quit [Ping timeout: 272 seconds]
infinity0 has joined #ocaml
mxns has joined #ocaml
mxns has quit [Ping timeout: 256 seconds]
mxns has joined #ocaml
mfp_ has quit [Ping timeout: 260 seconds]
djellemah has quit [Ping timeout: 264 seconds]
_whitelogger has joined #ocaml
rdivyanshu has joined #ocaml
waleee-cl has quit [Quit: Connection closed for inactivity]
mxns has quit [Ping timeout: 258 seconds]
narimiran has joined #ocaml
ArthurStrong has quit [Quit: leaving]
decentpenguin has quit [Read error: Connection reset by peer]
decentpenguin has joined #ocaml
mxns has joined #ocaml
kini has quit [Remote host closed the connection]
kini has joined #ocaml
osa1_ is now known as osa1
Haudegen has joined #ocaml
mxns has quit [Ping timeout: 258 seconds]
raver has joined #ocaml
borne has joined #ocaml
olle has joined #ocaml
jlr has joined #ocaml
benc has joined #ocaml
Tuplanolla has joined #ocaml
mxns has joined #ocaml
arecaceae has quit [Remote host closed the connection]
arecaceae has joined #ocaml
andreas303 has quit [Remote host closed the connection]
bartholin has joined #ocaml
andreas303 has joined #ocaml
andreas303 has quit [Ping timeout: 268 seconds]
andreas303 has joined #ocaml
banjiewen__ has quit [Ping timeout: 240 seconds]
sz0 has quit [Ping timeout: 240 seconds]
JSharp has quit [Read error: Connection reset by peer]
stephe has quit [Read error: Connection reset by peer]
SrPx has quit [Read error: Connection reset by peer]
stephe has joined #ocaml
banjiewen__ has joined #ocaml
narimiran has quit [Ping timeout: 240 seconds]
JSharp has joined #ocaml
SrPx has joined #ocaml
sz0 has joined #ocaml
mxns has quit [Ping timeout: 260 seconds]
benc has quit [Remote host closed the connection]
narimiran has joined #ocaml
benc has joined #ocaml
ewd has joined #ocaml
rdivyanshu has quit [Quit: Connection closed for inactivity]
<greenbagels> so I'm trying to understand this type signature for a conduit function
<greenbagels> val resolve_uri : ?rewrites:(string * rewrite_fn) list -> uri:Uri.t -> t -> Conduit.endp io
<greenbagels> based on my (basic) understanding, ?rewrites:(string * rewrite_fn) should be the parameter type for list, right?
<d_bot> <ggole> `string * rewrite_fn` is; the `?rewrites:` part is an argument name/label
benc has quit [Read error: Connection reset by peer]
benc_ has joined #ocaml
benc_ has quit [Read error: Connection reset by peer]
benc has joined #ocaml
olle has quit [Ping timeout: 246 seconds]
benc_ has joined #ocaml
benc has quit [Read error: Connection reset by peer]
zolk3ri has quit [Ping timeout: 268 seconds]
<greenbagels> ah a named tuple, got it
banjiewen__ has quit [Read error: Connection reset by peer]
JSharp has quit [Read error: Connection reset by peer]
sz0 has quit [Read error: Connection reset by peer]
stephe has quit [Read error: Connection reset by peer]
SrPx has quit [Read error: Connection reset by peer]
<greenbagels> ah and the ? means *optional* labeled argument, got it
JSharp has joined #ocaml
stephe has joined #ocaml
banjiewen__ has joined #ocaml
SrPx has joined #ocaml
sz0 has joined #ocaml
zolk3ri has joined #ocaml
vicfred has quit [Quit: Leaving]
zebrag has joined #ocaml
mfp_ has joined #ocaml
olle has joined #ocaml
<greenbagels> ok, follow-up question (apologies if its a basic question, im trying to mostly learn by example since books tend to get dry)
<greenbagels> ah
<greenbagels> nevermind i think i got it, hah. it was to ask what the ">>=" operator was, but it seems it's an infix bind operator used in jane street and lwt libraries
<olle> greenbagels: monadic bind
<greenbagels> time to read about monads i suppose :D
<olle> greenbagels: there's also let* = ... now
<olle> or let% ?
<olle> don't remember
zolk3ri has quit [Remote host closed the connection]
<octachron> It might better to start using `>>=` before reading about monads. Reading about the generalization of concepts that you have never used is not helpful for everyone.
<d_bot> <n4323> hm. statmemprof seems to exist only up to 4.07. in Instruments, i also see symbol names similar to camlMyMoudle__some_function_1234 but i don't see e.g. how to find out what called that function. anyway, it kind of works.
zolk3ri has joined #ocaml
<greenbagels> octachron: yeah im trying to find examples of bind being used, and i'll move to the more abstract theory after
<d_bot> <octachron> Statmemprof is part of the default compiler since 4.11.1
arecaceae has quit [Remote host closed the connection]
arecaceae has joined #ocaml
<greenbagels> there's a convenient textbook that some cornell course publishes online: https://www.cs.cornell.edu/courses/cs3110/2019sp/textbook/ads/ex_maybe_monad.html seems pretty handy as a readable reference to jump around
cqc has quit [Ping timeout: 272 seconds]
stylewarning has quit [Ping timeout: 240 seconds]
nullcone has quit [Read error: Connection reset by peer]
cqc has joined #ocaml
troydm has quit [Ping timeout: 258 seconds]
stylewarning has joined #ocaml
nullcone has joined #ocaml
djellemah has joined #ocaml
troydm has joined #ocaml
mxns has joined #ocaml
vicfred has joined #ocaml
mxns has quit [Ping timeout: 240 seconds]
andreas303 has quit [Remote host closed the connection]
andreas303 has joined #ocaml
rdivyanshu has joined #ocaml
rdivyanshu has quit [Ping timeout: 272 seconds]
mengu has joined #ocaml
rdivyanshu has joined #ocaml
ygrek has joined #ocaml
mxns has joined #ocaml
<sleepydog> greenbagels: have you used promises or futures in any other programming language?
andreas303 has quit [Remote host closed the connection]
<sleepydog> >>= is like the `then` operator in javascript or futures.add_done_callback in python
<greenbagels> so it's commonly used for binding callbacks to an async call then?
andreas303 has joined #ocaml
<sleepydog> yes. other modules may re-use >>= to mean something else, but with the same idea of "call the right side with the result of the left side"
<greenbagels> i see
<greenbagels> i can see how the generalization is useful
<olle> it's also async, correct?
<olle> depending on the lib, I guess
<sleepydog> like olle mentioned, recent modules may also define a ( let* ) operator which may be a nicer-looking way to do the same thing
<olle> sleepydog: in JS they use async/await instead of .then(...), btw
<olle> these days
<sleepydog> heh, i'm dating myself :)
<olle> ^^
<sleepydog> I haven't touched JS in years
<greenbagels> sleepydog: some would congratulate you for that
<sleepydog> i hope that the next time i have to do frontend work i can use js_of_ocaml
<greenbagels> lol
<greenbagels> i know just enough ocaml to get that one :D
<olle> sleepydog: did you try ocaml_of_js?
<sleepydog> no, is that a thing?
<olle> nah
<olle> ^^
<olle> Guess that would be Flow...
ygrek has quit [Remote host closed the connection]
waleee-cl has joined #ocaml
benc_ has quit []
rdivyanshu has quit [Quit: Connection closed for inactivity]
ygrek has joined #ocaml
olle has quit [Ping timeout: 258 seconds]
bartholin has quit [Quit: Leaving]
ciobul has joined #ocaml
ciobul has quit [Ping timeout: 265 seconds]
ciobul has joined #ocaml
jlr has quit [Ping timeout: 246 seconds]
borne has quit [Ping timeout: 264 seconds]
ciobul has quit [Ping timeout: 265 seconds]
tryte has quit [Remote host closed the connection]
tryte has joined #ocaml
tane has joined #ocaml
mxns has quit [Quit: ZNC 1.8.2 - https://znc.in]
mxns has joined #ocaml
waleee-cl has quit [Ping timeout: 256 seconds]
waleee-cl has joined #ocaml
djellemah has quit [Ping timeout: 258 seconds]
djellemah has joined #ocaml
smorimoto has left #ocaml ["User left"]
olle has joined #ocaml
borne has joined #ocaml
<olle> What's the difference between caml_alloc(1, 0) and caml_alloc(1, 1)?
<olle> Last argument is the "tag"
<olle> Docs says:
<olle> "0 to No_scan_tag−1 A structured block (an array of OCaml objects). Each field is a value."
<olle> "A tag lower than No_scan_tag indicates a structured block, containing well-formed values, which is recursively traversed by the garbage collector."
<olle> This does not really explain the use-case of tag numbers...
<olle> Hm, let me ask on the forum...
<zozozo> olle: broadly speaking, tags are used to distinguish cases of a variant type definition
<zozozo> though if you're looking at this kind of things, you should probably familiarize yourself with how ocaml represent values (there is a chapter in the manual and in rwo about that iirc)
<olle> Yes, that's what I'm reading. :) zozozo
<olle> Oh, rwo too? Good tip
jlr has joined #ocaml
ciobul has joined #ocaml
borne has quit [Ping timeout: 272 seconds]
<olle> Wow, you can tweak GC behaviour on a per datatype basis? That's cool!
<olle> (With custom blocks.)
<olle> "The contents of custom blocks are not scanned by the garbage collector"
<olle> Oh, nevermind...
ciobul has quit [Ping timeout: 264 seconds]
borne has joined #ocaml
narimiran has quit [Ping timeout: 240 seconds]
jlr has quit [Remote host closed the connection]
ArthurStrong has joined #ocaml
<olle> The language benchmark game for n-body can possibly be optimized with [@@unboxing] and [@@noalloc]
<olle> Nah, float records are already unboxed.
olle has quit [Ping timeout: 256 seconds]
zolk3ri has quit [Remote host closed the connection]
zolk3ri has joined #ocaml
tane has quit [Quit: Leaving]
borne has quit [Ping timeout: 260 seconds]
mengu has quit []
zolk3ri has quit [Remote host closed the connection]
zolk3ri has joined #ocaml
arecaceae has quit [Remote host closed the connection]
arecaceae has joined #ocaml
Jesin has quit [Quit: Leaving]
ygrek has quit [Remote host closed the connection]