adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml MOOC http://1149.fr/ocaml-mooc | OCaml 4.02.3 announced http://ocaml.org/releases/4.02.html | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
A1977494 has joined #ocaml
Vintila has joined #ocaml
mistermetaphor has quit [Remote host closed the connection]
<AJavaIdiot> Well, I solved my problems. Thanks to all who helped :)
<AJavaIdiot> See you!
AJavaIdiot has quit [Quit: ChatZilla 0.9.92 [Firefox 45.0/20160304114926]]
A19774941 has joined #ocaml
A1977494 has quit [Ping timeout: 260 seconds]
hydan has joined #ocaml
A19774941 has quit [Ping timeout: 252 seconds]
A1977494 has joined #ocaml
Vintila has quit [Ping timeout: 244 seconds]
A1977494 has quit [Ping timeout: 244 seconds]
<Algebr`> def`: well, there's another vote for pgocaml
<Algebr`> I'm looking for an intuitive explanation of continuation passing style to beginners
Reshi has joined #ocaml
<pierpa> Algebr`: http://matt.might.net/articles/cps-conversion/ and maybe some other articles from the same author too
<Algebr`> pierpa: oh awesome, thank you!
foocraft has quit [Ping timeout: 246 seconds]
<pierpa> lot of simple introductory articles about func prog there
struk|desk|away is now known as struk|desk
<Reshi> Hi, I am just beginning OCaml, should the comments for functions be placed in the .mli file or .ml file or both?
<Algebr`> you can put them in either, (** *) will be come doc strings
<Algebr`> pierpa: I should have included CPS style in the last OCaml meetup, will do it for next.
<pierpa> Reshi, I'd put comments useful for clients in the mlis and comments useful for mantainers in the mls
<Reshi> pierpa: Even for the same function? So if a function `foo' appears in the interface and implementation, I should comment it in both files but differently if I can?
<Algebr`> you don't have to, but can
<pierpa> exactly :)
A1977494 has joined #ocaml
<Reshi> pierpa, Algebr` Thanks! :D
ril has joined #ocaml
raxello has quit [Remote host closed the connection]
A1977494 has quit [Ping timeout: 244 seconds]
A1977494 has joined #ocaml
noddy has joined #ocaml
A19774941 has joined #ocaml
A1977494 has quit [Ping timeout: 250 seconds]
A1977494 has joined #ocaml
A19774941 has quit [Ping timeout: 248 seconds]
gpietro_ has quit [Ping timeout: 250 seconds]
cross has quit [Ping timeout: 260 seconds]
Drup has quit [Ping timeout: 260 seconds]
tobast has quit [Ping timeout: 260 seconds]
Drup has joined #ocaml
tobast has joined #ocaml
cross has joined #ocaml
struk|desk is now known as struk|desk|away
struk|desk|away is now known as struk|desk
A19774941 has joined #ocaml
A1977494 has quit [Ping timeout: 268 seconds]
mistermetaphor has joined #ocaml
Haudegen has quit [Ping timeout: 260 seconds]
mistermetaphor has quit [Ping timeout: 260 seconds]
nicholasf has joined #ocaml
tennix has quit [Ping timeout: 276 seconds]
A1977494 has joined #ocaml
A19774941 has quit [Ping timeout: 244 seconds]
Haudegen has joined #ocaml
aantron has quit [Ping timeout: 260 seconds]
grandy has joined #ocaml
noddy has quit [Ping timeout: 248 seconds]
<grandy> i'm new to ocaml, and planning to use the bitstring library on a small side project, if anyone here is familiar with it and feels like answering a few very early questions I have, I'd much appreciated it ...
struk|desk is now known as struk|desk|away
atsampson has quit [Ping timeout: 246 seconds]
ril is now known as ril[away]
A19774941 has joined #ocaml
A1977494 has quit [Ping timeout: 244 seconds]
nicholasf has quit [Ping timeout: 276 seconds]
MercurialAlchemi has joined #ocaml
A1977494 has joined #ocaml
A19774941 has quit [Ping timeout: 244 seconds]
ril[away] is now known as ril
ril has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Reshi has quit [Ping timeout: 248 seconds]
A1977494 has quit [Ping timeout: 246 seconds]
A1977494 has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 248 seconds]
mistermetaphor has joined #ocaml
A1977494 has quit [Ping timeout: 264 seconds]
nicholasf has joined #ocaml
A1977494 has joined #ocaml
mistermetaphor has quit [Ping timeout: 244 seconds]
kushal has quit [Ping timeout: 260 seconds]
A1977494 has quit [Ping timeout: 260 seconds]
A19774941 has joined #ocaml
<Algebr`> grandy: the source repo should have some example and rjones has some blog posts about it
<Algebr`> grandy: there's also cstruct which should overlap in some functioanlity
<grandy> ahh, thanks much
<Algebr`> be aware the bitstring uses a camlp4 syntax extension, aka its using some stuff that isn't part of the ocaml grammar proper
johnelse has quit [Ping timeout: 260 seconds]
A1977494 has joined #ocaml
johnelse has joined #ocaml
A19774941 has quit [Ping timeout: 252 seconds]
Reshi has joined #ocaml
A1977494 has quit [Ping timeout: 244 seconds]
kushal has joined #ocaml
struktured has joined #ocaml
pierpa has quit [Ping timeout: 268 seconds]
dsheets has joined #ocaml
dsheets has quit [Ping timeout: 250 seconds]
struktured has quit [Ping timeout: 248 seconds]
adelbertc has joined #ocaml
A1977494 has joined #ocaml
atsampson has joined #ocaml
A1977494 has quit [Ping timeout: 250 seconds]
yunxing has joined #ocaml
<grandy> ahh ok
mistermetaphor has joined #ocaml
atsampson has quit [Ping timeout: 264 seconds]
atsampson has joined #ocaml
rwmjones has quit [Ping timeout: 244 seconds]
tristero has quit [Read error: Connection reset by peer]
struk|desk|away is now known as struk|desk
Vintila has joined #ocaml
rwmjones has joined #ocaml
ichernetsky has quit [Remote host closed the connection]
atsampson has quit [Ping timeout: 264 seconds]
struk|desk has quit [Remote host closed the connection]
dsheets has joined #ocaml
struk|desk has joined #ocaml
dsheets has quit [Ping timeout: 250 seconds]
Vintila has quit [Ping timeout: 268 seconds]
Algebr` has quit [Ping timeout: 250 seconds]
foocraft has joined #ocaml
atsampson has joined #ocaml
A1977494 has joined #ocaml
A19774941 has joined #ocaml
A1977494 has quit [Ping timeout: 260 seconds]
A1977494 has joined #ocaml
tennix has joined #ocaml
A19774941 has quit [Ping timeout: 276 seconds]
slash^ has joined #ocaml
Reshi has quit [Ping timeout: 252 seconds]
nicholasf has quit [Remote host closed the connection]
A19774941 has joined #ocaml
A1977494 has quit [Ping timeout: 244 seconds]
nicholasf has joined #ocaml
Simn has joined #ocaml
A19774941 has quit [Ping timeout: 260 seconds]
nicholasf has quit [Ping timeout: 260 seconds]
mistermetaphor has quit [Remote host closed the connection]
tennix has quit [Quit: WeeChat 1.4]
A1977494 has joined #ocaml
Reshi has joined #ocaml
copy` has quit [Quit: Connection closed for inactivity]
nicholasf has joined #ocaml
mort___ has joined #ocaml
kolko has joined #ocaml
inr has quit [Remote host closed the connection]
inr has joined #ocaml
struk|desk is now known as struk|desk|away
MercurialAlchemi has joined #ocaml
yunxing has quit [Remote host closed the connection]
mort___ has quit [Quit: Leaving.]
mort___ has joined #ocaml
mort___ has quit [Client Quit]
foocraft has quit [Ping timeout: 260 seconds]
badon has quit [Disconnected by services]
badon_ has joined #ocaml
badon_ is now known as badon
ggole has joined #ocaml
yegods has quit [Remote host closed the connection]
A19774941 has joined #ocaml
A1977494 has quit [Ping timeout: 248 seconds]
ggole_ has joined #ocaml
yegods has joined #ocaml
yegods has quit [Remote host closed the connection]
ggole has quit [Ping timeout: 264 seconds]
tane has joined #ocaml
A1977494 has joined #ocaml
A19774941 has quit [Ping timeout: 244 seconds]
mistermetaphor has joined #ocaml
A19774941 has joined #ocaml
A1977494 has quit [Ping timeout: 244 seconds]
ggole__ has joined #ocaml
mistermetaphor has quit [Ping timeout: 252 seconds]
foocraft has joined #ocaml
ggole_ has quit [Ping timeout: 248 seconds]
ggole_ has joined #ocaml
matason has joined #ocaml
ggole__ has quit [Ping timeout: 260 seconds]
Reshi has quit [Ping timeout: 248 seconds]
matason has quit [Ping timeout: 276 seconds]
Sorella has quit [Quit: Connection closed for inactivity]
darkf_ has joined #ocaml
Reshi has joined #ocaml
darkf has quit [Ping timeout: 268 seconds]
silver has joined #ocaml
ggole__ has joined #ocaml
darkf_ is now known as darkf
ggole_ has quit [Ping timeout: 240 seconds]
ril has joined #ocaml
pyon has quit [Quit: Reality is multidimensional. In fact, two-dimensional, to be more precise.]
ril has quit [Ping timeout: 260 seconds]
foocraft has quit [Ping timeout: 244 seconds]
d0nn1e has quit [Ping timeout: 250 seconds]
ggole__ is now known as ggole
kolko has quit [Quit: ZNC - http://znc.in]
mistermetaphor has joined #ocaml
d0nn1e has joined #ocaml
noddy has joined #ocaml
kolko has joined #ocaml
sz0 has joined #ocaml
Haudegen has quit [Ping timeout: 244 seconds]
mistermetaphor has quit [Ping timeout: 244 seconds]
kolko has quit [Ping timeout: 264 seconds]
thomasga has joined #ocaml
thomasga has quit [Client Quit]
thomasga has joined #ocaml
<thomasga> hey, what's the current state of conditional compilation + ppx + oasis?
<thomasga> e.g. if I want to compile some expression only if an oasis flag is enabled?
<thomasga> (I suspect nothing exists)
<companion_cube> sounds difficult :s
matason has joined #ocaml
<thomasga> well I just want the final binary to link with some module if it has been compiled
yegods has joined #ocaml
<thomasga> (and add an option to the command-line arguments in that case)
<thomasga> I guess I'll just use cppo/optcomp if I manage to remember how they work… (and if they are compatible with ppx)
<companion_cube> somewhere I have a dirty hack: a dummy module and the real module, + a symlink to one of them
<companion_cube> at setup, change the symlink
<thomasga> ha that could work
yegods has quit [Remote host closed the connection]
<companion_cube> cppo works with ppx, but not in merlin
<companion_cube> (afaik)
Haudegen has joined #ocaml
kolko has joined #ocaml
<thomasga> is there a built-in command in ocamlbuild pluggins to read the output of a shell command?
<companion_cube> no idea
<thomasga> (eg. I want to add a flag whose contents is `opam config var foo:installed`)
foocraft has joined #ocaml
<adrien> there is
<adrien> you can try git grep 'run.*read'
<adrien> in one of the My* modules
nicholasf has quit [Remote host closed the connection]
nicholasf has joined #ocaml
nicholasf has quit [Remote host closed the connection]
nicholasf has joined #ocaml
butts_butts has joined #ocaml
badon has quit [Disconnected by services]
badon_ has joined #ocaml
badon_ is now known as badon
<thomasga> adrien: thx!
<thomasga> by any chance, you don't have also the runes to access whether a flag has been passed to `./configure`?
<thomasga> inside myocamlbuild.ml
<adrien> which configure? ocaml's?
<adrien> (asking because of the ocamlbuild split)
<thomasga> no the one which is at the root of a project (generated by _oasis)
<thomasga> e.g. I want `./configure —enable-foo` to become `#define foo true` for cppo
<thomasga> so I can conditionally compile some parts of my code
<adrien> I don't know that off-hand: I haven't touched myocamlbuild.ml files much
<thomasga> me netiher, I'd always tried to stay very far for _oasis and myocamlbuild because it's always a pain to do such kind of things :-/
<adrien> (and I would advise HAVE_FOO or something like that like in autoconf land because it makes it clear it's a configure-time choice)
<thomasga> good idea
<Maelan> it seems merlin-vim does not like ctypes 8-(
<Maelan> « :MerlinUse ctypes » then « :e » do not help
<adrien> thomasga: I think this should do it: BaseEnvLight.var_get "ocamlfind" env
<adrien> I'm not sure why it's "Light" btw
<adrien> but I can't find any other trace
<thomasga> where is that module?
<thomasga> ha it's an oasis thing
<adrien> yup, if you want the configure part, you need stuff that gets written into setup.data and they're both oasis stuff
<adrien> but oasis inject the whole code in myocamlbuild.ml so you should be able to access that
adelbertc has quit [Quit: Connection closed for inactivity]
<thomasga> ha great, seems to work
<def`> Maelan: what do you mean by doesn't like?
<thomasga> adrien: thx a lot!
<adrien> :)
nicholasf has quit [Remote host closed the connection]
darkf has quit [Read error: Connection reset by peer]
t4nk610 has joined #ocaml
darkf has joined #ocaml
<Maelan> def`, i mean Syntastic keeps saying « unbound module Ctypes »
dsheets has joined #ocaml
teiresias has quit [Quit: gone]
Kakadu has joined #ocaml
yegods has joined #ocaml
noddy has quit [Ping timeout: 276 seconds]
Vintila has joined #ocaml
yegods has quit [Remote host closed the connection]
<def`> Maelan: something is wrong in your setup maybe, try putting that in .merlin
matason has quit [Ping timeout: 246 seconds]
<flux> what if.. there would be a directive like "import _tags" for .merlin, and if .merlin does not exist, just default to that?-o
<def`> because it is a pain to parse?
<flux> could ocamlbuild itself be used for that part?
<companion_cube> I'd rather have ocamlbuild make a .merlin file
<def`> yes
<def`> if you factor out the library from ocamlbuild, I integrate it to merlin
<flux> well, .merlin is less expressive than _tags, but I guess that would be easier to integrate
noddy has joined #ocaml
<companion_cube> it really should be the job of ocamlbuild (or other build systems)
<companion_cube> merlin does one job, and does it very well, but it should not have to understand _tags, omake, jenga files, etc.
mysiticity has joined #ocaml
Reshi has quit [Ping timeout: 252 seconds]
mistermetaphor has joined #ocaml
larhat1 has joined #ocaml
larhat has quit [Read error: Connection reset by peer]
<Maelan> waaat
<Maelan> i have « module C = Ctypes » in my source file
<Maelan> which gives « unbound module Ctypes »
<Maelan> if i write « CTypes » instead, i do net get an error on that line
<flux> you mean Ctypes vs CTypes?
<Maelan> but i still have errors whenever i use C, e·g· « Unbound type constructor C.typ »
<Maelan> yes flux
<flux> (Ctypes is the correct one)
mistermetaphor has quit [Ping timeout: 276 seconds]
<Maelan> and if i use the C.(…) syntax, i get a brand new error message: « This module is not a structure; it has type (module CTypes) »
<Maelan> i never saw that one ^^
bacam has quit [Quit: reboot]
bacam has joined #ocaml
<Maelan> i know Ctypes is the correct one, but i have no idea what is happening there
<Maelan> CTypes seems unknown from utop
<flux> did you try restarting merlin?-)
dwillems has joined #ocaml
mysiticity has quit [Ping timeout: 244 seconds]
<Maelan> yes, it changes nothing
<Maelan> and « PKG ctypes ctypes.foreign » in .merlin has no apparent effect neither
<dwillems> Hi everyone. Do you think it's better (in terms of visibility, tools, integration with other softwares, etc) to publish a library on forge.ocaml.org or github ? I observed there are some libraries on forge which are not on github, no opam repository, etc. Is there another reason than 'no time' ?
<Maelan> okay, solved it
<Maelan> apparently, naming the file ctypes.ml was not such a good idea
<Maelan> but still, i don’t see exactly why, and the error messages are nonsensical
<thomasga> dwillems: ocaml forge was there before Github, so usually old projects are there (and some of them moved to Github later)
<thomasga> for you code to be visible, I'd recommend putting it on Github though.
<thomasga> s/you/your
<Maelan> and there is still this odd behaviour when changing the case of Ctypes to any of C[tT][yY][pP][eE][sS]
dsheets has quit [Remote host closed the connection]
<thomasga> anyway to inject some tags when other tags are set with ocamlbuild?
<thomasga> (instead of injecting a command, like `flag` does?)
dsheets has joined #ocaml
raxello_ has joined #ocaml
darkf has quit [Quit: Leaving]
noddy has quit [Ping timeout: 268 seconds]
butts_butts has quit [Ping timeout: 268 seconds]
yegods has joined #ocaml
shinnya has joined #ocaml
<thomasga> to answer my own question: I can use `T` to inject tags in the command
thomasga has quit [Quit: Leaving.]
<raxello_> hi all, I have this simple project to start with Ocaml after MOOC courses. https://bitbucket.org/wmyll6/ocaml_starter/src/2b9cacd43e35a47d35f070e552973629cf0c56ca?at=master If somebody uses Merlin in emacs, could you please tell me what can be the potential reason that I cannot see from test module my Classifier from src folder
<raxello_> I managed to get tests running using oasis, but also weird that I need to create artificial `classifierlib` to test code from my executable ...
FreeBirdLjj has joined #ocaml
<flux> raxello_, I suppose when you build it goes into directory _build?
yegods has quit [Remote host closed the connection]
<flux> raxello_, if this is the case, stick B _build into your .merlin
<raxello_> @flux yes
<raxello_> aha! I got it by adding `_build/src`
thomasga has joined #ocaml
<raxello_> @flux thank you! So merlin depends on the built artefact not on the source right ?
dwillems has quit [Ping timeout: 246 seconds]
<flux> raxello_, yes
<flux> raxello_, well I think it works ok within a single file without those, but to find stuff from other files it needs it
<raxello_> cool, understood. I am spoiled by python. Thank you
<raxello_> and what about oasis, if I want to test code from src folder which is Executable, do I need to create a library and add it to dependencies ? Here is my version that I play with (very simple) https://bitbucket.org/wmyll6/ocaml_starter/src/2b9cacd43e35a47d35f070e552973629cf0c56ca/_oasis?at=master&fileviewer=file-view-default
<Leonidas> raxello_: python has merlin?
<raxello_> @Leonidas no it doesn't have merlin, but test runners auto-discover tests for me and depend on source not on build products =)
dsheets has quit [Remote host closed the connection]
<Leonidas> ah, yep, that's true.
jgjl has joined #ocaml
<flux> I don't know much about oasis, but I think that to deal with dependencies the best, making a library of the src first and then using that in your tests would be the way to go (as you seem to be doing)
<raxello_> understood. what do you use to build your projects ? Manually crafted makefile + ocamlbuild ?
<Leonidas> ocamlbuild and sometimes oasis
<flux> basically just ocamlbuild, sometimes a a Makefile that does ocamlbuild mybinary.natiev
<Leonidas> flux: I concur.
<thomasga> does anyone understand how tag resolution work in ocambuild?
<Leonidas> flux: the disadvantage is that you can't test non-public parts but OTOH, it might not be a good idea to start with to test internals
<flux> though Makefile isn't that bad if you make use of OCamlMakefile
picolino has joined #ocaml
<thomasga> especially when does the `T` parameters are resolved (https://github.com/ocaml/ocamlbuild/blob/master/src/signatures.mli#L191-L195)
<thomasga> I managed to inject `package(foo)` flags, but then they don't seem to be resolved properly
<thomasga> (ie. I see them appearing in the _log files, but then the next command-line doesn't use them)
BitPuffin|osx has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
dsheets has joined #ocaml
<flux> it is quite annoying to use gdb on ocaml c bindings when none of the macros work..
<orbitz_> Is Assemblage dead?
<flux> hmm, it was alive at some point? I thought it was some jane street internal stuff.
TheLemonMan has joined #ocaml
nicholasf has joined #ocaml
<orbitz_> Aseemblage seems to be more OcamlLabs-ish, I think
pierpa has joined #ocaml
<orbitz_> thomasga and dbunzli are primary authors, I think.
orbitz_ has quit [Quit: Reconnecting]
<thomasga> not dead, just unfortunately not on top of the TODO list
orbitz has joined #ocaml
<thomasga> daniel is still working on that on the side, I don't
<orbitz> Whoops
<orbitz> thomasga: how come? Did the need for it lessen because of another tool?
raxello_ has quit [Remote host closed the connection]
nicholasf has quit [Ping timeout: 248 seconds]
<thomasga> Unfortunately not (the state of the OCaml build system is still very far from ideal, but still sufficient workarounds exist to carry on). Just other things to worry about nowadays..
dsheets has quit [Remote host closed the connection]
shinnya has quit [Quit: ZNC - http://znc.in]
foocraft has quit [Ping timeout: 248 seconds]
shinnya has joined #ocaml
foocraft has joined #ocaml
dsheets has joined #ocaml
butts_butts has joined #ocaml
<mrvn> "THE OCaml build system"?
yegods has joined #ocaml
<butts_butts> I installed the websocket package using opam (opam install websocket), and am now using Oasis to create a makefile in the project where I want to use websocket.
<thomasga> systemS
<butts_butts> I added websocket as a BuildDepends
<butts_butts> But on running ocaml setup.ml -configure, ocamlfind says it can't find websocket.
<butts_butts> I guess I'm making some small mistake... but what? ocamlfind list does not show websocket in the list.
foocraft has quit [Remote host closed the connection]
yegods has quit [Ping timeout: 276 seconds]
<butts_butts> Ah, this seems to have fixed it: Conan 2015 07 09 The Hunger Games Mockingjay Part 2 720p HDTV x264-CROOKS
<butts_butts> Fooks.
<butts_butts> VM to Win copying fail.
butts_butts has quit [Remote host closed the connection]
<mrvn> no spoilers, haven't watched it yet
yegods has joined #ocaml
shinnya has quit [Ping timeout: 260 seconds]
yegods has quit [Read error: Connection reset by peer]
yegods has joined #ocaml
_ohCamel has joined #ocaml
<_ohCamel> What is the library of Clock.time () that I need to include? It is considered as unbound by my code
thomasga has quit [Quit: Leaving.]
Algebr` has joined #ocaml
mistermetaphor has joined #ocaml
mistermetaphor has quit [Remote host closed the connection]
dwillems has joined #ocaml
<dwillems> thomasga: Is there an organization on github to put project initially on forge.ocaml ? Or it's owners who needs to do it ?
mistermetaphor has joined #ocaml
mort___ has joined #ocaml
<flux> oops, nope ;-)
<_ohCamel> I think it is in mirage-clock library
<flux> funny how there are at least four modules in opam that from their description seem to be doing almost the same thing: posix-clock ptime oclock mtime
<_ohCamel> ya
<flux> at least mtime does something different and comes with js support as well
mort___ has quit [Client Quit]
mistermetaphor has quit [Ping timeout: 252 seconds]
<_ohCamel> by the way, still need to add it to the dependencies of another library, as I would like to modify it
<_ohCamel> It has two opam libararies: -unix and -xen
<_ohCamel> where is the right place to add, is it in .oasis?
noddy has joined #ocaml
Vintila has quit [Ping timeout: 264 seconds]
badon_ has joined #ocaml
badon has quit [Disconnected by services]
badon_ is now known as badon
copy` has joined #ocaml
Algebr` has quit [Ping timeout: 248 seconds]
noddy has quit [Ping timeout: 276 seconds]
_ohCamel has quit [Ping timeout: 250 seconds]
matason has joined #ocaml
atsampson has quit [Ping timeout: 246 seconds]
Sorella has joined #ocaml
t4nk610 has quit [Ping timeout: 250 seconds]
nicoo has quit [Ping timeout: 260 seconds]
t4nk981 has joined #ocaml
pyon has joined #ocaml
nicoo has joined #ocaml
atsampson has joined #ocaml
struk|desk|away is now known as struk|desk
natimic has quit [Ping timeout: 260 seconds]
picolino has quit [Ping timeout: 276 seconds]
matason has quit [Ping timeout: 276 seconds]
dwillems has quit [Ping timeout: 244 seconds]
dsheets has quit [Remote host closed the connection]
dwchandler has joined #ocaml
struk|desk is now known as struk|desk|away
<t4nk981> What functions should I use in Module List to make a readable function for the product of polynomials
<pierpa> you could use this https://github.com/farr/ocaml-poly and save some time
tristero has joined #ocaml
<pierpa> (but check the open issues :)
struk|desk|away is now known as struk|desk
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
nicholasf has joined #ocaml
dhil has joined #ocaml
hydan has quit [Remote host closed the connection]
hydan has joined #ocaml
dsheets has joined #ocaml
sh0t has joined #ocaml
matason has joined #ocaml
nicholasf has quit [Remote host closed the connection]
nicholasf has joined #ocaml
Algebr` has joined #ocaml
struktured has joined #ocaml
tane has quit [Quit: Verlassend]
tane has joined #ocaml
struk|desk is now known as struk|desk|away
nicholasf has quit [Remote host closed the connection]
t4nk981 has quit [Quit: Page closed]
dario1 has joined #ocaml
<dario1> Summoning Drup... Summoning Drup...
<adrien> best way I've found was to complain about CSS
ggole has quit []
<companion_cube> nah, say "I wrote a new web framework"
<adrien> "because ocsigen was too complicated"
<Algebr`> meanies.
<dario1> Perhaps you guys can help me out. Consider the new API for the Tyxml's Html5 module (what will be version 4.0): http://ocsigen.org/tyxml/dev/api/Html5
<dario1> The page lists a small example using the Format module...
<dario1> ...which doesn't seem to typecheck.
<dario1> Am I missing something? (I'm very reluctant to touch the Format module until someone writes a proper tutorial for it)
<companion_cube> :D
<companion_cube> let s = Format.sprintf "%a" (Html5.pp ()) my_svg ← is this what does not typecheck?
<dario1> Yes. I did take a brief look at the Format module (ugh...) and perhaps the example means to use the Format.asprintf function...
<dario1> ...which does have the correct signature.
<Algebr`> +1 to companion_cube's tutorial
<companion_cube> ohhhh
<companion_cube> right
<companion_cube> bad sprintf, bad
<companion_cube> I'm used to my own alias to sprintf
<dario1> It's probably just a typo. I'll open an issue...
john51 has quit [Remote host closed the connection]
john51 has joined #ocaml
<companion_cube> ✔
Haudegen has quit [Ping timeout: 252 seconds]
fraggle_ has quit [Quit: -ENOBRAIN]
dsheets has quit [Remote host closed the connection]
<dario1> Btw, companion_cube's tutorial is nice, but it barely scratches the surface...
dsheets has joined #ocaml
<Algebr`> dario1: maybe you will write part 2
<companion_cube> well, then you need to experiment
<dario1> I didn't even realise that Format was a "thing" until recently...
<dario1> I thought it was just one of those old modules that no one used...
<dario1> It seems to be picking up popularity, though, which is why good docs matter...
<dario1> I hope the RWO folks consider addressing it in an eventual 2nd edition of their book...
struktured has quit [Ping timeout: 268 seconds]
dsheets has quit [Ping timeout: 276 seconds]
fraggle_ has joined #ocaml
<dario1> Note to Drup: I've opened a ticket. See https://github.com/ocsigen/tyxml/issues/113
<companion_cube> (what is critical and missing?)
<companion_cube> (in the tutorial)
mort___ has joined #ocaml
nicholasf has joined #ocaml
<dario1> companion_cube: Better context about the limitations of Format, and why ancillary modules like CCFormat exist.
<dario1> If I've never used Format before, should I be looking seriously into CCFormat, for Fmt?
<dario1> s/for/or/
<companion_cube> fmt is nice if you don't use containers already, I'd say
dsheets has joined #ocaml
<companion_cube> it's one of the Bünzli libs, can't go wrong
<companion_cube> so anyway, it's useful because Format lacks many useful combinators
<dario1> So CCFormat and Fmt occupy the same niche?
tane has quit [Quit: Verlassend]
<companion_cube> I think so, yeah
<companion_cube> useful combinators on top of Format
<companion_cube> but you're right, I should add a word on this
nicholasf has quit [Ping timeout: 248 seconds]
dsheets has quit [Ping timeout: 250 seconds]
<dario1> On a somewhat related note, Containers is an impressive effort. Kudos!
Algebr` has quit [Ping timeout: 260 seconds]
<companion_cube> thanks!
Haudegen has joined #ocaml
dario1 has quit [Quit: Konversation terminated!]
mort___ has quit [Quit: Leaving.]
matason has quit [Ping timeout: 246 seconds]
matason has joined #ocaml
BitPuffin|osx has quit [Ping timeout: 264 seconds]
mort___ has joined #ocaml
mort___ has quit [Quit: Leaving.]
mort___ has joined #ocaml
atsampson has quit [Quit: Rearranging lounge for better speaker placement.;..]
mort___ has quit [Client Quit]
Algebr` has joined #ocaml
Algebr` has quit [Remote host closed the connection]
Algebr` has joined #ocaml
slash^ has quit [Read error: Connection reset by peer]
TheLemonMan has joined #ocaml
picolino has joined #ocaml
Algebr` has quit [Remote host closed the connection]
dwillems has joined #ocaml
mort___ has joined #ocaml
mort___ has quit [Client Quit]
jgjl has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mort___ has joined #ocaml
BitPuffin|osx has joined #ocaml
BitPuffin|osx has quit [Ping timeout: 244 seconds]
yunxing has joined #ocaml
atsampson has joined #ocaml
meteo has quit [Ping timeout: 276 seconds]
<Maelan> so i assume the Real Word OCaml book is no more updated?
dhil has quit [Ping timeout: 246 seconds]
<pierpa> they say they are working on a new edition
<pierpa> *said
<companion_cube> if only they could remove Core :}
<flux> companion_cube, you just need to write your own book.. :)
sh0t has quit [Ping timeout: 250 seconds]
<fds> I heard the new version would be core_kernel only, which *technically* isn't Core. :-)
sh0t has joined #ocaml
<fds> And I look forward to reading companion_cube's book too!
<flux> this is the best way to do c++ with ocaml?! http://stackoverflow.com/a/21745733
<companion_cube> aww, as if I had the time :p
<flux> I guess it would be feasible to make ocamlc support c++ just as it support c, but I wonder if such an enhancement would be approved upstream :)
<companion_cube> it is much harder to support C++, isn't it? non standard ABI, templates, objects, manglibng...
<flux> I don't think there's a lot to support if that approach works
<flux> that is: rename the c++ files to .c, tell compiler they are actually c++, link in stdc++
<flux> maybe the last step would be better if it used the c++ compiler for linking
<companion_cube> ah, just for compiling, assuming the c++ files contain some "extern C" ?
<flux> well, depends what they do, but yes for the case of exposing c++ symbols to ocaml
sh0t has quit [Ping timeout: 268 seconds]
<flux> is there a way to ask the ocaml compiler the switches to use for compiling c files?
<flux> I feel that would be a bit more elegant than faking c++ as c
mort___ has quit [Quit: Leaving.]
<companion_cube> no idea
<flux> that approach might also work with rust..
<companion_cube> oh yeah
A19774941 has quit [Quit: Leaving.]
matason has quit [Ping timeout: 244 seconds]
<flux> I guess it's not polite to require users of C-bindings to need to link in stdc++ though :)
<flux> but I feel it would be quite nicer to deal with value wrappers with the assistance of (ie.) templates..
hydan has quit [Remote host closed the connection]
hydan has joined #ocaml
sh0t has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 260 seconds]
nicholasf has joined #ocaml
sh0t has quit [Ping timeout: 248 seconds]
yegods has quit []
<flux> the most complicated part of the support for c++ would the to choose which extensions to suppotr.. :)
<flux> .cpp, .cxx, .cc, .C, that covers everything, right?
<flux> oh and how could I have forgotten .c++
t4nk268 has joined #ocaml
dwillems has quit [Ping timeout: 240 seconds]
picolino has quit [Ping timeout: 244 seconds]
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
phrst has quit [Ping timeout: 248 seconds]
phrst has joined #ocaml
phrst has quit [Ping timeout: 246 seconds]
phrst has joined #ocaml
cg has joined #ocaml
<cg> is it generally better style to avoid using the "function" keyword, and instead just use "match"? seems to me that "function" reduces readability/clarity since it allows us to omit a parameter name. e.g. `let f foo = match foo with ...` vs. `let f = function ...`
<Drup> cg: what if you don't care about the name ?
<cg> Drup: I guess normally you wouldn't, except the name often provides some extra context, like type info for example
<Drup> when the function is very generic, you don't
<Drup> like walking a list
cg has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
dsheets has joined #ocaml
cg has joined #ocaml
dsheets has quit [Ping timeout: 250 seconds]
nzyuzin has quit [Ping timeout: 244 seconds]
nzyuzin has joined #ocaml
nicholasf has quit [Remote host closed the connection]
t4nk268 has quit [Quit: Page closed]
jok has joined #ocaml
<jok> where can I find the Source code of Module List
sh0t has joined #ocaml
cg has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
cg has joined #ocaml
jok has quit [Quit: Page closed]
yunxing has quit [Remote host closed the connection]
mfp has joined #ocaml
ollehar has joined #ocaml
<ollehar> in
<ollehar> let f l =
<ollehar> let a = List.nth l 0 in
<ollehar> let b = a + 1 in
<ollehar> b
<ollehar> what type does a have? 'a list?
<ollehar> no, I mean `l`, what type does `l` have at row 2.
<ollehar> at line 2
<ollehar> ach
yunxing has joined #ocaml
<pierpa> int list
cg has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
<ollehar> pierpa: sure, but it can't be inferred as int list until line 3, right?
<ollehar> so it has to have an intermediate step.
<pierpa> the type checker does not work on lines
<ollehar> so, scopes?
<pierpa> there is only one variable named l, and its type is constrained to be int list by everything
<ollehar> but first it has to be 'a list?
<pierpa> I don't think this makes any sense
<ollehar> hm
<pierpa> if you want to know the details of the Hindley-Milner type reconstruction algorithm, there tutorial on the net
<ollehar> sure
<pierpa> *there are
<ollehar> I'm working on it.
<ollehar> but in my language there are statements that come after each other.
t4nk964 has joined #ocaml
<ollehar> so I would have
<ollehar> fn l {
<pierpa> think about it like simultaneous equations
<ollehar> fn l {
<ollehar> a = l[0] // statement
<ollehar> b = a + 1
<ollehar> return b
<ollehar> }
<ollehar> hm
<ollehar> depends on how the ast is built up.
<ollehar> if line 3 is subtree of line 2, it's easy to go recursively.
<ollehar> I can't do that since I have a list of statements.
<ollehar> so I have to use refs.
<pierpa> does it ring any bell if I say "unification" ?
<ollehar> only that I have such a function in my code I stole from another code base.
<ollehar> unify
<pierpa> :)
nore has quit [Ping timeout: 264 seconds]
<ollehar> pierpa: you think it would be better if I treat the lines as subtrees of each other instead of list of statments?
<pierpa> AFAIU, this shouldn't be important
<ollehar> ok
<pierpa> if you are unsure about HM, try starting with explicitly supplied types?
<pierpa> later you may eliminate them
<ollehar> pierpa: maybe...
<pierpa> in this mooc the topic is explained and there is homework about this https://www.coursera.org/course/proglang
Anarchos has joined #ocaml
<ollehar> I will have a deeper look at the code I took code from. thanks! and good night.
<pierpa> I don't know if the lessons are available without enrolling, and don't know if you can enroll now, though... :(
<pierpa> 'night
ollehar has quit [Quit: ollehar]
Cypi has quit [Ping timeout: 244 seconds]
<aggelos_> hmm
<aggelos_> is there some program that keeps shuffling some Result.t and Lwt.t to look at for best practices?
ollehar has joined #ocaml
Cypi has joined #ocaml
darkf has joined #ocaml
nore has joined #ocaml
<ollehar> uh, can ocaml dump its ast easily? (without dumpast opam package)
dsheets has joined #ocaml
<pierpa> ollehar, try ocamlc -help
Simn has quit [Quit: Leaving]
dsheets has quit [Ping timeout: 250 seconds]
nore is now known as athelio
athelio is now known as nore
<ollehar> pierpa: thanks
<pierpa> yw
<sspi> I had a question related to Irmin - how easy would it be to use your own types for a store? I've tried to look for examples but most seem to use Irmin.Contents.String.
d0nn1e has quit [Ping timeout: 268 seconds]
nicholasf has joined #ocaml
d0nn1e has joined #ocaml
nicholasf has quit [Remote host closed the connection]
nicholasf has joined #ocaml
<ollehar> pierpa: statements actually form a tree
<ollehar> but not at lambda level
<ollehar> but as parse tree.
<ollehar> have to sleep be
<ollehar> bye
ollehar has quit [Quit: ollehar]
<pierpa> ok, but this shouldn't make any difference wrt how you proceed to type programs
<pierpa> oops. gone.
yunxing has quit [Remote host closed the connection]
Ravana has quit [Ping timeout: 244 seconds]
Ravana has joined #ocaml
dsheets has joined #ocaml
nore has quit [Quit: WeeChat 0.3.7]
madroach has quit [Ping timeout: 244 seconds]
madroach has joined #ocaml
dsheets has quit [Ping timeout: 264 seconds]
ril has joined #ocaml
nore has joined #ocaml