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
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> ic, just found it
<P4Titan> Very useful. Many thanks!
xorpse has joined #ocaml
handlex has quit [Quit: handlex]
snhmib has quit [Ping timeout: 264 seconds]
profan_ is now known as profan
sz0 has joined #ocaml
qdwang has joined #ocaml
<qdwang> Hi, is there an updated OCaml instruction document? I only found a 2010 version `http://cadmium.x9c.fr/distrib/caml-instructions.pdf`
jao has quit [Ping timeout: 276 seconds]
philtor has joined #ocaml
mfp has quit [Ping timeout: 258 seconds]
ocabot_ has quit [Ping timeout: 240 seconds]
ocabot_ has joined #ocaml
jeffmo has joined #ocaml
jeffmo has quit [Client Quit]
FreeBirdLjj has joined #ocaml
snhmib has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 260 seconds]
qdwang_ has joined #ocaml
xorpse has quit [Ping timeout: 276 seconds]
qdwang has quit [Ping timeout: 260 seconds]
Premislaus has joined #ocaml
armish has quit [Quit: Textual IRC Client: www.textualapp.com]
FreeBirdLjj has joined #ocaml
snhmib has quit [Ping timeout: 264 seconds]
yawar has joined #ocaml
snhmib has joined #ocaml
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
<Onemorenickname> zozozo, suchas ? (or where can i learn these ? https://caml.inria.fr/pub/old_caml_site/oreilly-book/html/book-ora209.html does not mention it)
<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]
jao has quit [Ping timeout: 240 seconds]
nomicflux has quit [Quit: nomicflux]
sh0t has quit [Quit: Leaving]
average has quit [Quit: leaving]
average has joined #ocaml
<Flerex> Why does this piece of code http://pastebin.com/nT5jb09a returns
<Flerex> val first_match : ('a -> 'b) -> ('a -> 'b) -> 'a list -> 'a = <fun>
<Flerex> Shouldn't it be more logical to return
<Flerex> val first_match : ('a -> bool) -> ('a -> bool) -> 'a list -> 'a = <fun>
<Flerex> ?
<companion_cube> f1 h = f2 h ← this uses polymorphic equality
<Flerex> return*
<Flerex> What is that?
<dmbaturin> Well, (=) is 'a -> 'a -> bool
<Flerex> Oh
<Flerex> Sure
<Flerex> Didn't notice that.
<Flerex> Thanks!
psacrifice has quit [Remote host closed the connection]
psacrifice has joined #ocaml
nomicflux has joined #ocaml
octarin has joined #ocaml
mesiviah has joined #ocaml
Anarchos has joined #ocaml
<mesiviah> Hi, I have a problem setting up my OCaml environment
<mesiviah> I installed utop, core, core_extended and async through opam, but utop won't load the core library
<mesiviah> I did update my .ocamlinit with the necessary lines
<dmbaturin> mesiviah: What does it say when you #require it?
<mesiviah> I'm not sure what you mean, I should type #require "core" INSIDE utop ?
<mesiviah> I've required it in the ocamlinit file, and when I start utop it just says that there is no such package
<dmbaturin> Yep. #require "core";;
<dmbaturin> How did you install it?
<mesiviah> It says "No such package: core"
<mesiviah> I installed it with opam (opam install core)
<mesiviah> though when I run ocamlfind on core, it doesn't find it, but opam certifies me that it's installed
wtetzner has joined #ocaml
jao has joined #ocaml
<mesiviah> Something weird is that OPAM's ppa wasn't correctly processed (I think), cause it says
<mesiviah> W: The repository 'http://ppa.launchpad.net/avsm/ppa/ubuntu xenial Release' does not have a Release file.
<dmbaturin> mesiviah: That's odd. Tried opam reinstall core ?
<mesiviah> will do
<dmbaturin> Uhm, PPA?
<adrien> I would tend to assume that the PPA is completely unavailable
<adrien> and that you're maybe not getting opam from there
<adrien> how did you install opam?
<mesiviah> I installed opam with avsm/ppa
<dmbaturin> I don't even bother with distro-specific procedures and just install in distro-agnostic way.
<mesiviah> (as it was recommended in Real World OCaml)
defgeneric has quit [Ping timeout: 240 seconds]
<dmbaturin> Well, if that PPA is not available, I guess RWO is out of sync with reality. :)
<mesiviah> Yeah so I should compile OPAM ?
<dmbaturin> mesiviah: You don't need to compile it. That script fetches binaries.
<dmbaturin> opam is really just one binary anyway.
defgeneric has joined #ocaml
<mesiviah> Okay thanks a lot !
<Flerex> I've been asked to simplify this expression:
<Flerex> if f (x) < h then f (x) else h
<Flerex> Would you consider this a simplification?
<Flerex> let a = f x in if a < h then a else h
AlexDenisov has quit [Remote host closed the connection]
AlexDenisov has joined #ocaml
<companion_cube> yes, but it's not the one the person who asked you that was thinking of
<Flerex> It's an exam question.
<companion_cube> exactly :p
<zozozo> also, the second version might have a different behavior because of side effects
<Flerex> It's already specified that there's are no side effects
<companion_cube> Flerex: I think the answer involves a classical math operator :)
zpe has quit [Remote host closed the connection]
<Flerex> Mmmm
<Flerex> I'll try to work on tnat
<Flerex> lmao
<Flerex> dmbaturin: Okay now I'm crying
<Flerex> XDDDDDDD
<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
<Flerex> My problem is
<Flerex> In line 4 i want to append either the last element of a list of nothing to another list
<Flerex> and If I match it, i would have to divide that into two cases h::t and []
<octachron> Flerex, part of your problem may be that the primary notion is tail-calls , not tail-recursive functions
<dmbaturin> Anyway, the number of nested calls non-tail recursive functions can handle is quite large in practice.
<Flerex> Yeah I understand that but I'm asked to create the function as tail-recursive
<Flerex> So I'm worried if using List.append in that case would make it not tail-recursive
<octachron> Flerex, then expand your match cases to have "[] -> | [a] -> "
<Flerex> Okay then
<Flerex> Thanks!
mesiviah_ has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
mesiviah_ has quit [Client Quit]
mesiviah_ has joined #ocaml
mesiviah1 has joined #ocaml
mesiviah1 has quit [Client Quit]
dhil has quit [Ping timeout: 255 seconds]
wtetzner has quit [Remote host closed the connection]
snhmib has quit [Ping timeout: 260 seconds]
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
mesiviah1 has joined #ocaml
mattrepl has joined #ocaml
<mesiviah1> Sorry I've been connecting/disconnecting, I'm setting up my client
slash^ has quit [Read error: Connection reset by peer]
mesiviah1 has quit [Quit: leaving]
mesiviah1 has joined #ocaml
mesiviah1 has quit [Client Quit]
mesiviah has quit [Quit: Page closed]
kakadu has joined #ocaml
yomimono has quit [Ping timeout: 255 seconds]
snhmib has joined #ocaml
mengu has joined #ocaml
Xadnem has joined #ocaml
companion_square has joined #ocaml
companion_square has quit [Client Quit]
companion_square has joined #ocaml
companion_square has quit [Client Quit]
Xadnem has quit [Client Quit]
companion_square has joined #ocaml
companion_square is now known as coucou
Xadnem has joined #ocaml
orbifx has joined #ocaml
octachron has quit [Quit: Leaving]
Xadnem is now known as highlight
highlight is now known as Xadnem
xorpse has joined #ocaml
ygrek has joined #ocaml
<Xadnem> Hello kakadu, finally I achieved to compile lablqt and try the examples. B
<Xadnem> I think it could be too complicated for me to use it for now.
<Xadnem> But it is really interesting.
<kakadu> thanks
rgrinberg has joined #ocaml
rgrinberg has quit [Remote host closed the connection]
rgrinberg has joined #ocaml
Onemorenickname has quit [Ping timeout: 240 seconds]
nullremains has quit [Read error: Connection reset by peer]
virtualeyes has joined #ocaml
wtetzner has joined #ocaml
Onemorenickname has joined #ocaml
coucou has quit [Quit: WeeChat 1.6]
Xadnem has quit [Quit: leaving]
MercurialAlchemi has quit [Ping timeout: 255 seconds]
fre has joined #ocaml
Flerex has quit [Quit: Textual IRC Client: www.textualapp.com]
ygrek_ has joined #ocaml
ygrek has quit [Ping timeout: 240 seconds]
ygrek_ has quit [Ping timeout: 276 seconds]
fre has quit [Ping timeout: 276 seconds]
yawaramin has joined #ocaml
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
fre has joined #ocaml
ygrek_ has joined #ocaml
larhat has quit [Quit: Leaving.]
tane has quit [Quit: Leaving]
fre has quit [Ping timeout: 276 seconds]
jnavila has quit [Ping timeout: 252 seconds]
orbifx has quit [Ping timeout: 240 seconds]
pierpa has quit [Read error: Connection reset by peer]
octarin has quit [Quit: leaving]
xorpse has quit [Ping timeout: 258 seconds]
ia0 has quit [Quit: reboot]
ia0 has joined #ocaml
Flerex has joined #ocaml
virtualeyes has quit [Ping timeout: 255 seconds]
virtualeyes has joined #ocaml
pierpa has joined #ocaml
yawaramin has quit [Quit: Page closed]
ygrek_ has quit [Ping timeout: 258 seconds]
ygrek_ has joined #ocaml
kakadu has quit [Ping timeout: 240 seconds]
virtualeyes1 has joined #ocaml
virtualeyes has quit [Ping timeout: 240 seconds]