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
hcarty has joined #ocaml
<hcarty> 2
<mengu> 3
<dmbaturin> Succ (Succ (Succ (Succ Zero)))
<mengu> (inc (read (quote dmbaturin)))
<dmbaturin> mengu: Who do you think I am, an input port?
shinnya has quit [Ping timeout: 240 seconds]
<mengu> dmbaturin: sorry, couldn't help myself
fre has joined #ocaml
hcarty has quit [Ping timeout: 256 seconds]
orbifx has quit [Ping timeout: 256 seconds]
virtualeyes is now known as nullremains
mengu has quit [Remote host closed the connection]
ski has joined #ocaml
wtetzner has joined #ocaml
fre has quit [Ping timeout: 248 seconds]
fre has joined #ocaml
wtetzner has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 276 seconds]
wtetzner has joined #ocaml
fre has quit [Ping timeout: 255 seconds]
mfp has quit [Ping timeout: 240 seconds]
nicoo has quit [Ping timeout: 240 seconds]
nicoo has joined #ocaml
<Bluddy[m]> Question about Eliom: does anyone have an example of how to use Eliom_notif?
fre has joined #ocaml
govg has quit [Ping timeout: 264 seconds]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Client Quit]
snhmib has quit [Ping timeout: 256 seconds]
fre has quit [Ping timeout: 240 seconds]
snhmib has joined #ocaml
fre has joined #ocaml
snhmib has quit [Ping timeout: 260 seconds]
mattrepl has quit [Quit: mattrepl]
snhmib has joined #ocaml
govg has joined #ocaml
wtetzner has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
_y has quit [Ping timeout: 245 seconds]
tobiasBora has quit [Ping timeout: 258 seconds]
fre has quit [Ping timeout: 240 seconds]
wtetzner has joined #ocaml
fre has joined #ocaml
nomicflux has joined #ocaml
govg has quit [Ping timeout: 245 seconds]
virtualeyes has joined #ocaml
nullremains has quit [Ping timeout: 264 seconds]
govg has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
<Algebr> I forgot what the syntax was to make a first class module type for a record
<Algebr> looking for example
tobiasBora has joined #ocaml
_y has joined #ocaml
virtualeyes has quit [Ping timeout: 248 seconds]
ygrek_ has quit [Ping timeout: 255 seconds]
fre has quit [Ping timeout: 252 seconds]
fre has joined #ocaml
nomicflux has quit [Quit: nomicflux]
fre has quit [Ping timeout: 256 seconds]
wtetzner has quit [Remote host closed the connection]
jao has quit [Ping timeout: 264 seconds]
copy` has quit [Quit: Connection closed for inactivity]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 240 seconds]
snhmib has quit [Ping timeout: 264 seconds]
rgrinberg has quit [Remote host closed the connection]
rgrinberg has joined #ocaml
govg has quit [Ping timeout: 240 seconds]
FreeBirdLjj has joined #ocaml
snhmib has joined #ocaml
ocalm has quit [Read error: Connection reset by peer]
ocalm has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
wtetzner has joined #ocaml
MercurialAlchemi has joined #ocaml
ygrek_ has joined #ocaml
wtetzner has quit [Remote host closed the connection]
hcarty has joined #ocaml
FreeBirdLjj has joined #ocaml
hcarty has quit [Ping timeout: 255 seconds]
MercurialAlchemi has quit [Ping timeout: 258 seconds]
hcarty has joined #ocaml
hcarty has quit [Ping timeout: 240 seconds]
AlexDenisov has joined #ocaml
govg has joined #ocaml
mengu has joined #ocaml
mengu has quit [Ping timeout: 240 seconds]
fre has joined #ocaml
AlexDeni_ has joined #ocaml
AlexDenisov has quit [Ping timeout: 255 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
MercurialAlchemi has joined #ocaml
<rgrinberg> Is is possible to use Lwt.finalize in a tail recursive way? E.g. make a recursive call in the 1st or 2nd thunk?
<flux> isn't the whole concept of finalizing against tail recursion?
jnavila has joined #ocaml
<rgrinberg> Unfortunately that seems to be the case
fre has quit [Ping timeout: 240 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
jnavila has quit [Ping timeout: 252 seconds]
snhmib has quit [Ping timeout: 240 seconds]
AlexDenisov has joined #ocaml
AlexDeni_ has quit [Read error: Connection reset by peer]
snhmib has joined #ocaml
freusque has quit [Ping timeout: 264 seconds]
william-s has quit [Quit: WeeChat 1.7]
jnavila has joined #ocaml
freusque has joined #ocaml
snhmib has quit [Read error: Connection reset by peer]
govg has quit [Ping timeout: 260 seconds]
snhmib has joined #ocaml
AltGr has joined #ocaml
orbifx has joined #ocaml
freusque has quit [Ping timeout: 245 seconds]
govg has joined #ocaml
zpe has joined #ocaml
ygrek_ has quit [Ping timeout: 264 seconds]
snhmib has quit [Ping timeout: 256 seconds]
Simn has joined #ocaml
zpe has quit [Ping timeout: 240 seconds]
<companion_cube> o/ rgrinberg
<companion_cube> Algebr: how do you mean? it's either first-class module, or record?
mengu has joined #ocaml
snhmib has joined #ocaml
larhat has joined #ocaml
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
freusque has joined #ocaml
<companion_cube> !seen gasche
<ocabot_> seen gasche last: 80 days, 11 hours, 32 minutes, 2 seconds ago
<companion_cube> it's been a while :s
rgrinberg has quit [Ping timeout: 248 seconds]
<freehck> What is Core's analog for StdLib's List.flatten
<freehck> ?
mengu has quit [Remote host closed the connection]
<freehck> Ah, concat...
govg has quit [Ping timeout: 240 seconds]
govg has joined #ocaml
<Drup> Bluddy[m]: that module is pretty new, if the documentation is not enough, please report it on the bug tracker
<reynir> !seen reynir
<ocabot_> seen reynir last: 0 seconds ago
<reynir> heh
AlexDenisov has joined #ocaml
kakadu has joined #ocaml
orbifx has quit [Ping timeout: 240 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
mengu has joined #ocaml
chelfi has quit [Quit: WeeChat 1.4]
freusque has quit [Read error: Connection reset by peer]
freusque has joined #ocaml
chelfi has joined #ocaml
dhil has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
nopf has quit [Ping timeout: 272 seconds]
mfp has joined #ocaml
silver has joined #ocaml
<balod> !random
theblatt1 is now known as theblatte
steve_gh has joined #ocaml
<steve_gh> Hi. I'm trying to understand using functors. I'm getting a compile error "module is not a functor". I have a sig called Distribution_intf which is instantiated by the module Distribution, which is applied to a module with a correct signature.
<steve_gh> The compiler tells me that when I try to instantiate Distribution, the module is not a functor, and has type sig sig <contents of Distribution_intf> end end
<steve_gh> Obviously my code is not setting up the module type quite correctly, but I am at a bit of a loss..
<steve_gh> sorry - should have read sig module type Distribution_intf = sig ... end end
<companion_cube> but how do you define Distribution?
<companion_cube> module Distribution(Foo : Bar) = struct … end?
<steve_gh> @companion_cube. Yep: module Distribution( Value : Floatable) : Distribution_intf with type v = Value.t = struct ... end
<companion_cube> and you use it as: `module D = Distribution(Foo)`?
<steve_gh> @companion_cube: Yes. module DiscreteDistribution = Distribution(Discrete)
<companion_cube> and that's where the issue is? weird
<steve_gh> That is exactly where the issue is :-(
<companion_cube> can we see some more code? :) (use a paste)
<steve_gh> Right - hopefully this will come out ok: Distribution.ml
<steve_gh> module type Distribution_intf = sig type v type element = Element of float * v type t = element list val norm : t -> t val create : t -> t val lift : t -> f:(v -> v) -> t val compose : t -> t -> f:(v -> v -> v) -> t val expected : t -> v (*val random : t -> v *) end open Core.Std module Distribution( Value : Floatable) : Distribution_intf with type v = Value.t = struct type v = Value.t type eleme
<steve_gh> nah - that didn't work
<companion_cube> on a paste site would be better…
<companion_cube> good thing you didn't copy 30 lines here
<companion_cube> !paste
<steve_gh> ok - distribution.ml at http://www.heypasteit.com/clip/0C3H1
<companion_cube> and the place where you use it?
hcarty has joined #ocaml
<steve_gh> test_distribution.ml: http://www.heypasteit.com/clip/0C3H2
<companion_cube> well it does look ok, indeed
<companion_cube> I wonder if there's a module Distribution in Core, though
<steve_gh> pleas excuse my excrable ocaml code style ... I've been mainly writing in ruby for the past 15 years
<companion_cube> try module DiscreteDistribution = Distribution.Distribution(Discrete) or sth
<steve_gh> nope - unbound module Distribution
<companion_cube> I dislike `open` -_-
<companion_cube> got to go, sorry, be back in ~1.5h
stormogulen has joined #ocaml
<steve_gh> Thanks for your help - much appreciated
hcarty has quit [Ping timeout: 240 seconds]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
<mengu> steve_gh:
<mengu> when i tried building your file
<mengu> i got a different error
<mengu> File "dist.ml", line 60, characters 30-31:
<mengu> Error: Syntax error: operator expected.
<mengu> List.reduce_exn line
snowcrshd has joined #ocaml
Simn has quit [Ping timeout: 255 seconds]
Simn has joined #ocaml
<steve_gh> hi @mengu. The following command works for me: corebuild -pkg oUnit distribution.byte test_distribution.byte
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<mengu> oh
<mengu> core is not working with 4.03.0
kakadu has quit [Quit: Konversation terminated!]
kakadu has joined #ocaml
nahra has quit [Read error: Connection reset by peer]
nahra has joined #ocaml
_andre has joined #ocaml
steve_gh has quit [Ping timeout: 260 seconds]
govg has quit [Ping timeout: 255 seconds]
Flerex has joined #ocaml
<Flerex> What's the point of using self in object (self) when defining a class?
<Flerex> It seems to compile perfectly with and without (self)
<Drup> Flerex: it's for self-reference
<Flerex> Drup: Like this in other languages?
<Drup> more or less, yes
<Flerex> Okay, thanks! ^^
<Drup> (recursive method calls, puting yourself in a data structure, etc)
<Flerex> I see
<Flerex> And the super in inherit className as super is just to call the parent class, right? I could use another name instead of super
<Drup> in both cases (super and self), you can use the name you want
freusque has quit [Ping timeout: 258 seconds]
<Drup> `object (this)` works fine
<Flerex> Oh I didn't know that
<Flerex> That's a cool feature tho
<Drup> And you get to look at your horrified colegues when they look at your code and get Javascript PTSD.
<Flerex> lol
<Flerex> And what's the difference between these two statements?
<Flerex> let f11(x:subClass1) = x#method1 ();;
<Flerex> let f12 (x : #subClass1 ) = x#method1 ();;
<Flerex> I didn't even know the second did exist
<Drup> I think the manual explains this kind of stuff well: `#foo` is "any objects which inherits class foo`
<Flerex> I didn't know how to look for this in the manual, sorry.
<Flerex> Thanks tho!
wokalski has joined #ocaml
sepp2k has joined #ocaml
freusque has joined #ocaml
Denommus has joined #ocaml
wokalski has quit [Ping timeout: 260 seconds]
chbatey has joined #ocaml
steve_gh has joined #ocaml
Flerex has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
zpe has joined #ocaml
dhil has quit [Ping timeout: 264 seconds]
nomicflux has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
zpe has quit [Remote host closed the connection]
dhil has joined #ocaml
AlexDenisov has joined #ocaml
virtualeyes has joined #ocaml
nomicflux has quit [Quit: nomicflux]
Flerex has joined #ocaml
zpe has joined #ocaml
mattrepl has joined #ocaml
int-e has joined #ocaml
<steve_gh> Hi - I posted a problem earlier today that I don't have a solution to. I have a functor definition (http://www.heypasteit.com/clip/0C3H1), and a test harness (http://www.heypasteit.com/clip/0C3H2).
<steve_gh> I'm running ocamlc 4.02.3
<steve_gh> When I try and compile this code (using corebuild -pkg oUnit) I get an interesting error that I don't understand
<steve_gh> Error: This module is not a functor; it has type
<steve_gh> sig module type Distribution_intf = sig ... end end
<companion_cube> just to be sure: in distribution.ml you have this `module Distribution(…) : sig … end = struct … end`, right?
<steve_gh> Hi @companion_cube. I define module type Distribution_intf = sig ... end, then module Distribution(...) : Distribution_intf= struct ... end
<companion_cube> all that in the file called distribution.ml right?
Flerex has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<steve_gh> Yes - that is all in distribution.ml at http://www.heypasteit.com/clip/0C3H1
<steve_gh> There is also a Distribution.mli file - that just holds a copy of the Distribution_intf signature
<int-e> I'm seeing some funny behavior with Format and threads, http://sprunge.us/UdBA?ocaml (using ocaml 4.04.0)... in the end, my question is basically this, is Format supposed to be thread-safe?
<companion_cube> steve_gh: ahhhhhhhhh
<companion_cube> the distribution.mli should contain: `module type Distribution_intf = sig … end module Distribution(V : Floatable) : Distribution_intf with type t = V.t`
<companion_cube> steve_gh: your problem is that the .mli doesn't match the .ml
<companion_cube> but it also happens that ocaml trusts the .mli in the first place
<companion_cube> and when you use this .mli it believes that `Distribution` is indeed not a functor
<companion_cube> so it complains in the other module
<steve_gh> ahhh - thank you :-)
<Drup> int-e: huum, I wouldn't be surprised if Format was not thread safe
<companion_cube> I'd be very surprised if it *was* thread safe
<Drup> yeah
<Drup> given how it works ...
<companion_cube> reminds me I should publish this thead sub-library
<companion_cube> would look like: `with_lock some_lock (fun () -> Format.printf …)`
<Drup> companion_cube: I would just use (future) Lwt_fmt
<companion_cube> that's like, totally different
<companion_cube> sometimes you might want to use threads and not lwt
<companion_cube> (and I'm a bit expecting those to be popular again once/if we get effects)
<int-e> Drup: Well I was hoping not having to find out how it works.
stormogulen has quit [Remote host closed the connection]
<Drup> int-e: just put lock around the format statement
<companion_cube> ^
<int-e> Drup: if I make sure that every formatter is only used from one thread, do I have a chance of being threadsafe then?
<Drup> that should be enough, if you flush at each statement
<companion_cube> int-e: yes it's safe if you use each f ormatter only from one thread
<Drup> yeah
<int-e> okay, that should be good enough, thanks!
<Drup> actually, yes, but only if you use @.
<Drup> Otherwise, you will have two concurent indentation engine trying to format on the same channel. The output might turn messy
<int-e> oh and before I dig myself in further, is thread support in ocaml there to stay or is there still a risk of it being removed again?
<Drup> "again" ?
mengu has quit [Quit: Leaving...]
<Drup> thread support was always there, no ?
<companion_cube> it's here to stay afaik, removing it would be an incredibly breaking change
<int-e> "again" in the sense of going back to habing no (native) thread support.
<companion_cube> people would complain
<companion_cube> (I would)
<Drup> but why would it be removed ? I'm not sure I follow the logic x)
<companion_cube> maybe they could remove Event one of these days, though :]
<int-e> Drup: afaik native threads are fairly new; there has been a cooperative mechanism for a long time.
<Drup> huh, no
<int-e> what am I mixing up then, hmm.
<Drup> git log tells me "Mon Oct 30 10:21:56 1995"
<Drup> so, really not
<companion_cube> :D
<int-e> Oh, what I'm mixing up is that there are plans, perhaps a reality now (need to check), to make the global interpreter lock more finely grained.
<Drup> !multicore
<Drup> :3
<int-e> yeah, that.
<int-e> it says "if all goes well" and I don't know whether all went well.
<thizanne> we're in 4.04
<thizanne> so take a guess :}
<int-e> thizanne: "hopefully!" ;-)
<companion_cube> everything takes longer than expected, even taking this law into account
<companion_cube> "Can we get unicode string literals next ;_;" ← huh?!
<companion_cube> you can already write utf8 in string literals
infinity0_ has joined #ocaml
infinity0_ has quit [Changing host]
infinity0 has quit [Killed (orwell.freenode.net (Nickname regained by services))]
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
sh0t has joined #ocaml
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
Denommus has quit [Remote host closed the connection]
Denommus has joined #ocaml
infinity0 has joined #ocaml
yomimono has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
<int-e> So, unfortunately, as far as I can see, the multicore support has not made it into ocaml's mainline yet, it's still a separate ocaml-multicore repository. (I'd love to be wrong about this ;-) )
<yomimono> Unfortunately you are correct, as far as I (a person who doesn't work on multicore) know
<companion_cube> that's it
<companion_cube> and it will still take time, imho
Denommus has quit [Ping timeout: 255 seconds]
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
hcarty has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 240 seconds]
hcarty has quit [Ping timeout: 260 seconds]
<companion_cube> Drup: hey, I think I have a good way of making CCFormat.list better
<companion_cube> ~sep:",@ " by default
<companion_cube> you would pass any arg-free format
Muzer has quit [Ping timeout: 256 seconds]
<Drup> it's strictly less expressive than having (cst ",@ ") by default, but okay
<companion_cube> it's much more convenient
<Drup> having sep of type `unit printer` (as above) also sounds simpler
<Drup> (type and documentation wise)
<companion_cube> yes, but it's much more heavy to write
<companion_cube> ~sep:";@ " is nice and readable
<Drup> is it ? 5 chars is that bad ?
<companion_cube> yes, it is
<int-e> 738
<companion_cube> + parenthesis + some combinator
rgrinberg has joined #ocaml
<Drup> it also means you can't do something like "const pp v" as a sep
<companion_cube> in hundreds of places in my code
<Drup> (well, you don't have the equivalent of Fmt.const anyway, but still)
<companion_cube> I will
<companion_cube> but still, it's annoying to have ~sep:(Fmt.const "foo")
<companion_cube> especially because you want the "@ " in addition to that
<companion_cube> (I known I do, at least)
<companion_cube> so it would always be ~sep:(Fmt.fprintf ",@ ") or whatever
<Drup> if you chose the default well enough, will you still have the issue ?
<companion_cube> yes
<companion_cube> I overload the default to be future proof in quite a lot of places
<Drup> that makes the default kindof pointless, but okay
<companion_cube> please, stop lecturing me on how to use my own libraries -_-
<companion_cube> I understand your concern of `unit t`, it's nice and all
<Drup> Make an operator ? :D
<companion_cube> but how often do you need a dynamic separator?
<Drup> Alternative solution, expose sp = unit "@ " and various other common separators
<Drup> then it's ~sep:sp, or the one you choose
<Drup> (that's actually what is done in Fmt)
<companion_cube> ~sep:Fmt.sp
virtualeyes has quit [Ping timeout: 276 seconds]
<companion_cube> meh
<companion_cube> I'll think about it
<Drup> huh, non
<companion_cube> huh, yes
<Drup> Fmt.(list ~sep:sp .... )
<Drup> local open ftw
<Drup> :D
<companion_cube> I'm always a bit weary of this, I avoid it if I can
<companion_cube> too easy to get a shadowing
<companion_cube> if not all the printers live in Fmt.(…)
<Drup> As long as you don't have "pp" in your module, it's going to be fine most of the time
<companion_cube> I'm tired of this -_-
<companion_cube> "it's essential" pure curiosity, what do you use the additional flexibility for?
<Drup> it's not essential, I will just have to load Fmt on top of containers, ultimately, you do whatever you want :)
snowcrshd has quit [Remote host closed the connection]
<companion_cube> no but what do you need this for?
<companion_cube> what use cases do you have, really?
<companion_cube> (I could image ~sep:(return "@{<green>,@}@ ") perhaps)
<Drup> it's the way I define my printing operators generally. There is no reason to impose base values in ~sep, that's all.
<Drup> Well color is a good example: I really don't want to use the tag explitely (that's so extremly prone to breakage ...)
virtualeyes has joined #ocaml
rgrinberg has quit [Remote host closed the connection]
rgrinberg has joined #ocaml
<Drup> companion_cube: anyway, as I said, do what you want, I'll use what I prefer
ethnopes has joined #ocaml
ethnopes has quit [Quit: quit]
ethnopes has joined #ocaml
ethnopes has quit [Quit: /part]
ethnopes has joined #ocaml
MercurialAlchemi has joined #ocaml
hcarty has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
zpe has quit [Ping timeout: 240 seconds]
dhil has quit [Ping timeout: 255 seconds]
<kakadu> I kind of forgot a right trick to allow function of type ('a -> bool) to be appyed to anything......
<kakadu> let foo : 'a . ('a -> bool) -> int -> string -> bool = fun f a b -> (f a) && (f b);;
<kakadu> Does it exist>
<kakadu> ?
<thizanne> kakadu: you need to put it in an object or a record
<companion_cube> let foo: type a. (a -> bool) -> int -> string -> bool = … ?
* kakadu is trying...
zpe has joined #ocaml
<companion_cube> ah right
<companion_cube> you probably need a record indeed
ocaml709 has joined #ocaml
<thizanne> (do you actually have a function 'a -> bool that does not return a constant ?)
<kakadu> Yeah, doing some unsafe stuff :_
<ocaml709> when using tuareg with emacs is there a way to look up symbols? i.e `>>=` is sort of difficult to google and i would like to see what it means
<Drup> you can do it with merlin
<thizanne> companion_cube: we need something like !poly for this question (and I can't find the doc entry again)
copy` has joined #ocaml
<companion_cube> you can add it once you found it
Denommus has joined #ocaml
<ocaml709> thanks, i think my merlin setup is broken. i get the auto complete but not the docs
<Drup> there is a special setting for the doc
<Drup> (define-key merlin-mode-map (kbd "C-c C-f") 'merlin-document)
<Drup> (setq merlin-completion-with-doc t)
<thizanne> !poly
<ocabot_> https://caml.inria.fr/resources/doc/faq/core.en.html#typing (How to write a function with polymorphic arguments?)
<thizanne> \o/
<companion_cube> ✔
yomimono has quit [Ping timeout: 276 seconds]
yomimono has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
ethnopes has left #ocaml ["/part"]
zpe has quit [Ping timeout: 245 seconds]
th5 has joined #ocaml
ocaml709 has quit [Ping timeout: 260 seconds]
jeffmo has joined #ocaml
jnavila has quit [Quit: It was time]
zpe has joined #ocaml
<Algebr> companion_cube: I meant type f = {foo : (module F...)}
<Algebr> also merlin-document is great
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<companion_cube> Algebr: hmm, never thought of that
snowcrshd has joined #ocaml
octachron has joined #ocaml
virtualeyes has quit [Ping timeout: 240 seconds]
virtualeyes has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
jao has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
zpe has quit [Ping timeout: 258 seconds]
AltGr has left #ocaml [#ocaml]
al-damiri has joined #ocaml
william-s has joined #ocaml
dhil has joined #ocaml
slash^ has joined #ocaml
zpe has joined #ocaml
dhil has quit [Ping timeout: 260 seconds]
virtualeyes has quit [Ping timeout: 240 seconds]
virtualeyes has joined #ocaml
AlexDenisov has joined #ocaml
zpe has quit [Ping timeout: 255 seconds]
ygrek_ has joined #ocaml
slash^ has quit [Read error: Connection reset by peer]
hcarty has quit [Ping timeout: 255 seconds]
kakadu has quit [Quit: Konversation terminated!]
malc_ has joined #ocaml
srcerer has joined #ocaml
virtualeyes1 has joined #ocaml
moei has quit [Quit: Leaving...]
virtualeyes has quit [Ping timeout: 264 seconds]
sepp2k has quit [Ping timeout: 255 seconds]
virtualeyes1 has quit [Ping timeout: 248 seconds]
snowcrshd has quit [Ping timeout: 240 seconds]
kakadu has joined #ocaml
snowcrshd has joined #ocaml
hcarty has joined #ocaml
virtualeyes has joined #ocaml
ocalm_ has joined #ocaml
rgrinberg has quit [Remote host closed the connection]
yomimono has quit [Ping timeout: 240 seconds]
malc_ has quit [Quit: ERC (IRC client for Emacs 25.0.50.2)]
hcarty1 has joined #ocaml
hcarty has quit [Ping timeout: 256 seconds]
yomimono has joined #ocaml
orbifx has joined #ocaml
fre has joined #ocaml
zpe has joined #ocaml
zpe has quit [Ping timeout: 264 seconds]
snowcrshd has quit [Remote host closed the connection]
breitenj has joined #ocaml
_andre has quit [Quit: leaving]
infinity0 has quit [Remote host closed the connection]
steve_gh has quit [Ping timeout: 260 seconds]
infinity0 has joined #ocaml
jnavila has joined #ocaml
lucasem has joined #ocaml
<lucasem> Is there a way to explicitly set the types/objects included when using a module (so as not to clutter my scope)? Something like haskell's `import Mod (x,y)`?
<copy`> lucasem: No, but we often write `let (x, y) = Mod.(x, y)`
<lucasem> copy`: thanks! What about bringing in a type and its constructors?
vicfred has joined #ocaml
<copy`> I don't think there is a nice way to do it, you can repeat the type definition
<copy`> Or give the module a shorter name
Denommus has quit [Ping timeout: 255 seconds]
<companion_cube> there's sth like ppx.import, I think
MercurialAlchemi has quit [Ping timeout: 258 seconds]
<lucasem> hmmm.. if I repeat the type definition, how would compatibility work with a nearly-identical type in a module (nearly-identical meaning just different names)? Would I have to change the way I made calls using my new type with the module's expected use of its old type?
<companion_cube> you can write `type t = Foo | Bar = Foo.t`
<lucasem> companion_cube: I don't understand what's actually happening in that statement — could you explain?
breitenj has quit [Ping timeout: 240 seconds]
<companion_cube> lucasem: you redefine the type t, but keeping it equal to Foo.t
<companion_cube> type 'a my_option = None | Some of 'a = 'a option`
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
breitenj has joined #ocaml
yomimono has left #ocaml ["Leaving"]
yomimono has joined #ocaml
<lucasem> companion_cube: I can't seem to avoid some syntax error... Is there another way to do it? Perhaps more explicitly?
<companion_cube> might be `type 'a my_option = 'a option = None | Some of 'a`
<lucasem> companion_cube: that works! This can rename the type, is there any way to rename the constructors?
<companion_cube> sadly not
ocalm_ has quit [Ping timeout: 248 seconds]
smondet has joined #ocaml
th5 has quit []
infinity0 has quit [Remote host closed the connection]
obadz has quit [Ping timeout: 256 seconds]
infinity0 has joined #ocaml
infinity0 has quit [Changing host]
infinity0 has joined #ocaml
jrslepak has quit [Quit: leaving]
handlex has joined #ocaml
jrslepak has joined #ocaml
jrslepak has quit [Client Quit]
Flerex has joined #ocaml
obadz has joined #ocaml
yomimono has quit [Quit: Leaving]
jrslepak has joined #ocaml
handlex has quit [Quit: handlex]
jnavila has quit [Remote host closed the connection]
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
<cheater> but you could add a function
<cheater> let blah a = None a
<cheater> or rather
<cheater> let blah = None
<cheater> let blub a = Some a
<cheater> if you really wanted :)
<cheater> lucasem: ^
<cheater> i mean renaming types and constructors is kind of pointless to me but it's fine
Ferwin has joined #ocaml
Ferwin has quit [Client Quit]
zv has joined #ocaml
<lucasem> cheater: ah yes that makes sense. I'm doing it because I need to use a library that's poorly written, and I don't want to re-write it. I'm making an interface that basically prettifies and selectively exposes modules.
virtualeyes1 has joined #ocaml
Ferwin has joined #ocaml
<Drup> lucasem: what's the library ?
Flerex has quit [Read error: Connection reset by peer]
Ferwin has quit [Client Quit]
<lucasem> Drup: it's nothing big or popular. It's from a research project several years ago that I'm expanding upon. Scientists aren't all engineers!
handlex has joined #ocaml
<Drup> fork and fix, then
<Drup> (what's the name ? :D)
Flerex has joined #ocaml
virtualeyes has quit [Ping timeout: 240 seconds]
<lucasem> (I don't want to shame the researcher! :P)
kakadu has quit [Remote host closed the connection]
<Drup> I have seen enough terrible code by researcher, don't worry
<lucasem> I'll make sure I get my changes pushed once I finish my work, though :)
<Drup> and you're getting me curious x)
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Flerex has quit [Client Quit]
AlexDenisov has joined #ocaml
AlexDenisov has quit [Client Quit]
AlexDenisov has joined #ocaml
AlexDenisov has quit [Client Quit]
AlexDenisov has joined #ocaml
<octachron> If only I had only "seen" terrible code by written by researcher (and not used nor … written some)
AlexDenisov has quit [Client Quit]
<companion_cube> :D
<Drup> octachron: same x)
<companion_cube> let's all admit we wrote terrible code, and hope we don't any more
handlex has quit [Quit: handlex]
<jerith> I'm not going to stop writing terrible code.
<Drup> a few month ago, I stumbled upon the svn(!!) repository of my license class projects
<Drup> it was terrifying
<companion_cube> :D
<companion_cube> fun fun
<Drup> I wrote all of it
<thizanne> SVN is nice already
<thizanne> I used a POP3 repository
<jerith> Or rather, I'm not going to stop writing code that I will later look at and find terrible.
<companion_cube> I found a caml light file I wrote 10 years ago
<jerith> Because if I do, it means I've stopped improving.
<companion_cube> a symbolic derivation function
<companion_cube> in french :D
int-e has left #ocaml ["too much information"]
<Drup> companion_cube: my first Caml Light program, also in french, was a mandelbrot/julia plotter with graphics
<Drup> (to be fair, the field is prone to frenchiness, so that's fair)
<jerith> I pride myself on never having written any code in French.
<jerith> (I'd have to learn French before I could do that.)
<companion_cube> Drup: I'm going to make a pre-release for 1.0 :-)
<octachron> jerith, I would'nt be so sure, avoiding valid french words in english takes some dedications
<Drup> :D
<octachron> (and avoiding words with french origin is a long long war)
wokalski has joined #ocaml
<wokalski> hey, I would like to supply a file different than .c to C compiler when using ocamlopt. I have seen it discussed here https://caml.inria.fr/mantis/print_bug_page.php?bug_id=5823. It mentions however a specific file and therefore rises issues that the last comment mentions about.
<wokalski> I imagine there could be a simple flag to allow pass anything to the compiler. Am I missing something?
rgrinberg has joined #ocaml
<Algebr> wokalski: give the .c file, then for your ccopt tell -x c++ or -x ObjC++
<wokalski> Algebr: Hm, interesting. What you are saying is that I should rename .cpp to .c, right? afaik it will work with c++, but won't with .m (objective-c).
<Algebr> it will be taking .cpp cause underlying c compiler will let you but its legacy
<Algebr> easiest thing for objc is to do -ccopt -ObjC++
larhat has quit [Quit: Leaving.]
Flerex has joined #ocaml
sillyotter has joined #ocaml
<wokalski> I'm getting: ocamlopt: don't know what to do with file.m.
octachron has quit [Quit: Leaving]
sillyotter has quit [Client Quit]
wtetzner has joined #ocaml
<Algebr> I said don't name it .m
Flerex has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<Algebr> give it as .c, hence you're telling the underlying C compiler how to interpret the c source code sa
<wokalski> ah, clever. Thanks!
orbifx has quit [Ping timeout: 240 seconds]
average has quit [Remote host closed the connection]
sz0 has joined #ocaml
wokalski has quit [Ping timeout: 260 seconds]
virtualeyes1 has quit [Ping timeout: 248 seconds]
moei has joined #ocaml