adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.08 release notes: https://caml.inria.fr/pub/distrib/ocaml-4.08/notes/Changes | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
bitwinery has quit [Remote host closed the connection]
bitwinery has joined #ocaml
bitwinery has quit [Remote host closed the connection]
bitwinery has joined #ocaml
hannes has quit [Remote host closed the connection]
malina has quit [Remote host closed the connection]
malina has joined #ocaml
nahra` has quit [Quit: ERC (IRC client for Emacs 26.2)]
zolk3ri has quit [Remote host closed the connection]
nahra has joined #ocaml
mfp has quit [Ping timeout: 258 seconds]
Jeanne-Kamikaze has joined #ocaml
vesper11 has quit [Ping timeout: 250 seconds]
vesper11 has joined #ocaml
tormen_ has joined #ocaml
analogue has joined #ocaml
tormen has quit [Ping timeout: 258 seconds]
analogue has quit [Quit: Leaving]
_whitelogger has joined #ocaml
malina has quit [Remote host closed the connection]
Jeanne-Kamikaze has quit [Quit: Leaving]
_whitelogger has joined #ocaml
malina has joined #ocaml
malina has quit [Remote host closed the connection]
_whitelogger has joined #ocaml
gravicappa has joined #ocaml
_whitelogger has joined #ocaml
jao- has quit [Ping timeout: 245 seconds]
vicfred has joined #ocaml
bitwinery has quit [Quit: Leaving]
bitwinery has joined #ocaml
ggole has joined #ocaml
olle has joined #ocaml
bitwinery has quit [Quit: Leaving]
pyx has joined #ocaml
pyx has quit [Client Quit]
kakadu has joined #ocaml
olle has quit [Ping timeout: 246 seconds]
olle has joined #ocaml
hannes has joined #ocaml
Haudegen has joined #ocaml
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
olle has quit [Ping timeout: 244 seconds]
TheLemonMan has joined #ocaml
kvda has joined #ocaml
mfp has joined #ocaml
<kakadu> I have a virtual class type `c`. Can I easily (without copy/paste) write a value with signature `.... -> something` where `something` is my class where all virtual methods' declaration are defined as concrete methods
<kakadu> ?
<kakadu> Right now I see the only way is to inherit virtual class in signature and copy/paste methods' definitions without `virtual` keyword
<def`> -> is the arrow of (term) functions? Then just writing c is good
<kakadu> I meant `constructor_arguments -> object inherit class_with_virtual_methods end`
<def`> Ah, a class function then
<def`> No I don't know how to do that :/
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
zolk3ri has joined #ocaml
ravenousmoose has joined #ocaml
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kakadu has quit [Quit: Konversation terminated!]
kakadu has joined #ocaml
kvda has joined #ocaml
kvda has quit [Client Quit]
kvda has joined #ocaml
kakadu has quit [Ping timeout: 245 seconds]
AtumT has joined #ocaml
gareppa has joined #ocaml
kakadu has joined #ocaml
kakadu has quit [Ping timeout: 245 seconds]
orbifx has joined #ocaml
ravenousmoose has quit [Remote host closed the connection]
ravenousmoose has joined #ocaml
gareppa has quit [Quit: Leaving]
ravenousmoose has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jao has joined #ocaml
orbifx has quit [Ping timeout: 268 seconds]
IndoRuby has joined #ocaml
zolk3ri has quit [Remote host closed the connection]
zolk3ri has joined #ocaml
IndoRuby has quit [Quit: Leaving]
jnavila has joined #ocaml
<hannes> anyone aware of a client&server side (websocket-based) chat application using ocaml/reason?
jaar__ has joined #ocaml
olle has joined #ocaml
jao has quit [Ping timeout: 268 seconds]
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<olle> test
<olle> anyone online?
ravenousmoose has joined #ocaml
orbifx has joined #ocaml
ravenousmoose has quit [Ping timeout: 252 seconds]
jnavila has quit [Ping timeout: 246 seconds]
gareppa has joined #ocaml
gareppa has quit [Quit: Leaving]
<olle> bah
<olle> I have question about ocaml classes
<olle> how to structure the files in a project with multiple classes
jnavila has joined #ocaml
<octachron> What is the issue? Classes are not that different from submodules in term of organisation.
ziyourenxiang has quit [Ping timeout: 268 seconds]
<olle> octachron: modules have no code-reuse
<olle> code re-use*
<olle> octachron: wait, you mean submodules as in modules inside files?
<octachron> Yes. And I have no idea what you meant by "modules have no code reuse".
sillyotter has joined #ocaml
sillyotter has quit [Client Quit]
<olle> octachron: sorry, re-use in the sence in inheritance
zolk3ri has quit [Remote host closed the connection]
zolk3ri has joined #ocaml
vicfred has quit [Quit: Leaving]
<letoh> olle: how about `include' in a module to reuse another module
<olle> letoh: thanks, yeah, I'm thinking about that. :d
<olle> but, OOP actually has valid use-cases
<olle> looking for code using objects...
jnavila has quit [Ping timeout: 252 seconds]
kakadu has joined #ocaml
jao has joined #ocaml
Hrundi_V_Bakshi has joined #ocaml
nullifidian has quit [Read error: Connection reset by peer]
nullifidian_ has joined #ocaml
<orbifx> letoh: that's what I was recommending too yesterday
<olle> ^^
q9929t has joined #ocaml
<olle> neither haskell nor rust has inheritance, right? how do they handle these use-cases? just write the code over and over again?
<octachron> It is often possible to use composition over inheritance. And you can simulate late bindings by hand if needed.
<olle> octachron: ok
<olle> octachron: with composition, you add "helpers" which uses explicit state instead, and include them in the relevant classes/modules?
<octachron> Having function with explicit state is more the functional programming's code structure. It is orthogonal to the issue at hand. Composition just means that you explicit the state of your "inherited" class/type and then delegate functions to this "inherited"state when needed.
<olle> hm
<olle> maybe we can discuss my specific use-case?
<olle> I'm making a web crawler.
<olle> I have classes of types of web pages
<olle> "forum", "article", "search engine" and so on
<olle> in OOP, they would all inherit from a base class with some common behaviour
<olle> maybe there would be deeper hierarchies later, too. right now it's just one level (in my head, at least).
<octachron> Why use classes over a variant?
<olle> octachron: because they all have different behaviour? I don't want to make one giant pattern match to distribute the behaviour
<olle> each behaviour should be in its own file
<olle> hm, maybe it's mostly the "to string" behaviour that's different :d
<olle> also this: It should be possible to add a new web page type without touching old code.
so has quit [*.net *.split]
jnavila has joined #ocaml
* olle going shopping, bbl
q9929t has quit [Quit: q9929t]
so has joined #ocaml
so has quit [Max SendQ exceeded]
so has joined #ocaml
so has joined #ocaml
so has quit [Max SendQ exceeded]
so has joined #ocaml
so has quit [Max SendQ exceeded]
so has joined #ocaml
so has quit [Max SendQ exceeded]
so has joined #ocaml
so has joined #ocaml
so has quit [Max SendQ exceeded]
so has joined #ocaml
tane has joined #ocaml
<orbifx> olle: not to start an OOP flame, but what problems in the real world are solved in that way?
<olle> orbifx: which problem what?
<olle> code re-use?
<octachron> orbifx, objects/record of functions are fine when you have an open set of variants and a closed set of behaviors
<olle> octachron: the expressions problem, right? adding new data vs adding new operators.
<olle> I'll start a reddit thread...
<olle> octachron: ha! you already answered ^^ thanks!
<octachron> olle, right. Contrarily, depending on how much behaviors are shared, it might be more useful to have an internal library of helper functions than a deep inheritance hierarchy.
<olle> hm
bitwinery has joined #ocaml
bitwinery has quit [Max SendQ exceeded]
gravicappa has quit [Ping timeout: 245 seconds]
bitwinery has joined #ocaml
bitwinery has quit [Max SendQ exceeded]
<olle> octachron: what's more common - to have a fixed set of operations, or a fixed set of data?
<olle> in my experience, operations are often set.
<olle> but that must depend on the domain.
bitwinery has joined #ocaml
<octachron> With a finite program, data classifications and operations are both finite. So I would say that the distinction is more in which direction the program is expected to grow.
ggole has quit [Quit: Leaving]
nullifidian__ has joined #ocaml
nullifidian_ has quit [Read error: Connection reset by peer]
tane has quit [Quit: Leaving]
<olle> octachron: yes, of course.
<olle> damn, I feel like there should be research about that
<olle> it should have an answer, because it can affect lanuage design for specific domains
jaar__ has quit [Quit: Leaving]
orbifx has quit [Ping timeout: 258 seconds]
olle has quit [Ping timeout: 268 seconds]
jnavila has quit [Remote host closed the connection]
Jeanne-Kamikaze has joined #ocaml
kakadu has quit [Remote host closed the connection]
Involuntary has joined #ocaml
Jeanne-Kamikaze has quit [Ping timeout: 265 seconds]
kvda has joined #ocaml
kvda has quit [Client Quit]
bitwinery has quit [Ping timeout: 248 seconds]
kvda has joined #ocaml
bitwinery has joined #ocaml
bitwinery has quit [Max SendQ exceeded]
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
zolk3ri has quit [Remote host closed the connection]
olle has joined #ocaml
_whitelogger has joined #ocaml
ziyourenxiang has joined #ocaml
bitwinery has joined #ocaml
bitwinery has quit [Max SendQ exceeded]
olle has quit [Ping timeout: 240 seconds]
analogue has joined #ocaml