adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.03.0 announced http://ocaml.org/releases/4.03.html | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
nicholasf has joined #ocaml
nicholasf has quit [Remote host closed the connection]
wolfcore has joined #ocaml
nicholasf has joined #ocaml
kakadu has quit [Remote host closed the connection]
spip has joined #ocaml
spip has left #ocaml ["Konversation terminated!"]
ollehar has joined #ocaml
nicholasf has quit [Remote host closed the connection]
nicholasf has joined #ocaml
Algebr` has quit [Ping timeout: 250 seconds]
ollehar has quit [Ping timeout: 264 seconds]
SilverKey has joined #ocaml
agarwal1975 has quit [Quit: agarwal1975]
wolfcore has quit [Ping timeout: 244 seconds]
SilverKey has quit [Quit: Halted.]
wolfcore has joined #ocaml
gadster has quit [Ping timeout: 260 seconds]
struk|desk2 has joined #ocaml
struk|desk has quit [Ping timeout: 240 seconds]
dexterph has quit [Ping timeout: 252 seconds]
ygrek has quit [Ping timeout: 250 seconds]
sh0t has joined #ocaml
rand__ has quit [Quit: leaving]
pierpa has quit [Ping timeout: 258 seconds]
johnelse has joined #ocaml
johnelse has quit [Ping timeout: 258 seconds]
nicholasf has quit [Remote host closed the connection]
SilverKey has joined #ocaml
sh0t has quit [Ping timeout: 260 seconds]
copy` has quit [Quit: Connection closed for inactivity]
sh0t has joined #ocaml
fraggle_ has quit [Ping timeout: 260 seconds]
sh0t has quit [Ping timeout: 250 seconds]
fraggle_ has joined #ocaml
shinnya has quit [Ping timeout: 244 seconds]
shum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
rgrinberg has quit [Ping timeout: 240 seconds]
unbalancedparen has quit [Quit: WeeChat 1.5]
johnelse has joined #ocaml
johnelse has quit [Ping timeout: 244 seconds]
nicholasf has joined #ocaml
darkf has joined #ocaml
slash^ has joined #ocaml
tmtwd has quit [Ping timeout: 240 seconds]
ollehar has joined #ocaml
Simn has joined #ocaml
ggole has joined #ocaml
zpe has joined #ocaml
zpe has quit [Ping timeout: 250 seconds]
MercurialAlchemi has joined #ocaml
shinnya has joined #ocaml
tmtwd has joined #ocaml
johnelse has joined #ocaml
johnelse has quit [Ping timeout: 260 seconds]
fluter has quit [Ping timeout: 260 seconds]
dhil has joined #ocaml
fluter has joined #ocaml
zpe has joined #ocaml
nicholasf has quit [Remote host closed the connection]
shinnya has quit [Ping timeout: 250 seconds]
dexterph has joined #ocaml
tmtwd has quit [Ping timeout: 276 seconds]
fluter has quit [Ping timeout: 260 seconds]
fluter has joined #ocaml
manizzle has joined #ocaml
<jstolarek> I am reading RWO and I just encountered In_channel.fold_lines
<jstolarek> I'd like to find the documentation for that function
<jstolarek> the question is where is the OCaml library documentation and how do I search it?
<jstolarek> this looks like containing the library documentation
<jstolarek> but I see no way of searching it
<ollehar> need to update: http://ocsigen.org/js_of_ocaml/manual/
<ollehar> -pretty should be --pretty
nicholasf has joined #ocaml
nicholasf has quit [Ping timeout: 252 seconds]
ggole_ has joined #ocaml
ggole has quit [Ping timeout: 250 seconds]
<companion_cube> jstolarek: RWO is based on `core`, an alternative standard library
<companion_cube> there is no `In_channel.fold_lines` in the standard library
johnelse has joined #ocaml
johnelse has quit [Ping timeout: 260 seconds]
silver has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
diphuser 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
zpe has quit [Remote host closed the connection]
Simn has quit [Ping timeout: 260 seconds]
Orion3k has quit [Quit: Leaving]
<jstolarek> companion_cube: thanks. But my question stands: how do I search the standard library?
<jstolarek> I mean the documentation of the standard library
<companion_cube> list of modules and their doc
<jstolarek> This assumes that I know in which module to look
<companion_cube> ah, well
<jstolarek> what if I only have a function name?
<companion_cube> meaning you'd have `open` somewhere?
<jstolarek> well, yes (I think)
<companion_cube> you might try https://ocamloscope.herokuapp.com/
<jstolarek> I am trying to figure out whethere there is an Ocaml equivalent of Hoogle, Hayoo or Hackage
<jstolarek> yup, that's what I was looking for
<companion_cube> not really, sadly
<companion_cube> it's very incomplet
<companion_cube> e
<jstolarek> still better than looking through the docs manually
<jstolarek> will do for starters
zpe has joined #ocaml
zpe has quit [Ping timeout: 240 seconds]
<jstolarek> what is the meaning of "module Foo = struct ... end" construct?
<jstolarek> I know that with "module type Bar = sig ... end" I can create an abstract module signature
<jstolarek> "module Foo = struct..." seems to create a concrete module implementation, but what is it's usefulness without the abstract signature?
<ollehar> jstolarek: signature will be implicit. usefullness is namespace, I guess.
<ollehar> and you can send it to functors.
<ollehar> or first-class modules.
<ollehar> compare with the Set.Make functor.
<ggole_> jstolarek: namespacing, and the creation of a module value that can be refined with a signature, passed to a functor, etc
<_y> jstolarek, plus, its signature can be specified in the .mli file associated to your .ml file (just like the type of a value in your .ml can be specified in your .mli and left implicit in your .ml)
<ggole_> It can also be useful to create a module and dump a bunch of stuff in it with include
sdothum has joined #ocaml
copy` has joined #ocaml
* jstolarek has not yet learned about functors
ubertaco has joined #ocaml
<ubertaco> Hello again!
<ubertaco> Mostly for the learning exercise, I sent that PR for the String.of/to_char_list methods. It got rejected, as folks in here predicted. Ah well, I learned a thing.
zpe has joined #ocaml
<Drup> ubertaco: it wasn't rejected, someone who is not from the core team said he didn't find it a good idea ;)
<ubertaco> oh
<companion_cube> but it will still probably not be merged
<Drup> (tbf, it would probably be rejected anyway, it's not a great idea ^^')
<ubertaco> yeah, I didn't know I was re-adding a function that had previously been dropped. Whoops.
<Drup> regardless of the fact that it was droped, "string as char lists" is a known anti-pattern that should be avoided
<ubertaco> Ah, this sounds like a good learning opportunity
<ubertaco> why's it an anti-pattern?
<Drup> it's ridiculously inefficient.
<ubertaco> space-inefficient, time-inefficient...?
<Drup> (and most of the time, there is another way to do the job that doesn't involve lists ... like a for loop)
<Drup> Both :D
<ubertaco> oh. Huh.
zpe has quit [Ping timeout: 240 seconds]
<ubertaco> Good to know
<ubertaco> I'm guessing space inefficiency is because lists (of any sort) occupy more space in-memory than strings do
ontologiae_ has joined #ocaml
nicholasf has joined #ocaml
Simn has joined #ocaml
nicholasf has quit [Ping timeout: 240 seconds]
<Drup> There is a handy new function to answer size questions in the next version of OCaml
nicholasf has joined #ocaml
<ubertaco> Oh wow, that's a *huge* difference
<Drup> Yes.
<companion_cube> :D
<Drup> a char in a string is 1/8th of a word, a char in a list is 3 words (block header, the char, pointer to the rest of the list)
<ubertaco> Ahh...that makes sense
<ubertaco> thanks for explaining it to me, even though it sounds like it's pretty basic knowledge
<Drup> I wouldn't say it's basic knowledge
<ubertaco> I'm generally kinda bad at reasoning about space/time complexity sometimes; a side effect of growing up with Java and never really writing any C
silver has quit [Read error: Connection reset by peer]
<mrvn> writing a quick parser is so much simpler with char lists than with strings though.
<mrvn> WOuld be nice to have a pattern matchable enumeration over a string in stdlib.
<ubertaco> mrvn: yeah, that was my major motivation for the to/of_char_list fns; I was writing toy parsers and kept wanting to pattern-match on a string in recursive functions (the = function | [] -> something | next::rest -> somethingelse kind)
<Drup> mrvn: like, hum, sedlex *cough* ?
<Drup> (or ocamllex, for that matter)
<mrvn> too complex
<companion_cube> like iterators?
<companion_cube> oh wait
<ubertaco> having never heard of sedlex, man that looks pretty cool
<mrvn> never heart of sedlex either
dhil has quit [Ping timeout: 240 seconds]
<mrvn> Error: Unbound module Sedlex
dhil has joined #ocaml
<Drup> companion_cube: sedlex does use iterators :3
<ubertaco> mrvn: looks like a third-party lib instead of a builtin: https://github.com/alainfrisch/sedlex
MercurialAlchemi has quit [Ping timeout: 244 seconds]
slash^ has quit [Read error: Connection reset by peer]
ubertaco has quit [Quit: Page closed]
nicholasf has quit [Remote host closed the connection]
nicholasf has joined #ocaml
agarwal1975 has joined #ocaml
zpe has joined #ocaml
cthuluh has joined #ocaml
zpe has quit [Ping timeout: 240 seconds]
rgrinberg has joined #ocaml
dhil has quit [Ping timeout: 276 seconds]
nicholasf has quit [Remote host closed the connection]
nicholasf has joined #ocaml
ontologiae_ has quit [Ping timeout: 244 seconds]
orbifx1 has joined #ocaml
diphuser has quit [Ping timeout: 264 seconds]
orbifx1 has quit [Ping timeout: 264 seconds]
shinnya has joined #ocaml
<copy`> Are values captured in utop? (like when I run `[1;2;3];;` can I access the list somehow)
johnelse has joined #ocaml
<copy`> Oh, there's an open issue for that
LiamGoodacre has joined #ocaml
SpiceGuid has joined #ocaml
johnelse has quit [Ping timeout: 240 seconds]
diphuser has joined #ocaml
<LiamGoodacre> Hi I'm currently reading this https://blogs.janestreet.com/introducing-incremental/ - I currently don't have any experience with OCaml; what do `~f` and `~f:(+.)` mean? I'm guessing that the `(+.)` bit means the addition function for floating point numbers?
<rgrinberg> LiamGoodacre: you're right about `(+.)`. `~f` is just supplying a lablled argument `f` to a function.
<rgrinberg> `~f` is usually reserved for functions, but it's just a convention
<rgrinberg> e.g. try : let add ~x ~y = x + y in add ~x:100 ~y:200
SpiceGuid has quit [Quit: ChatZilla 0.9.92 [SeaMonkey 2.40/20160120202951]]
<LiamGoodacre> oh interesting, thanks for your help :)
nicholasf has quit [Remote host closed the connection]
wtetzner_ has joined #ocaml
<LiamGoodacre> rgrinberg what does it mean if the `:expr` part is missed off during function application? Does it "pun" the argument label with a variable in scope?
<ggole_> Yep
diphuser has quit [Ping timeout: 260 seconds]
ggole_ is now known as ggole
<LiamGoodacre> ggole awesome, thanks
SpiceGuid has joined #ocaml
tane has joined #ocaml
zpe has joined #ocaml
zpe has quit [Ping timeout: 276 seconds]
SilverKey has quit [Quit: Halted.]
SilverKey has joined #ocaml
diphuser has joined #ocaml
SilverKey has quit [Quit: Halted.]
wtetzner_ has quit [Remote host closed the connection]
SilverKey has joined #ocaml
SilverKey has quit [Client Quit]
tane has quit [Quit: Leaving]
nicholasf has joined #ocaml
nicholasf has quit [Ping timeout: 244 seconds]
SpiceGuid has quit [Quit: ChatZilla 0.9.92 [SeaMonkey 2.40/20160120202951]]
gustav___ has quit [Quit: leaving]
rgrinberg has quit [Ping timeout: 276 seconds]
<ollehar> maybe use stackoverflows new document feature to add some js_of_ocaml examples?
johnelse has joined #ocaml
andy__ has joined #ocaml
johnelse has quit [Ping timeout: 244 seconds]
fraggle_ has quit [Remote host closed the connection]
shinnya has quit [Ping timeout: 240 seconds]
rgrinberg has joined #ocaml
fraggle_ has joined #ocaml
copy` has quit [Quit: Connection closed for inactivity]
lol-icon has quit [Ping timeout: 240 seconds]
<flux> given an Lwt_stream with an on_termination handler, is it possible to arrange the on_termination handler to be called without reading the whole stream though?
<flux> in other words, is there a way to explicitly close an Lwt_stream.t?
slash^ has joined #ocaml
<flux> let's say I open a gigabyte file and provide an Lwt_stream.t for it, and I would wish to close the fd once the Lwt_stream has been consumed (naturally using Lwt_stream.on_termination), while allowing the consumer of the stream to stop early..
tane has joined #ocaml
wtetzner has joined #ocaml
wtetzner has quit [Remote host closed the connection]
unbalancedparen has joined #ocaml
shinnya has joined #ocaml
pyon has joined #ocaml
<companion_cube> that's a design issue, I think
<companion_cube> resource management is hard
andy__ has quit [Ping timeout: 276 seconds]
<mrvn> Gc.finalise?
<flux> nooo, I told you the last time, Gc is suitable only for memory-only-resources :)
nicholasf has joined #ocaml
<flux> I don't want a system where my 1024 fds can be eaten up by a malicios client in 0.01 seconds
<mrvn> it lets you close the file when the stream gets reaped
<flux> nor do I want to call Gc.major every time I open an fd
<flux> I suppose I could call Gc.major only when the server creation throws an exception and it would work (except at very high performance cost), but that would be ugly
nicholasf has quit [Remote host closed the connection]
<mrvn> flux: the runtime should really do that internally.
<flux> well, it still works only for fds
<companion_cube> +1 flux, the GC is bad for IO resources
<flux> what if you have an expensive external resource?
<flux> let's say I have X bitmaps
<mrvn> flux: then you make the cost for the resource tracking it high
<flux> I will never see the memory runs out, but I do see gigabytes of memory allocated to the X server
<flux> mrvn, and when do I rn Gc.major? I'm not going to get an exeption before the X server dies
<mrvn> and nothing stops you from having a close function that releases the bitmap when you call it. The Gc is just a safety in case you forget.
<flux> exactly, and that's how Gc.finalize should be used on resources
<flux> except it should complain loudly when it happens
pyon is now known as lol-icon
<mrvn> flux: I agree there
<companion_cube> I think there's a warning now
<companion_cube> if the GC collects a non closed fd
<mrvn> companion_cube: no. FDs are just ints
<mrvn> currently under unixes the FD just leaks.
<companion_cube> channels
<companion_cube> I meant channels
<mrvn> other than stdin/out/err I've actually never used channels.
<ggole> I think you can probably do OK if you design a system to support GCing resources. Oberon had GCable files, for example.
<ggole> You could use some of the same tricks you use for memory: run a GC once you allocate a certain number or run out
<companion_cube> mrvn: how do you read files?
<ggole> Doesn't really work for things like X or a DB that aren't designed for that though
<companion_cube> ggole: so when it reaches the max number of FDs it tries to collect?
<ggole> I don't think it had a max number of FDs
<companion_cube> every unix has a max number of FDs
MercurialAlchemi has joined #ocaml
<ggole> Oberon was not a Unix.
<companion_cube> that's like my n°1 error on Lwt
<companion_cube> ah... thought it was a language :D
<ggole> It was both, really
<mrvn> companion_cube: Unix.
<companion_cube> mrvn: but why?
rgrinberg has quit [Ping timeout: 244 seconds]
<companion_cube> I mean, in some cases it's justified, but if you just want to simply read a file, it's simpler with channels
<mrvn> you run it every so many allocations just like for memory.
<mrvn> companion_cube: because when I have a trivial case I just pipe the file to stdin.
<mrvn> no reason really. just never had the use case.
<companion_cube> even for reading from stdin, it's easier with channels
<mrvn> as said, I've used stdin
<companion_cube> oh ok, you still use the stdin channel
<companion_cube> how weird
<mrvn> just never opened my own channel. so can't say what they do on close or not close.
pierpa has joined #ocaml
andy__ has joined #ocaml
cthuluh has quit [Quit: leaving]
cthuluh has joined #ocaml
ollehar has quit [Ping timeout: 264 seconds]
rgrinberg has joined #ocaml
darkf has quit [Quit: Leaving]
ygrek has joined #ocaml
nicholasf has joined #ocaml
nicholasf has quit [Ping timeout: 276 seconds]
andy__ has quit [Quit: Leaving]
test123 has joined #ocaml
test123 has quit [Client Quit]
SilverKey has joined #ocaml
wtetzner has joined #ocaml
SilverKey has quit [Remote host closed the connection]
andy__ has joined #ocaml
andy__ has left #ocaml [#ocaml]
yofu has joined #ocaml
<yofu> Could someone point me to a sample project that uses 'ocamldep' to find dependencies in a `src` directory and builds to a `build` directory?
<yofu> I am trying to use the example in http://caml.inria.fr/pub/docs/manual-ocaml/depend.html but it just creates an empty `.depend`.
<adrien> OCamlMakefile maybe
<adrien> but what do you want that for actually?
ollehar has joined #ocaml
<yofu> What specifically? The separate `src` and `build`?
adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | Upcoming OCaml MOOC: https://huit.re/ocamlmooc | OCaml 4.03.0 release notes: http://ocaml.org/releases/4.03.html | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
sh0t has joined #ocaml
shinnya has quit [Ping timeout: 244 seconds]
diphuser has quit [Ping timeout: 260 seconds]
ygrek has quit [Ping timeout: 244 seconds]
slash^ has quit [Read error: Connection reset by peer]
nicholasf has joined #ocaml
johnelse has joined #ocaml
nicholasf has quit [Remote host closed the connection]
agarwal1975 has quit [Ping timeout: 258 seconds]
nicholasf has joined #ocaml
<yofu> I'm trying out the example in http://l-lang.org/blog/Incorporating-C-code-in-an-Ocaml-project-using-Ocamlbuild/ and it works for the exact example code given, but I get problems when trying to move code into a `src` directory.
johnelse has quit [Ping timeout: 276 seconds]
<yofu> Specifically, I just move the files to `src` and add `-I src` to the ocamlbuild calls and change toto_c.o in _tags to src/toto_c.o, and get the error, "The external function `toto' is not available".
Orion3k has joined #ocaml
ygrek has joined #ocaml
zpe has joined #ocaml
zpe has quit [Ping timeout: 240 seconds]
Algebr` has joined #ocaml
yofu has quit [Quit: Leaving]
raphaelss has joined #ocaml
raphaelss has quit [Remote host closed the connection]
Algebr` has quit [Ping timeout: 240 seconds]
nicholas_ has joined #ocaml
nicholasf has quit [Ping timeout: 276 seconds]
silver has joined #ocaml
sh0t has quit [Remote host closed the connection]
axiles has quit [Quit: Quitte]
jackweirdy has joined #ocaml
Simn has quit [Quit: Leaving]
MercurialAlchemi has quit [Ping timeout: 260 seconds]
ggole has quit []
shinnya has joined #ocaml
rgrinberg has quit [Ping timeout: 276 seconds]
nicholasf has joined #ocaml
nicholas_ has quit [Ping timeout: 264 seconds]
nicholasf has quit [Read error: Connection reset by peer]
jackweirdy has quit [Quit: Textual IRC Client: www.textualapp.com]
nicholasf has joined #ocaml
wtetzner has quit [Remote host closed the connection]
orbifx1 has joined #ocaml
LiamGoodacre has quit [Ping timeout: 258 seconds]
johnelse has joined #ocaml
nicholasf has quit [Ping timeout: 250 seconds]
nicholasf has joined #ocaml
johnelse has quit [Ping timeout: 276 seconds]
tane has quit [Quit: Leaving]
nicholas_ has joined #ocaml
LiamGoodacre has joined #ocaml
nicholasf has quit [Ping timeout: 240 seconds]
Denommus has joined #ocaml
kakadu has joined #ocaml
SilverKey has joined #ocaml
agarwal1975 has joined #ocaml
dexterph has quit [Ping timeout: 260 seconds]
nicholas_ has quit [Read error: Connection reset by peer]
nicholasf has joined #ocaml
zpe has joined #ocaml
zpe has quit [Ping timeout: 244 seconds]
rgrinberg has joined #ocaml
orbifx1 has quit [Ping timeout: 244 seconds]
<ollehar> any comments about f*?
<Drup> it's cool :3
rgrinberg has quit [Ping timeout: 276 seconds]
<ollehar> yeah, looks good. both refinement types and effects. \o/
<ollehar> you know if it can interact with ocaml code?
Algebr` has joined #ocaml
<ollehar> import, export, ...
Denommus has quit [Remote host closed the connection]
<Drup> not as far as I know
<ollehar> ok