gildor changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.12.1 http://bit.ly/nNVIVH
Drup has quit [Quit: Leaving.]
KDr2 has joined #ocaml
Tobu has quit [Remote host closed the connection]
Tobu has joined #ocaml
Xizor has quit []
iago has joined #ocaml
otk has quit [Ping timeout: 248 seconds]
iago has quit [Quit: Leaving]
otk has joined #ocaml
andreypopp has quit [Quit: Computer has gone to sleep.]
emmanuelux has quit [Ping timeout: 245 seconds]
<pippijn> does oasis support ocamlyacc?
<pippijn> I suppose it does, via ocamlbuild
<pippijn> better question: does oasis support custom build steps?
andreypopp has joined #ocaml
<pippijn> or ocamlbuild?
<thelema_> yes, the auto-generated ocamlbuild can be easily extended
andreypopp has quit [Quit: Computer has gone to sleep.]
twittard has quit [Quit: twittard]
<pippijn> thelema_: where can I find examples of custom build steps?
<pippijn> I have a .mly to be generated from a .mly.in
<thelema_> one sec
Tobu has quit [Ping timeout: 260 seconds]
otk has quit [Quit: leaving]
Tobu has joined #ocaml
cdidd has quit [Remote host closed the connection]
Tobu has quit [Ping timeout: 272 seconds]
Tobu has joined #ocaml
andreypopp has joined #ocaml
MaskRay has joined #ocaml
MaskRay has quit [Changing host]
MaskRay has joined #ocaml
hsuh has quit [Remote host closed the connection]
hsuh has joined #ocaml
Tobu has quit [Ping timeout: 260 seconds]
philtor has joined #ocaml
MaskRay has quit [Remote host closed the connection]
ulfdoz has joined #ocaml
Tobu has joined #ocaml
philtor has quit [Ping timeout: 260 seconds]
othiym23 has quit [Excess Flood]
othiym23 has joined #ocaml
emmanuelux has joined #ocaml
ulfdoz has quit [Ping timeout: 246 seconds]
Tobu has quit [Ping timeout: 260 seconds]
andreypopp has quit [Quit: Computer has gone to sleep.]
Tobu has joined #ocaml
dsheets has quit [Ping timeout: 244 seconds]
dsheets has joined #ocaml
emmanuelux has quit [Ping timeout: 245 seconds]
dsheets has quit [Ping timeout: 250 seconds]
twittard has joined #ocaml
dsheets has joined #ocaml
zzz_` has quit [Remote host closed the connection]
zzz_ has joined #ocaml
tomprince has quit [Ping timeout: 244 seconds]
milosn has quit [Ping timeout: 240 seconds]
twittard_ has joined #ocaml
lorilan[dodo] has quit [Ping timeout: 244 seconds]
ousado has quit [Ping timeout: 244 seconds]
hcarty has quit [Ping timeout: 244 seconds]
Derander_ has quit [Ping timeout: 244 seconds]
g0dmoney- has quit [Ping timeout: 240 seconds]
ousado_ has joined #ocaml
hcarty has joined #ocaml
wagle has quit [Ping timeout: 244 seconds]
Obfuscate has quit [Ping timeout: 244 seconds]
rixed has quit [Ping timeout: 240 seconds]
wagle has joined #ocaml
Derander has joined #ocaml
lorilan[dodo] has joined #ocaml
twittard has quit [Ping timeout: 244 seconds]
twittard_ is now known as twittard
g0dmoney- has joined #ocaml
rixed has joined #ocaml
milosn has joined #ocaml
tomprince has joined #ocaml
Obfuscate has joined #ocaml
<adrien> hi
pango is now known as pangoafk
probst has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
_KDr2_ has joined #ocaml
KDr2 has quit [Ping timeout: 244 seconds]
ski has quit [Ping timeout: 244 seconds]
ski has joined #ocaml
emmanuelux has joined #ocaml
ftrvxmtrx has joined #ocaml
cago has joined #ocaml
sgnb` has joined #ocaml
sgnb` is now known as sgnb
Cyanure has joined #ocaml
edwin has joined #ocaml
djcoin has joined #ocaml
<bobry> anyone tried building the latest OASIS?
<bobry> I have some weird 'OCamlDarcsPrecommit' error <_<
<djcoin> Darcs :<
<Ptival> djcoin: haters gonna hate? :D
<djcoin> :) I don't know Darcs so I can really hate
<djcoin> Yet, I guess OCaml should use more popular tools.
<adrien> darcs issue is that it lives in its own small world
<djcoin> True. Never heard of it before
<djcoin> Yet one more specific thing
<djcoin> I would recommend Git :b
<adrien> well, it's not specific to oasis but some things it does don't integrate very well with other well-established tools
<adrien> (patch format!!!!!!!!!!!)
<Ptival> djcoin: darcs is (unsurprisingly...) famous in the Haskell bubble
<djcoin> lol, i just ran into the sourec
<djcoin> source. It is in Haskell isn't it ?
<djcoin> As Mercurial is famous in Python's world
<djcoin> It's not a good reason at all
<ousado_> does darcs come with libraries (unlike git)?
<djcoin> Unless you plan to extend your DVCS on a daily basis
albacker has joined #ocaml
<ousado_> yes it does
<ousado_> well, that's a big advantage over git
<djcoin> Not realyl
<djcoin> really
<djcoin> Mercurial is extensible
<ousado_> not really what?
ousado_ is now known as ousado
<djcoin> But it just look like those plugin does not integrate well in the dvcs.
ousado has quit [Changing host]
ousado has joined #ocaml
<djcoin> And basically, you do not need much extensibility for a dvcs. There are a few things that must done in the right way
<_habnabit> mercurial is terrible
<ousado> if you want to write a plugin for an IDE or something like that, a sane API is a pretty nice thing
<flux> darcs is actually quite nice and different from the rest of the DVCSs though, with its own set of problems :)
<djcoin> Maybe Darcs is awesome, but from my point of view, it is just one more thing to learn to access the elitist world of ocaml
<ousado> there's a reason why e.g. libgit2 isn't based on git
<f[x]> darcs if f*cking slow. make the world a better place and throw it away - that simple
<f[x]> yet all this doesn't answer the OPs question :)
<djcoin> lol :)
<djcoin> I don't darcs, but Git is damn fast, that's for sure
<djcoin> know *
Ptival has quit [Read error: Connection reset by peer]
albacker has quit [Quit: .]
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
Ptival has joined #ocaml
Ptival has quit [Client Quit]
Ptival has joined #ocaml
emmanuelux has quit [Read error: Connection reset by peer]
Ptival has quit [Client Quit]
Ptival has joined #ocaml
foocraft has quit [Ping timeout: 244 seconds]
foocraft has joined #ocaml
rjohnson has quit [Ping timeout: 244 seconds]
rjohnson has joined #ocaml
MaskRay has joined #ocaml
MaskRay has quit [Changing host]
MaskRay has joined #ocaml
_KDr2_ has quit [Remote host closed the connection]
rby_ has joined #ocaml
zzz_ has quit [*.net *.split]
bzzbzz has quit [*.net *.split]
joewilliams has quit [*.net *.split]
rby has quit [*.net *.split]
iZsh has quit [*.net *.split]
zzz_ has joined #ocaml
bzzbzz has joined #ocaml
joewilliams has joined #ocaml
iZsh has joined #ocaml
<bobry> 'elitist world of ocaml', seriously? :)
avsm has quit [Quit: Leaving.]
<djcoin> :)
redfire has joined #ocaml
redfire has quit [Client Quit]
redfire has joined #ocaml
redfire has quit [Client Quit]
_andre has joined #ocaml
avsm has joined #ocaml
KDr2 has joined #ocaml
MaskRay has quit [Remote host closed the connection]
letrec has joined #ocaml
emmanuelux has joined #ocaml
<probst> I am getting a "Parse error: currified constructor", but cannot understand why… here is the code where it is generated. https://gist.github.com/97e3a939f8c036012757 Any ideas? Thanks in advance
iago has joined #ocaml
emmanuelux has quit [Remote host closed the connection]
<iZsh> probst: are you using the revised syntax?
emmanuelux has joined #ocaml
<probst> iZsh: sorry, but I am not sure what revised syntax is?
<probst> iZsh: I am running ocaml 3.12.1
<mrvn> That code looks correct but sounds like it wants "Response result i"
<mrvn> how do you call ocaml to get that error?
<probst> mrvn: and that is the strange thing. There is no other curried function with the same name, nor any conflicting type, as far as I can tell
<probst> mrvn: ocamlbuild
<mrvn> and how does that call ocaml?
<probst> mrvn: the full string is '/usr/local/bin/ocamlbuild lib/signpost.cma lib/signpost.cmxa lib/signpost.a lib/client.native lib/server.native -tag debug'
<probst> mrvn: hang on
emmanuelux has quit [Remote host closed the connection]
<probst> mrvn: sorry, don't really know. I am using oasis with ocamlbuild
<probst> mrvn: and doing a make
<probst> not sure how ocaml gets invoked here
<probst> mrvn: can of course do "ocaml setup.ml -build", but that problaly isn't what you mean
jamii has joined #ocaml
<mrvn> The question is wether you haver some camlp4 extension or extra flags that screw with the syntax
<probst> mrvn: I am using the lwt syntax extensions
<probst> mrvn: and more generally: <lib/*.ml{,i}>: syntax_camlp4o
<probst> <lib/*.ml{,i}>: pkg_lwt.syntax
<probst> <lib/tactics/*.ml{,i}>: pkg_lwt.syntax
<probst> true: annot
emmanuelux has joined #ocaml
<probst> mrvn: sorry, have to run for a meeting. I'll debug more later. Thanks for all the input!
<f[x]> probst, ocamlbuild file.pp.ml to see what camlp4 generates
emmanuelux has quit [Remote host closed the connection]
emmanuelux has joined #ocaml
KDr2 has quit [Remote host closed the connection]
cdidd has joined #ocaml
KDr2 has joined #ocaml
KDr2 has quit [Remote host closed the connection]
thomasga has joined #ocaml
iago has quit [Ping timeout: 252 seconds]
KDr2 has joined #ocaml
avsm has quit [Quit: Leaving.]
avsm has joined #ocaml
tonyg has joined #ocaml
<tonyg> Hi all. Anyone know a sensible way of pushing stuff to the browser from ocaml? For instance websockets or similar less bleeding-edge ideas, perhaps.
<mrvn> Mirage has a http module afaiks.
Tobu has quit [Ping timeout: 260 seconds]
EmmanuelOga has joined #ocaml
<flux> tonyg, are you aware of ocsigen?
<flux> they used to have a collaborative drawing program as a demo on their pages
<tonyg> mrvn, flux: thanks! flux, yes I've briefly looked at ocsigen
<tonyg> I shall dig further into it. Thanks for the pointer.
<avsm> ocsigen is definitely what you want there (Eliom in particular)
iago has joined #ocaml
<avsm> i have some in-progress code to do socket.io servers without needing a big framework, but you have to be prepared to do a little hacking to get that to work
<tonyg> avsm: that actually sounds interesting. At the moment I'm happily programming just with what I'm given by raw ocaml 3.12.1, and I'd prefer to keep my deps list short if possible
<avsm> i can sympathise with that
<tonyg> eliom looks perhaps a bit heavyweight; I'm intending to bolt some HTTP onto the side of an existing system, so just something that can parse & print HTTP requests & responses would almost be enough. I mean, except that I originally asked for websockets etc too ;-)
<tonyg> i'll dig into ocsigen and see if the little pieces i need are exposed far enough to be used on their own, perhaps
<flux> I've written cgibins with ocamlnet
<flux> then there was some other small http server for ocaml, ocaml-http perhaps..
<tonyg> ocaml-http looks promising
<tonyg> oh wait it requires ocamlnet
<tonyg> hmf :)
KDr2 has quit [Remote host closed the connection]
Tobu has joined #ocaml
wagle has quit [Ping timeout: 260 seconds]
<avsm> no, it doesnt
<avsm> oh, ocaml-http does
<avsm> i removed ocamlnet from my Lwt version
<avsm> although I do view Lwt as a pretty standard 'must-have' library these days. it's so darn useful
<flux> you mean ocamlnet?
<mfp> avsm: what's the current status of cohttp(d?)?
<avsm> mfp: just needs some unit tests and cleanup of the interface. the parser is ok
<avsm> all small things; remove gratuitous use of Hashtbl in favour of Map in header parsing
<tonyg> avsm: I'm new to ocaml programming, so started off without lwt. I'm thinking I should likely get used to it soon. If I need real multicore support as well as 1e6s of lightweight threads, can lwt work for me?
<mfp> I see, the remaining 80% ;)
* avsm is preparing a large, standalone release of all the mirage libs that work with normal Lwt
<avsm> tonyg: its funny you mention that. I'm just hacking together an ocaml-workflow module with fast shared memory at the moment (for multiprocessing). Lwt works great for concurrency
<avsm> mfp: yeah :)
<tonyg> avsm: iiiiinteresting.
<mfp> avsm: if I wanted to expose a server via HTTP, I'd need both avsm/ocaml-cohttp (+ deps, re and uri IIRC) and avsm/ocaml-cohttpserver, right?
<avsm> mfp: it does work for quite a few users though. i've just been careful to not release it to avoid having crap code tagged
<avsm> mfp: yeah, although now that i've figured out oasis, ocaml-cohttpserver can be merged back in
<avsm> in general, we're structuring the libraries to have a 'pure' parser core that doesnt use Lwt_unix (i.e. only Lwt_stream for iteration)
<avsm> and then a client/ server/ that uses Lwt_unix
<Ptival> thomasga: yay, another of my Typerex bugs fixed already
<avsm> it makes it an awful lot easier to port over to Mirage and Windows and Javascript or iPhone and whereever else you need the protoco implementation
wagle has joined #ocaml
<avsm> mfp: ocaml-cohttpserver can be merged back with ocaml-cohttp, i meant
MaskRay has joined #ocaml
MaskRay has quit [Changing host]
MaskRay has joined #ocaml
<mfp> avsm: I'm soon ("RSN") releasing a database server with bigtable's datamodel built on top of google levelDB, and was thinking about exposing it via HTTP (currently have a client lib in OCaml with custom proto)
<thomasga> Ptival: there are no bugs in typerex :p
Cyanure has quit [Ping timeout: 240 seconds]
<avsm> mfp: awesome! yes, cohttp is ideal for that. as an example of embedding it, check out http://github.com/avsm/ocaml-lwt-json-logger
<avsm> mfp: it exposes the Lwt_log stream via JSON, and serves up a Bootstrap UI to render the logs
<avsm> mfp: very basic atm, but it's kind of obvious how to extend it further (which is on the todo list)
<mfp> avsm: yes, I took a look at it (not yet built though :)
<avsm> the progress bars are cute ;-) need that for the xen cloud stuff too (lots of tasks flying around)
<avsm> so the major thing cohttp could use is a cleanup of the Server.spec that is passed in. it's very ad-hoc atm
<mfp> hmm there's a minor issue with the license (IIRC I told you about it some time ago). I want to put my code under LGPL+static linking, and ocaml-cohttp's LICENSE states it's plain LGPL (OTOH _oasis says it's LGPL + linking exn)
<avsm> ah yes, i mailed stefano about that
<avsm> he gave me permission to relicense it, but i need to submit an upstream pull request
<avsm> and he would do both
<mfp> I'm getting lost, wasn't Stefano's original cohttp the one that depended on ocamlnet?
<avsm> so the history is
<mfp> or it's just 'for the record'?
<avsm> ocamlnet+ocaml-http (no lwt)
<avsm> i ported ocaml-http -> ocaml-cohttp (+lwt, no pthreads)
<mfp> ah right, Stefano's is ocaml-http
<avsm> then i ripped out ocamlnet, and put up ocaml-uri, and removed pcre, and used Jerome's ocaml-re (pure ocaml regexps)
probst has quit [Quit: probst]
<avsm> neat, shared memory in lwt working, with just the minor addition of shm_open bindings. now to write a protocol over it
<mfp> hmm I guess the only practical way to get all the deps in place would be to use git submodules (and potentially fork cohttp if extra changes needed?) and wrap my build system over everything (already doing that for ocaml-leveldb + leveldb itself)
<avsm> i was actually wondering, not entirely idly, about having a mega 'ocaml-pkgs' repo with all the things i use as submodules
<avsm> what's your build system? something on top of ocamlbuild?
<mfp> I'm using omake
<mfp> I tried to use ocamlbuild some time ago but didn't manage to handle submodules and stuff
<mfp> and omake had docs...
<avsm> hrm yeah. i hear you
<avsm> oasis pretty much works for me nowadays, with 0.3.0
<avsm> pack support, in particular was important
<avsm> i would prefer something that didn't require ocamlfind, but that's a little more work
<avsm> mfp: actually, i could see how omake could work ok here, with git submodules.
<mfp> I'm already using it that way for some internal deps
<thomasga> avsm: you should use ocp-build :p
<mfp> some of which are also released separately with an oasis-generated build sys
<thomasga> it will work fine with git submodules
<avsm> i'm going to work backwards from a package manager
<avsm> the first complete one i see, i'll generate packages for all my repos. hinthinthint thomasga
<thomasga> :p
* mfp noticed that Jane Street's releases come with an ocamlmakefile (IIRC) _and_ an OMakefile, indicating they're using it internally as a submodule of a larger project
Cyanure has joined #ocaml
<Ptival> thomasga is in advertising mode!
<Ptival> I'm expecting a mechanized proof to support this bug-free claim :p
<mfp> uh when did the channel become this big (124)? Don't remember ever seeing it over 11X before.
<avsm> mfp: yeah, and apparently lots of nice little omakefile tricks in their internal repos for pa_ounit and such
<mfp> pa_ounit?
* mfp googles
<thomasga> Ptival: we accept proof contribution as well
<thomasga> :)
<Ptival> :s
<avsm> mfp: syntax extension to write inline ounit tests, and gather them into a single module to execute
* mfp reading till-varoquaux/pa_ounit
<Ptival> no bugs in this emacs-lisp...
<mfp> seems most convenient... once you hack the build sys, as usual
<avsm> yeah
<mfp> one non-trivial gain from inline tests is that you can do whitebox testing w/o exposing undocumented internal funcs/structures
* mfp thinking out loud
* ousado wonders why adding an assert gives his toy allocator a 25% performance boost ..
<ousado> hm, maybe branch prediction
<mrvn> hurray for worse is better. :)
<ousado> heh
<flux> mfp, have you thought of how to use the new fancy-pants gadts in your sql generation code?-)
<mfp> flux: haven't played with GADTs yet, but not planning to update ocaml-relational (I've since concluded that it's just too much of a PITA)
<avsm> mfp: the pa_ounit ability to "punch through" module signatures is really cool
ulfdoz has joined #ocaml
<hcarty> thomasga: What is ocp-build?
Submarine has quit [Ping timeout: 260 seconds]
<Ptival> hcarty: OCamlPro's build tool, which you can find included with typerex
<hcarty> Ptival: Are there examples and documentation available? How does it compare with oasis?
MaskRay has quit [Remote host closed the connection]
<Ptival> hcarty: I don't think so, there is a paper about it in French, and examples ocp files in typerex's sources, anyway thomasga will tell you the actual status
notk0 has joined #ocaml
<notk0> is Unix.time the only way to get the time in ocaml?
<notk0> is there a platform independent way?
<mrvn> Don't all platforms have Unix?
<notk0> mrvn, the Unix module works everywhere ?
<mrvn> That was my question
<notk0> I don't know, I thought UNIX is for POSIX specific things, I know that Microsoft claims that Windows(R) is posix
EmmanuelOga has quit [Read error: Connection reset by peer]
<hcarty> thelema_: What is the status of BatLog vs BatLogger? Is one better/more likely to stick around?
EmmanuelOga has joined #ocaml
<thelema_> hcarty: I hope that BatLog will stick around longer, and would like to deprecate batLogger. That said, maybe they both belong in separate libraries
<thelema_> sadly, I'm not using batLog in my own code yet, otherwise I'd say that it'll definitely stay around longer
<hcarty> thelema_: Ok, thanks. I'm trying to pick a logging library/module. I do'nt need much, so I may end up with something custom.
<hcarty> I'd rather avoid that if possible, but it may not be at this point.
<thomasga> hcarty: the only available "documentation" is the .ocp files in typerex. We use it internally a lot, but it is not yet ready to be used widely (ie. user doc is missing, the syntax of .ocp is still changing, etc). So if you are courageous and want to give it a try, I will be happy to help (otherwise you can wait for a proper release)
thomasga has quit [Quit: Leaving.]
cago has quit [Quit: Leaving.]
<thelema_> hcarty: try BatLog - worst case I'll spin it off to a odb-able package
<thelema_> hcarty: it's simple but should be quite flexible
thomasga has joined #ocaml
Tobu has quit [Ping timeout: 272 seconds]
andreypopp has joined #ocaml
andreypopp has quit [Quit: Computer has gone to sleep.]
avsm has quit [Quit: Leaving.]
emmanuelux has quit [Ping timeout: 245 seconds]
silver has quit [Remote host closed the connection]
Tobu has joined #ocaml
<hcarty> thelema_: What is the optional fp argument used for?
ulfdoz_ has joined #ocaml
ulfdoz has quit [Ping timeout: 245 seconds]
ulfdoz_ is now known as ulfdoz
avsm has joined #ocaml
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
<notk0> how can I extract data from a constructor when I know the return type?
<notk0> eg, let (_,Type(var)) = something
Kakadu has joined #ocaml
<f[x]> your question doesn't make sense but the answer seems correct
<notk0> I am having trouble
zcero has joined #ocaml
<_habnabit> notk0, well, ask about that
<notk0> I don't even know what to ask
<_habnabit> show us the error ??
<notk0> I am working with yojson, http://mjambon.com/yojson-doc/Yojson.Safe.html
<notk0> and basically I use List.find to obtain a certain Association, that is of the form string*json
<notk0> ocaml seems to recognize the return type
<notk0> but when I cast it to
<notk0> `String(v) it tells me it's of wrong type
<_habnabit> that's not a cast
<notk0> I mean an extraction
<notk0> This expression has type string * Yojson.Safe.json
<notk0> but an expression was expected of type
<notk0> string * ([< `String of 'b ] as 'a)
<notk0> but `String is of type json
<_habnabit> and what's your code
<notk0> ok commenting , one sec
<notk0> here you go _habnabit http://pastebin.com/qwttU4m0
<notk0> the "paging" part is wrong
<thizanne> notk0: try with `String rather than String
<_habnabit> where does he have String instead of `String
<notk0> it already has `String
<thizanne> oh, yes, I msread
<thizanne> +i
<thizanne> sorry
<notk0> the font is small
<notk0> on pastebin
ftrvxmtrx has quit [Quit: Leaving]
<f[x]> notk0, that is not a full code
<f[x]> notk0, make a smaller self-contained example
<f[x]> we don't even know where `this expression` refers to
lorilan[dodo] is now known as lorilan
<notk0> f[x],what expression
<notk0> ?
<f[x]> the one that you quoted from error message
g0dmoney- has quit [Changing host]
g0dmoney- has joined #ocaml
<f[x]> and btw none of the parentheses in the code are needed
<f[x]> ok, almost none
<thomasga> notk0: I guess you need some type annotation. Something like: let string (j : Yojson.Safe.json) = match j with `String s -> s | _ -> failwith "string"
<notk0> the problem is basically I have a json type variable and I know it to be of type `String() but I can't extract the data because it tells me it's of type json but it expects it to be of type `String
<f[x]> there is no such thing as type `String
<thomasga> polymorphic variants are sometimes a bit heavy to use
<f[x]> I guess json has `String of string as constructor
<thomasga> (due to the type annotations)
<notk0> json is a recursive type
<f[x]> notk0, you are using wrong words and confusing yourself and others
<notk0> and I am in the case string*json where the json is `String
andreypopp has joined #ocaml
<notk0> f[x], why?
<f[x]> json is `String of string
<notk0> among others yes
<f[x]> and ocaml infers `String of 'a
<f[x]> for your code
<f[x]> or maybe that's not the problem
<notk0> is there a way to force it to be a string?
<thomasga> notk0: use the function that I gave you
<Drakken> Is there a way to define a module in terms of another module, but with some functions changed?
<Drakken> The signature is the same, but I want to change some of the implementation.
<_habnabit> Drakken, module Y = struct let x = 0 end module X = struct include Y let x = 1 end
<f[x]> notk0, I've wasted 10 minutes to install yojson and compile your code - and discover that it compiles without error
<thomasga> f[x]: at least now you have yojson installed (a very good json library) :-)
<f[x]> in the virtual machine that I have already wiped :)
<thomasga> haha
<notk0> f[x], not in my case, I tried thomasga code and it works
<f[x]> ok
<f[x]> telepathy ftw
<notk0> but without that it didn't, and the strange thing is it told me the correct type without the match thing
<thomasga> should be related to the version of ocaml
<notk0> f[x], what version of ocaml do you havae?
<Drakken> _habnabit thanks. What if x is in submodule Z? Do I have to say let Z.x = 1 or is there a way to open Z first?
<_habnabit> hmmm, I don't remember offhand
<Drakken> x is actually a (recursive) function that refers to several things in Z (including itself).
<Drakken> So it's not very convenient to keep typing "Z.", especially since Z actually has a longer name.
<f[x]> 3.12.1
<notk0> I have 3.12.0
<thomasga> Drakken: you can open Z
<Drakken> thomasga hmm. That might work.
avsm has quit [Quit: Leaving.]
thomasga1 has joined #ocaml
zcero has quit [Read error: Connection reset by peer]
<Drakken> What's the point of saying type foo = Foo.foo == <a copy of the definition of Foo.foo> ?
<Drakken> Is is just some kind of reminder or sanity check?
djcoin has quit [Quit: WeeChat 0.3.2]
metasyntax|work has joined #ocaml
thomasga has quit [Ping timeout: 244 seconds]
zcero has joined #ocaml
twittard has quit [Quit: twittard]
<Kakadu> hello!
<Kakadu> I have a question about typerex. Why it is so slow? http://paste.in.ua/3999/
<_andre> is there a way to map between unix signal numbers and the signal numbers in the Sys module?
<thomasga1> Kakadu: ocp-* wrappers basically call ocamlc + *
<thomasga1> this is not expected to be so slow (I would have expected *2)
pangoafk is now known as pango
<Kakadu> thomasga1: can u or your team try to reproduce this behaviour?
<thomasga1> can you open an issue on github to keep track of it ?
ftrvxmtrx has joined #ocaml
<thomasga1> I will try to repro your pb tomorrow, I have to go
thomasga1 has quit [Quit: Leaving.]
NihilistDandy has joined #ocaml
andreypopp has quit [Quit: Computer has gone to sleep.]
iago has quit [Ping timeout: 260 seconds]
<Drakken> What happens if I define foo, define bar to use foo, and then redefine foo? When does foo get bound in bar?
<Drakken> bar is a function.
<_habnabit> Drakken, ocaml has early-binding closures
twittard has joined #ocaml
andreypopp has joined #ocaml
<thelema_> Drakken: let foo = 3 in let bar () = foo in let foo = 5 in bar = 3
<Drakken> _habnabit apparently so. thelema_ I'm trying to redefine Z.bar arter opening Z, but the compiler can't find some field labels in Z.
<thelema_> Drakken: let foo = ref 3 in let bar() = !foo in foo := 5; bar() = 5
<Drakken> aFter
<thelema_> ? If you redefine Z.bar, that new definition will only matter for things inside the scope of the redefinition.
<thelema_> what do you mean by can't find some field labels?
Steltek has joined #ocaml
<Drakken> thelema_ the scope of the redefinition is Y, where I'm trying create Y from X and modify Y.Z.(foo,bar) from X.Z.(foo,bar).
<Drakken> bar creates a record of type Z.t
<thelema_> foo and bar are values or types?
<Drakken> but the compiler is saying the field labels in t are unbound. foo and bar are both functions.
<thelema_> you want to create a module Y which is just like existing module X, except some things in X.Z are changed?
<Drakken> exactly
<Steltek> hello, I'm a dumb newbie and have a simple but hard to google problem. why does this fail to compile? let rec meh a b = a + b ; meh;;
<_habnabit> Steltek, you have a 'let' with no 'in'
<Steltek> in what?
<Drakken> Steltek a + b has type int
<Drakken> but you have a ;
<_habnabit> Steltek, 'in' is a keyword
<thelema_> Drakken: module Y = struct module Z = struct include X.Z (* changes here *) end include (Y:module type of Y with Z := Z) end
gnuvince has quit [Read error: Operation timed out]
<_habnabit> Steltek, the form is `let f x = x in ...`
<thelema_> Steltek: let rec meh a b = a+b in meh
<Steltek> _habnabit: right but there is no more 'in', it's (forgive me for using bad terminology) a top level function
<Steltek> hmm, ok
<_habnabit> Steltek, then you need a ;; or a newline, not a ;
<thelema_> Steltek: or let rec meh a b = a + b;; meh;;
<Steltek> ok, that's not waht I'm trying to accomplish
<thizanne> so what do you want ?
<thelema_> _habnabit: newline not sufficient without `let _ = meh;;`
<Steltek> I want a method that does some side effect on two parameters then returns itself or another function of similar signature
<_habnabit> thelema_, oh, well, for `meh` sure
<thelema_> # let meh a b = a + b;;
<thelema_> val meh : int -> int -> int = <fun>
<thelema_> # meh 3 5;;
<thelema_> - : int = 8
Cyanure has quit [Read error: Operation timed out]
<thelema_> oh, side effect... hmm...
<thizanne> Steltek: something like let rec meh a b = a = !a + b; meh should work I think
<Steltek> for instance: let run1 a b = a + b ; run2 ;; let run2 a b = a - b ; run1 ;; let loop state list = loop (head of list) (state run1)
<Steltek> okay, that example won't compile but it gets the point across
<thizanne> hm, of course no
<thizanne> it's :=
<thizanne> and I still have an error
<thelema_> thizanne: one problem - return value.
<Steltek> ok yeah, that example was probably not as clear...
<thelema_> Steltek: what's the type of run1? int -> (int -> (int -> ???))
<thizanne> Steltek: anyway, I think an answer could probably be « you're doing it wrong » :-'
<thizanne> also, my previous code works with -rectypes
<Steltek> for instance: let run1 a = a + 2 ; run2 ;; let run2 a = a - 2 ; run1 ;; let loop state list = loop (state (hd list)) (tl list);;
<Steltek> ah, ok, rectypes
<thizanne> Steltek: you probably do not want to use it
<Steltek> that's probably the thing I was missing in my googling
<Steltek> so a method can't return itself, basically?
<thizanne> basically yes
<thizanne> because it would never return anything
flux has quit [Ping timeout: 260 seconds]
<Steltek> hmm, alright, I'll rework things
<Steltek> thanks guys!
Steltek has left #ocaml []
letrec has quit [Ping timeout: 240 seconds]
albacker has joined #ocaml
albacker has quit [Changing host]
albacker has joined #ocaml
asdfhjkl has joined #ocaml
flux has joined #ocaml
iago has joined #ocaml
Tobu has quit [Ping timeout: 272 seconds]
NihilistDandy has quit []
Tobu has joined #ocaml
tomprince has quit [Ping timeout: 252 seconds]
wagle_ has joined #ocaml
wagle has quit [Ping timeout: 248 seconds]
zcero has left #ocaml []
tomprince has joined #ocaml
emmanuelux has joined #ocaml
<hcarty> thelema_: This is what I had in mind for a simple logging module - https://gist.github.com/2031221
letrec has joined #ocaml
<thelema_> hcarty: batLog doesn't consider the different logging levels as primitive, but as created by generating different loggers for each level and then enabling/disabling them.
<thelema_> there's a default logger for logging to stderr by default with just the time printed before each message
<thelema_> to do different log levels, do `let debug = make_logger stderr "debug" [`Time]`, etc. and use debug.print "log message"
<hcarty> thelema_: Is it possible to have a custom prefix?
<hcarty> The full prefix, rather than just date/time/etc.
<hcarty> Well, etc = filepos in this case
<thelema_> the s
<thelema_> the string argument on `make_logger` is also printed with each log message
<thelema_> do you want something before the date/time?
<hcarty> Something in place of the date/time
<hcarty> So that they can be formatted differently or replaced entirely
<thelema_> let debug = make_logger stderr "debug" []
<hcarty> But then the prefix logic needs to be included in each debug.print call
<thelema_> I can easily add a [`Custom of 'a BatIO.output -> unit] flag
<thelema_> or is [`Custom of unit -> string] better?
<hcarty> thelema_: unit -> string is fine by me
<thelema_> maybe it could receive the prefix and log message as arguments
<thelema_> hcarty: unit -> string it is.
<thelema_> back in a few minutes, will implement now
<hcarty> thelema_: Perhaps the 'level' too? Although I think that could be solved with currying.
_andre has quit [Quit: leaving]
Xizor has joined #ocaml
<thelema_> hcarty: batLog has no need of "level". Just enable and disable ... hmm, I thought I had put in a nicer way to disable loggers... I guess the best way to do that is with setting the output to null_output (or whatever it is from BatIO)
<hcarty> thelema_: How do you enable/disable? I see creation, but no enable/disable.
<hcarty> thelema_: set_output?
<thelema_> I thought I had made such, apparently I didn't... on creation , just set the output to the null output
<thelema_> although that still does more work than desired...
<thelema_> I guess I'll have to add enable/disable
<hcarty> Is a user expected to "open (Bat)Log"?
<thelema_> yes
<thelema_> the alternative is to use objects for 'a logger
<thelema_> which doesn't seem too bad, actually.
<hcarty> Maybe the default implementation should be in a submodule
<hcarty> Or objects work too
<hcarty> print/get_output/fatal seem like common enough names that they could cause confusion.
jamii has quit [Ping timeout: 246 seconds]
<thelema_> there's a functorized version if you really like. Module Debug = BatLogger.Make(struct let out = stderr let prefix = "debug" let flags = [`Time] end) Debug.print "Log Message"
<thelema_> ah... maybe the functorized version would be better than opening log.
<thelema_> You're right - the 'a logger type is really the only thing that should be opened.
<thelema_> Maybe I should submodule that. I want people to be able to do Log.printf "blah"
notk0 has quit [Remote host closed the connection]
<thelema_> nevermind, I'm going to drop make_logger and make a Object solution. The module solution should be a better replacement for the record solution.
<thelema_> wow, it's been so long since I've coded ocaml modules, I've forgot the syntax
<thelema_> err, ocaml classes
<thelema_> heh, and I end up just using a local object, not even a class
Submarine has quit [Ping timeout: 248 seconds]
<hcarty> thelema_: I was away for a bit, but here is a functorized version of what I pasted earlier - https://gist.github.com/2031221
* thelema_ really dislikes having a linear set of levels
<hcarty> thelema_: I can see that. But if the effort required to maintain each additional level scales more gracefully with a linear set of levels
<hcarty> If each logger is defined independently then each one needs to be enabled/disabled on its own.
<hcarty> I don't know which approach is best
<hcarty> s/But if//
<thelema_> true, my approach could still use an adapter to enable the first n levels...
<hcarty> Perhaps a combination approach - one way to disable everything less than n; another to disable specific levels
<thelema_> maybe a logger_array object?
<thelema_> created with a polymorphic variant... except there's no way to iterate through a type or get its length at runtime
<hcarty> thelema_: Yes, that's the issue I ran up against
<thelema_> which is why your functor is as you designed it.
<hcarty> Yes
<thelema_> now it makes sense. Although the "max level" should be "default level", no?
<thelema_> oh, this is designed to be used as is with different users
<thelema_> not to be implemented specially by each user
<hcarty> thelema_: It could be default_level
<hcarty> max_level because the default is meant to be the most restrictive. But default_level probably makes more sense.
<hcarty> Or at least is more flexible.
<hcarty> thelema_: I like default_level more. Thanks for the suggestion :-)
<hcarty> I made the change locally and will update the gist later. Off for a bit now - we can pick this up later if you like.
<thelema_> ok, cheers
<thelema_> I'll finish this here - maybe I can provide similar interface with batLog
ulfdoz has quit [Ping timeout: 252 seconds]
oriba has joined #ocaml
EmmanuelOga has quit [Quit: WeeChat 0.3.7-dev]
Tobu has quit [Ping timeout: 272 seconds]
Tobu has joined #ocaml
tonyg has left #ocaml []
<hcarty> thelema_: gist updated. I'm curious to see what you end up with on your end.
wagle_ is now known as wagle
Kakadu has quit [Remote host closed the connection]
malouin has quit [Ping timeout: 265 seconds]
mehitabel has quit [Ping timeout: 265 seconds]
ski has quit [Ping timeout: 244 seconds]
ski has joined #ocaml
mrvn has quit [Ping timeout: 276 seconds]
malouin has joined #ocaml
mehitabel has joined #ocaml
mjonsson has joined #ocaml
edwin has quit [Remote host closed the connection]
<thelema_> hcarty: I updated batLog with a little more, but haven't had a chance to work on the leveled-functor
<hcarty> thelema_: You're more than welcome to use my code if it's helpful
asdfhjkl has quit [Ping timeout: 260 seconds]
gmcabrita has quit [Ping timeout: 245 seconds]
lopex has quit [Ping timeout: 252 seconds]
bobry has quit [Ping timeout: 276 seconds]
joewilliams has quit [Ping timeout: 260 seconds]
lopex has joined #ocaml
gmcabrita has joined #ocaml
joewilliams has joined #ocaml
<thelema_> I think I may borrow your Basic and Level_sig modules
bobry has joined #ocaml
<hcarty> Sounds good to me
KDr2 has joined #ocaml
Xizor has quit []
<Drakken> thelema thanks for you help earlier today. I think [ Y with Z := Z] should be [ Y with module Z = Z], but including Y at the end seems to be the answer. I guess overwriting modules isn't allowed.
<Drakken> I mean thelema_
Tobu has quit [Ping timeout: 260 seconds]
Tobu has joined #ocaml
albacker has quit [Ping timeout: 246 seconds]
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
KDr2 has quit [Remote host closed the connection]
<thelema_> Drakken: your welcome. I recently figured this trick with modules out myself.