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
assemblyman has joined #ocaml
NSA_Spy has quit [Quit: Leaving]
zmt00 has joined #ocaml
zmt00 has quit [Read error: Connection reset by peer]
zmt00 has joined #ocaml
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
eskatrem has quit [Ping timeout: 268 seconds]
_whitelogger has joined #ocaml
crowley95 has joined #ocaml
Algebr has joined #ocaml
silver has quit [Read error: Connection reset by peer]
nullifidian__ has joined #ocaml
nullifidian_ has quit [Ping timeout: 250 seconds]
AtumT has quit [Quit: AtumT]
assemblyman has quit [Quit: ™]
mfp has quit [Ping timeout: 245 seconds]
kvda has joined #ocaml
ygrek has joined #ocaml
jao has quit [Ping timeout: 245 seconds]
tormen_ has joined #ocaml
tormen has quit [Ping timeout: 246 seconds]
Jeanne-Kamikaze has joined #ocaml
bartholin has quit [Ping timeout: 255 seconds]
bartholin has joined #ocaml
zmt00 has quit [Read error: Connection reset by peer]
zmt00 has joined #ocaml
AnAverageHuman has quit [Ping timeout: 256 seconds]
ygrek has quit [Ping timeout: 246 seconds]
caltelt_ has joined #ocaml
Jeanne-Kamikaze has quit [Quit: Leaving]
gravicappa has joined #ocaml
Keodedad has joined #ocaml
Keodedad has quit [Client Quit]
crowley95 has quit [Ping timeout: 255 seconds]
crowley95 has joined #ocaml
tizoc has quit [Quit: Coyote finally caught me]
tizoc has joined #ocaml
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
al-damiri has quit [Quit: Connection closed for inactivity]
crowley95 has quit [Ping timeout: 255 seconds]
crowley95 has joined #ocaml
caltelt_ has quit [Ping timeout: 250 seconds]
Keodedad has joined #ocaml
Birdface has joined #ocaml
keep_learning has quit [Remote host closed the connection]
Algebr has quit [Ping timeout: 245 seconds]
Algebr has joined #ocaml
Algebr has quit [Ping timeout: 246 seconds]
keep_learning has joined #ocaml
Keodedad has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mildtaste has joined #ocaml
Keodedad has joined #ocaml
stux|RC-only has quit [Quit: Aloha!]
Keodedad has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kakadu has quit [Ping timeout: 246 seconds]
_whitelogger has joined #ocaml
kvda has joined #ocaml
CcxWrk has quit [Killed (verne.freenode.net (Nickname regained by services))]
CcxWrk has joined #ocaml
Keodedad has joined #ocaml
nullifidian_ has joined #ocaml
nullifidian__ has quit [Read error: Connection reset by peer]
kakadu has joined #ocaml
mfp has joined #ocaml
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Keodedad has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<xvilka> Hi!
<xvilka> Base64.decode returns (string, [`Msg of string]) Stdlib.result. Thus I can't use Ok/Error match or Lwt_result.bind on this type
<xvilka> How to bypass this? Convert it somehow
<xvilka> sorry, stupid question, but can't comprehend this
<xvilka> Because currently OCaml gives me error like:
<xvilka> (Query_types.query_answer option, Error.t) Lwt_result.t =
<xvilka> but an expression was expected of type (Query_types.query_answer option, [ `Msg of string ]) Lwt_result.t
<Armael> it seems you're not doing the right thing in the Error case, it should be "| Error (`Msg msg) -> ..." and then msg is a string
<xvilka> Armael: I am using "Lwt.return @@ Base64.decode x >>=? fun x' -> (* some function that accepts standard Lwt.Result.t type *)
<xvilka> and ">>=?" is Lwt_result.bind
<xvilka> so I have to write my binding function to convert the Error (`Msg msg) into Error (msg), right?
<AxiomaticEspress> Is there any way to reload modules inside utop? Or even have like watch files options that does it for me when files change. I'm using dune. Thanks :)
<AxiomaticEspress> I see is possible to do `dune utop --watch` but it doesn't seem to work.
<xvilka> sorry
<xvilka> wrong console window for ArrowUp + Enter
ggole has joined #ocaml
silver has joined #ocaml
jao has joined #ocaml
ygrek has joined #ocaml
johnelse has joined #ocaml
johnelse_ has quit [Ping timeout: 244 seconds]
Haudegen has joined #ocaml
Keodedad has joined #ocaml
freyr69 has joined #ocaml
cmk_zzz has quit [Ping timeout: 244 seconds]
nicoo has quit [Remote host closed the connection]
nicoo has joined #ocaml
cmk_zzz has joined #ocaml
Keodedad has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jaar has joined #ocaml
spew has joined #ocaml
<freyr69> I want to store an OCaml closure within a C-code
<freyr69> How to do it safely
<freyr69> Should I keep an OCaml value with a pointer to closure?
<freyr69> and return in from a function, registering the callback
<freyr69> Or Callback.register is preferred?
AtumT has joined #ocaml
zolk3ri has joined #ocaml
AnAverageHuman has joined #ocaml
jao has quit [Ping timeout: 245 seconds]
ygrek has quit [Ping timeout: 250 seconds]
assemblyman has joined #ocaml
Keodedad has joined #ocaml
Keodedad has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
assemblyman has quit [Read error: Connection reset by peer]
assemblyman has joined #ocaml
AnAverageHuman has quit [Ping timeout: 256 seconds]
Keodedad has joined #ocaml
AnAverageHuman has joined #ocaml
Keodedad has quit [Ping timeout: 268 seconds]
freyr69 has quit [Remote host closed the connection]
Haudegen has quit [Read error: Connection reset by peer]
<theblatte> so no one is going to post https://github.com/ocaml/ocaml/pull/8562 here?
<companion_cube> 👀 Drup
<theblatte> I just went to the pull requests tab to see if there were more :D
<theblatte> Drup: does it work for filenames too?
al-damiri has joined #ocaml
gareppa has joined #ocaml
<Drup> theblatte: it does not change filenames, but it will work for module names, including the one that represent compilation units
gareppa has quit [Remote host closed the connection]
<theblatte> noice
jao has joined #ocaml
<vsiles> it's difficult to choose which feature is the best today
Haudegen has joined #ocaml
AnAverageHuman has quit [Ping timeout: 256 seconds]
jaar has quit [Ping timeout: 255 seconds]
Keodedad has joined #ocaml
zolk3ri has quit [Remote host closed the connection]
Keodedad has quit [Quit: Mutter: www.mutterirc.com]
Keodedad has joined #ocaml
Jesin has quit [Quit: Leaving]
AnAverageHuman has joined #ocaml
Keodedad has quit [Remote host closed the connection]
Keodedad has joined #ocaml
Jesin has joined #ocaml
Keodedad has quit [Remote host closed the connection]
keep_learning_M has quit [Ping timeout: 250 seconds]
assemblyman has quit [Quit: ™]
sapristi has joined #ocaml
Birdface has quit [Remote host closed the connection]
<sapristi> hello
Serpent7776 has joined #ocaml
Birdface has joined #ocaml
<sapristi> does someone know how I could check that a library is available at runtime ?
AnAverageHuman has quit [Ping timeout: 256 seconds]
Keodedad has joined #ocaml
kakadu has quit [Quit: Konversation terminated!]
<Fardale> You can not, why would you like to do something like that ?
<Fardale> Or are you using dynlink ?
Keodedad has quit [Quit: Mutter: www.mutterirc.com]
gravicappa has quit [Ping timeout: 250 seconds]
jnavila has joined #ocaml
<cemerick> companion_cube: I suppose that makes sense. I (still) don't see that one form is more essential than the other, thus the question.
<companion_cube> `functor` is more canonical, I guess, the same way `let f = fun x -> fun y -> …` is closer to the actual theoretical calculus (and AST)
<sapristi> Fardale, I would like to enable some features if a certain module (ppx_deriving yojson) is preset
<sapristi> *present
stux|RC-only has joined #ocaml
kakadu has joined #ocaml
sonologico has joined #ocaml
Haudegen has quit [Remote host closed the connection]
<Fardale> sapristi: I think you will need to know that at compile time
dh_work has joined #ocaml
<dh_work> if I have a module type with two types t and u, is there any way to generate a module type from it that's restricted to the case where t = u?
<dh_work> coherence constraints don't seem to allow it
<companion_cube> maybe if you have another type w and say `with type t = w and type u = w`
<dh_work> there are two implementations of the module type (let's call it M and the implementations M1 and M2)
<dh_work> in M1, u = t; in M2, u = t thingy (for some "thingy" hopefully irrelevant to the question)
Birdface has quit [Ping timeout: 255 seconds]
<dh_work> there's an .mli file that declares "module M1 : M" and "module M2 : M"
<dh_work> but some stuff that uses M1 needs to know u = t
kakadu has quit [Remote host closed the connection]
<dh_work> and unfortunately t is not the same in M1 and M2, nor can it easily be moved out
Serpent7776 has quit [Quit: leaving]
kakadu has joined #ocaml
<dh_work> so we'd like to be able to say "module M1 : M with type u = t" but that doesn't work, nor does any simple permutatino of it
<companion_cube> it should definitely work
<companion_cube> even if you do `type u` and then `module M1 : M with type t=u`
<dh_work> "with type u = t" doesn't work because t is out of scope; you can't qualify with M1 because (I guess) it doesn't exist yet at that piont, and you can't qualify with M because it's a module type and not a module
Haudegen has joined #ocaml
<dh_work> hmm
<dh_work> you just gave me an idea though
<companion_cube> ah sorry, then I mean `type t\n type u\n module M1 : M with type t=t and type u=u`
<companion_cube> or even: `module M1 : M module M2 : M with type t = M1.t and type u = M1.u`
<dh_work> I just tried "type w module M1 : M with type t = w and type u = w" and this claims that the kinds differ (they don't)
<companion_cube> can you paste some code online?
<companion_cube> for me this should really work
<companion_cube> (in a mli)
<dh_work> my officemate just posted to stack overflow
<companion_cube> `type w module Value1 : Value with type word=w and type t_word=w`
<companion_cube> (also you need to define `w` in the ml)
<octachron> another solution would be `module type M2 = sig type t include M with type t:=t and type u = t end`
<dh_work> that's what we just tried, and it claims the kinds of w and word don't match
<octachron> or more acrobatic "module rec M1: M with type u = M1.t"
<companion_cube> what's the concrete type you use?
<dh_work> but it works for a simple example
<dh_work> grr.
<companion_cube> are you sure you don't use `list` for w, or something like that?
<companion_cube> something polymorphic?
<dh_work> we specifically said just "type w"
<dh_work> without binding it to anything
<companion_cube> in the mli, but in the ml?
<dh_work> in M, the type of t is a sum and u is unbound
<dh_work> it doesn't get as far as trying to compile the .ml file
<companion_cube> ôO
<octachron> if t is exposed as variant in the module type `M`, you need to keep it a variant in the new module type
<dh_work> ah I get the same behavior with a slighty different simple example
<octachron> module type M' = sig type t = Exactly_the_same_definition_as_t include M with type t:= t type u = t end
crowley95 has quit [Ping timeout: 255 seconds]
ggole has quit [Quit: Leaving]
<dh_work> yeah
<dh_work> ah but this doesn't work in the actual code, because t is a sum of other abstract types
crowley95 has joined #ocaml
<companion_cube> just type definitions and my trick work
<dh_work> it does work and it causes other things to explode :-(
<companion_cube> you can't redefine a type
<companion_cube> here you're trying to redefine `t` which is already defined in the signature
<companion_cube> it's not an abstract type
<dh_work> that works
<companion_cube> it gives me an error :p
<companion_cube> (the kind error on w)
jnavila has quit [Remote host closed the connection]
<dh_work> yeah, the first part works though (the one with v)
<dh_work> it just causes our thing to explode later on because b is too abstract
<dh_work> which is a different problem :-/
<companion_cube> I f eel like you're probably over engineering this
<dh_work> yes
<dh_work> well
<dh_work> it's trying to do both concrete and symbolic execution in the same interpreter
<dh_work> I didn't design it, I'm just the ocaml resource :-/
<companion_cube> with two instances, right?
<dh_work> yeah
<companion_cube> I mean, instantiate a functor twice
<companion_cube> not sure why you need abstract types
<dh_work> M1 is the concrete execution, M2 inserts symbolic foo (that's why t <> u)
<companion_cube> can't you instantiate all types to concrete types?
<dh_work> not at this point
<dh_work> anyway it's 8500 lines and not readily rearchitected on the fly :-/
<dh_work> that is, however, our problem...
<companion_cube> 8500 lines in the functor? :/
<dh_work> 8500 total
<dh_work> this module is not even the functor, it's the argument to the main functor
<companion_cube> -_-
<dh_work> oh well
<dh_work> thanks for your help, anyway
<companion_cube> sure
wagle has quit [Remote host closed the connection]
wagle has joined #ocaml
stux|RC-only has quit [Ping timeout: 250 seconds]
dh_work has left #ocaml [#ocaml]
ygrek has joined #ocaml
bartholin has quit [Remote host closed the connection]
kvda has joined #ocaml
dmiles has quit [Ping timeout: 245 seconds]
dmiles has joined #ocaml
Haudegen has quit [Remote host closed the connection]
sapristi has quit [Remote host closed the connection]
mfp has quit [Ping timeout: 246 seconds]
stux|RC-only has joined #ocaml
mfp has joined #ocaml
amiloradovsky has joined #ocaml
AnAverageHuman has joined #ocaml
ygrek has quit [Ping timeout: 246 seconds]
Jesin has quit [Quit: Leaving]
spew has quit [Quit: Connection closed for inactivity]
Jesin has joined #ocaml
cantstanya has quit [Ping timeout: 256 seconds]
cantstanya has joined #ocaml