flux 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.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
<Drup> not really no. ldmb has a lot more capabilities and is supposed to be much faster than dbm, but I haven't done benchmarks myself
<orbifx3> It's what it says on the box
<orbifx3> Any other k,v databases I should be considering?
<Drup> is it performance sensitives ?
<orbifx3> Simplicity and good read/lookup times
<orbifx3> I'm writing an authentication program
orbifx1 has quit [Ping timeout: 260 seconds]
<orbifx3> I'd like it to be self contained
<Drup> just use dbm now
<orbifx3> Because?
<Drup> self contained, available everywhere, simple, released :)
<orbifx3> Lmbd not there yet?
<Drup> my bindings ? not released
<orbifx3> Ok
<orbifx3> What's the outlook?
<Drup> the outlook ?
<Drup> hum, didn't knew that meaning
<Drup> well, I just couldn't figure out an API for cursors, and I stopped working on it.
<orbifx3> Ok
mfp_ has joined #ocaml
mfp has quit [Ping timeout: 276 seconds]
orbifx3 has quit [Read error: Connection reset by peer]
orbifx has joined #ocaml
amnn has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
samg_ has quit [Ping timeout: 260 seconds]
struk|desk has quit [Remote host closed the connection]
tmtwd has quit [Ping timeout: 244 seconds]
struk|desk has joined #ocaml
mfp_ has quit [Ping timeout: 260 seconds]
mfp_ has joined #ocaml
silver has quit [Read error: Connection reset by peer]
samg_ has joined #ocaml
pierpa has quit [Read error: No route to host]
scarygelatin has quit [Quit: Leaving]
rgrinberg has joined #ocaml
pierpa has joined #ocaml
Pepe_ has quit [Ping timeout: 272 seconds]
FreeBirdLjj has joined #ocaml
pierpa has quit [Ping timeout: 260 seconds]
yegods has joined #ocaml
samg_ has quit [Quit: leaving]
Orion3k has quit [Ping timeout: 252 seconds]
Orion3k has joined #ocaml
rgrinberg has quit [Ping timeout: 252 seconds]
mistermetaphor has joined #ocaml
walter|r has quit [Remote host closed the connection]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
jonasen has joined #ocaml
shinnya has joined #ocaml
sh0t has quit [Remote host closed the connection]
<struk|desk> Algebr: finall got that damn cohml library to link properly.
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
unbalancedparen has quit [Quit: WeeChat 1.5]
<struk|desk> now I'm going to hack away at it to make it a true api..
tmtwd has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
Sorella has quit [Quit: Connection closed for inactivity]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
tmtwd has quit [Ping timeout: 240 seconds]
<Algebr> oh great, same makefile?
MercurialAlchemi has joined #ocaml
copy` has quit [Quit: Connection closed for inactivity]
yunxing has joined #ocaml
mistermetaphor has quit [Remote host closed the connection]
yunxing_ has joined #ocaml
yunxing has quit [Ping timeout: 260 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
Bahman has quit [Quit: ave atque vale]
d0nn1e has quit [Ping timeout: 244 seconds]
ygrek has joined #ocaml
d0nn1e has joined #ocaml
yunxing_ has quit [Ping timeout: 250 seconds]
A1977494 has joined #ocaml
redpoppies has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
TheLemonMan has joined #ocaml
mistermetaphor has joined #ocaml
mistermetaphor has quit [Ping timeout: 258 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
dsheets has joined #ocaml
dsheets has quit [Ping timeout: 260 seconds]
_2can has quit [Remote host closed the connection]
govg has joined #ocaml
orbifx1 has joined #ocaml
orbifx has quit [Quit: AtomicIRC: The nuclear option.]
orbifx1 is now known as orbifx
rgrinberg has joined #ocaml
schive has joined #ocaml
slash^ has joined #ocaml
mistermetaphor has joined #ocaml
redpoppies has quit [Quit: redpoppies]
A1977494 has quit [Quit: Leaving.]
mistermetaphor has quit [Ping timeout: 272 seconds]
rgrinberg has quit [Ping timeout: 244 seconds]
Pepe_ has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 250 seconds]
wolfcore has quit [Ping timeout: 250 seconds]
anoisz has joined #ocaml
wolfcore has joined #ocaml
govg has quit [Quit: leaving]
<orbifx> why does Marshal.from_string need an int?
<flux> it's an offset.. if your data starts at offset 0, then use that
<flux> it needs it because ocaml doesn't have a substring datatype
<flux> seems quite opintless that it doesn't return the number of bytes consumed, though
<flux> though you can use total_size for that
<orbifx> ok thanks
A1977494 has joined #ocaml
amnn has joined #ocaml
ygrek has quit [Ping timeout: 240 seconds]
<orbifx> First version of Tokenauth in OCaml ready: https://github.com/orbifx/tokenauth. flux and others, any comments welcome.
mistermetaphor has joined #ocaml
<orbifx> I'll write the documentation soon
dakk has joined #ocaml
mistermetaphor has quit [Ping timeout: 276 seconds]
dakk has quit [Ping timeout: 260 seconds]
orbifx-m has joined #ocaml
ygrek has joined #ocaml
regnat has quit [Ping timeout: 276 seconds]
orbifx has quit [Ping timeout: 244 seconds]
ygrek has quit [Ping timeout: 244 seconds]
orbifx has joined #ocaml
orbifx-m has quit [Ping timeout: 260 seconds]
dario1 has joined #ocaml
regnat has joined #ocaml
sdothum has joined #ocaml
oxcsh has joined #ocaml
oxcsh_ has joined #ocaml
<dario1> Hi everyone! Does Cmdliner support grouping of options into categories?
Sorella has joined #ocaml
oxcsh has quit [Ping timeout: 250 seconds]
devol has joined #ocaml
orbifx has quit [Ping timeout: 276 seconds]
Bahman has joined #ocaml
<zozozo> dario1: yes
<zozozo> you can group options in separate Term.t in your code, and also give each option a manpage section under which it should appear in the manpage
orbifx has joined #ocaml
orbifx has quit [Read error: Connection reset by peer]
orbifx2 has joined #ocaml
Anarchos has joined #ocaml
mistermetaphor has joined #ocaml
mistermetaphor has quit [Ping timeout: 244 seconds]
copy` has joined #ocaml
dsheets has joined #ocaml
amnn has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<dario1> zozozo: Thanks! I'll check for that in the docs...
yegods has quit [Remote host closed the connection]
yegods has joined #ocaml
pierpa has joined #ocaml
dario1 has quit [Quit: Konversation terminated!]
<struk|desk> Algebr: the critical bits seem to be (1) adding -lc++, (2) making sure the linking pieces are at the end of the command line, after the object files, and (3) moving iostream / sstream further up in the include file, to fix a redefinition of std::ostream::flush to caml_flush
<struk|desk> Algebr: sorry, adding -lstdc++ not -lc++
mcc has joined #ocaml
tane has joined #ocaml
<mcc> i have not been in here for a while, so : hello
<Drup> hello mcc :)
<struk|desk> hi mcc
Bahman_ has joined #ocaml
jonasen has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Bahman has quit [Ping timeout: 244 seconds]
A1977494 has quit [Remote host closed the connection]
Anarchos has quit [Quit: gardening time]
troydm has quit [Ping timeout: 244 seconds]
dsheets has quit [Remote host closed the connection]
jonasen has joined #ocaml
troydm has joined #ocaml
Bahman__ has joined #ocaml
Bahman_ has quit [Ping timeout: 250 seconds]
jonasen has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<MercurialAlchemi> how can I tell ocaml that, contrary to what it believes, a parameter is of type [> foo ] and not of type foo?
<Drup> what's the context ?
<MercurialAlchemi> specifying it in the signature appears to make no difference in practice
dsheets has joined #ocaml
<Drup> well, [> foo] unifies with foo, so you have a constraint somewhere asking for foo
<MercurialAlchemi> I have a type [ `Foo ] and a type [ `Foo | `Bar ]
<MercurialAlchemi> I have a function which takes another function, and returns either `Foo or the result of the other function
<MercurialAlchemi> OCaml has decided that the function in parameter has [ `Foo ] as return type, I want to tell it that it's actually [> `Foo]
<MercurialAlchemi> but no amount of type annotation appears to make a difference, if I attempt to feed anything that returns [ `Foo | `Bar ] it has a fit and refuses to compile
<Drup> can you show the code ?
amnn has joined #ocaml
<MercurialAlchemi> let me make a simpler case...
A1977494 has joined #ocaml
oxcsh_ has quit [Remote host closed the connection]
oxcsh has joined #ocaml
sh0t has joined #ocaml
<MercurialAlchemi> hmm
<MercurialAlchemi> I think the problem is that one of the functions uses something that eats a [`Foo] and not a [>`Foo]
TheLemonMan has quit [Remote host closed the connection]
<Drup> well, you can't possibly give a [> `Foo] to something expecting [ `Foo]
<MercurialAlchemi> it's not quite the issue
walter|r has joined #ocaml
scarygelatin has joined #ocaml
<Enjolras_> You can cast with :> but i'm not sure this is your problem here. It is not clear without code
<Enjolras_> but sometimes :> is necessary to help typechecker
<Enjolras_> let foo = `Foo in foo;;
<Enjolras_> - : [> `Foo ] = `Foo
<Enjolras_> let foo :> [ `Foo | `Bar ]= `Foo in foo;;
<Enjolras_> - : [ `Bar | `Foo ] = `Foo
<Enjolras_> but i guess we can't help without seeing the code or a more precise description of the code
<Enjolras_> (funny toplevel reoreders variant. I had never noticed :) )
<MercurialAlchemi> Enjolras_: I'm trying to pinpoint the issue more precisely
<MercurialAlchemi> (and litering the code with :> and [>], indeed)
mistermetaphor has joined #ocaml
<Enjolras_> usually, when you have a type issue with variant, i find the easiest strategy is to anotate manually all function arguments and or let bindings until you find a more precise type error
yegods has quit [Remote host closed the connection]
<Enjolras_> because it shows you where exactly your expectation is wrong
jonasen has joined #ocaml
yegods has joined #ocaml
<MercurialAlchemi> well, I can get it to compile by removing a call to a ppx_deriving_show function
<Enjolras_> (i which it was a merlin feature btw)
mistermetaphor has quit [Ping timeout: 246 seconds]
<Drup> MercurialAlchemi: what are you deriving from ?
<MercurialAlchemi> well, in my case it would be [ `Foo ]
<Drup> why are you not deriving on the biggest datatype ?
<Enjolras_> pfiu. deriving on polymorphic variants looks scary
<Drup> Enjolras_: well, it's going to be closed, that's all
<Drup> nothing scary
TheLemonMan has joined #ocaml
<Enjolras_> maybe i'm scared for nothing but i don't like the idea of having generated code mixed with subtyping
<Drup> that's the point, it's not subtyping when a variant is closed
troydm has quit [Ping timeout: 244 seconds]
Mercuria1Alchemi has joined #ocaml
<Enjolras_> Drup: but the other types you use are not always closed and then it breaks your expectations. Like you derive enum on [`Foo | `Bar], you want to store the results in ([`Foo | `Bar | `Lol ], int) Hashtbl.t. It doesn't work.
<Enjolras_> it's not a big issue, but if the code becomes complex it can lead to some headache when it's not explicit because the code is generated
<Enjolras_> actually i don't even know if deriving enum works on variants
dakk has joined #ocaml
troydm has joined #ocaml
<Enjolras_> there is nothing crazy here, it would happen with a hand written function which returns a closed type and you want to upcast it to store in a collection, but with deriving you don't see the code. Maybe it's not a big deal though :)
Mercuria1Alchemi has quit [Ping timeout: 260 seconds]
<Enjolras_> hmm. I guess this is called downcast. Whatever
dakk has quit [Ping timeout: 272 seconds]
struktured has joined #ocaml
<struktured> so if one were to implement a map, would you adhere to Map.S 's signature, or diverge from it because it's too limiting in some way?
<MercurialAlchemi> http://pastebin.com/ddGQAQ3w
<MercurialAlchemi> ocaml thinks that the signature of M.do_stuff is foo -> foo
<MercurialAlchemi> it's not like there are type annotations to the contrary or anything
<Drup> MercurialAlchemi: I told you, foo and [> foo] unifies, so it's perfectly valid
<Drup> it's like "let f : 'a -> 'a = (+) 1"
<Drup> it's valid
<MercurialAlchemi> is "it's valid" a synonym for "you're screwed"?
<Drup> no, let me look at it
<MercurialAlchemi> note that removing the type annotation in do_stuff_with_foo and the use of show_foo makes ocaml caml down, but that's not really satisfactory
<Drup> I removed the useless annotations and kept only the one that is needed
<Drup> (the others were doing more harm than good ...)
<Drup> So, basically, the issue is that if you put (foo' :> [> foo]), the typechecker doesn't even bother doing a coercion, since foo' is of a type compatible with [> foo] (namely: foo).
<Drup> So you need to be a bit more forceful, and tell the typecher the exact coercion you want
<MercurialAlchemi> ok, I didn't know you could do that
<MercurialAlchemi> well, thanks
<Drup> no problem, it's one of those case that is quite tricky
Anarchos has joined #ocaml
yegods_ has joined #ocaml
yegods has quit [Read error: Connection reset by peer]
unbalancedparen has joined #ocaml
struktured has quit [Ping timeout: 260 seconds]
mistermetaphor has joined #ocaml
orbifx has joined #ocaml
orbifx2 has quit [Ping timeout: 260 seconds]
mistermetaphor has quit [Remote host closed the connection]
<MercurialAlchemi> I can live with that
copy` has quit [Quit: Connection closed for inactivity]
rgrinberg has joined #ocaml
Algebr has quit [Remote host closed the connection]
Algebr has joined #ocaml
dhil has joined #ocaml
sh0t has quit [Remote host closed the connection]
sh0t has joined #ocaml
g4143 has joined #ocaml
amnn has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
darkf has quit [Quit: Leaving]
g4143 has quit [Quit: Ex-Chat]
ygrek has joined #ocaml
amnn has joined #ocaml
yegods_ has quit []
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
copy` has joined #ocaml
amnn has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Leonidas> MercurialAlchemi: "makes ocaml caml down" :D
amnn has joined #ocaml
amnn has quit [Client Quit]
amnn has joined #ocaml
dakk has joined #ocaml
al-maisan has quit [Ping timeout: 260 seconds]
al-maisan has joined #ocaml
oxcsh has quit [Remote host closed the connection]
oxcsh has joined #ocaml
sh0t has quit [Quit: Leaving]
Pepe_ has quit [Quit: leaving]
Pepe_ has joined #ocaml
Bahman__ has quit [Quit: ave atque vale]
slash^ has quit [Read error: Connection reset by peer]
orbifx-m has joined #ocaml
orbifx has quit [Ping timeout: 258 seconds]
<Drup> rgrinberg: do you mind if I just rewrite the pp function ? ^^
<Drup> It's going to be quicker than just telling you all the small fixes
schive has quit [Quit: Leaving]
<rgrinberg> Drup: that would be great. Thanks!
<rgrinberg> so we can't use pp_print_list. annoying :/
<Drup> rgrinberg: it's a good timing, btw, I wanted a printer for Tyre.t but I was annoyed by the lack of printer for Re.t
<Drup> oh, version constraints, right
<Drup> not that much of a problem
jonasen has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
demonimin has quit [Remote host closed the connection]
dhil has quit [Ping timeout: 246 seconds]
dsheets has quit [Remote host closed the connection]
dsheets has joined #ocaml
demonimin has joined #ocaml
dsheets has quit [Ping timeout: 252 seconds]
oxcsh has quit [Remote host closed the connection]
redpoppies has joined #ocaml
oxcsh has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 244 seconds]
<Drup> (it was nicer that way ...)
<Drup> (there are various other printers that could be simplified too)
dsheets has joined #ocaml
<rgrinberg> Drup: so we can get rid of the print_* functions in re_* right?
<rgrinberg> they aren't a part of the public API
<Drup> everything that is in Re_automaton and Re_cset is not public
<rgrinberg> yup
<Drup> I removed one already
<Drup> I'll let you play with it more :p
dsheets has quit [Ping timeout: 250 seconds]
<Drup> rgrinberg: while we're at it, could you 4.03 in CI ?
<Drup> +add
cr4ven has joined #ocaml
bba has joined #ocaml
<cr4ven> Hi all, I'm just getting start with ocaml and I was wondering if someone could help with (what I assume is) a trivial build issue. I have a file containing just 'open Extlib', but when I try to build it I get an error 'Unbound module Extlib'. You can see the full details here http://pastebin.com/M2HNPqKc
<cr4ven> Assistance would be greatly appreciated so I can move on to failing at the language itself ;)
rgrinberg has quit [Ping timeout: 276 seconds]
<Drup> cr4ven: it's "ExtLib"
<Drup> your first ocamlbuild invocation is correct
pyon has quit [Quit: Ihnen, Herr Lasker, habe ich nur drei Worte zu sagen: Nyan und Pasu~.]
bba has quit [Quit: Textual IRC Client: www.textualapp.com]
pyon has joined #ocaml
<cr4ven> Drup: Hmm, so I tried 'open ExtLib' and got the same error
<cr4ven> ah, nvm, it works
<cr4ven> I got the same error with 'corebuild test.native'
<Drup> yeah, that's normal
<cr4ven> But as you said, the first ocamlbuild invocation was fine.
cr4ven has quit [Quit: leaving]
cr4ven has joined #ocaml
bba has joined #ocaml
bba_ has joined #ocaml
redpoppies has quit [Quit: redpoppies]
bba has quit [Ping timeout: 244 seconds]
_2can has joined #ocaml
loocash has joined #ocaml
ygrek has quit [Ping timeout: 246 seconds]
loocash has quit [Quit: Leaving]
orbifx has joined #ocaml
Sorella has quit [Quit: Connection closed for inactivity]
amnn has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
unbalancedparen has quit [Quit: WeeChat 1.5]
unbalancedparen has joined #ocaml
<orbifx> Does my tokenauth auth Readme make any sense? https://github.com/orbifx/tokenauth
<orbifx> I'd appreciate if anyone took the time to have a quick read
<orbifx> Nginx knowledge would be handy
<orbifx> Next stop is to put it in Opam, but need some core features completed.
dakk has quit [Remote host closed the connection]
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
andy has joined #ocaml
<orbifx> seliopou: :)
<andy> Hi, new to ocaml as of today. Was wondering the idiomatic way to output data as a string. (I don't need to be able to read it back.) I have some code here http://pastebin.com/UYK7wEed but I don't want to have to write code like that every time I define a data type!
<andy> Would like something like c++'s `out << "(" << x << ...` but ocaml doesn't have overloading.
<orbifx> Printf.printf "%s ..." string;
amnn has joined #ocaml
<andy> @orbfix: problem is I may not always want to send it to stdout
<orbifx> Look at the Pervasives and Printf module documentation.
A19774941 has joined #ocaml
<orbifx> Broadly speaking, the IO is handled a bit like in C
<orbifx> rather than stream operators
A1977494 has quit [Ping timeout: 264 seconds]
<orbifx> That said, there is probably some module out there providing that approach ;)
<Drup> well, the API is slightly like C, not the semantics
<Drup> (thanksfully, because printf/scanf's C semantics is a nightmare)
<orbifx> :P
<andy> Looks like I could use `out_channel` and `fprintf` instead of BatIO's `output` and `write_***`.
<orbifx> yes
<orbifx> You can make a socket from anything and write to it using that.
<orbifx> OCaml has good Unix support, but in workflow and backend support.
<orbifx> s/but/both
<andy> Drup: thanks, looks like exactly what I want.
tane has quit [Remote host closed the connection]
bba_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<orbifx> seliopou:
<orbifx> ?
scarygelatin has quit [Ping timeout: 260 seconds]
scarygelatin has joined #ocaml
A19774941 has quit [Remote host closed the connection]
d0nn1e has quit [Ping timeout: 272 seconds]
d0nn1e has joined #ocaml
andy has quit [Quit: Leaving]
yunxing has joined #ocaml
yunxing has quit [Client Quit]
orbifx has quit [Ping timeout: 272 seconds]
pyon has quit [Quit: fix config]
pyon has joined #ocaml
madroach has quit [Ping timeout: 244 seconds]
madroach has joined #ocaml
jhaberku has quit [Remote host closed the connection]