adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | Current MOOC: https://huit.re/ocamlmooc | OCaml 4.04.0 release notes: http://ocaml.org/releases/4.04.html | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
xorpse has quit [Ping timeout: 255 seconds]
silver has quit [Read error: Connection reset by peer]
kamog has quit [Quit: ERC (IRC client for Emacs 25.1.1)]
antkong has quit [Ping timeout: 252 seconds]
antkong has joined #ocaml
<orbifx> copy`: back, checking it now
<orbifx> copy`: why is it async dependant?
<orbifx> or are you not that familiar with the project?
cpdean has quit [Quit: Leaving.]
cpdean has joined #ocaml
Algebr`` has quit [Ping timeout: 258 seconds]
Algebr`` has joined #ocaml
cpdean has quit [Quit: Leaving.]
Xadnem has quit [Quit: leaving]
MercurialAlchemi has quit [Ping timeout: 258 seconds]
Algebr`` has quit [Ping timeout: 240 seconds]
P4Titan has joined #ocaml
<P4Titan> Hi all. Is there a way I can make LWT block on a thread
<orbifx> P4Titan: what do you wish to achieve with that?
jao has joined #ocaml
<P4Titan> basically there is a call to Lwt.on_failure which runs the input thread async
<P4Titan> but I want it to effectively not do that
<P4Titan> on_failure doesn't wait for the thread passed to it to complete before moving on
<orbifx> why not use some of the join functions?
<P4Titan> yes, I'm just thinking
<P4Titan> I don't think join wo do me the job though
<P4Titan> I'll have to rethink the soln to this problem
<P4Titan> thanks for the input though!
<orbifx> I suspect you have gone down the wrong path
<orbifx> so, yeah, you may need to rethink your algorithm
<orbifx> you are welcome
orbifx has quit [Quit: WeeChat 1.6]
_avery has quit [Quit: _avery]
lucybun has joined #ocaml
snhmib has quit [Ping timeout: 240 seconds]
trepta has joined #ocaml
copy` has quit [Quit: Connection closed for inactivity]
shinnya has joined #ocaml
mfp has quit [Ping timeout: 256 seconds]
<cojy> is it possible to parameterize a polymorphic variant like: module Foo (M : sig type t end) = struct type t = [ M.t | `B ] end
Algebr`` has joined #ocaml
smondet has quit [Ping timeout: 258 seconds]
unbalanced has quit [Ping timeout: 258 seconds]
unbalancedparen has joined #ocaml
ryanartecona has joined #ocaml
shinnya has quit [Ping timeout: 260 seconds]
trepta has quit [Ping timeout: 256 seconds]
antkong has quit [Ping timeout: 258 seconds]
antkong_ has joined #ocaml
ryanartecona has quit [Quit: ryanartecona]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 255 seconds]
P4Titan has quit [Remote host closed the connection]
ygrek has joined #ocaml
ryanartecona has joined #ocaml
malc_ has joined #ocaml
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 255 seconds]
rcabaco_ has joined #ocaml
rcabaco has quit [Ping timeout: 240 seconds]
pierpa has quit [Ping timeout: 256 seconds]
govg has quit [Ping timeout: 255 seconds]
antkong_ has quit [Quit: antkong_]
ygrek has quit [Ping timeout: 260 seconds]
Algebr`` has quit [Ping timeout: 240 seconds]
slash^ has joined #ocaml
shinnya has joined #ocaml
ryanartecona has quit [Quit: ryanartecona]
MercurialAlchemi has joined #ocaml
malc_ has quit [Ping timeout: 241 seconds]
malc_ has joined #ocaml
malc_ has quit [Ping timeout: 248 seconds]
malc_ has joined #ocaml
fraggle_ has quit [Ping timeout: 255 seconds]
fraggle_ has joined #ocaml
orbifx-m has joined #ocaml
<orbifx-m> what would br
<orbifx-m> oops
<orbifx-m> what would be the performance difference between a big nested structure of records and say a map with a tuple of invariants for keys?
Flerex has joined #ocaml
orbifx-m has quit [Quit: Simple IRC: The quit option.]
orbifx has joined #ocaml
kakadu has joined #ocaml
Simn has quit [Quit: Leaving]
freusque has joined #ocaml
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 240 seconds]
FreeBirdLjj has joined #ocaml
mfp has joined #ocaml
sfri has quit [Remote host closed the connection]
sepp2k has joined #ocaml
infinity0 has quit [Ping timeout: 240 seconds]
infinity0 has joined #ocaml
jnavila has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
lucybun has quit [Remote host closed the connection]
lucybun has joined #ocaml
AlexDenisov has joined #ocaml
AlexDenisov has quit [Client Quit]
jnavila has quit [Ping timeout: 252 seconds]
sfri has joined #ocaml
silver has joined #ocaml
rcabaco_ is now known as rcabaco
freusque has quit [Ping timeout: 248 seconds]
aantron has left #ocaml ["Leaving..."]
cpdean has joined #ocaml
ocaml828 has joined #ocaml
ocaml828 has left #ocaml [#ocaml]
jnavila has joined #ocaml
Flerex has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
snhmib has joined #ocaml
jnavila has quit [Ping timeout: 240 seconds]
cpdean has quit [Quit: Leaving.]
cpdean has joined #ocaml
averell has joined #ocaml
cpdean has quit [Quit: Leaving.]
freusque has joined #ocaml
cpdean has joined #ocaml
malc_ has quit [Ping timeout: 256 seconds]
sepp2k has quit [Quit: Leaving.]
cpdean has quit [Quit: Leaving.]
tane has joined #ocaml
kareeeeem has joined #ocaml
orbifx has quit [Ping timeout: 252 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
Flerex has joined #ocaml
FreeBirdLjj has joined #ocaml
zpe has joined #ocaml
bobry has joined #ocaml
<bobry> Is it possible to use ppx_inline_test with ppx_deriving? I'm trying ppx-driver(ppx_inline_test+ppx_deriving.show -inline-test-lib ...) but the resulting driver doesn't list deriving in -print-transformations
jao has quit [Ping timeout: 248 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 256 seconds]
myst|fon has quit [Quit: Connection closed for inactivity]
Xadnem has joined #ocaml
<larhat> bobry: pass ppx_deriving subpackages as package(ppx_deriving.show), and ppx_inline stuff to ppx_driver tag in your _tags? https://github.com/prepor/condo/blob/master/_tags
tane has quit [Read error: Connection reset by peer]
freusque has quit [Quit: WeeChat 1.4]
cpdean has joined #ocaml
myst|fon has joined #ocaml
FreeBirdLjj has joined #ocaml
<bobry> @larhat that did work, thanks! I had to additionally pass "-no-check" to ppx-driver to suppress "Attribute `deriving' was not used".
ryanartecona has joined #ocaml
Flerex has quit [Quit: Textual IRC Client: www.textualapp.com]
freusque has joined #ocaml
kakadu has quit [Remote host closed the connection]
<flux> amazing, I encountered a 32-bitness bug on my software I hadn't anticipated
kareeeeem has quit [Quit: Connection closed for inactivity]
ryanartecona has quit [Quit: ryanartecona]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 258 seconds]
Simn has joined #ocaml
tane has joined #ocaml
<justin_smith> what's the correct way to handle "foo was selected from type Module.bar it is not visible in the current scope and will not be selected if the type becomes unknown"
<justin_smith> (compiler warning)
<flux> justin_smith, to understand why this happens and disable the warning
<justin_smith> using "let open Module" on the block seems to fix it
smondet has joined #ocaml
<flux> so let's say you have function: let mkfoo () = { Foo.a = 42 } let work () = let a = mkfoo () in a.a
<flux> the latter piece of code causes the warning to occr
<flux> but if you later refactor the code so that instead of mkfoo it takes it as an argument: let work a = a.a
<flux> this no longer compiles, because the type of 'a' is not known
<flux> there are two solutions: the one you did (let open or its global alternative) or explicitly indicating the field: let work a = a.Foo.a
<justin_smith> oh! cool
<flux> I'm nowadays happy with just accepting sometimes that I need to give additional type information
<flux> and disable the warning
<dmbaturin> Anyone knows if it's normal to reuse Pbrt.Encoder.t, or it should be created for every act of encoding?
jnavila has joined #ocaml
<justin_smith> flux: thank you for the comprehensive explanation
<flux> I haven't used protobuffers, but from the looks of it it seems that you can keep it around
<flux> you probably shouldn't use the same instance of encoder from multiple threads
<flux> (at the same time)
<flux> justin_smith, glad to be of help. happy coding ;)
<dmbaturin> flux: I wonder why it needs mutation to begin with, rather than just encode : Pbrt.Encoder.t -> 'a -> bytes. I guess only reading the lib can explain.
<flux> dmbaturin, I guess even in C(++) one is expected to first create an instance of the encoder before using it, and this simply 1:1 reflects that
<flux> dmbaturin, maybe the C++ api allows you to modify of the encoder or it is a potential future improvement that never happened.
cpdean has quit [Quit: Leaving.]
<dmbaturin> Yeah, it might have imported a limitation from another language indeed. :)
<justin_smith> dmbaturin: sometimes encoding could be a bottleneck if you reallocated an internal buffer of bytes for every message
<justin_smith> dmbaturin: if you can reuse a preallocated state, you can send messages much faster
<dmbaturin> The order of arguments also rules out keeping it in a closure, unless you flip it.
<justin_smith> of course it's easy to make a wrapper that allocates every time and call it done if it's not a bottleneck
<justin_smith> oh, that's inconvenient
bobry has quit [Quit: Connection closed for inactivity]
cheater has quit [Quit: Reconnecting]
cpdean has joined #ocaml
cheater has joined #ocaml
<dmbaturin> Yeah, it may be wholesale import of C++ API issues I suppose.
two_wheels has joined #ocaml
yegods has joined #ocaml
larhat has quit [Quit: Leaving.]
Flerex has joined #ocaml
defgeneric has joined #ocaml
troydm has quit [Ping timeout: 252 seconds]
troydm has joined #ocaml
larhat has joined #ocaml
pierpa has joined #ocaml
yegods has quit [Remote host closed the connection]
yegods has joined #ocaml
yegods has quit [Remote host closed the connection]
yegods has joined #ocaml
yegods has quit [Remote host closed the connection]
yegods has joined #ocaml
zpe has quit [Remote host closed the connection]
omarramo has joined #ocaml
RonnieHolm has joined #ocaml
zpe has joined #ocaml
<omarramo> hey guys I am using merlin in emacs. I wrote a module and in the same directory but different file I want to open it but merlin doesn't find it. I don't know what I have to write into the .merlin file
<omarramo> I have this problem every time and it somehow always ^^ fixes itself. I typed in S . and B _build now
tane has quit [Ping timeout: 255 seconds]
sh0t has quit [Ping timeout: 256 seconds]
RonnieHolm has left #ocaml ["ERC Version 5.3 (IRC client for Emacs)"]
<omarramo> another question: how can I apply currying when the argument I want to replace is not the first argument?
tane has joined #ocaml
<omarramo> like I have a function with type a' -> b' -> a' and somehow want to turn it into a' ->'a by applying one argument to it
<omarramo> instead of b' -> 'a
tg has quit [Quit: Leaving]
<flux> omarramo, well, you can have a function such as flip
<flux> let flip f a b = f b a
frefity has joined #ocaml
<omarramo> flux: ahh okay, thanks!
<flux> some people don't appreciate the use of flip-kind of functions, but personally I don't mind :)
<frefity> is it possible to iterate over all the types of a variant?
sh0t has joined #ocaml
Algebr`` has joined #ocaml
<flux> you mean all constructors. no, you need a (ie.) ppx-based language extension such as ppx_deriving to do that kind of operations.
<flux> so basically it would generate you some code based on the definition of the type
<thizanne> frefity: how would you do that when your type is type foo = Bar | Int of int ?
<frefity> In my case I don't care about the values. I have a variant type defining each command that my program accepts and I want a help function that prints a description for each one
<larhat> frefity: by description you mean string representation? then you can use ppx_deriving.show to generate show_foo automatically. or use https://github.com/janestreet/ppx_variants_conv to get fold over all variants
<frefity> larhat: great, thanks, I never used any language extensions
<thizanne> frefity: you may want to look at Cmdliner
<thizanne> which does quite exactly what you described
<frefity> I did, but it looks like more than I needed for now
trepta has joined #ocaml
defgeneric has quit [Ping timeout: 240 seconds]
defgeneric has joined #ocaml
smondet has quit [Ping timeout: 240 seconds]
shinnya has quit [Ping timeout: 258 seconds]
jnavila has quit [Ping timeout: 252 seconds]
cpdean has quit [Quit: Leaving.]
<flux> if there is only a limited number of variants, I usually just do function | Variant1 -> .. | Variant2 _ -> .. etc
<flux> I get a compiler warning if a new one is added
<flux> though things get slightly more annoying if I want a bidirectional mapping, as I usually use an association list and two functions, and I don't get a warning :(
zpe has quit [Remote host closed the connection]
cpdean has joined #ocaml
omarramo has quit [Ping timeout: 240 seconds]
zpe has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
zpe has quit [Ping timeout: 240 seconds]
omarramo has joined #ocaml
Flerex has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
kakadu has joined #ocaml
zpe has joined #ocaml
Flerex has joined #ocaml
jnavila has joined #ocaml
jmiven has quit [Quit: co'o]
jmiven has joined #ocaml
yegods has quit [Remote host closed the connection]
yegods has joined #ocaml
sz0 has joined #ocaml
<flux> is it really so that this isn't part of any book? seems pretty interesting chapter if you're interested in OCaml and monads: https://www.cl.cam.ac.uk/teaching/1415/L28/monads.pdf
two_wheels has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jnavila has quit [Ping timeout: 240 seconds]
<flux> it seems it's linked from https://www.cl.cam.ac.uk/teaching/1415/L28/materials.html, with "Lecture notes"
yegods has quit []
obadz has joined #ocaml
<flux> seems like a quality course
frefity has quit [Quit: Ex-Chat]
<flux> I guess yallop and lwp25 can make it happen ;)
orbifx has joined #ocaml
Algebr`` has quit [Read error: Connection reset by peer]
Algebr`` has joined #ocaml
govg has joined #ocaml
slash^ has quit [Read error: Connection reset by peer]
ygrek has joined #ocaml
wtetzner has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
zv has quit [Read error: Connection reset by peer]
xorpse has joined #ocaml
zv has joined #ocaml
zpe has quit [Ping timeout: 258 seconds]
Flerex has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
tg has joined #ocaml
wtetzner has quit [Remote host closed the connection]
xorpse has quit [Ping timeout: 248 seconds]
jao has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 240 seconds]
jnavila has joined #ocaml
jnavila has quit [Quit: Konversation terminated!]
cpdean has quit [Quit: Leaving.]
antkong has joined #ocaml
larhat has quit [Quit: Leaving.]
orbifx has quit [Ping timeout: 255 seconds]
cpdean has joined #ocaml
rcabaco has quit [Ping timeout: 240 seconds]
xorpse has joined #ocaml
cpdean has quit [Quit: Leaving.]
defgeneric has quit [Ping timeout: 255 seconds]
SpiceGuid has joined #ocaml
Xadnem has quit [Quit: leaving]
Flerex has joined #ocaml
defgeneric has joined #ocaml
Flerex has quit [Client Quit]
rgrinberg has joined #ocaml
average has quit [Remote host closed the connection]
average has joined #ocaml
sz0 has quit [Quit: Connection closed for inactivity]
tane has quit [Quit: Leaving]
SpiceGuid has quit [Ping timeout: 260 seconds]
omarramo has quit [Ping timeout: 240 seconds]
Simn has quit [Quit: Leaving]
wtetzner has joined #ocaml
kakadu has quit [Remote host closed the connection]
omarramo has joined #ocaml
wtetzner has quit [Remote host closed the connection]