adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.07.1 release notes: https://caml.inria.fr/pub/distrib/ocaml-4.07/notes/Changes | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml | Due to ongoing spam, you must register your nickname to talk on the channel
orbifx1 has quit [Ping timeout: 268 seconds]
Guest90447 has quit [Ping timeout: 245 seconds]
themsay has joined #ocaml
themsay has quit [Read error: Connection reset by peer]
jbkcc has joined #ocaml
jbkcc has quit [Client Quit]
pierpa has joined #ocaml
jbkcc has joined #ocaml
themsay has joined #ocaml
themsay has quit [Read error: Connection reset by peer]
themsay has joined #ocaml
themsay has quit [Ping timeout: 268 seconds]
Guest90447 has joined #ocaml
pierpal has quit [Ping timeout: 250 seconds]
jmiven has quit [Quit: co'o]
jmiven has joined #ocaml
KeyJoo has joined #ocaml
keep_learning has joined #ocaml
demonimin has quit [Quit: bye]
keep_learning has quit [Client Quit]
demonimin has joined #ocaml
jbkcc has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jbkcc has joined #ocaml
crowley95 has quit [Ping timeout: 250 seconds]
crowley95 has joined #ocaml
Jeanne-Kamikaze has joined #ocaml
keep_learning has joined #ocaml
keep_learning has quit [Remote host closed the connection]
keep_learning has joined #ocaml
jbkcc has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jbkcc has joined #ocaml
jbkcc has quit [Client Quit]
mfp has quit [Ping timeout: 250 seconds]
KeyJoo has quit [Quit: KeyJoo]
tormen has joined #ocaml
tormen_ has quit [Ping timeout: 250 seconds]
_whitelogger has joined #ocaml
env__ has quit [Ping timeout: 240 seconds]
env__ has joined #ocaml
pierpal has joined #ocaml
pierpa has quit [Quit: Page closed]
jimt has quit [Quit: WeeChat 1.9.1]
jimt has joined #ocaml
MadcapJake has quit [Quit: MadcapJake]
MadcapJake has joined #ocaml
MadcapJake has quit [Quit: MadcapJake]
MadcapJake has joined #ocaml
coetry has joined #ocaml
coetry has quit [Client Quit]
MadcapJake has quit [Quit: MadcapJake]
MadcapJake has joined #ocaml
gravicappa has joined #ocaml
gravicappa has quit [Ping timeout: 246 seconds]
jao has quit [Ping timeout: 245 seconds]
Guest90447 has quit [Ping timeout: 240 seconds]
c4rc4s has quit [Quit: Adios]
gravicappa has joined #ocaml
fraxamo has joined #ocaml
_whitelogger_ has joined #ocaml
_whitelogger has quit [Ping timeout: 250 seconds]
wickedshell has joined #ocaml
_whitelogger has joined #ocaml
bartholin has joined #ocaml
gravicappa has quit [Ping timeout: 250 seconds]
ggole has joined #ocaml
slamzy has joined #ocaml
slamzy1234 has joined #ocaml
slamzy has quit [Ping timeout: 256 seconds]
slamzy1234 has quit [Remote host closed the connection]
kvda has joined #ocaml
_whitelogger has joined #ocaml
nicooo has quit [Remote host closed the connection]
nicooo has joined #ocaml
gravicappa has joined #ocaml
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kvda has joined #ocaml
kakadu has joined #ocaml
env__ has quit [Ping timeout: 250 seconds]
mfp has joined #ocaml
sagotch has joined #ocaml
<sagotch> hello
<sagotch> Can you enforce type checker to reject le last expression? https://pastebin.com/ZtrZMqaY
orbifx1 has joined #ocaml
<sagotch> In short, how to make `?foo:bool -> unit -> unit` values to be reject when you want `unit -> unit` values?
<ggole> I don't think there's any type checker flag for that
<sagotch> Even a typechecker flag would not be enough since it's a library, so this type error should be raised as well in any code using the function :(
<ggole> Hmm
<ggole> You might be able to do some private type stuff
<sagotch> what it would look like ?
<ggole> module M : sig type t = private (?foo:bool -> unit -> unit) type s = private (unit -> unit) val f : t -> ?foo:bool -> unit -> unit val g : s -> ?foo:bool -> unit -> unit val h : t end
<ggole> This would interfere with using normal functions at that argument, though
<ggole> If necessary you could provide an injection to the private type, but that would allow the unwanted optional arguments in
<sagotch> I need to go, but I will try to understand what you suggest when coming back, thanks :)
sagotch has quit [Quit: Leaving.]
orbifx1 has quit [Ping timeout: 268 seconds]
thomasga has joined #ocaml
<thomasga> hey, is there a way to take a lock in a Lwt_preemptive detached thread, without blocking everyhing? Seems that using Mutex.lock there just stucks all the program.
zolk3ri has joined #ocaml
kakadu has quit [Quit: Konversation terminated!]
kakadu has joined #ocaml
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
_whitelogger has joined #ocaml
thomasga has left #ocaml [#ocaml]
chjk6x has joined #ocaml
gravicappa has quit [Ping timeout: 250 seconds]
pierpal has quit [Remote host closed the connection]
KeyJoo has joined #ocaml
themsay has joined #ocaml
pierpal has joined #ocaml
chjk6x has quit [Ping timeout: 240 seconds]
jnavila has joined #ocaml
ziyourenxiang has quit [Ping timeout: 240 seconds]
jnavila has quit [Ping timeout: 246 seconds]
jao has joined #ocaml
aristos has joined #ocaml
Guest90447 has joined #ocaml
FreeBirdLjj has joined #ocaml
zolk3ri has quit [Remote host closed the connection]
zolk3ri has joined #ocaml
env__ has joined #ocaml
KeyJoo has quit [Quit: KeyJoo]
kakadu has quit [Ping timeout: 240 seconds]
kakadu has joined #ocaml
Jeanne-Kamikaze has quit [Quit: Leaving]
env__ has quit [Ping timeout: 272 seconds]
env__ has joined #ocaml
Guest90447 has quit [Remote host closed the connection]
chjk6x has joined #ocaml
Guest90447 has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
Guest90447 has quit [Ping timeout: 244 seconds]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 240 seconds]
env__ has quit [Quit: Lost terminal]
objmagic has joined #ocaml
Ganwell has joined #ocaml
Guest90447 has joined #ocaml
rain1 has joined #ocaml
<rain1> is ocaml self hosted? so you need an ocaml binary to build it from source
<rain1> ah i found the answer it's in boot/
gravicappa has joined #ocaml
objmagic has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
objmagic has joined #ocaml
kakadu has quit [Ping timeout: 240 seconds]
kakadu has joined #ocaml
Haudegen has joined #ocaml
themsay has quit [Ping timeout: 245 seconds]
<Ganwell> I am an ocaml newbie, because someone on the internet said it is a good idea to convert runtime-errors to compiler-errors am trying to do that: https://git.io/fpNSf Maybe its not a good idea at all. :)
<lyxia> Ganwell: if you know at compile time that p is Team0 t0 then you might as well pass t0 around, so you don't need get_team0
<dmbaturin> Ganwell: If you want to make non-exhaustive matching an error rather than a warning, use -w @8
objmagic has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<octachron> I would even add that you *should* consider non-exhaustive matching as an error by default
iovec has quit []
ggole has quit [Quit: ggole]
jnavila has joined #ocaml
<Ganwell> octachron: of course I consider non-exhaustive matching an error, its just for the sake of showing the problem
<octachron> Then as lyxia said, you can just not use the type player, since the type is more or less saying: I have either a `team0` or a `team1` and I don't know which statistically.
hyarion has left #ocaml [#ocaml]
Guest90447 has quit [Ping timeout: 272 seconds]
<Ganwell> octachron: how can I then define a function that works with either team? For example this fails: let first_player a = a == Player0 || a == Player1
pierpal has quit [Ping timeout: 240 seconds]
gravicappa has quit [Ping timeout: 272 seconds]
Guest90447 has joined #ocaml
<Ganwell> lyxia: I simplified the example: https://git.io/fpN7h How to define a function that works on team0 or team1, then?
Jeanne-Kamikaze has joined #ocaml
<lyxia> you make one function for each team
iovec has joined #ocaml
<octachron> Ganwell, if you have a function that works on both team; then you use your player type, and whenever you have a function that works only on team1, you use the unwrapped type `team1`
fraxamo has quit [Quit: Leaving]
<octachron> in otherwords, you use `player` to erase the difference between the type, and you need to know on which side you are, you try to keep the `team$d` unwrapped as long as possible
<octachron> *and if you need to know
kark has joined #ocaml
orbifx1 has joined #ocaml
jbkcc has joined #ocaml
aristos has quit [Quit: Leaving]
<dinosaure> wq
orbifx1 has quit [Read error: Connection reset by peer]
orbifx1 has joined #ocaml
Guest90447 has quit [Remote host closed the connection]
Guest90447 has joined #ocaml
Guest90447 has quit [Remote host closed the connection]
Algebr has joined #ocaml
zolk3ri has quit [Quit: Lost terminal]
objmagic has joined #ocaml
jimt has quit [Ping timeout: 272 seconds]
Algebr has quit [Remote host closed the connection]
objmagic_ has joined #ocaml
coetry has joined #ocaml
objmagic has quit [Ping timeout: 240 seconds]
teej has joined #ocaml
<coetry> can someone help me understand why my first match case is giving me an error?
<rain1> i think you need () around it
<coetry> like (first :: rest ) -> first ?
<coetry> its saying "unused variable rest"
<coetry> even with parenthesis
<rain1> change it to _
chjk6x has quit [Ping timeout: 246 seconds]
<coetry> perfect, thank you. The Real World OCaml book needs a few updates!
<coetry> another error I was getting was the **. operator for Floats (which it appears you don't need that now)
<coetry> 2. ** 3. works fine
<octachron> You don't need the parenthesis, another possibility is to use `_rest` to both name the variable and signal to the compiler that is not used with the leading "_"
<coetry> ah ok so "_" signals unused vars, thank you!
jnavila has quit [Ping timeout: 252 seconds]
bartholin has quit [Remote host closed the connection]
chjk6x has joined #ocaml
jnavila has joined #ocaml
coetry has quit [Quit: Lost terminal]
orbifx1 has quit [Ping timeout: 250 seconds]
<Ganwell> octachron: Thanks this make things very explicit, I like it. I also played with polymorphic variants, which allow what I first intended, but are less explicit.
jnavila has quit [Ping timeout: 252 seconds]
cobax has quit [Ping timeout: 264 seconds]
kvda has joined #ocaml
steenuil has quit [Remote host closed the connection]
objmagic_ has quit [Ping timeout: 240 seconds]
objmagic has joined #ocaml
enedil has joined #ocaml
<enedil> Hello
<enedil> Could somebody tell me why I get syntax error?
<enedil> And before any question is asked I'll answer, yes, I need imperative constructions here (that's the part of the task).
<lyxia> enedil: line 6 should be a double semicolon
<lyxia> You might also want to paste the error with your code for this kind of question, saves us the trouble of getting the code compiling
<enedil> lyxia, yes, I should have, but nonetheless the error was plain and simple File "./f.ml", line 30, characters 0-0:Error: Syntax error (line 30 is the last one, it's empty)
<enedil> Than you for your help
<enedil> Thank you for your help
objmagic has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kakadu has quit [Remote host closed the connection]
enedil_ has joined #ocaml
chjk6x has quit [Ping timeout: 250 seconds]
enedil has quit [Ping timeout: 250 seconds]
Haudegen has quit [Read error: Connection reset by peer]
pierpal has joined #ocaml
enedil_ has quit [Quit: Leaving]
pierpal has quit [Ping timeout: 246 seconds]
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]