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
ygrek has quit [Remote host closed the connection]
<vmonteco> Drup: Like an injection?
<Drup> like that*
<vmonteco> Drup: What would be a functionnal example? something like (a:string * b:{s1:int; s2:int;})?
<Drup> vmonteco: first declare the record type, then declare the type
<Drup> you can't have anonymous record types in arbitrary positions. Record types must be named (except inside sum types, but you are not in this case)
<vmonteco> Drup: That's what I did, but there is no other way? (type t1 = {a:int; b:int};; type t2 = (string * t1);;)
<Drup> No, there is no other way.
<Drup> record and sum types must have a name in OCaml.
<vmonteco> Drup: Ok, thank you for this explanation! :)
spew has quit [Quit: foobar]
mfp has quit [Ping timeout: 260 seconds]
cbot has joined #ocaml
maxirater has joined #ocaml
jao has quit [Remote host closed the connection]
fraggle_ has quit [Ping timeout: 252 seconds]
infinity0_ has joined #ocaml
infinity0_ has quit [Changing host]
infinity0 is now known as Guest86294
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
jao has joined #ocaml
jao has quit [Remote host closed the connection]
fraggle_ 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]
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
jao has joined #ocaml
chamar has joined #ocaml
maxirater has quit [Quit: Leaving]
pilne has quit [Quit: Quitting!]
jao has quit [Ping timeout: 240 seconds]
shinnya has joined #ocaml
_whitelogger has joined #ocaml
cbot_ has joined #ocaml
cbot has quit [Ping timeout: 258 seconds]
mars0i has joined #ocaml
shinnya has quit [Ping timeout: 252 seconds]
govg has quit [Ping timeout: 240 seconds]
mengu has quit [Remote host closed the connection]
mars0i has quit [Quit: Page closed]
nomicflux has joined #ocaml
nomicflux has quit [Client Quit]
tmtwd has joined #ocaml
tmtwd has quit [Client Quit]
MercurialAlchemi has joined #ocaml
govg has joined #ocaml
orbifx has joined #ocaml
_whitelogger has joined #ocaml
richi235 has joined #ocaml
kakadu has joined #ocaml
AlexDenisov has joined #ocaml
AlexDeni_ has joined #ocaml
AlexDenisov has quit [Ping timeout: 258 seconds]
_whitelogger has joined #ocaml
Algebr has joined #ocaml
cbot_ has quit [Quit: Leaving]
fraggle_ has quit [Remote host closed the connection]
fraggle_ has joined #ocaml
shinnya has joined #ocaml
kakadu has quit [Remote host closed the connection]
kakadu has joined #ocaml
kakadu has quit [Remote host closed the connection]
kolko has quit [Ping timeout: 260 seconds]
kolko_ has joined #ocaml
average has quit [Ping timeout: 245 seconds]
average has joined #ocaml
mfp has joined #ocaml
Algebr has quit [Remote host closed the connection]
silver has joined #ocaml
infinity0 has joined #ocaml
orbifx has quit [Ping timeout: 260 seconds]
copy` has quit [Quit: Connection closed for inactivity]
rand__ has joined #ocaml
fraggle-boate has joined #ocaml
fraggle-boate has quit [Quit: Quitte]
<mrvn> sometimes I wih you could have inlined types.
AlexDeni_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
inr_ has quit [Quit: WeeChat 1.6]
inr has joined #ocaml
mengu has joined #ocaml
govg has quit [Ping timeout: 268 seconds]
<infinity0> i'm writing a pure state transition, do you guys think it's clearer to do e.g. "let transition state0 = (let state1 = f state0 in let state2 = g state1 in etc etc)"
<infinity0> or just "let transition state = (let state = f state in let state = g state in etc etc)" so the bindings have the same name and shadow the earlier ones
<infinity0> the first one is maybe clearer to read but more annoying to update, if i want to insert something between f and g, or refactor it, i have to rename everything correctly
<infinity0> (and the type system doesn't really help me here)
<infinity0> mrvn: there is some syntax like "val x : ('a -> 'a t -> 'a t1 -> 'a t2 as x) -> x -> x" that i've seen in some places but i never properly learned how it goes
<infinity0> er, the "as x" was meant to be separate from the first x, of course
silver has quit [Read error: Connection reset by peer]
sz0 has joined #ocaml
ncthom91 has joined #ocaml
mengu has quit [Read error: Connection reset by peer]
mengu has joined #ocaml
mengu has quit [Ping timeout: 260 seconds]
<reynir> lobo: I got #doc working on opened modules \o/
ncthom91 has quit [Quit: Textual IRC Client: www.textualapp.com]
oliverfriedmann has joined #ocaml
rand__ has quit [Quit: leaving]
<oliverfriedmann> I'm trying to create a library using OPAM / OASIS, but instead of installing a compiled version of this library, I would need to install the source files and compile it on demand when the "host" project is being compiled. This is due to the fact that the library is bridging a variety of C++ libraries to OCaml, and the it is up to the host project to select which of the C++ libraries should be
<oliverfriedmann> compiled and linked to the project. Therefore, it is necessary not to compile all ML files of that bridging library automatically, as they depend on the existence of the external C++ packages.
<oliverfriedmann> My previous OPAM / OASIS libraries work properly, but it looks like only the compiled files are installed and the source files are not present anymore. Is what I'm trying to do doable with OPAM / OASIS?
<Drup> Look at opam's manual for .install files, and write you own with everything you want to install, it'll work in addition to the oasis stuff
mengu has joined #ocaml
govg has joined #ocaml
<oliverfriedmann> That looks helpful. Thanks!
mengu has quit [Ping timeout: 255 seconds]
chamar has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
Fistine has quit [Ping timeout: 252 seconds]
Fistine has joined #ocaml
nomicflux has joined #ocaml
mengu has joined #ocaml
mengu has quit [Ping timeout: 260 seconds]
sz0 has quit [Quit: Connection closed for inactivity]
oliverfriedmann has quit []
richi238 has joined #ocaml
richi235 has quit [Ping timeout: 260 seconds]
AlexDenisov has joined #ocaml
dhil has joined #ocaml
nomicflux has quit [Quit: nomicflux]
kamog has joined #ocaml
ryanartecona has joined #ocaml
shinnya has quit [Ping timeout: 258 seconds]
nightmared has quit [Ping timeout: 255 seconds]
nightmared has joined #ocaml
richi238 has quit [Ping timeout: 260 seconds]
mengu has joined #ocaml
mengu has quit [Ping timeout: 240 seconds]
<lobo> reynir: nice. i'm just updating
copy` has joined #ocaml
ryanartecona has quit [Quit: ryanartecona]
zaquest has quit [Ping timeout: 260 seconds]
zaquest has joined #ocaml
manizzle has joined #ocaml
orbifx has joined #ocaml
TheLemonMan has joined #ocaml
orbifx has quit [Ping timeout: 260 seconds]
robertc has left #ocaml ["ERC Version 5.3 (IRC client for Emacs)"]
robertc has joined #ocaml
zv has quit [Ping timeout: 240 seconds]
ryanartecona has joined #ocaml
<lobo> reynir: i've sent you a pr. the compilation failed on my system. I'm running 4.04.0. if it works fine on your system, i might have to check the version of some of the installed packages
fraggle_ has quit [Remote host closed the connection]
zv has joined #ocaml
mengu has joined #ocaml
mengu has quit [Ping timeout: 260 seconds]
zv has quit [Ping timeout: 252 seconds]
maarhart has joined #ocaml
orbifx has joined #ocaml
cbot has joined #ocaml
SpiceGuid has joined #ocaml
maarhart has quit [Remote host closed the connection]
zv has joined #ocaml
zv has quit [Ping timeout: 240 seconds]
vicfred has joined #ocaml
Algebr has joined #ocaml
zv has joined #ocaml
davs has joined #ocaml
<davs> Hi! I'm a beginner learning OCaml via the Real World OCaml book. It tells me to install core_extended, but it fails with an error (opam install core_extended). On the projects github page there is a mention, that Arch linux (which I'm using) upgraded to glibc .25, which dropped some functionality required by core_extended. Is there a way around this issue? Do I need to install it somehow from source?
<mrvn> davs: apt-get install debian
<mrvn> If Arch linux droped functionality then they must make a libc.so.7
<mrvn> with all the pain that entails.
<davs> the issue seems to be fixed/merged in the master branch, but they did not make a release to opam yet (apparently)
<def`> there is a dev repository to have access to this version:
zv has quit [Ping timeout: 260 seconds]
<davs> I am aware that being on a rolling distro is not optimal, but I won't reinstall/reconfigure my whole system just for this. If nothing works then I'll wait for a new release of core_extended
<def`> opam repository add janestreet-dev https://ocaml.janestreet.com/opam-repository
<def`> Then you will be running rolling releases of janestreet packages too :)
<def`> (However there are more risks of unstability)
<davs> :)
<mrvn> You might just get away with defining _LINUX_QUOTA_VERSION for the compile.
<def`> I am using this repo with arch without problem.
maarhart has joined #ocaml
<davs> How would I define this variable when installing via opam? Based on the code it seems that if I could set it to 1, it would work.
strykerkkd has joined #ocaml
zv has joined #ocaml
richi235 has joined #ocaml
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
AlexDenisov has joined #ocaml
AlexDenisov 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
AlexDenisov has quit [Client Quit]
pilne has joined #ocaml
<mrvn> no idea about opam
orbifx has quit [Ping timeout: 240 seconds]
copy` has quit [Quit: Connection closed for inactivity]
kakadu has joined #ocaml
jao has joined #ocaml
ryanartecona has quit [Quit: ryanartecona]
davs has quit [Ping timeout: 240 seconds]
silver has joined #ocaml
cbot has quit [Ping timeout: 240 seconds]
<orbitz> rgrinberg: how come your mustache library depends on Json?
<orbitz> Or rather calls the objects json
Algebr has quit [Ping timeout: 240 seconds]
mengu has joined #ocaml
cml has joined #ocaml
Algebr has joined #ocaml
Mougan has joined #ocaml
<cml> I'm trying to implement co finit set in Ocaml. In mathematics, a cofinite subset A of a set X is a subset A whose complement A ' in X is a finite set. I did this : type setCo : finit of setA * setX
Algebr has quit [Ping timeout: 260 seconds]
maarhart has quit [Quit: Mutter: www.mutterirc.com]
maarhart has joined #ocaml
<orbitz> Does menhir support unicode input?
MercurialAlchemi has quit [Ping timeout: 240 seconds]
Mougan has quit [Read error: Connection reset by peer]
<mrvn> cml: don't you mean Finit?
<orbitz> I guess the options are ulex and sedlex
<cml> mrvn yes
maarhart has quit [Quit: Mutter: www.mutterirc.com]
Algebr has joined #ocaml
SpiceGuid has quit [Quit: ChatZilla 0.9.93 [SeaMonkey 2.46/20161213183751]]
octachron has joined #ocaml
<octachron> cml, without looking at implementation for now, if I give you a finite set, can you construct a cofinite set?
<mrvn> can't cofinite sets be infinite?
<octachron> mrvn, yes that is the point of cofinite set: cofinite set in a finite space are pointless
Algebr has quit [Ping timeout: 258 seconds]
<cml> octachron yes
<octachron> cml, which one?
<cml> octachron Her is how i see it : You give me X as a set, I pick A as cofinit set and A' is complement. Thus all the element from E that there aren't in A is the set A'
<cml> his**
<cml> This is why I definied like this type setCo : finit of setA * setX
<cml> I'm trying to implement it on bicolore trees
<octachron> cml, question do you expect to have different global set X ?
<cml> what do you mean by different the type of element ?
<octachron> generally, cofinite set are useful when working in infinite set, this means that giving an explicit value representation of the infinite set X may be both bothersome and unrequired
<octachron> short example, how would you implement cofinite set of integers?
maarhart has joined #ocaml
<cml> this is the question I'm struggling with . type element = int; type CoSet = Fin of Set
maarhart has quit [Remote host closed the connection]
<cml> octachron
<octachron> cml, what is Set here?
<cml> set is X,
<mrvn> but how do you store setX if it is infinite?
<octachron> cml, you mean ℕ ?
<cml> this is why we have to pick some element
<octachron> or ℤ ?
<cml> yes octachron
<cml> Z
<mrvn> octachron: type t = Cofinit_of_ineteger of int list
<mrvn> octachron: e.g. Cofinit_of_ineteger [ 0 ] for the set of x != 0.
dhil has quit [Ping timeout: 260 seconds]
<octachron> mrvn, yes, … thanks. *I* am aware of this posible implementation
<mrvn> only way I can see this work is with an implicit set, like all inetegers, or a lazy list or enumeration for setX.
<octachron> mrvn, you can also have a symbolic representation
<mrvn> octachron: true. but that's basically an implicit set. The code has to know what the symbol means.
<mrvn> what are you going to do with those cofinit sets?
silver has quit [Read error: Connection reset by peer]
<octachron> mrvn, yes, by definition you cannot have an explicit enumeration of an infinite set
<mrvn> octachron: you can enumerate it. it just never ends. :)
silver has joined #ocaml
<octachron> mrvn, well let's go to uncountable set to avoid this technicality
darktenaibre has joined #ocaml
<mrvn> octachron: now you are just mean. :)
<octachron> cml, this may help in fact: when looking at implentation, there is a big difference between finite sets and infinite sets
<mrvn> yeah, a finit set you can just construct.
<octachron> mrvn, even if I let you pick your prefered aleph_k with k > 0? :p
<mrvn> octachron: sorry, wokring on the M-set at the moment. much nicer pictures.
<octachron> cml, the advantage of cofinite set is that there is bijection between finite and cofinite sets
<octachron> cml, consequently cofinite set can be represented by finite set
<octachron> mrvn, Mandelbrot set?
<mrvn> octachron: yep
<cml> I really hate maths in programming I'm lost ... I understand the definition but it seems that there is some details that makes no sens for me ...
<mrvn> trying to parallelise the single orbital iteration method for speeding up computations.
<cml> And I have a bad english fml
<octachron> cml, you are french are'nt you?
<cml> octachron yes
<cml> octachron so I have to implement it only for finit set ?
<octachron> cml, rather if you have an implementation of a finite set, you have an implementation of cofinite set
<octachron> what changes between finite and cofinite set will be the mathematical interpretation of the concrete object
<octachron> for instance in the finite case the list of element [1;2;3] will represent the set s = {1;2;3};
<octachron> whereas in the cofinite case, the list of element [1;2;3] will represent the set E / {1;2;3}
<octachron> for the sake of clarity, you can define "type cofinite_integer_sets = Complement of int list"
Algebr has joined #ocaml
<cml> octachron That's what I have done
<cml> So I can do this : let b = Complement X
<octachron> cml, if X is an implementation of a finite set, yes
<cml> Ok so her is why I'm struggling with this definition
Algebr has quit [Ping timeout: 260 seconds]
<cml> wait if E = {1;2;3}; then E / {1;2;3} = empty , no ?
<cml> by s you mean E ?
kakadu has quit [Remote host closed the connection]
<mrvn> the infinite set that you complement off
<octachron> cml, I was considering E = ℤ
<octachron> cml, a part of your problems may be the fact that mathematics is far more liberal than programming with infinites
<mrvn> unless you are doing symbolic math forget about handling infinites
<octachron> in particular, this means that in set theory there is no conceptual difference between finite sets and infinite sets, whereas there are completely different beasts in programming
<cml> haaan ok I understand now