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
mxns has quit [Ping timeout: 272 seconds]
tryte has joined #ocaml
mxns has joined #ocaml
smazga has joined #ocaml
mxns has quit [Ping timeout: 272 seconds]
mxns has joined #ocaml
<companion_cube> -- is pretty classic for a range by now
vicfred has joined #ocaml
smazga has quit [Ping timeout: 240 seconds]
mxns has quit [Ping timeout: 260 seconds]
brettgilio has quit [Quit: Long live IRC! <https://brettgilio.com>]
brettgilio has joined #ocaml
aaaaaa has quit [Ping timeout: 260 seconds]
mxns has joined #ocaml
Haudegen has quit [Ping timeout: 260 seconds]
mxns has quit [Ping timeout: 272 seconds]
mxns has joined #ocaml
aaaaaa has joined #ocaml
mxns has quit [Ping timeout: 260 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 260 seconds]
neiluj has joined #ocaml
smazga has joined #ocaml
neiluj has joined #ocaml
neiluj has quit [Changing host]
remexre has quit [Read error: Connection reset by peer]
smazga has quit [Ping timeout: 258 seconds]
remexre has joined #ocaml
yomimono_ has joined #ocaml
zolk3ri has joined #ocaml
mxns has joined #ocaml
yomimono has quit [Ping timeout: 260 seconds]
remexre has quit [Read error: Connection reset by peer]
mxns has quit [Ping timeout: 272 seconds]
mxns has joined #ocaml
remexre has joined #ocaml
<d_bot> <arctumn> thx
mxns has quit [Ping timeout: 240 seconds]
smazga has joined #ocaml
smazga has quit [Ping timeout: 272 seconds]
smazga has joined #ocaml
smazga has quit [Ping timeout: 260 seconds]
yomimono_ has quit [Ping timeout: 260 seconds]
yomimono has joined #ocaml
neiluj has quit [Quit: leaving]
amiloradovsky has quit [Remote host closed the connection]
mxns has joined #ocaml
smazga has joined #ocaml
amiloradovsky has joined #ocaml
mxns has quit [Client Quit]
mxns has joined #ocaml
smazga has quit [Ping timeout: 272 seconds]
mxns has quit [Ping timeout: 260 seconds]
smazga has joined #ocaml
mxns has joined #ocaml
smazga has quit [Ping timeout: 264 seconds]
mxns has quit [Ping timeout: 260 seconds]
smazga has joined #ocaml
yomimono_ has joined #ocaml
yomimono has quit [Ping timeout: 240 seconds]
smazga has quit [Ping timeout: 256 seconds]
smazga has joined #ocaml
garfr has quit [Quit: WeeChat 2.9]
smazga has quit [Ping timeout: 260 seconds]
smazga has joined #ocaml
smazga has quit [Ping timeout: 260 seconds]
djellemah has quit [Ping timeout: 260 seconds]
amiloradovsky has quit [Remote host closed the connection]
amiloradovsky has joined #ocaml
mxns has joined #ocaml
amiloradovsky has quit [Remote host closed the connection]
amiloradovsky has joined #ocaml
aaaaaa has quit [Quit: leaving]
mxns has quit [Ping timeout: 258 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 260 seconds]
smazga has joined #ocaml
smazga has quit [Ping timeout: 240 seconds]
onerti_a has quit [Remote host closed the connection]
waleee-cl has quit [Quit: Connection closed for inactivity]
reynir has quit [Ping timeout: 240 seconds]
reynir has joined #ocaml
smazga has joined #ocaml
mxns has joined #ocaml
smazga has quit [Ping timeout: 260 seconds]
zolk3ri has quit [Remote host closed the connection]
mxns has quit [Ping timeout: 272 seconds]
yomimono has joined #ocaml
yomimono_ has quit [Ping timeout: 240 seconds]
vicfred has quit [Ping timeout: 246 seconds]
smazga has joined #ocaml
smazga has quit [Ping timeout: 264 seconds]
smazga has joined #ocaml
<d_bot> <rgrinberg> Anyone has something like gen_server implement in OCaml lying around?
smazga has quit [Ping timeout: 272 seconds]
smazga has joined #ocaml
_whitelogger has joined #ocaml
ggole has joined #ocaml
smazga has quit [Ping timeout: 272 seconds]
yomimono has quit [Ping timeout: 272 seconds]
mal`` has quit [Quit: Leaving]
yomimono has joined #ocaml
mxns has joined #ocaml
mal`` has joined #ocaml
mxns has quit [Ping timeout: 260 seconds]
decentpenguin has quit [Read error: Connection reset by peer]
decentpenguin has joined #ocaml
smazga has joined #ocaml
yomimono_ has joined #ocaml
yomimono has quit [Ping timeout: 240 seconds]
smazga has quit [Ping timeout: 240 seconds]
snowpanda has quit [Quit: Leaving...]
<d_bot> <ulrikstrid> I think @ostera experimented with something like it done time ago @rgrinberg
wingsorc has quit [Ping timeout: 260 seconds]
tane has joined #ocaml
Tuplanolla has joined #ocaml
<d_bot> <ostera> @rgrinberg wha part of the gen_server are you interested in?
<d_bot> <rgrinberg> I'd like a generic rpc server that allows custom user state + calling + casting
<d_bot> <rgrinberg> Don't need any supervision
mxns has joined #ocaml
mxns has quit [Ping timeout: 260 seconds]
yomimono has joined #ocaml
yomimono_ has quit [Ping timeout: 246 seconds]
<d_bot> <Drup> @ostera `Qrc` provides various printers for QR codes, including the utf8 shown above
smazga has joined #ocaml
hnOsmium0001 has quit [Quit: Connection closed for inactivity]
smazga has quit [Ping timeout: 260 seconds]
Haudegen has joined #ocaml
<d_bot> <ostera> @rgrinberg my old sketches were a little rough around the edges, so I've cleaned this up: https://sketch.sh/s/gTPWpZMpu5UBGtj8CHRbIH/
<d_bot> <ostera> its essentially a functor to create the right API, and the core-logic of the server isn't too interesting right now since there's no concurrency in place (so no messages to wait for, or nodes that could disconnect, etc)
<d_bot> <ostera> one core difference is that while in erlang you'd have the illusion of state through recursion at a process level, here i'm using actual mutable state to replace server's internal state
<d_bot> <ostera> this makes it possible to issue sequential calls, like you'd do in Erlang
<d_bot> <ostera> without having to care about threading the new gen_server value around
berberman has joined #ocaml
berberman_ has quit [Ping timeout: 260 seconds]
smazga has joined #ocaml
nullcone has quit [Quit: Connection closed for inactivity]
mxns has joined #ocaml
mxns has quit [Ping timeout: 256 seconds]
tane has quit [Ping timeout: 260 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 240 seconds]
averell has quit [Quit: .]
h14u has joined #ocaml
averell has joined #ocaml
zebrag has joined #ocaml
inkbottle has quit [Ping timeout: 260 seconds]
Jesin has quit [Ping timeout: 260 seconds]
djellemah has joined #ocaml
smazga has quit [Ping timeout: 256 seconds]
<d_bot> <arctumn> how would someone explain to List.init that you want to make an m sized tuple ? example if the tuple is of size 2 i want to pass it as (a,x) if tje tuple if of size 3 i want it to be as (a,x,x+1) and if it's of size n i want it to be like (a,x,x+1,...,x+n) is that possible?
inkbottle has joined #ocaml
zebrag has quit [Ping timeout: 260 seconds]
<d_bot> <ggole> `List.init` doesn't create tuples, only lists. It might be better to use an array if you want a tuple-like thing of size n.
<tryte> hello, I'm reading Real World OCaml and in the introductory chapter, when describing let ... in expressions it shows an example with multiple bindings by using nested let ... in. My question is, does OCaml has the SML-style sugar of a single let ... in with a list of bindings?
<def> no
<tryte> ok
<tryte> thanks def
<def> for sequence, you do let x1 = e1 in let x2 = e2 in ..
<def> you can do let x1 = e1 and x2 = e2 in ...
<tryte> ah, and
<tryte> yeah there are things that are less verbose here than in SML and I take it there will be a couple that are more verbose in turn
<tryte> no biggue
<def> but this is to evaluate binding independently, in this example e2 cannot see x1.
<tryte> biggie*
<def> let-and is useful in the recursive case to evaluate mutually recursive bindings
<tryte> and is also simultaneous bindings here
<tryte> yes
<def> (and also in (concurrency) monads to do parallel evaluatoin)
<tryte> I'm pretty much liking the language, I was looking for a way to use SML to write my code. I decided there's no language I like better overall
<def> :_
<def> :)
<tryte> but it turned out impossible to use by lacking of ... "life" I guess
<tryte> so it will be OCaml and so far I am liking it
<tryte> I expect some things to be more or less verbose sintactically at one or the other, not that important
<d_bot> <arctumn> @ggole i meant a list of a n-tuple since list accepts a generic type
amiloradovsky has quit [Remote host closed the connection]
amiloradovsky has joined #ocaml
<d_bot> <ggole> Well, `List.init` will return a list of whatever is returned by the function passed to it
<d_bot> <ggole> But that type can't depend on a normal int value
<d_bot> <arctumn> i know that, the issue is that i don't know how would you be able to inform that the type of the list is of an n-sized tuple
<d_bot> <arctumn> as there's no notation that i know by default that could compreend a sintax like (a,...,xn)
<d_bot> <ggole> You can probably come up with something using GADT hacks, but that honestly kind of sucks
smazga has joined #ocaml
tane has joined #ocaml
<d_bot> <arctumn> the only way i might think that can be possible is to save in a list and then convert that list to a tuple
<d_bot> <ggole> Hence the suggestion to use an array, which supports being of size `n` just fine
silver has joined #ocaml
<d_bot> <arctumn> for that i would jut keep as an 'a list list when i want to produce a ('a,...,'an) list
<Fardale> @arctumn on what depends the size of the tuple ?
<d_bot> <arctumn> on the input of the user
<Fardale> that not possible in Ocaml
<Fardale> You need dependent type to do this
<d_bot> <ggole> It's possible, just hard
<Fardale> the size of tuple are known at compile time
<d_bot> <arctumn> uhm.... maybe saving everything into a list and then convert that list to a tupe, might be the way to go
<Fardale> @ggogle w
<Fardale> what is the type of such function ?
<d_bot> <ggole> You'd hide the tuple type under an existential with a type-level length (encoded in a GADT)
<d_bot> <arctumn> yup, i see that the issue stays the same as i would not know how to tell it to ocaml
<Fardale> @ggole then it is not an Ocaml tuple
<Fardale> @arctumn, you can not write a function that take a list and return a tuple with all element of that list
<d_bot> <arctumn> yup i already saw that when you asked me for the type
mxns has joined #ocaml
<d_bot> <ggole> That's how to do tuples with statically unknown length.
<d_bot> <arctumn> i might go using an 'a list list way to approach what i was doing
<d_bot> <arctumn> thx for the help @ggole @fardale
mxns has quit [Ping timeout: 240 seconds]
Jesin has joined #ocaml
mbuf has joined #ocaml
amiloradovsky has quit [Remote host closed the connection]
amiloradovsky has joined #ocaml
osa1 has joined #ocaml
neiluj has joined #ocaml
neiluj has quit [Changing host]
neiluj has joined #ocaml
mxns has joined #ocaml
mxns has quit [Ping timeout: 260 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 256 seconds]
mxns has joined #ocaml
smazga has quit [Ping timeout: 240 seconds]
smazga has joined #ocaml
yomimono_ has joined #ocaml
smazga has quit [Ping timeout: 258 seconds]
yomimono has quit [Ping timeout: 240 seconds]
mbuf has quit [Quit: Leaving]
smazga has joined #ocaml
hnOsmium0001 has joined #ocaml
TheLemonMan has joined #ocaml
bartholin has joined #ocaml
mxns has quit [Ping timeout: 260 seconds]
yomimono_ has quit [Ping timeout: 260 seconds]
yomimono has joined #ocaml
smazga has quit [Ping timeout: 265 seconds]
amiloradovsky has quit [Remote host closed the connection]
amiloradovsky has joined #ocaml
amiloradovsky has quit [Remote host closed the connection]
amiloradovsky has joined #ocaml
smazga has joined #ocaml
mxns has joined #ocaml
smazga has quit [Ping timeout: 260 seconds]
mxns has quit [Ping timeout: 260 seconds]
neiluj has quit [Quit: leaving]
mxns has joined #ocaml
smazga has joined #ocaml
amiloradovsky has quit [Remote host closed the connection]
amiloradovsky has joined #ocaml
smazga has quit [Ping timeout: 258 seconds]
mxns has quit [Ping timeout: 265 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 240 seconds]
reynir has quit [Ping timeout: 246 seconds]
reynir has joined #ocaml
smazga has joined #ocaml
jbrown has joined #ocaml
mxns has joined #ocaml
smazga has quit [Ping timeout: 260 seconds]
osa1 has quit [Remote host closed the connection]
bartholin has quit [Ping timeout: 258 seconds]
smazga has joined #ocaml
mxns has quit [Ping timeout: 260 seconds]
bartholin has joined #ocaml
mxns has joined #ocaml
osa1 has joined #ocaml
smazga has quit [Ping timeout: 240 seconds]
mxns has quit [Ping timeout: 260 seconds]
smazga has joined #ocaml
h14u has quit [Quit: Leaving]
smazga has quit [Ping timeout: 260 seconds]
waleee-cl has joined #ocaml
amiloradovsky has quit [Remote host closed the connection]
amiloradovsky has joined #ocaml
mxns has joined #ocaml
smazga has joined #ocaml
mxns has quit [Ping timeout: 272 seconds]
smazga has quit [Ping timeout: 260 seconds]
decentpenguin has quit [Ping timeout: 260 seconds]
amiloradovsky has quit [Remote host closed the connection]
amiloradovsky has joined #ocaml
mxns has joined #ocaml
decentpenguin has joined #ocaml
berberman_ has joined #ocaml
berberman has quit [Ping timeout: 260 seconds]
mxns has quit [Ping timeout: 256 seconds]
smazga has joined #ocaml
mxns has joined #ocaml
osa1 has quit [Ping timeout: 246 seconds]
smazga has quit [Ping timeout: 256 seconds]
amiloradovsky has quit [Remote host closed the connection]
amiloradovsky has joined #ocaml
bartholin has quit [Ping timeout: 260 seconds]
smazga has joined #ocaml
bartholin has joined #ocaml
snowpanda has joined #ocaml
smazga has quit [Ping timeout: 260 seconds]
silver has quit [Quit: rakede]
smazga has joined #ocaml
mxns has quit [Ping timeout: 260 seconds]
smazga has quit [Ping timeout: 240 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 272 seconds]
smazga has joined #ocaml
ggole has quit [Quit: Leaving]
mxns has joined #ocaml
smazga has quit [Ping timeout: 240 seconds]
mxns has quit [Ping timeout: 272 seconds]
smazga has joined #ocaml
amiloradovsky has quit [Ping timeout: 260 seconds]
amiloradovsky1 has joined #ocaml
smazga has quit [Ping timeout: 256 seconds]
bartholin has quit [Ping timeout: 256 seconds]
smazga has joined #ocaml
amiloradovsky1 is now known as amiloradovsky
smazga has quit [Ping timeout: 260 seconds]
mxns has joined #ocaml
wingsorc has joined #ocaml
smazga has joined #ocaml
mxns has quit [Ping timeout: 260 seconds]
smazga has quit [Ping timeout: 260 seconds]
mxns has joined #ocaml
smazga has joined #ocaml
tane has quit [Quit: Leaving]
smazga has quit [Ping timeout: 272 seconds]
amiloradovsky has quit [Remote host closed the connection]
amiloradovsky has joined #ocaml
nullcone has joined #ocaml
smazga has joined #ocaml
mxns has quit [Ping timeout: 260 seconds]
smazga has quit [Ping timeout: 260 seconds]
vicfred has joined #ocaml
vicfred has quit [Max SendQ exceeded]
Tuplanolla has quit [Quit: Leaving.]
smazga has joined #ocaml
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
amiloradovsky has quit [Remote host closed the connection]
smazga has quit [Ping timeout: 240 seconds]
amiloradovsky has joined #ocaml
amiloradovsky has quit [Remote host closed the connection]
amiloradovsky has joined #ocaml
mxns has joined #ocaml
mxns has quit [Ping timeout: 260 seconds]
smazga has joined #ocaml
smazga has quit [Ping timeout: 240 seconds]
mxns has joined #ocaml
smazga has joined #ocaml
mxns has quit [Ping timeout: 258 seconds]
mxns has joined #ocaml
smazga has quit [Ping timeout: 260 seconds]
amiloradovsky has quit [Remote host closed the connection]
mxns has quit [Ping timeout: 272 seconds]
amiloradovsky has joined #ocaml
mxns has joined #ocaml
mxns has quit [Ping timeout: 240 seconds]
smazga has joined #ocaml
mxns has joined #ocaml
smazga has quit [Ping timeout: 240 seconds]
andreas303 has quit [Ping timeout: 240 seconds]
DanC has joined #ocaml
dckc has quit [Ping timeout: 272 seconds]