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
troydm has joined #ocaml
malc_ has joined #ocaml
nicoo has quit [Remote host closed the connection]
nicoo has joined #ocaml
jbrown has quit [Ping timeout: 272 seconds]
ollehar has quit [Ping timeout: 256 seconds]
ollehar has joined #ocaml
mirrorbird has quit [Ping timeout: 272 seconds]
mirrorbird has joined #ocaml
Jesin has quit [Ping timeout: 260 seconds]
waleee-cl has quit [Quit: Connection closed for inactivity]
mirrorbird has quit [Ping timeout: 272 seconds]
sadiq has quit [Ping timeout: 265 seconds]
_ks has quit [Ping timeout: 265 seconds]
sadiq has joined #ocaml
tmhoang has quit [Ping timeout: 265 seconds]
dckc has quit [Ping timeout: 265 seconds]
_tjr_ has quit [Ping timeout: 265 seconds]
tmhoang2 has joined #ocaml
_tjr_ has joined #ocaml
_ks has joined #ocaml
mfp has quit [Ping timeout: 265 seconds]
dian has quit [Ping timeout: 265 seconds]
taharqa has quit [Ping timeout: 265 seconds]
mangoicedtea has quit [Read error: Connection reset by peer]
mfp has joined #ocaml
RalfJ has quit [Ping timeout: 265 seconds]
dian has joined #ocaml
taharqa has joined #ocaml
RalfJ has joined #ocaml
malc_ has quit [Ping timeout: 272 seconds]
dckc has joined #ocaml
mfp has quit [Ping timeout: 246 seconds]
mirrorbird has joined #ocaml
malc_ has joined #ocaml
fritjof has quit [Ping timeout: 272 seconds]
fritjof has joined #ocaml
mirrorbird has quit [Ping timeout: 272 seconds]
mirrorbird has joined #ocaml
vicfred has quit [Quit: Leaving]
reynir has quit [Ping timeout: 246 seconds]
fritjof has quit [Ping timeout: 244 seconds]
reynir has joined #ocaml
mbuf has joined #ocaml
malc_ has quit [Ping timeout: 272 seconds]
osa1 has joined #ocaml
vicfred has joined #ocaml
dborisog has joined #ocaml
malc_ has joined #ocaml
malc_ has quit [Client Quit]
malc_ has joined #ocaml
vicfred has quit [Quit: Leaving]
dborisog has quit [Ping timeout: 240 seconds]
nkly_ has joined #ocaml
mirrorbird has quit [Ping timeout: 272 seconds]
mirrorbird has joined #ocaml
mirrorbird has quit [Ping timeout: 272 seconds]
mirrorbird has joined #ocaml
fritjof has joined #ocaml
Haudegen has joined #ocaml
nkly_ has quit [Ping timeout: 260 seconds]
mbuf has quit [Ping timeout: 240 seconds]
fritjof has quit [Ping timeout: 260 seconds]
mirrorbird has quit [Quit: Leaving]
fritjof has joined #ocaml
mirrorbird has joined #ocaml
dckc has quit [Ping timeout: 256 seconds]
dckc has joined #ocaml
jbrown has joined #ocaml
olle has joined #ocaml
Putonlalla has joined #ocaml
fritjof has quit [Quit: WeeChat 2.9]
fritjof has joined #ocaml
camlriot42 has left #ocaml ["Kicked by @appservice-irc:matrix.org : Idle for 30+ days"]
fritjof has quit [Quit: WeeChat 2.9]
borne_ has joined #ocaml
borne_ has quit [Quit: WeeChat 2.9]
borne has joined #ocaml
_whitelogger has joined #ocaml
mfp has joined #ocaml
craigfe has quit [Quit: WeeChat 2.9]
mtsd has joined #ocaml
copy has quit [Ping timeout: 256 seconds]
nkly_ has joined #ocaml
osa1 has quit [Quit: osa1]
mirrorbird has quit [Ping timeout: 272 seconds]
osa1 has joined #ocaml
nkly_ has quit [Quit: ZNC 1.6.6+deb1ubuntu0.2 - http://znc.in]
malc_ has quit [Ping timeout: 272 seconds]
waleee-cl has joined #ocaml
zebrag has quit [Ping timeout: 240 seconds]
zebrag has joined #ocaml
mtsd has left #ocaml ["Leaving"]
ggole has joined #ocaml
mbuf has joined #ocaml
malc_ has joined #ocaml
jbrown has quit [Ping timeout: 272 seconds]
<Putonlalla> I see `Hashtbl` allows multiple values per key, but, besides that, is there a reason to favor `Map` over it?
borne_ has joined #ocaml
borne has quit [Ping timeout: 244 seconds]
borne_ has quit [Client Quit]
borne has joined #ocaml
borne has quit [Ping timeout: 260 seconds]
<Leonidas> Putonlalla: Map is immutable, Hashtbl is mutable, that's a pretty significant difference
<zozozo> Putonlalla: they also require different assumptions on the keys (hash+equal function versus compare function)
<Putonlalla> Right. I guess `Map` is better for a static lookup table.
mbuf has quit [Remote host closed the connection]
<zozozo> really depends on your use-case et expected complexity of operations
mbuf has joined #ocaml
borne has joined #ocaml
jbrown has joined #ocaml
dckc has quit [Ping timeout: 272 seconds]
dckc has joined #ocaml
mbuf has quit [Quit: Leaving]
elfring has joined #ocaml
mbuf has joined #ocaml
mirrorbird has joined #ocaml
mirrorbird has quit [Ping timeout: 272 seconds]
vicfred has joined #ocaml
jbrown has quit [Ping timeout: 272 seconds]
borne has quit [Ping timeout: 264 seconds]
<Putonlalla> I somehow managed to crash `utop` with `*** Error in `/home/tuplanolla/.opam/default/bin/ocamlrun': double free or corruption (fasttop): 0x000000000276f720 ***`, but now I can't reproduce it.
<zozozo> ow, how did you do that ?! do you use some C code ?
<Putonlalla> Nope. Just learning OCaml.
<Putonlalla> The last thing I did was `Unix.kill (Unix.getpid ()) Sys.sigstop ;;`.
<zozozo> well, that's surprising, but utop might do some strange things to work (compared to ocamlc/ocamlopt)
<Putonlalla> I pasted all the commands I used during the session and it didn't crash again.
<zozozo> well, as long as it doesn't happen again, it might have been some strange coincidence
<Putonlalla> Oh, there it goes again!
<zozozo> it you can reliably reproduce then it might deserve a bug report I guess
<Putonlalla> I can repeat it now. I'll write a report as soon as I can get rid of my own modules.
jbrown has joined #ocaml
kanishka has joined #ocaml
kanishka has quit [Client Quit]
kanishka has joined #ocaml
kanishka has quit [Client Quit]
<d_bot> <Et7f3> can you test latest compiler+latest utop
vikfret has joined #ocaml
haesbaert has quit [Read error: Connection reset by peer]
mbuf has quit [Quit: Leaving]
smazga has joined #ocaml
Tuplanolla has joined #ocaml
reynir has quit [Ping timeout: 246 seconds]
reynir has joined #ocaml
jco has joined #ocaml
<jco> hi!
<jco> so i'm getting an exception with a function to sign a hash with a private key
<jco> it is: Exception: Mirage_crypto_rng__Rng.No_default_generator.
<jco> and here is the function https://tpaste.us/WRw0
<jco> i tried it in the top level and got this exception
<jco> any mirage-crypto experts? ;)
<jco> excellent
<jco> thanks reynir
osa1 has quit [Ping timeout: 260 seconds]
waleee-cl has quit [Quit: Connection closed for inactivity]
zebrag has quit [Quit: Konversation terminated!]
zebrag has joined #ocaml
elfring has quit [Quit: Konversation terminated!]
<hannes> jco: depending on the mirage-crypto version you're using -- the exception should be a bit more wordy (see https://github.com/mirage/mirage-crypto/blob/master/rng/rng.ml#L9-L30)
malc_ has left #ocaml ["ERC (IRC client for Emacs 28.0.50)"]
borne has joined #ocaml
zebrag has quit [Quit: Konversation terminated!]
zebrag has joined #ocaml
<jco> reynir: yep :)
Haudegen has quit [Ping timeout: 240 seconds]
ggole has quit [Quit: Leaving]
olle has quit [Ping timeout: 256 seconds]
borne has quit [Ping timeout: 240 seconds]
borne has joined #ocaml
jco has quit [Quit: WeeChat 2.7]
osa1 has joined #ocaml
osa1 has quit [Ping timeout: 265 seconds]
sonologico has joined #ocaml
borne has quit [Ping timeout: 264 seconds]
copy has joined #ocaml
waleee-cl has joined #ocaml
ollehar has quit [Ping timeout: 246 seconds]
ollehar has joined #ocaml
osa1 has joined #ocaml
jbrown has quit [Ping timeout: 272 seconds]
jbrown has joined #ocaml
Haudegen has joined #ocaml
vicfred has quit [Quit: Leaving]
Hrundi_V_Bakshi has joined #ocaml
borne has joined #ocaml
borne has quit [Ping timeout: 256 seconds]
Hrundi_V_Bakshi has quit [Quit: No Ping reply in 180 seconds.]
Hrundi_V_Bakshi has joined #ocaml
vicfred has joined #ocaml
jbrown has quit [Ping timeout: 272 seconds]
jbrown has joined #ocaml
osa1 has quit [Quit: osa1]
amiloradovsky has joined #ocaml
jbrown has quit [Ping timeout: 272 seconds]
tane has joined #ocaml
vicfred has quit [Quit: Leaving]
haesbaert has joined #ocaml
borne has joined #ocaml
borne has quit [Quit: WeeChat 2.9]
amiloradovsky has quit [Ping timeout: 260 seconds]
jbrown has joined #ocaml
tane has quit [Quit: Leaving]
POGtastic has joined #ocaml
<POGtastic> Hi everyone, got a stupid type question. Say that I do `let rec last lst = match lst with [] -> None | (x::[]) -> Some x | (x::xs) -> last xs`. If I ask the Ocaml toplevel for the type of last, I get `- : 'a list -> 'a option = <fun>`. This is great. But when I do a higher-order function, I get a weakly polymorphic type.
Hrundi_V_Bakshi has quit [Ping timeout: 246 seconds]
<POGtastic> For example, `let last = List.fold_left (fun x y -> Some y) None`. Now, `last` is of type `- : '_weak4 list -> '_weak4 option = <fun>`. Why is this different?
<POGtastic> argh, I figured it out. If I do `let last lst = List.fold_left const None lst`, it's no longer weakly polymorphic. Why does point-free programming not work properly?
Haudegen has quit [Ping timeout: 240 seconds]
Tuplanolla has quit [Ping timeout: 265 seconds]
<companion_cube> look for "value restriction"
<POGtastic> companion_cube: thanks, this definitively explains it. https://ocamlverse.github.io/content/weak_type_variables.html
mangoicedtea has joined #ocaml
<companion_cube> it's the mix between closures and mutable values (like `ref`) that makes this kind of stuff hard :)
<POGtastic> I'm coming from haskell, so I was like "whaddya mean I can't do an eta-reduction??"
<companion_cube> ah well, yes
<companion_cube> think of it as "most things can possibly be actually in ST" and you can't in general eta-convert `ST (a->b) -> c` to `ST (a->b->c)`
<POGtastic> gotcha.
<companion_cube> eg `let f = let r = ref None in (fun x -> r := Some x; !r)`
<companion_cube> `r` can only have one type :)
vicfred has joined #ocaml
POGtastic has quit [Remote host closed the connection]