ocabot_ has quit [Remote host closed the connection]
ocabot_ has joined #ocaml
nomicflux has joined #ocaml
yy has joined #ocaml
yy has quit [Client Quit]
larhat has quit [Quit: Leaving.]
wagle has quit [Read error: Connection reset by peer]
nomicflux has quit [Quit: nomicflux]
mengu has quit [Remote host closed the connection]
wagle has joined #ocaml
wagle has quit [Read error: Connection reset by peer]
wagle has joined #ocaml
wagle has quit [Remote host closed the connection]
silver has quit [Read error: Connection reset by peer]
Onemorenickname has joined #ocaml
armish has joined #ocaml
wagle has joined #ocaml
P4Titan has joined #ocaml
<P4Titan>
Hi all. I am trying to send an int (preferably on 16 bits) over TCP. I need to get into the type of `bytes`. How can I best do that?
<P4Titan>
I want this resulting `bytes` to have known and constant length such that on the other side, I can wait for that much data, read it, and handle accordingly
wagle has quit [Remote host closed the connection]
Onemorenickname has quit [Read error: Connection reset by peer]
copy` has quit [Quit: Connection closed for inactivity]
wagle has joined #ocaml
handlex has joined #ocaml
wtetzner has quit [Remote host closed the connection]
<Enjolras>
P4Titan: you can use a lib, like ocp-lib-endian, or if you are using Lwt, there is a module in LWt
<P4Titan>
What is this module in LWT?
<Enjolras>
(Lwt_io.LE or Lwt_io.BE depending on endianess)
P4Titan has quit [Remote host closed the connection]
nomicflux has joined #ocaml
Flerex has joined #ocaml
nomicflux has quit [Quit: nomicflux]
snhmib has quit [Ping timeout: 240 seconds]
qdwang_ has quit [Ping timeout: 260 seconds]
mengu has joined #ocaml
mengu has quit [Ping timeout: 240 seconds]
yawar has quit [Quit: Page closed]
govg has quit [Ping timeout: 276 seconds]
snhmib has joined #ocaml
snhmib has quit [Ping timeout: 255 seconds]
govg has joined #ocaml
Flerex has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
snhmib has joined #ocaml
sz0 has quit [Quit: Connection closed for inactivity]
pierpa has quit [Ping timeout: 240 seconds]
slash^ has joined #ocaml
MercurialAlchemi has joined #ocaml
snhmib has quit [Ping timeout: 240 seconds]
mengu has joined #ocaml
snhmib has joined #ocaml
rgrinberg has quit [Ping timeout: 240 seconds]
mengu has quit [Remote host closed the connection]
govg has quit [Ping timeout: 240 seconds]
arquebus has joined #ocaml
arquebus has quit [Quit: Leaving]
govg has joined #ocaml
shinnya has joined #ocaml
psacrifice has joined #ocaml
ygrek has quit [Ping timeout: 240 seconds]
orbifx has joined #ocaml
<companion_cube>
reynir, dmbaturin: the lib has evolved :-)
<companion_cube>
qmmm: I think it's relatively up to date, the bytecode changes very rarely
snhmib has quit [Ping timeout: 240 seconds]
snhmib has joined #ocaml
Premislaus has quit [Quit: Konversation terminated!]
sz0 has joined #ocaml
fraggle_ has quit [Ping timeout: 255 seconds]
infinity0 has joined #ocaml
snhmib has quit [Ping timeout: 276 seconds]
fraggle_ has joined #ocaml
tane has joined #ocaml
snhmib has joined #ocaml
jnavila has joined #ocaml
moei has quit [Quit: Leaving...]
moei has joined #ocaml
zpe has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
larhat has joined #ocaml
zpe has quit [Ping timeout: 240 seconds]
psacrifice has quit [Remote host closed the connection]
psacrifice has joined #ocaml
govg has quit [Ping timeout: 240 seconds]
silver has joined #ocaml
psacrifice has quit [Remote host closed the connection]
\h has left #ocaml ["WeeChat 1.7"]
sz0 has quit [Quit: Connection closed for inactivity]
fre has joined #ocaml
psacrifice has joined #ocaml
shinnya has quit [Ping timeout: 256 seconds]
psacrifice has quit [Remote host closed the connection]
psacrifice has joined #ocaml
Flerex has joined #ocaml
xorpse has joined #ocaml
orbifx has quit [Ping timeout: 252 seconds]
govg has joined #ocaml
<jerith>
Leonidas: I finally got around to hacking on some slacko tests this weekend.
fedruantine has quit [Ping timeout: 240 seconds]
xorpse has quit [Ping timeout: 260 seconds]
sh0t has joined #ocaml
fedruantine has joined #ocaml
Onemorenickname has joined #ocaml
<Onemorenickname>
Hm
<Onemorenickname>
I don't understand something
<Onemorenickname>
I thought ocaml types could be recursive
<infinity0>
you need to wrap them in a constructor at the very least
<Onemorenickname>
Yet I get on "type item = rule * (item option);;
<Onemorenickname>
" the error "This type abbreviation is cyclic"
<Onemorenickname>
oh.
<Onemorenickname>
wrapping them in option (which as constructors) is not enough ?
<infinity0>
type item = Item of (rule * (item option))
<infinity0>
it's because otherwise it gets expanded during aliasing, or something like that
<Onemorenickname>
hm. if I make a single constructor, i can deconstruct it in my functions parameters ? I mean, if i write "type item = Item of (rule * (item option))", will i be able to write "let aux Item(ru, io) = stuff in" ?
<infinity0>
i think so yes
<Onemorenickname>
ok, perfect then :)
<Onemorenickname>
Thanks for the (very !) quick answer !
<Onemorenickname>
(where can I learn such nuances of ocaml ?)
<infinity0>
heh yes, i had just opened my IRC client :)
<zozozo>
Onemorenickname: another solution is to use the -rectypes option, but it might lead to some strange things from what I recall
<zozozo>
Onemorenickname: well it makes the type-chedker more permissive so some errors which would have been caught otherwise will then be ignored because they are not type errors with rectypes
<Onemorenickname>
oh, i understand
<Onemorenickname>
for instance, if i make "type item = item * (whatever)", it will be allowed
<Onemorenickname>
even though it shall not
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
fre has quit [Ping timeout: 264 seconds]
<Onemorenickname>
"let next Item((v, lst),p) = stuff in", i get the errror "Item expects two arguments, but is applied to 0", aren't (v,lst) and p two arguments of Item ?
octachron has joined #ocaml
<infinity0>
it's ocaml so you need to write (Item (v, lst) p), think lisp not C, the left bracket goes before the main thing
<zozozo>
Onemorenickname: this is parsed as let next = function Item -> function ((v, lst, p)) -> stuff
troydm has quit [Quit: What is hope? That all of your wishes and all of your dreams come true? (C) Rau Le Creuset]
<Onemorenickname>
ooooh
<Onemorenickname>
infinity0, this explains so many things
<Onemorenickname>
thanks you both !
troydm has joined #ocaml
troydm has quit [Remote host closed the connection]
troydm has joined #ocaml
troydm has quit [Client Quit]
troydm has joined #ocaml
Onemorenickname has quit [Read error: No route to host]
sternenseemann has left #ocaml [#ocaml]
Onemorenickname has joined #ocaml
infinity0_ has joined #ocaml
infinity0 has joined #ocaml
infinity0 has quit [Changing host]
handlex has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
agarwal1975 has quit [Quit: agarwal1975]
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
Onemorenickname has quit [Ping timeout: 256 seconds]
psacrifice has quit [Remote host closed the connection]
handlex has quit [Quit: handlex]
Onemorenickname has joined #ocaml
nomicflux has joined #ocaml
handlex has joined #ocaml
wtetzner has joined #ocaml
handlex has quit [Quit: handlex]
jnavila has quit [Ping timeout: 240 seconds]
Onemorenickname has quit [Read error: Connection reset by peer]
Onemorenickname has joined #ocaml
mfp has joined #ocaml
handlex has joined #ocaml
psacrifice has joined #ocaml
AlexDenisov has joined #ocaml
mengu has joined #ocaml
handlex has quit [Quit: handlex]
jnavila has joined #ocaml
mengu has quit [Quit: Leaving...]
jao has joined #ocaml
zpe has joined #ocaml
defgeneric has quit [Ping timeout: 240 seconds]
defgeneric has joined #ocaml
virtualeyes has joined #ocaml
virtualeyes is now known as nullremains
wtetzner has quit [Remote host closed the connection]
<companion_cube>
Flerex: notice how the result is smaller than both f x and h?
<reynir>
f x + h
<reynir>
(for a suitable redefinition of ( + ))
* reynir
ducks
<Flerex>
I'm feeling stupid
<Flerex>
I don't get what you mean
<reynir>
companion_cube: I'm super tired, but I hope to take a look at calculon tonight :-)
<reynir>
Flerex: nevermind what I said, it was nonsense :-) sorry
<companion_cube>
yay!
<dmbaturin>
companion_cube: I'm looking to add SASL auth to the raw IRC part of the lib.
<companion_cube>
ouch
<companion_cube>
there's some code for SASL in jackline, the XMPP client, I think
<dmbaturin>
And nickserv auth too, perhaps, but more and more IRCDs have SASL. Freenode one does for certain, so does that of Esper.
<companion_cube>
well, there's this whole ircv3 project
<companion_cube>
I think SASL is part of it?
<dmbaturin>
Might be.
<companion_cube>
also, batches
<companion_cube>
anyway, feel free to contribute, johnelse is the maintainer and he's very friendly
<dmbaturin>
I'll see what I can add to calculon too.
<companion_cube>
heh
<companion_cube>
plugins!
<companion_cube>
(or using it, I guess)
<companion_cube>
I've thought a bit about the multi-channel part
<companion_cube>
it's not clear if plugins' state should be shared or not
<companion_cube>
especially if one queries the bot (which state to use)
<dmbaturin>
companion_cube: By the way, maybe separate plugins and core a bit?
<octachron>
reynir, (f x + h) works for (the right) tropical semi-rings
<companion_cube>
dmbaturin: like, in another sub-libraries? I didn't really know which name to pick
<companion_cube>
Flerex: you know about `min`?
defgeneric has quit [Ping timeout: 260 seconds]
<dmbaturin>
companion_cube: Well, maybe just in a subdir.
<Flerex>
omg
<reynir>
octachron: heh, I never heard of that one
<Flerex>
companion_cube you are so right
tane has quit [Ping timeout: 259 seconds]
nomicflux has quit [Quit: nomicflux]
<Flerex>
I was trying to find some logical way of simplifying it because the previous exercises were all like this, that I forgot to think about other functions
<Flerex>
thanks!
<mesiviah>
Okay so I installed OPAM the way you told me to, then installed core, core_extended and async, but when I launch utop it still tells me that module Core is unbound
<dmbaturin>
companion_cube: It would be nice to add configure options for (not) building specific plugins.
defgeneric has joined #ocaml
<mesiviah>
No more ppa error when updating though (obviously)
<companion_cube>
dmbaturin: yeah, it would be nice
<companion_cube>
right now it's more or less conditioned on the dependencies
<companion_cube>
(i.e. plugins requiring additional dependencies are optionally compiled)
<reynir>
mesiviah: #require "core";; ?
<octachron>
reynir, too be honest the name stuck with me due to my sheer bewilderment at the ludicrouness of this name
<mesiviah>
reynir: it stills tell me that there is no such package (I have that command in my .ocamlinit anyway)
<octachron>
mesiviah, have you tried "eval $(opam config env)"?
<mesiviah>
octachron: just did that, it returns nothing
<dmbaturin>
It never returns anything, it just sets a bunch of environment variables.
<octachron>
mesiviah, have you tried to lauch utop after setting up the command?
<mesiviah>
Daaamn it's working
Anarchos has quit [Read error: Connection reset by peer]
<mesiviah>
Well thanks a lot again !
Anarchos has joined #ocaml
pierpa has joined #ocaml
tane has joined #ocaml
yomimono has joined #ocaml
dhil has joined #ocaml
ivan_ has joined #ocaml
<Flerex>
If I use append, which is not tail recursive, in a function that is aimed to be tail recursive but I use append with only a list of one element as the first argument, would the parent function still be tail recursive?
psacrifice has quit []
<dmbaturin>
Flerex: Well, it will blow up if the left list is longer than append can handle.
<Flerex>
But I can assure that the left list will always be either of length 1 or 0
<dmbaturin>
What's the point though? Appending anything to a one element list is the same as ::
<Flerex>
Yeah but I can't append a list of 1 element with that
<Flerex>
I mean, afaik, you can't do [1]::l
infinity0 has joined #ocaml
<companion_cube>
you can 1::l though
<dmbaturin>
You can extract the element. match xs with [] -> ys | [x] -> x :: ys