gildor changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.12.0 http://bit.ly/aNZBUp
joewilliams is now known as joewilliams_away
lopex has joined #ocaml
joewilliams_away is now known as joewilliams
oriba has joined #ocaml
<oriba> hey I tried to use mktime in Unix module
<oriba> works fine
<oriba> I did the same stuff in C
<oriba> that seems to have a bug
<oriba> there is a one hour diff problem
<oriba> I say hour = 0 when feeding in, and get hour=23 (and one day too early), then
<oriba> i sthere a known C-bug, which OCaml compensates?
<oriba> workaround?
joewilliams is now known as joewilliams_away
philtor has quit [Ping timeout: 258 seconds]
avsm has quit [Quit: Leaving.]
joewilliams_away is now known as joewilliams
pdhborges has joined #ocaml
olauzon has quit [Quit: olauzon]
Modius has joined #ocaml
oriba has quit [Quit: oriba]
<thelema_> drat, just missed him
pdhborges has quit [Quit: Leaving.]
ymasory has joined #ocaml
lopex has quit []
enthymeme has quit [Quit: rcirc on GNU Emacs 23.1.1]
mfp has quit [Ping timeout: 240 seconds]
emmanuelux has quit [Remote host closed the connection]
mfp has joined #ocaml
Transformer has joined #ocaml
Transformer has quit [Excess Flood]
dnolen has quit [Quit: dnolen]
vivanov has joined #ocaml
<vivanov> what module to use to work with time? i only know jane streets time module
dnolen has joined #ocaml
<mlh> thelema_: what were you going to suggest?
<mlh> my wild-assed guess would be timezone issues
ankit9 has joined #ocaml
philtor has joined #ocaml
joewilliams is now known as joewilliams_away
vivanov has quit [Read error: Connection reset by peer]
vivanov has joined #ocaml
vivanov has quit [Read error: Connection reset by peer]
vivanov has joined #ocaml
lamawithonel has joined #ocaml
ulfdoz has joined #ocaml
eye-scuzzy has quit [Ping timeout: 260 seconds]
vivanov has quit [Ping timeout: 258 seconds]
vivanov has joined #ocaml
eye-scuzzy has joined #ocaml
ymasory has quit [Quit: Leaving]
vivanov has quit [Quit: Lost terminal]
vivanov has joined #ocaml
kushou has joined #ocaml
<kushou> hi ! here is a code I did to parse a file: http://paste.pocoo.org/show/K76XbsL69mSETIMXhdzl/ ; I have an Invalid_argument raised by Str.matched_group between comments
<kushou> the code at the bttom is a test I did, working, that proves the two regex aren't in conflict
jderque has joined #ocaml
<kushou> http://caml.inria.fr/pub/docs/manual-ocaml/libref/Str.html there is nothing about Invalid_argument on matched_group, I think this comes from a call of one of the two other following functions
<kushou> what am I doing wrong ? (ask for more details)
<kushou> (btw, the test at the bottom is on the string that raises Invalid_argument with the main program, and it works, I am completely lost)
<sgnb> kushou: the explanation of Invalid_argument is likely to be the same as group_beginning/group_end
<kushou> yes, but I count 3 matching parenthesis, am I wrong ?
<sgnb> and foo () works for me, btw
<kushou> yes, it works for me too, the error occurs in parse_syllable
<kushou> (on the same string)
ulfdoz has quit [Ping timeout: 260 seconds]
vivanov has quit [Read error: Connection reset by peer]
ankit9 has quit [Quit: Leaving]
dnolen has quit [Quit: dnolen]
vivanov has joined #ocaml
ankit9 has joined #ocaml
Yoric has joined #ocaml
thomasga has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
Yoric has quit [Quit: Leaving.]
ikaros has joined #ocaml
ocp has joined #ocaml
ikaros has quit [Client Quit]
Tobu has joined #ocaml
Tobu has quit [Ping timeout: 260 seconds]
philtor has quit [Ping timeout: 246 seconds]
pdhborges has joined #ocaml
ankit9 has quit [Quit: Leaving]
ankit9 has joined #ocaml
jknick has joined #ocaml
edwin has joined #ocaml
Reaganomicon has quit [Read error: Connection reset by peer]
jknick has quit [Remote host closed the connection]
Yoric has joined #ocaml
larhat has joined #ocaml
Yoric has quit [Ping timeout: 260 seconds]
Yoric has joined #ocaml
Yoric has quit [Ping timeout: 244 seconds]
Yoric has joined #ocaml
snf has quit [Ping timeout: 240 seconds]
snf has joined #ocaml
snf has quit [Changing host]
snf has joined #ocaml
impy has quit [Quit: impy]
pdhborges has quit [Quit: Leaving.]
jderque has quit [Quit: leaving]
joelr has joined #ocaml
<joelr> moin
<joelr> how do you force a value out of the lwt monad?
<larhat> val run : 'a http://ocsigen.org/lwt/api/Lwt#TYPEt -> 'a or you mean smth different?
<joelr> larhat: i think that's what i want, yes
<joelr> larhat: i think that function does not exist
<joelr> # Lwt.return;;
<joelr> - : 'a -> 'a Lwt.t = <fun>
<joelr> # Lwt.run;;
<joelr> Error: Unbound value Lwt.run
<joelr> Lwt_unix perhaps?
<larhat> oh, yes Lwt_unix or Lwt_main
mnabil has joined #ocaml
<joelr> how is type +'a t different from type 'a t?
<flux> it indicates that the type is covariant
ftrvxmtrx has joined #ocaml
<joelr> flux: what does it mean for a type to be a covariant?
<rproust> you can put a slighty different type instead, as long as one is a subtype of the other
<rproust> covariant and contravariant are dual
<flux> yes. it works with immutable datastructures.
<rproust> in one case, you can use a subtype, in the other you can use a supertype
<rproust> it's also usefull for phantom typing…
<joelr> rproust: can you express contravariance with ocaml?
<rproust> -'a t
<joelr> rproust: how is it useful with phantom typing? i thought you used [> ... ] and [< ... ] with phantom typing
<rproust> it's the same
<rproust> [> smthg ] means that you can use a super type of smthg
<joelr> so this expresses the same thing then
<joelr> cool
<rproust> [< smthg] means you can use a subtype
<joelr> right
<joelr> so that's covariance then, right?
<rproust> # let f = function `A x -> `AA x | `B y -> `BB y ;;
<rproust> val f : [< `A of 'a | `B of 'b ] -> [> `AA of 'a | `BB of 'b ] = <fun>
<rproust> you can use a anyvalue which type is a subtype of [ `A of 'a | `B of 'b ] as argument
<rproust> and you can use the result in anywhere a supertype of [ `AA of 'a | `BB of 'b ] is excpected
<rproust> subtyping works on polymorphic variants and objects… (maybe other things I forgot)
<joelr> cool
Enjolras has left #ocaml []
jderque has joined #ocaml
pdhborges has joined #ocaml
Yoric1 has joined #ocaml
oriba has joined #ocaml
Yoric has quit [Ping timeout: 276 seconds]
pdhborges has quit [Ping timeout: 260 seconds]
pdhborges has joined #ocaml
pdhborges has left #ocaml []
lopex has joined #ocaml
ftrvxmtrx has quit [Ping timeout: 248 seconds]
<hcarty> vivanov: There is the Calendar module
<hcarty> vivanov: It has very nice time and date handling
chegibari has joined #ocaml
<chegibari> Hello.
<chegibari> Is there any way to get more information about the cause of a "X and Y make inconsistent assumptions over interface Z"?
<chegibari> where X and Y are .cmo files
<hcarty> chegibari: It usually (always?) happens when something hasn't been recompiled properly
<hcarty> chegibari: So Z may have been updated and compiled, but X and/or Y have not been recompiled against the new Z
<chegibari> mmhh.. I'm just testing the build system and ALL the sources are untouched few days now and Makefile builds them just fine
<chegibari> maybe it's getting files from different places
<chegibari> hcarty, thanks
lamawithonel has quit [Remote host closed the connection]
ankit9 is now known as ankit9|away
jamii has joined #ocaml
<zorun> properly
<zorun> properly
<zorun> oops, sorry
_andre has joined #ocaml
ftrvxmtrx has joined #ocaml
<vivanov> hcarty: great -- thx -- ill try that :)
<chegibari> hcarty, my build system was not copying a handwritten .mli file to the working directory
<chegibari> hcarty, as a consequence, a default .mli file was being generated
<chegibari> hcarty, and that caused the mismatch
<chegibari> not that this is very interesting but...
<hcarty> chegibari: I'm glad you found the issue!
oriba has left #ocaml []
edwin has quit [Remote host closed the connection]
pdhborges has joined #ocaml
Yoric1 is now known as Yoric
hcarty has quit [Remote host closed the connection]
dnolen has joined #ocaml
hcarty has joined #ocaml
edwin has joined #ocaml
jamii has quit [Read error: Connection reset by peer]
emmanuelux has joined #ocaml
dnolen has quit [Quit: dnolen]
bohanlon has joined #ocaml
ankit9|away has quit [Quit: Leaving]
<chegibari> What exactly the directories specified with -I are used for by ocamlc?
thomasga has quit [Ping timeout: 240 seconds]
thomasga has joined #ocaml
<chegibari> f[x], right. I was using mostly "Developing applications with Objective Caml". I forgot there was a reference manual!
<chegibari> thanks
<f[x]> manual is quite easy reading
<chegibari> the ocamlc man page doesn't report as much information as the reference manual
avsm has joined #ocaml
joelr_ has joined #ocaml
joelr_ has quit [Client Quit]
joelr has quit [Ping timeout: 246 seconds]
ankit9 has joined #ocaml
<chegibari> does the "-a" flag for libraries comes from "assembly" (like CLR assemblies) or from something else?
<thelema_> chegibari: archive, I think
<chegibari> ah ok
<thelema_> just as .a
<chegibari> thanks
emmanuelux has quit [Ping timeout: 255 seconds]
eye-scuzzy has quit [Quit: leaving]
ocp has quit [Quit: Leaving.]
ymasory has joined #ocaml
<thelema_> is the ocaml planet widely read?
thelema_ is now known as thelema
notk0 has joined #ocaml
notk0 has left #ocaml []
* thelema wonders if he broke oasis-db
lopex has quit []
larhat has quit [Quit: Leaving.]
<chegibari> Never heard of before
<chegibari> :)
<thelema> well it's down now (for me), but it should be available at http://oasis.ocamlcore.org/dev/odb when it is back
ymasory has quit [Quit: Leaving]
philtor has joined #ocaml
eye-scuzzy has joined #ocaml
<gildor> thelema: what was your last action ?
<thelema> uploading batteries 2.0beta
<thelema> and then confirming the upload
<gildor> humm, let restart and see what happens
<gildor> removing batteries 2.0beta solve the problem
<thelema> hmm, it could be the filename collision - I uploaded "batteries-2.0beta.tar.gz" twice, once the _oasis file said it was v1.3.0, the next (when it failed) the _oasis file said 2.0beta
<thelema> gildor: shall I try to upload batteries-2.0beta again?
<gildor> if you were not able to confirm your upload, it shouldn't have cause any problem
joewilliams_away is now known as joewilliams
<thelema> oasis-db locked up after I chose the 'confirm upload' and before anything else happened
pdhborges has left #ocaml []
enthymeme has joined #ocaml
lopex has joined #ocaml
ymasory has joined #ocaml
<gildor> thelema: humm, maybe a problem with links
<gildor> symlinks
<gildor> you have a couple of symlinks and maybe there is a bug in fileutils about that
<thelema> in what I'm uploading?
<gildor> yes
<thelema> I didn't realize they had changed since 1.3.0
<gildor> e.g doc/html/batteries/batteries_large.png -> ../../batteries_large.png
<gildor> I check
<thelema> actually, I'm very susprised about this, as the first "v2.0beta" I uploaded had everything that's in the current version except... some minor changes to makefile/myocamlbuild, _oasis and build/mkconf.ml
<gildor> doesn't seem to be the case
<gildor> thelema: the first tarball (who end up in 1.3.0 directory) has a 0 size
<thelema> really... hmm
<gildor> thelema: I need to investigate your tarball
boscop_ has joined #ocaml
<gildor> thelema: I had the same problem on my localhost
<gildor> thelema: the problem is linked to the tarball itself
<thelema> extracting that tarball fails?
<gildor> thelema: no it stops working when I confirm the upload
boscop has quit [Ping timeout: 246 seconds]
<thelema> ok. The tarball is generated by "make release" which uses "git archive" to build the tarball
<gildor> thelema: it seems related to viewing the page
<gildor> (maybe a bug linked to deps solving)
<thelema> one change I made was to add a Library section to batteries' _oasis
<thelema> so that other packages could depend on batteries
<thelema> just this:
<thelema> Library "batteries" Path: src/
<thelema> (with a \n\t before Path)
<gildor> thelema: I'll just have a quick look now, this is a top priority bug to solve, but I would like to finish my work on fileutils before
<thelema> ok.
<gildor> thelema: no obvious error, I'll need to track it tonight
ymasory has quit [Read error: Connection reset by peer]
lamawithonel has joined #ocaml
sepp2k has joined #ocaml
Yoric has quit [Quit: Leaving.]
sepp2k has quit [Ping timeout: 255 seconds]
ftrvxmtrx has quit [Quit: This computer has gone to sleep]
avsm has quit [Quit: Leaving.]
ftrvxmtrx has joined #ocaml
ftrvxmtrx has quit [Client Quit]
ymasory has joined #ocaml
sepp2k has joined #ocaml
tildedave has quit [Ping timeout: 240 seconds]
Tobu has joined #ocaml
mnabil has quit [Read error: Connection reset by peer]
ikaros has joined #ocaml
ymasory has quit [Quit: Leaving]
ymasory has joined #ocaml
tildedave has joined #ocaml
davez0r has joined #ocaml
davez0r is now known as tildedave_
boscop_ is now known as boscop
tildedave has quit [Ping timeout: 255 seconds]
tildedave_ is now known as tildedave
Tobu has quit [Ping timeout: 260 seconds]
Yoric has joined #ocaml
avsm has joined #ocaml
ftrvxmtrx has joined #ocaml
philtor has quit [Ping timeout: 248 seconds]
nicolas_ has joined #ocaml
<nicolas_> hey :)
<thelema> hey
<nicolas_> do you know if it's possible to create "global function" ?
<thelema> everything in ocaml is in some module or another - it's a side effect of auto-modulizing each file
<nicolas_> I've two functions which needs the other, and if i write the first one before, there's an error compile
<nicolas_> and the same if i write the second one before
<nicolas_> how could i fix it ?
<thelema> ah, let rec odd = ... even ... and even = ... odd ...
<nicolas_> ok
<nicolas_> i look at it and i come back
<thelema> the key is "rec" and "and"
<thelema> ok
philtor has joined #ocaml
<nicolas_> well
<nicolas_> i don't find anything on google
<nicolas_> let's say my two functions are A & B
<nicolas_> how would it be ?
<rwmjones> lack of unsigned 64 bit ints driving me nuts ...
<thelema> let rec A = <definition of A, using B> and B = <definition of B, using A>
<nicolas_> a yeah
<nicolas_> great, thanks ;)
<nicolas_> i forgot it, thanks :)
<thelema> rwmjones: really? writing crypto?
<thelema> let rec sort lst = ... and insert elt lst = ...
vivanov has quit [Ping timeout: 258 seconds]
vivanov has joined #ocaml
<nicolas_> it works perfectly
<nicolas_> thanks :)
<thelema> nicolas_: n/p
mnabil has joined #ocaml
yezariaely has joined #ocaml
chegibari has quit [Ping timeout: 255 seconds]
Yoric has quit [Quit: Leaving.]
<rwmjones> thelema: writing stuff to delve into Linux kernels
<rwmjones> 64 bit pointers and that
<rwmjones> they're all ffffffff81xxxxxx
<thelema> rwmjones: Int64.t?
ulfdoz has joined #ocaml
<rwmjones> sure, but the real problem comes with address comparison
<rwmjones> like, ffffffff81xxxxxx < 0 => true
<thelema> You just need an output function.... and comparison function that do unsigned compares
<rwmjones> don't worry, I've written an unsigned address compare function (in C!) now
yezariaely has left #ocaml []
<_andre> rwmjones: maybe https://github.com/andrenth/ocaml-uint can be useful?
vivanov has quit [Ping timeout: 260 seconds]
vivanov has joined #ocaml
<rwmjones> I was looking at
<rwmjones> I wonder which is better
<rwmjones> _andre: I take it that the github one is yours?
<_andre> yep
<_andre> i merged some of jeffrey's library features in mine, so he deprecated his
<rwmjones> _andre: are you aware of "noalloc"?
<_andre> no
<rwmjones> if any of your functions genuinely don't allocate, then using noalloc is much faster
<rwmjones> C functions, I mean
<_andre> interesting
<rwmjones> however you have to be careful because a lot of things allocate, eg. throwing exceptions
<_andre> i'll review the code and add it if appropriate
Yoric has joined #ocaml
nicolas_ has quit [Quit: Quitte]
<zsparks> In smlnj, there's a function use : string -> unit that takes a file, compiles it, and adds the bindings from it (usually used from the repl)
<zsparks> Is there a similar thing in ocaml?
<zsparks> I tried typing "ocaml foo.ml", which seems to compile it and then not go to the repl...
oriba has joined #ocaml
<zsparks> (or, to rephrase: I have a file, I want to tinker with it in the repl. how do I do this?)
vivanov has quit [Read error: Connection reset by peer]
pdhborges has joined #ocaml
_andre has quit [Quit: Lost terminal]
_andre has joined #ocaml
ygrek has joined #ocaml
emmanuelux has joined #ocaml
olauzon has joined #ocaml
rfg has joined #ocaml
pdhborges has quit [Quit: Leaving.]
<rwmjones> zsparks: use "foo.ml"
<rwmjones> ie. "use" is the command
<zsparks> ah, cool
<zsparks> rwmjones: # use "mergesort.ml" ;;
<zsparks> Error: Unbound value use
<rwmjones> that's an ocaml toplevel command
<rwmjones> oh sorry
<rwmjones> #use
<rwmjones> #use "foo.ml"
<rwmjones> or it might be #load, I always forget the difference
<zsparks> ah
_andre has quit [Quit: Lost terminal]
_andre has joined #ocaml
oriba_ has joined #ocaml
oriba has quit [Ping timeout: 246 seconds]
oriba_ is now known as oriba
jderque has quit [Quit: leaving]
avsm has quit [Quit: Leaving.]
_andre has left #ocaml []
ygrek has quit [Ping timeout: 246 seconds]
olauzon_ has joined #ocaml
olauzon_ has quit [Client Quit]
mnabil has quit [Ping timeout: 260 seconds]
olauzon has quit [Ping timeout: 246 seconds]
mnabil has joined #ocaml
ymasory has quit [Quit: Leaving]
ulfdoz has quit [Ping timeout: 240 seconds]
mattrepl has joined #ocaml
det has joined #ocaml
det has quit [Client Quit]
det has joined #ocaml
avsm has joined #ocaml
ikaros has quit [Quit: Ex-Chat]
Tobu has joined #ocaml
mnabil has quit [Remote host closed the connection]
edwin has quit [Remote host closed the connection]
Tianon has quit [Ping timeout: 255 seconds]
Tianon has joined #ocaml
Tianon has quit [Changing host]
Tianon has joined #ocaml
philtor has quit [Ping timeout: 264 seconds]
det has left #ocaml []
philtor has joined #ocaml
Tobu has quit [Ping timeout: 264 seconds]
willb has quit [Ping timeout: 240 seconds]
boscop_ has joined #ocaml
boscop has quit [Ping timeout: 250 seconds]
Tobu has joined #ocaml
<hcarty> rwmjones: #use for .ml, #load for .cmo or .cma
pdhborges has joined #ocaml
pdhborges has left #ocaml []
Tobu has quit [Ping timeout: 260 seconds]
bohanlon has quit [Quit: Off to Boston]
Yoric has quit [Quit: Leaving.]
emmanuelux has quit [Read error: Connection reset by peer]
emmanuelux has joined #ocaml
sepp2k has quit [Quit: Leaving.]
impy has joined #ocaml
philtor has quit [Ping timeout: 255 seconds]
avsm has quit [Quit: Leaving.]
mattrepl has quit [Quit: mattrepl]
dnolen has joined #ocaml
philtor has joined #ocaml
pdhborges has joined #ocaml
joewilliams is now known as joewilliams_away
rfg has quit [Quit: rfg]
thomasga has quit [Quit: Leaving.]
Amorphous has quit [Ping timeout: 276 seconds]
pdhborges has quit [Quit: Leaving.]
Amorphous has joined #ocaml
oriba has left #ocaml []
fourier has joined #ocaml
emmanuelux has quit [Remote host closed the connection]