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
<lobo> mhh, seems like my code is so horrible that dune build gets philosophical now :) I must not segfault." Uncertainty is the mind-killer."
kleisli has joined #ocaml
<lobo> that happens only, when a unix socket is in the directory. maybe i've hit a bug
strmpnk has quit []
strmpnk has joined #ocaml
strmpnk has quit [Client Quit]
kakadu has quit [Remote host closed the connection]
strmpnk has joined #ocaml
kakadu has joined #ocaml
spew has quit [Quit: Connection closed for inactivity]
cartwright has joined #ocaml
kleisli has quit [Ping timeout: 265 seconds]
serge_ has joined #ocaml
bglm[m] has joined #ocaml
serge_ has quit [Ping timeout: 272 seconds]
<Adso_of_Jelq> are nullary constructors heap allocated
<Adso_of_Jelq> type t = Nullary;; let x = Nullary in let y = Nullary in x == y
<Adso_of_Jelq> ^ that returns true
<lyxia> indeed
ocaml459 has joined #ocaml
ocaml459 has quit [Client Quit]
<Adso_of_Jelq> lyxia: so is it safe to use == on nullary constructors
olle has quit [Ping timeout: 268 seconds]
olle has joined #ocaml
mfp has quit [Ping timeout: 272 seconds]
serge has joined #ocaml
serge has quit [Ping timeout: 240 seconds]
kleisli has joined #ocaml
tormen_ has joined #ocaml
tormen has quit [Ping timeout: 240 seconds]
ocaml459 has joined #ocaml
<nicolaus> Hi, I am trying to use the function find from module map and it raises a fatal error when then find does not find something
<nicolaus> I want to be able to return a false instead of raising the error
ocaml459 has quit [Client Quit]
nullifidian_ has quit [Read error: Connection reset by peer]
nullifidian__ has joined #ocaml
<nicolaus> ok, it's with try with
<nicolaus> lol
dborisog has joined #ocaml
serge has joined #ocaml
gravicappa has joined #ocaml
serge has quit [Ping timeout: 240 seconds]
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
pierpal has quit [Ping timeout: 272 seconds]
ygrek__ has joined #ocaml
ygrek__ has quit [Remote host closed the connection]
nullifidian__ is now known as nullifidian
ocaml459 has joined #ocaml
ocaml459 has quit [Client Quit]
FreeBirdLjj has joined #ocaml
NSA_Spy has quit [Ping timeout: 240 seconds]
narimiran has joined #ocaml
vicfred has quit [Quit: Leaving]
serge has joined #ocaml
serge has quit [Ping timeout: 246 seconds]
ggole has joined #ocaml
<vsiles> nicolaus: try / with, or probably the module exposes a find_opt which return an option type
<vsiles> (None / Some foo)
pierpal has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
nullifidian_ has joined #ocaml
nullifidian has quit [Ping timeout: 272 seconds]
pierpal has quit [Ping timeout: 268 seconds]
bartholin has quit [Quit: Leaving]
<Leonidas> lobo: you've probably hit a bug
<Leonidas> "let me just compile this socket real quick…"
<def`_> Adso_of_Jelq: nullary constructors are not heap allocated
<def`_> (and it is safe to use == on them, and should have the same behavior as =)
kleisli has quit [Ping timeout: 240 seconds]
<Leonidas> can I somehow tell in a module sig "just infer whatever the struct does"? I tried val foo : _ but that infers 'a.
<Leonidas> context: I have an existing function with a lot of arguments that I want to curry and return in my module (which has a `sig`). And to not repeat the signature (which I specifically want to keep open enough so the function can grow arguments needing changes on my side), I would like the compiler to expose that function and use whatever signature the partially applied function has
<Leonidas> let foo (x:int) (y:string) = 'c';;
<Leonidas> module M : sig val bar : _ end = struct let bar = foo 42 end;;
<Leonidas> something like that but `string -> char` is not included in `'a`
pierpal has joined #ocaml
<ggole> You can leave the signature off?
ocaml459 has joined #ocaml
ocaml459 has quit [Client Quit]
<ggole> If you want to specify some things and not others, then you might be able to do something hacky like module MImpl = struct let x = 0 let id x = x end module M : sig include module type of MImpl val id : 'a -> 'a end = MImpl
<Leonidas> ggole: I can't leave the signature out because I use it for hiding the implementation of type t (not pictured in that example)
Haudegen has joined #ocaml
<Leonidas> hmm, I'll give MImpl a try, though that looks like I would need to move my entire implementation over there.
malina has quit [Ping timeout: 265 seconds]
serge has joined #ocaml
serge has quit [Ping timeout: 240 seconds]
Serpent7776 has joined #ocaml
ocaml459 has joined #ocaml
ocaml459 has quit [Client Quit]
serge has joined #ocaml
serge has quit [Ping timeout: 260 seconds]
ocaml459 has joined #ocaml
ocaml459 has quit [Client Quit]
zolk3ri has joined #ocaml
nullifidian_ has quit [Read error: Connection reset by peer]
nullifidian has joined #ocaml
<nicolaus> Hi guys, i want to compile my files separately but the files depend on each other, what should I do?
<octachron> Do you mean that you have a dependency cycle?
<nicolaus> yeah, some files would require calling functions in another files
nicoo has quit [Ping timeout: 240 seconds]
<octachron> Assuming that you are compiling by hand, you just have to compile the "other" files first.
mbuf has joined #ocaml
nicoo has joined #ocaml
zolk3ri has quit [Remote host closed the connection]
mfp has joined #ocaml
dborisog has quit [Remote host closed the connection]
<vsiles> nicolaus: if you don't have a dependency cycle (file A calls something in file B which calls .... which calls something in file A), you'll be fine by building them in the right order (or asking dune to do it)
dborisog has joined #ocaml
<Leonidas> ggole: no, even if I split it into implementation module and exporting module I still get an error that the inferred signature in my implementation does not match my signature ('a -> 'a)
<vbmithr_> -q def`_
<vbmithr_> fail :D
<def`_> gni ? :)
def`_ is now known as def`
serge has joined #ocaml
serge has quit [Ping timeout: 272 seconds]
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
pierpal has quit [Read error: Connection reset by peer]
dhil has joined #ocaml
kleisli has joined #ocaml
pierpal has joined #ocaml
dhil has quit [Ping timeout: 248 seconds]
pierpal has quit [Ping timeout: 265 seconds]
Haudegen has quit [Quit: Bin weg.]
<lobo> Leonidas: i've just opened an issue regarding the dune/unix-socket issue :-) https://github.com/ocaml/dune/issues/3124
serge has joined #ocaml
serge has quit [Ping timeout: 260 seconds]
<Leonidas> lobo: nice! wonder what happens if you drop a device file into your source folder :D
<Leonidas> "yes, having sda at hand at all times is integral to my workflow"
<lobo> Leonidas: that was a good idea. i guess i need to update the issue. having a device file raises also the exception and after creating a fifo with mkfifo, dune build just hangs
<lobo> Leonidas: well, i guess no one should have these files directly in their build directory. in my case i was just playing around with unix sockts. that's why i've noticed the problem
<Leonidas> lobo: guess dune needs to check whether things are regular files.
<Leonidas> lobo: probably not device files but having unix sockets might be sort of useful if you're writing an application that uses these
<Leonidas> whoa, named arguments in signatures actually have an order
<lobo> Leonidas: i've just moved the socket file to another directory. it is only an issue when it is in the same dirctory
<Leonidas> still, dune shouldn't try to open them.
<Leonidas> it would be kind of hilarious if you could compile files supplied through unix sockets
dhil has joined #ocaml
<lobo> :-)
<octachron> Leonidas, only named *runtime* elements have a meaningful order in signatures
<Leonidas> octachron: I'll elaborate on a discuss post with examples (then it might be helpful to others)
<octachron> Did you hit the illegal permutation error?
<Leonidas> octachron: not even that, something much simpler I assume: https://discuss.ocaml.org/t/named-arguments-signature-order/5152
<Leonidas> octachron: thanks on your answer in the other thread! I'll need to spend some time to deliberate what your code is doing :)
nullifidian has quit [Read error: Connection reset by peer]
nullifidian has joined #ocaml
Haudegen has joined #ocaml
spew has joined #ocaml
<reynir> Writing to /dev/mem from your build system \o/
gareppa has joined #ocaml
pierpal has joined #ocaml
dogui has quit [Remote host closed the connection]
serge has joined #ocaml
ocaml459 has joined #ocaml
gareppa has quit [Quit: Leaving]
dhil has quit [Ping timeout: 245 seconds]
serge has quit [Ping timeout: 272 seconds]
dhil has joined #ocaml
ocaml459 has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
pierpal has quit [Read error: Connection reset by peer]
pierpal has joined #ocaml
pierpal has quit [Ping timeout: 260 seconds]
ocaml459 has joined #ocaml
ocaml459 has quit [Client Quit]
ocaml459 has joined #ocaml
ocaml459 has quit [Client Quit]
malina has joined #ocaml
pierpal has joined #ocaml
ocaml459 has joined #ocaml
<spew> hey companion_cube
<spew> I know you did this a while ago but I'm grumpy today
<spew> so I'm complaining about it now
<spew> thank you for breaking my browser history
<spew> and bookmarks
<spew> I hope you feel terrible
<spew> okay now I feel better
ocaml459 has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
rosterok has joined #ocaml
ygrek__ has joined #ocaml
ocaml459 has joined #ocaml
chindy_ has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
ocaml459 has quit [Client Quit]
Serpent7776 has quit [Quit: Leaving]
smazga has joined #ocaml
dogui has joined #ocaml
dckc has quit [Ping timeout: 260 seconds]
dckc has joined #ocaml
<companion_cube> ugh, I just put the symlink back
<companion_cube> and for some reason it works only without the `index.html` at the end :-(
<companion_cube> (I blame jekyll!)
serge has joined #ocaml
pierpal has quit [Ping timeout: 268 seconds]
serge has quit [Ping timeout: 268 seconds]
olle has quit [Ping timeout: 272 seconds]
olle has joined #ocaml
ocaml459 has joined #ocaml
ocaml459 has quit [Client Quit]
ggole has quit [Quit: Leaving]
<spew> thank you companion_cube you have made my day
vicfred has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
ocaml459 has joined #ocaml
ocaml459 has quit [Client Quit]
chindy has joined #ocaml
<chindy> I am using menhir for parsing and installed it via opam. However, dune build proj tells me that the library is not found and that I should install it via opam.
<chindy> Any idea how to fix this/what I am doing wrong?
<lyxia> chindy: do you get a warning if you type "opam switch"
<chindy> lyxia: no
cartwright has quit [Ping timeout: 240 seconds]
mbuf has quit [Quit: Leaving]
cartwright has joined #ocaml
serge has joined #ocaml
Serpent7776 has joined #ocaml
serge has quit [Ping timeout: 240 seconds]
dborisog has quit [Ping timeout: 240 seconds]
kakadu_ has joined #ocaml
pierpal has joined #ocaml
ocaml459 has joined #ocaml
ocaml459 has quit [Client Quit]
pierpal has quit [Read error: Connection reset by peer]
bartholin has joined #ocaml
jnavila has joined #ocaml
dhil has quit [Ping timeout: 240 seconds]
serge has joined #ocaml
narimiran has quit [Ping timeout: 265 seconds]
serge has quit [Ping timeout: 272 seconds]
gravicappa has quit [Ping timeout: 268 seconds]
pierpal has joined #ocaml
ocaml459 has joined #ocaml
TC01 has quit [Ping timeout: 240 seconds]
mahmudov has joined #ocaml
TC01 has joined #ocaml
m_oss has joined #ocaml
Jesin has quit [Quit: Leaving]
<Leonidas> does it show up in `ocamlfind list`?
<m_oss> Hey, I want to compile a static binary on linux. I write a simple CLI app that uses ncurses (OPAM curses library). It works in shared mode but when I've added (flags (-ccopt -static)) to the dune file of executable, I get a lot of unresolved symbols from ncurses - seems it does not link to ncurses lib. What should I add to dune file to get the effect of -lncurses ?
<m_oss> Tried (flags (:standard -ccopt -static -cclib -lncurses)), also (link_flags ... )
<companion_cube> not sure, maybe a +musl switch?
Jesin has joined #ocaml
<oni-on-ion> (c_library_flags (-lncurses)) ?
<m_oss> +musl ?
<m_oss> I use dune 2.0.1 and c_library_flags is an undefined field
<m_oss> unknown field
<m_oss> link_flags works, but not sure what to pass
<m_oss> If I use (link_flags (-lncurses)) i get:
<m_oss> -> /usr/bin/ocamlopt.opt: unknown option '-lncurses'.
Serpent7776 has quit [Quit: leaving]
ocaml459 has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
ocaml459 has joined #ocaml
ocaml459 has quit [Client Quit]
serge has joined #ocaml
serge has quit [Ping timeout: 246 seconds]
rosterok has quit [Quit: Connection closed for inactivity]
<chindy> Leonidas: yes
mahmudov has quit [Ping timeout: 265 seconds]
NSA_Spy has joined #ocaml
mahmudov has joined #ocaml
jnavila has quit [Remote host closed the connection]
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
olle has quit [Ping timeout: 260 seconds]
olle has joined #ocaml
kakadu_ has quit [Remote host closed the connection]
m_oss has quit [Ping timeout: 268 seconds]
pierpal has quit [Ping timeout: 272 seconds]
mahmudov has quit [Ping timeout: 260 seconds]
serge_ has joined #ocaml
serge_ has quit [Ping timeout: 265 seconds]
ocaml459 has joined #ocaml
ocaml459 has quit [Client Quit]
Haudegen has joined #ocaml
mahmudov has joined #ocaml