companion_cube changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.05.0 release notes: https://caml.inria.fr/pub/distrib/ocaml-4.05/notes/Changes | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
ziyourenxiang has quit [Ping timeout: 255 seconds]
jlongster has quit [Client Quit]
mengu has joined #ocaml
pierpa has joined #ocaml
cthuluh_ is now known as cthuluh
dreadedfrog has joined #ocaml
mfp__ has quit [Ping timeout: 260 seconds]
sapristi has quit [Ping timeout: 260 seconds]
jlongster has joined #ocaml
swalk has joined #ocaml
dreadedfrog has quit [Ping timeout: 240 seconds]
zpe has joined #ocaml
zpe has quit [Ping timeout: 240 seconds]
deep-book-gk has joined #ocaml
Ragora has joined #ocaml
deep-book-gk has left #ocaml [#ocaml]
jlongster has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jao has quit [Ping timeout: 255 seconds]
nomicflux has joined #ocaml
govg has joined #ocaml
govg has quit [Quit: leaving]
axiles has quit [Ping timeout: 258 seconds]
axiles has joined #ocaml
sh0t has quit [Remote host closed the connection]
pierpa has quit [Quit: Page closed]
djellemah__ has joined #ocaml
djellemah_ has quit [Ping timeout: 240 seconds]
zpe has joined #ocaml
soultadu has joined #ocaml
zpe has quit [Ping timeout: 240 seconds]
soultadu has quit [Client Quit]
enterprisey has joined #ocaml
govg has joined #ocaml
malina has quit [Ping timeout: 246 seconds]
jlongster has joined #ocaml
zpe has joined #ocaml
zpe has quit [Ping timeout: 240 seconds]
swalk has quit [Quit: swalk]
BitPuffin|osx has quit [Ping timeout: 260 seconds]
xvilka_ has joined #ocaml
xvilka has quit [Ping timeout: 255 seconds]
MercurialAlchemi has joined #ocaml
nomicflux has quit [Quit: nomicflux]
_whitelogger has joined #ocaml
zpe has joined #ocaml
zpe has quit [Ping timeout: 240 seconds]
enterprisey has quit [Ping timeout: 240 seconds]
xvilka_ has quit [Changing host]
xvilka_ has joined #ocaml
xvilka_ is now known as xvilka
enterprisey has joined #ocaml
enterprisey has quit [Remote host closed the connection]
jlongster has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
zpe has joined #ocaml
zpe has quit [Ping timeout: 246 seconds]
_whitelogger has joined #ocaml
raphaelss has quit [Quit: Lost terminal]
GK1wmSU has joined #ocaml
GK1wmSU has left #ocaml [#ocaml]
_GK1wmSU has joined #ocaml
_GK1wmSU has left #ocaml [#ocaml]
Mercuria1Alchemi has joined #ocaml
zpe has joined #ocaml
zpe has quit [Ping timeout: 240 seconds]
mengu has quit [Remote host closed the connection]
mengu has joined #ocaml
Simn has joined #ocaml
mengu has quit [Ping timeout: 246 seconds]
swalk has joined #ocaml
al-damiri has quit [Quit: Connection closed for inactivity]
mbuf has joined #ocaml
<mbuf> Can OCaml be used for parallel and concurrent programming on SMP systems?
<companion_cube> yes, using multiplus processes
<companion_cube> for simple cases see parmap/functory
<mbuf> companion_cube, what about thread support?
<companion_cube> not yet, although it's in the works
<companion_cube> what would you need parallel code for?
<mbuf> companion_cube, web server requests
<companion_cube> then you can use lwt for concurrency
<companion_cube> I'm not sure how you could use multiple cores for that, but anyway the DB is the bottleneck, isn't it? and lwt provides high degree of concurrency with the asynchronous style
<mbuf> companion_cube, I see
<companion_cube> (afaik cpu is rarely the bottleneck in web backends)
<mbuf> companion_cube, I was primarily looking for a static, strong, inferred language that is performant
<companion_cube> well it is performant
<mbuf> companion_cube, and I can use for backend; is there a web framework with ocaml that you recommend that also has support for integrating with JavaScript?
<companion_cube> hmm I'm really no expert, but the "default" framework is ocsigen, I think
<companion_cube> does a lot of stuff
<companion_cube> got to go
<mbuf> and something that I can use with GPL
<mbuf> companion_cube, thanks for your help!
enterprisey has joined #ocaml
<mbuf> unlike Haskell, OCaml syntax is easier to read
zpe has joined #ocaml
baroud has joined #ocaml
zpe has quit [Ping timeout: 260 seconds]
dhil has joined #ocaml
cbot has quit [Ping timeout: 260 seconds]
TheLemonMan has joined #ocaml
argent_smith has joined #ocaml
dhil has quit [Ping timeout: 260 seconds]
freusque has joined #ocaml
samrat_ has joined #ocaml
dreadedfrog has joined #ocaml
andreas_ has joined #ocaml
swalk has quit [Quit: swalk]
dakk has joined #ocaml
dreadedfrog has quit [Ping timeout: 240 seconds]
zpe has joined #ocaml
zpe has quit [Ping timeout: 260 seconds]
mfp__ has joined #ocaml
Lightsephi has joined #ocaml
mrvn has left #ocaml [#ocaml]
freusque has quit [Ping timeout: 260 seconds]
enterprisey has quit [Quit: Leaving]
ziyourenxiang has joined #ocaml
samrat_ has quit [Ping timeout: 240 seconds]
freusque has joined #ocaml
zpe has joined #ocaml
zpe has quit [Ping timeout: 260 seconds]
<freusque> Hello. Is it possible to write a module signature where two types must be equal?
<freusque> I'm trying to write a functor F that takes as input modules of type MSig
<freusque> Where MSig has two types x and y
<freusque> F must take as input only modules MSig with type x=y
<def`> if x and y where not declared in the same module, you could write just as you say:
<def`> module F (A : MSig) (B : Msig with type x = A.y) = ...
<def`> to refer to types in the same module, we need an outside name to refer too:
<def`> module F (A : sig type x include MSig with type x := x and type y = x end) = ...
<shepi> In Vim, commenting out code containing a string using *) will break the highlighting.
<shepi> Anyone knows where I should submit a bug notification?
<def`> Vim highlighting is quite broken, I don't think people care much :P
<shepi> Okay :D
<shepi> (by the way this is the first bug I encounter after more than 10 years developing OCaml with Vim ^^)
<shepi> no
<shepi> that was a lie
<shepi> only more than 9 years
<shepi> ^^
<freusque> def`: wow
<def`> shepi: try generative functor: module F() = struct end
<freusque> def`: is there a resource you would reccomend for reading more about modules?
<def`> freusque: have you read the manual? http://caml.inria.fr/pub/docs/manual-ocaml/moduleexamples.html for instance
<shepi> def`, Indeed this is horrible :O
<def`> shepi: include with non trivial modules is quite broken too :)
<def`> include (struct end)
<freusque> I've not been through it systematically
<freusque> thank you.
<freusque> shepi: there is this https://github.com/rgrinberg/vim-ocaml
<def`> freusque: it covers the module system quite well, but it is split:
<shepi> the `include (struct end)` example seems alright :-)
<def`> shepi: ah, maybe it has been fixed in your version
<def`> :) not all hope is lost, please report :D
<shepi> :P I will try the freusque's repo, I'm usually very happy with Markus Mottl's work ^^
<freusque> thank you def` straight to reading list
<def`> moduleexamples.html and advexamples.html are "friendly" example / use case, modules.html and modtypes.html are more formal definition
<def`> extn.html is about extensions and experimental features
<freusque> a careful read may allow me to unfuck my codebase actually
<freusque> thx lots
<orbifx[m]> Can a signature be inlined without having to create a separate mli file? for a module, not creating a submodule
<def`> orbifx[m]: include (struct inline_ml end : sig inline_mli end)
<flux> https://github.com/ocaml/ocaml/pull/1249 - finally objects getting a bit of love, support for "let open" classes ;)
<flux> apparently "let module" would be way harder, though, and it's not implemented
kakadu has joined #ocaml
fre has joined #ocaml
<orbifx[m]> thanks def`
<orbifx[m]> is it better to use mli files isntead of that way?
freusque has quit [Ping timeout: 260 seconds]
zpe has joined #ocaml
zpe has quit [Ping timeout: 248 seconds]
fre has quit [Ping timeout: 246 seconds]
nicoo has quit [Remote host closed the connection]
nicoo has joined #ocaml
sheijk has quit [Ping timeout: 255 seconds]
sapristi has joined #ocaml
argent_smith has quit [Quit: Leaving.]
dhil has joined #ocaml
sheijk has joined #ocaml
zpe has joined #ocaml
zpe has quit [Ping timeout: 248 seconds]
fre has joined #ocaml
CcxWrk has joined #ocaml
dhil has quit [Ping timeout: 240 seconds]
BitPuffin|osx has joined #ocaml
<andreas_> I have a GADT and I'm now trying to add a "dynamic" variant to it. Unfortunately I keep running into an issue with a type constructor escaping its scope. I've tried to create a minimal meaningful example: https://gist.github.com/andreas/53f67474cbc69e8b995229042c07b956 Any ideas or workarounds?
malina has joined #ocaml
<Drup> andreas_: in that simple case, just add quantification over the ctx type
<Drup> like you do for the src one
<andreas_> Drup: Hmm, maybe it's as simple as that -- I'll try in the actual code.
nomicflux has joined #ocaml
zpe has joined #ocaml
M-ErkkiSeppl has quit [Ping timeout: 240 seconds]
yetanotherion[m] has quit [Ping timeout: 246 seconds]
M-martinklepsch has quit [Ping timeout: 246 seconds]
timclassic has quit [Ping timeout: 240 seconds]
mars0i[m] has quit [Ping timeout: 240 seconds]
M-jimt has quit [Ping timeout: 240 seconds]
smondet[m] has quit [Ping timeout: 258 seconds]
srenatus[m] has quit [Ping timeout: 246 seconds]
samrat[m] has quit [Ping timeout: 246 seconds]
aspiwack[m] has quit [Ping timeout: 246 seconds]
orbifx[m] has quit [Ping timeout: 240 seconds]
regnat[m] has quit [Ping timeout: 240 seconds]
hdurer[m] has quit [Ping timeout: 240 seconds]
Bluddy[m] has quit [Ping timeout: 264 seconds]
copy[m] has quit [Ping timeout: 276 seconds]
isaachodes[m] has quit [Ping timeout: 276 seconds]
zpe has quit [Ping timeout: 260 seconds]
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
swalk has joined #ocaml
swalk has quit [Read error: Connection timed out]
sepp2k has joined #ocaml
sapristi has quit [Remote host closed the connection]
sapristi has joined #ocaml
_andre has joined #ocaml
dhil has joined #ocaml
Enamex has joined #ocaml
nomicflux has quit [Quit: nomicflux]
zpe has joined #ocaml
mbuf has quit [Ping timeout: 240 seconds]
zpe has quit [Ping timeout: 255 seconds]
sh0t has joined #ocaml
jlongster has joined #ocaml
mengu has joined #ocaml
Denommus has joined #ocaml
mengu_ has joined #ocaml
mengu_ has quit [Remote host closed the connection]
mengu_ has joined #ocaml
mengu has quit [Ping timeout: 276 seconds]
Denommus has quit [Ping timeout: 240 seconds]
maattdd has joined #ocaml
mengu_ has quit [Ping timeout: 240 seconds]
Enamex has quit [Quit: ("")]
fre has quit [Ping timeout: 240 seconds]
fre has joined #ocaml
<shepi> Hello! Is anyone familiar with GADTs? I'm toying with them but I don't get how "composition" works. In the following example: https://gist.githubusercontent.com/shepard8/16b297109181ebeef659d9d373800b27/raw/8d3d0a8048c93d3317f0578eae98992d8735695a/gistfile1.ml I hoped I would get "XXXXXX" but I just get the following error: This expression has type $0 t but an expression was expected of type a t.
maattdd_ has joined #ocaml
maattdd_ has quit [Client Quit]
maattdd has quit [Quit: WeeChat 1.9]
<shepi> (Cons (Cons Empty) has type string -> string -> 'a, as expected)
<shepi> s/'a/'a t/
<lyxia> your definition of parse looks odd.
<lyxia> f : a, Cons st : a t
<shepi> Sure it does, it's the first time I get my hands in GADTs ^^
<lyxia> so, a = string -> b for some b
<lyxia> and st : b t
<lyxia> then does parse f st type check?
<lyxia> parse : a -> a t -> _, f : a, st : b t, but a <> b !
<shepi> (I read you, I just need several minutes to parse the information :P)
<lyxia> shepi: Beyond this error, I don't understand what you are actually trying to do.
<Drup> shepi: Pretty sure what you want is exactly what is explained here: http://drup.github.io/2016/08/02/difflists/
mengu has joined #ocaml
<shepi> The final objective is to pair this with regular expressions consructors, to get things like let f = regex |> text "I am " |> var |> " and I am " |> var |> " years old." in exec f g
<shepi> Drup, I'll have a look :-)
<Drup> as for regex, you might want to take a look at Tyre :)
<shepi> lyxia, I see what the problem is, I'll try to fix it, thank you! :-)
sapristi has quit [Remote host closed the connection]
<Drup> shepi: if you still don't manage to do it after reading the link, I can show you the solution, but it's better if you try to figure it out
sapristi has joined #ocaml
<shepi> Drup, I'm glad to hear there _is_ a solution :D Now I won't go asleep until I find it :p
al-damiri has joined #ocaml
zpe has joined #ocaml
<Drup> Yes, there is a common trick to do this kind of GADT-lists
zpe has quit [Ping timeout: 240 seconds]
<Fistine> q
<Fistine> Oups sry sry
Mercuria1Alchemi has quit [Ping timeout: 240 seconds]
Denommus has joined #ocaml
<shepi> Mmh I got it working, but I took the problem the other way around. Now Empty is constructed using function f. (I updated the gist above to the "correct" version)
<shepi> Also I added the "final type" to the GADT, as in the article you provided
<Drup> putting it inside the Empty case is not a great solution, since it makes it non-composable
<Drup> the function is better provided externally
<shepi> Ok, that part was not hard to do :-)
<shepi> Ok, this solves my problem, thank you and lyxia for help! :-)
<Drup> shepi: now take a look at tyre :p
fre has quit [Quit: WeeChat 1.9]
<shepi> Yes I'll do :p
kotangent has joined #ocaml
TheLemonMan has joined #ocaml
SpiceGuid has joined #ocaml
aciniglio has joined #ocaml
samrat[m] has joined #ocaml
\h has quit [Ping timeout: 240 seconds]
dhil has quit [Ping timeout: 255 seconds]
M-martinklepsch has joined #ocaml
timclassic has joined #ocaml
srenatus[m] has joined #ocaml
M-jimt has joined #ocaml
aspiwack[m] has joined #ocaml
smondet[m] has joined #ocaml
copy[m] has joined #ocaml
hdurer[m] has joined #ocaml
yetanotherion[m] has joined #ocaml
isaachodes[m] has joined #ocaml
orbifx[m] has joined #ocaml
M-ErkkiSeppl has joined #ocaml
mars0i[m] has joined #ocaml
regnat[m] has joined #ocaml
Bluddy[m] has joined #ocaml
cbot has joined #ocaml
mengu_ has joined #ocaml
<Leonidas> seliopou: what evaluates #ifdef in the core codebase? I would think it is cppo, but it is not in the dependency tree
mengu has quit [Ping timeout: 258 seconds]
<Drup> Leonidas: ppx_optcomp, iirc
<Leonidas> Drup: thanks, judging from the docs, that's it.
<Leonidas> didn't know one can attach to #ifdef via ppx.
<Drup> You can't, it's at the lexer level
<Drup> (the name ppx is quite misleading)
zpe has joined #ocaml
zpe has quit [Ping timeout: 240 seconds]
SpiceGuid has quit [Ping timeout: 246 seconds]
FreeBirdLjj has joined #ocaml
enterprisey has joined #ocaml
AlexRussia has quit [Ping timeout: 260 seconds]
FreeBirdLjj has quit [Read error: Connection reset by peer]
FreeBirdLjj has joined #ocaml
* shepi is literally jumping in his appartment because he received a phone interview opportunity for his dream job!
shepi has left #ocaml [#ocaml]
dhil has joined #ocaml
AlexRussia has joined #ocaml
<orbifx[m]> Anyone knows how to put floats into a cstruct?
<orbifx[m]> Search the repo for `float` and nothing comes up
<orbifx[m]> Make it a uint64 and somehow copy the bytes in there?
<johnelse> orbifx[m]: Int64.bits_of_float ?
<johnelse> and Int64.float_of_bits to convert it back again
<orbifx[m]> That should do, thanks johnelse
<hannes> orbifx[m]: you may want to open a PR/issue at the cstruct repository... may be worth to add 32 and 64bit floats.. it seems like nobody until now had a use for that
baroud has quit [Quit: AndroIRC - Android IRC Client ( http://www.androirc.com )]
<orbifx[m]> pushing the boundary
<orbifx[m]> I shall submit something once tested hannes
<hannes> orbifx[m]: but i also haven't (yet) come across network protocols using float..
<orbifx[m]> it's a custom case
tg has quit [Excess Flood]
tg has joined #ocaml
zpe has joined #ocaml
zpe has quit [Ping timeout: 240 seconds]
<orbifx[m]> Opened issue in case anyone else if more keen :)
orbitz_ has quit [Quit: Reconnecting]
jimmyrcom has quit [Ping timeout: 246 seconds]
orbitz has joined #ocaml
sapristi has quit [Remote host closed the connection]
sapristi has joined #ocaml
mengu_ has quit [Remote host closed the connection]
copy_ has joined #ocaml
slash^ has joined #ocaml
cbot has quit [Quit: Leaving]
tane has joined #ocaml
zpe has joined #ocaml
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
iitalics has joined #ocaml
zpe has quit [Ping timeout: 260 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
mrvn has joined #ocaml
ristos has joined #ocaml
_berke_ has joined #ocaml
aciniglio has quit [Ping timeout: 276 seconds]
enterprisey has quit [Read error: Connection reset by peer]
enterprisey has joined #ocaml
raphaelss has joined #ocaml
FreeBirdLjj has joined #ocaml
<_berke_> hi, fixed a few bugs in opam ffmpeg by editing the build dir. what's the workflow to get those (1) permanently in my opam (2) upstream?
FreeBirdLjj has quit [Ping timeout: 260 seconds]
Denommus has quit [Remote host closed the connection]
Denommus` has joined #ocaml
<_berke_> never mind they're fixed in ffmpeg 0.1.2
zpe has joined #ocaml
Denommus` is now known as Denommus
iitalics has quit [Quit: /thread]
zpe has quit [Ping timeout: 258 seconds]
malina has quit [Read error: Connection reset by peer]
dakk has quit [Ping timeout: 240 seconds]
sapristi has quit [Ping timeout: 248 seconds]
https_GK1wmSU has joined #ocaml
https_GK1wmSU has quit [K-Lined]
dakk has joined #ocaml
zpe has joined #ocaml
_y has left #ocaml ["Dans la marine, il faut saluer tout ce qui bouge et peindre le reste."]
malina has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
zpe has quit [Ping timeout: 268 seconds]
ygrek has joined #ocaml
dejanr has joined #ocaml
jnavila has joined #ocaml
malina has quit [Remote host closed the connection]
malina has joined #ocaml
mali__ has joined #ocaml
mali__ has quit [Remote host closed the connection]
dejanr has quit []
slash^ has quit [Read error: Connection reset by peer]
ygrek has quit [Ping timeout: 240 seconds]
malina has quit [Ping timeout: 260 seconds]
dakk has quit [Ping timeout: 260 seconds]
dejanr has joined #ocaml
jnavila has quit [Quit: Konversation terminated!]
jnavila has joined #ocaml
kakadu_ has joined #ocaml
kakadu__ has joined #ocaml
kakadu_ has quit [Ping timeout: 240 seconds]
dejanr has quit []
dejanr has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 260 seconds]
mengu has joined #ocaml
aciniglio has joined #ocaml
flashmozzg has left #ocaml [#ocaml]
jnavila has quit [Remote host closed the connection]
zpe has joined #ocaml
<dxtr> So, I'm still wrestling with pgocaml :) If I'm not using the camlp4 stuff I'm getting a unit PGOCaml.t and if I am using it I get a (string, bool) Hashtbl.t PGOCaml.t - how would I make my own thing?
<dxtr> I basically want the Hashtbl thing without the camlp4 stuff
<dxtr> I'm reading through the code for the camlp4 stuff but I feel I'm not getting a lot smarter
tane has quit [Quit: Leaving]
AlexRussia has quit [Quit: WeeChat 1.9]
BitPuffin has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
dhil has quit [Ping timeout: 268 seconds]
zpe has quit [Ping timeout: 276 seconds]
mengu has quit [Remote host closed the connection]
mengu has joined #ocaml
sapristi has joined #ocaml
_andre has quit [Quit: leaving]
mengu has quit [Ping timeout: 260 seconds]
infinity0_ has joined #ocaml
infinity0 is now known as Guest98142
infinity0_ has quit [Changing host]
infinity0_ has joined #ocaml
infinity0_ is now known as infinity0
Guest98142 has quit [Killed (weber.freenode.net (Nickname regained by services))]
aciniglio has quit [Ping timeout: 240 seconds]
enterprisey has quit [Remote host closed the connection]
sh0t has quit [Ping timeout: 276 seconds]
sapristi has quit [Remote host closed the connection]
sapristi has joined #ocaml
Simn has quit [Quit: Leaving]
ygrek has joined #ocaml
sepp2k has quit [Ping timeout: 260 seconds]
sh0t has joined #ocaml
malina has joined #ocaml
peterpp has joined #ocaml
<Leonidas> seliopou: oh and btw thanks for signing up to discuss.ocaml.org to answer my question. I appreciate it :)
<Leonidas> dxtr: maybe you could post a gist with some runnable/compileable code, then I could take a look?
copy_ has quit [Quit: Connection closed for inactivity]
<Leonidas> because your questions are so generic that missing the context the only possible answer is "by doing the right thing".
<dxtr> Leonidas: I don't have any code for this because I don't know where to start :) But I guess my question really is "How do I use functors?"
Denommus has quit [Quit: going home]
raphaelss has quit [Ping timeout: 260 seconds]
pierpa has joined #ocaml
seangrove has joined #ocaml
kakadu__ has quit [Remote host closed the connection]
<peterpp> I just noticed for the first time that something like List.(iter print_endline ["foo"; "bar"]) is valid
<peterpp> what would be the purpose of adding parentheses like that?
sapristi has quit [Remote host closed the connection]
sapristi has joined #ocaml
https_GK1wmSU has joined #ocaml
https_GK1wmSU has left #ocaml [#ocaml]
mengu has joined #ocaml
andreas_ has quit [Quit: Connection closed for inactivity]
sh0t has quit [Remote host closed the connection]
peterpp has quit [Ping timeout: 260 seconds]
nomicflux has joined #ocaml