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
hlisp_ has quit [Remote host closed the connection]
hlisp has joined #ocaml
hlisp has quit [Ping timeout: 240 seconds]
olle_ has quit [Ping timeout: 264 seconds]
hlisp has joined #ocaml
rosterok has quit [Quit: Connection closed for inactivity]
Anarchos has quit [Ping timeout: 256 seconds]
ygrek has joined #ocaml
mfp has quit [Ping timeout: 256 seconds]
dborisog has joined #ocaml
ansiwen_ has quit [Quit: ZNC 1.7.1 - https://znc.in]
ansiwen has joined #ocaml
pigeonv has quit [Ping timeout: 260 seconds]
ygrek has quit [Ping timeout: 272 seconds]
hlisp has quit [Remote host closed the connection]
hlisp has joined #ocaml
hlisp has quit [Remote host closed the connection]
hlisp has joined #ocaml
hlisp has quit [Remote host closed the connection]
hlisp has joined #ocaml
_whitelogger has joined #ocaml
taharqa has quit [Ping timeout: 256 seconds]
hlisp has quit [Remote host closed the connection]
taharqa has joined #ocaml
hlisp has joined #ocaml
narimiran has joined #ocaml
hlisp has quit [Ping timeout: 246 seconds]
hlisp has joined #ocaml
muskan has quit [Ping timeout: 245 seconds]
cranix has quit [Ping timeout: 260 seconds]
cranix has joined #ocaml
hlisp has quit [Ping timeout: 260 seconds]
mbuf has joined #ocaml
hlisp has joined #ocaml
hlisp has quit [Ping timeout: 246 seconds]
hlisp has joined #ocaml
kleisli has quit [Remote host closed the connection]
hlisp has quit [Ping timeout: 256 seconds]
kleisli has joined #ocaml
jao has quit [Ping timeout: 246 seconds]
hlisp has joined #ocaml
hlisp has quit [Ping timeout: 256 seconds]
hlisp has joined #ocaml
hlisp has quit [Ping timeout: 246 seconds]
hlisp has joined #ocaml
muskan has joined #ocaml
muskan has left #ocaml [#ocaml]
sagax has joined #ocaml
amiloradovsky has joined #ocaml
Haudegen has joined #ocaml
<mbuf> In the dune file at http://dev.realworldocaml.org/parsing-with-ocamllex-and-menhir.html#scrollNav-3-2, what command do I pass to dune to build the targets short_parser.mli and short_parser.ml?
<def> something like (menhir (modules short_parser))
<mbuf> def, the upstream code examples only has the (rule ...) declaration
<def> because this was a common rule it is now builtin in dune
<mbuf> def, I see
hlisp has quit [Remote host closed the connection]
hlisp has joined #ocaml
clockish has quit [Quit: bye]
clockish has joined #ocaml
mfp has joined #ocaml
olle__ has joined #ocaml
nullcone has quit [Quit: Connection closed for inactivity]
pigeonv has joined #ocaml
ggole has joined #ocaml
vicfred has quit [Remote host closed the connection]
vicfred has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
raver has quit [Remote host closed the connection]
terrorjack___ has quit []
terrorjack has joined #ocaml
raver has joined #ocaml
jao has joined #ocaml
hlisp has quit [Remote host closed the connection]
Haudegen has joined #ocaml
ferd has joined #ocaml
tane has joined #ocaml
ygrek has joined #ocaml
Anarchos has joined #ocaml
amiloradovsky1 has joined #ocaml
amiloradovsky has quit [Ping timeout: 260 seconds]
amiloradovsky1 is now known as amiloradovsky
jao has quit [Ping timeout: 246 seconds]
hlisp has joined #ocaml
amiloradovsky has quit [Remote host closed the connection]
amiloradovsky has joined #ocaml
olle__ has quit [Ping timeout: 256 seconds]
amiloradovsky has quit [Ping timeout: 260 seconds]
amiloradovsky has joined #ocaml
hlisp_ has joined #ocaml
hlisp has quit [Ping timeout: 272 seconds]
hlisp_ has quit [Remote host closed the connection]
Anarchos has quit [Quit: Vision[0.10.3]: i've been blurred!]
Haudegen has quit [Quit: Bin weg.]
Anarchos has joined #ocaml
ggole has quit [Quit: Leaving]
nullcone has joined #ocaml
<companion_cube> how is -custom supposed to work exactly? where does ocamlc look for the .a or .so to pack in the binary?
<companion_cube> cause LD_LIBRARY_PATH doesn't seem to be enough
<companion_cube> (unless dune removes it, but I hope not)
jao has joined #ocaml
olle_ has joined #ocaml
theglass has quit [Quit: ZNC - http://znc.in]
theglass has joined #ocaml
theglass has quit [Changing host]
theglass has joined #ocaml
Haudegen has joined #ocaml
mbuf has quit [Quit: Leaving]
<def> it calls the C linker
<companion_cube> but it doesn't pass the env variables I think
<def> I don't think the linker looks in LD_LIBRARY_PATH
<def> by default it look for runtime library in the standard_library path (look at the output of ocamlc -config)
Anarchos has quit [Quit: Vision[0.10.3]: i've been blurred!]
<def> -verbose also help to see how the linker is invoked
gareppa has joined #ocaml
gareppa has quit [Remote host closed the connection]
muskan has joined #ocaml
amiloradovsky has quit [Ping timeout: 260 seconds]
theglass has quit [Quit: ZNC - http://znc.in]
theglass has joined #ocaml
theglass has quit [Changing host]
theglass has joined #ocaml
jbrown has quit [Ping timeout: 272 seconds]
<companion_cube> yeah so we're missing things in ocamlfind paths :)
<companion_cube> the stdlib path doesn't get very far
jbrown has joined #ocaml
pigeonv has quit [Ping timeout: 244 seconds]
pigeonv has joined #ocaml
<olle_> what's the type of +?
<olle_> as in addition
<companion_cube> int -> int -> int
<olle_> hm hm hm
<olle_> and `=` is 'a -> 'a -> bool ?
<companion_cube> yeah
<olle_> \o/
<companion_cube> it's compiler magic though
<olle_> aha?
<olle_> no fancy SystemF PhD paper?
<olle_> wait, no type-classes in OCaml
<pigeonv> values are dynamically inspected
muskan has quit [Remote host closed the connection]
muskan has joined #ocaml
<olle_> ?
<olle_> Also: Some 3 > Some 2 --> true
<olle_> neat
<pigeonv> when you test a=b, a and b must have the same type
<olle_> Sure
<pigeonv> values that fit into a single machine word are easy to compare
<olle_> what companion_cube meant is, compare to +. and -. etc
<olle_> Compiler magic --> use same `=` for all types
<olle_> Normally not possible in OCaml
<pigeonv> it's a nasty hack
<olle_> "nasty" is too strong :)
<pigeonv> blocks are dynamically inspected
<pigeonv> it works
<pigeonv> as long as you don't compare closures
<pigeonv> then, chaos ensues
<pigeonv> (actually you just get an exception)
dborisog has quit [Ping timeout: 256 seconds]
<pigeonv> anyway, it's not decidable whether two arbitrary functions are equal
<reynir> what's the name for ( = ) : 'a -> 'b -> bool
<reynir> (not in OCaml)
<companion_cube> heterogeneous equality?
<reynir> there's a funny nickname
<Armael> JMeq in dependent type theory
<olle_> OK, so my function `run_operation op lval rval` does not work to run twice with different arguments.
<olle_> I assume 'a evaluates to something and cannot be changed later during compilation?
<pigeonv> it happens with '_a
<pigeonv> (weak polymorphic types)
<olle_> what's the solution?
<olle_> let me google...
<pigeonv> sometimes they come from partially applied functions
<pigeonv> for example, List.map (fun x -> x) has type '_a list -> '_a list
<olle_> Explicitly polymorphic annotations?
<reynir> John Major equality
<Armael> reynir: yeah
<pigeonv> nice name
<olle_> run_if_operation (op : 'a -> 'a -> bool) (content : 'a) (value : 'a) : string =
<olle_> tip?
<reynir> how does it not work?
<olle_> reynir: running it twice with different 'a
<olle_> I want `>` for int, and `=` for string and int
<pigeonv> 'a in your signature isn't polymorphic
<olle_> ok, so where to put 'a. ?
<olle_> syntax is not clear for me
<olle_> But they write functions a little bit differently
<olle_> ok, let me test
<pigeonv> let f : 'a. op:('a -> 'a -> bool) -> ... ?
<olle_> pigeonv: yes, works now!
<olle_> had to rewrite function signature like in the examples
<pigeonv> it's a bit unpractical, but yeah
<pigeonv> and 'a doesn't always mean the same thing
<pigeonv> this is valid: let f (x : 'a) = 2 * x
<pigeonv> 'a unifies with int
<olle_> sure
<pigeonv> if you want to compare things with different types,
<pigeonv> maybe you could just tag them
<olle_> no, this is less code
<octachron> If you want to use a function argument with different argument you need to put it in a polymorphic record field: "type comp = { f: 'a. 'a -> 'a -> bool }"
<pigeonv> oh, right, I thought about using run_if_operation multiple times
<pigeonv> but that's not the point... sorry
<olle_> 'a. worked fine
Jesin has quit [Quit: Leaving]
Jesin has joined #ocaml
narimiran has quit [Ping timeout: 272 seconds]
Jesin has quit [Quit: Leaving]
Jesin has joined #ocaml
<olle_> - #9232: allow any class type paths in #-types,
<olle_> What's #-type?
<olle_> val f: #F(X).t -> unit
<olle_> Functor stuff?
<olle_> wait, someone already asked on reddit
nullcone has quit [Quit: Connection closed for inactivity]
<Drup> object/polymorphic-variant stuff :p
<companion_cube> the day I see `#F(X).t ` in a codebase is the day I quit :D
<Drup> oh come on
<Drup> we've both done worse.
<Drup> well, maybe mostly me
<companion_cube> :DDDDD
<companion_cube> maybe mostly you indeed
<Drup> don't sell yourself short, I believe in you :D
<companion_cube> I use some GADTs, but few functors, remember? :p
<companion_cube> (well at least not higher order functors, as you were saying earlier)
<octachron> And honestly the "feature" is mostly here because it makes the syntax more logical and easier to describe in the manual.
<olle_> I'd like to try typestate with phantom types wrapped in monad
<olle_> Gasche described that many years ago in a stackoverflow thread.
<olle_> But it's late, sleep
<olle_> \o
<companion_cube> o/
tane has quit [Quit: Leaving]
hlisp has joined #ocaml
jao has quit [Remote host closed the connection]
nullcone has joined #ocaml
Haudegen has quit [Quit: No Ping reply in 180 seconds.]
Haudegen has joined #ocaml
jao has joined #ocaml
muskan has quit [Ping timeout: 245 seconds]
Haudegen has quit [Ping timeout: 264 seconds]