<rgrinberg>
I'm writing code that depends on a serialization protocol (json or bin_prot maybe) but I'd like it to remain protocol independent
<rgrinberg>
are there any best practices for doing that?
<rgrinberg>
I could wrap all my code in a functor over serialization/deserialization but then I think that I restrict using the API in cases where it doesn't matter
<rgrinberg>
for example if i depend on serialization for a job to be created I might not depend on that if I'm deleting a job (where only knowing the id is sufficient)
chrisdotcode has joined #ocaml
cdidd has joined #ocaml
mcclurmc has quit [Quit: Leaving.]
cdidd has quit [Read error: Operation timed out]
cdidd has joined #ocaml
manud_ has joined #ocaml
cratylus has joined #ocaml
mcclurmc has joined #ocaml
ollehar has quit [Ping timeout: 256 seconds]
mcclurmc has quit [Quit: Leaving.]
manud_ has quit [Ping timeout: 240 seconds]
cratylus has quit [Quit: Leaving]
Simn has quit [Quit: Leaving]
zRecursive has joined #ocaml
madroach has quit [Ping timeout: 264 seconds]
madroach has joined #ocaml
q66 has quit [Quit: Leaving]
Drup has quit [Quit: Leaving.]
cesar_ has joined #ocaml
cesar_ is now known as Guest33683
ygrek_ has joined #ocaml
csakatoku has joined #ocaml
watermind has quit [Quit: Konversation terminated!]
tchell has quit [Ping timeout: 248 seconds]
caligula_ has quit [Ping timeout: 256 seconds]
caligula_ has joined #ocaml
manizzle has quit [Ping timeout: 240 seconds]
ihm1 has joined #ocaml
ihm1 has quit [Client Quit]
ihm1 has joined #ocaml
<zRecursive>
After installing ocaml from ocaml-4.01.0.tar.gz, how to install ocaml findlib ?
<pippijn>
omake_main depends on all the stuff before it
<pippijn>
oh, I got it
zRecursive has joined #ocaml
<pippijn>
is it possible to add extra modules to a Program in oasis?
talzeus has quit [Remote host closed the connection]
Guest33683 has quit [Remote host closed the connection]
<zRecursive>
i only heard of OPAM, what's the usage of oasis ?
<pippijn>
opam is a package manager, oasis is a build system
<pippijn>
oasis builds on ocambuild
<pippijn>
does oasis have a way to specify DESTDIR when installing?
<zRecursive>
oh, it seems `make` is enough for me
talzeus has joined #ocaml
talzeus has quit [Remote host closed the connection]
lopex has joined #ocaml
talzeus has joined #ocaml
talzeus has quit [Remote host closed the connection]
manud_ has quit [Ping timeout: 248 seconds]
manud_ has joined #ocaml
SrPx has joined #ocaml
manud_ has quit [Ping timeout: 248 seconds]
nikki93 has quit [Remote host closed the connection]
csakatok_ has joined #ocaml
csakatoku has quit [Ping timeout: 248 seconds]
manizzle has joined #ocaml
ihm1 has joined #ocaml
Simn has joined #ocaml
ggole has joined #ocaml
Kakadu has joined #ocaml
zarul has quit [Ping timeout: 268 seconds]
ihm1 has quit [Quit: ihm1]
caseyjames has joined #ocaml
Yoric has joined #ocaml
zpe has joined #ocaml
zRecursive has left #ocaml []
<caseyjames>
has anyone here done work with pomap or generally posets?
manud_ has joined #ocaml
manud_ has quit [Ping timeout: 252 seconds]
octet8 has joined #ocaml
talzeus has joined #ocaml
talzeus has quit [Remote host closed the connection]
talzeus has joined #ocaml
Khady1 is now known as Khady
mort___ has joined #ocaml
nikki93 has joined #ocaml
nikki93 has quit [Remote host closed the connection]
nikki93 has joined #ocaml
<Simn>
I have a list of elements and I want to shortcut a few specific elements in a record. Is there any sane way of doing this?
<companion_cube>
depends, how specific are they? :)
<Simn>
I know which ones I want if that's what you're asking.
<companion_cube>
Simn: by their index?
<companion_cube>
or some property?
<Simn>
I don't know the index unfortunately. It's a list of types that have some path, and I want to have e.g. record.t_string = somehow_find_type "String".
<Simn>
That's what I'm doing right now, but I would much rather iterate the types just once...
<companion_cube>
could you write a small example?
<companion_cube>
maybe what you need is not a list, but some kind of map
ulfdoz has joined #ocaml
<Kakadu>
I think you can iterate over list and if path of current list element is good you can update specific field in your record
<Simn>
Well, the list is my input. I'm sure I can use some map and resolve by type name.
<Simn>
Kakadu, yes, but then I have to make all record fields mutable just for the initialization, right?
<companion_cube>
Simn: if you re-use the list later, it could be indeed simpler to convert it to a map
<companion_cube>
which has much nicer properties w.r.t. lookup
<Kakadu>
Simn: you can use fold insert of iter where fold result will be your structure
<Kakadu>
s/insert/instead/
<Simn>
Hmm...
<Simn>
Not sure I understand that.
<Kakadu>
List.fold ~init:empty_struct ~f:(fun acc x -> if x#type="String" then {acc with t_string=x} else acc) xs
<Simn>
Ah, that's allowed? Nice
<companion_cube>
looks like Core :]
<Kakadu>
yep
<Simn>
What is this empty_struct?
<Kakadu>
your struct where fields are not initialized
<Kakadu>
You probably need to decide what content should field 't_string' have if type String is not in the list
nikki93 has quit [Remote host closed the connection]
chrisdotcode_ has joined #ocaml
chrisdotcode has quit [Ping timeout: 260 seconds]
<Simn>
I see, thank you.
octet8 has quit []
ontologiae_ has joined #ocaml
zarul has joined #ocaml
octet8 has joined #ocaml
ontologiae_ has quit [Ping timeout: 240 seconds]
ikudrautsau has joined #ocaml
ikudrautsau has quit [Max SendQ exceeded]
ikudrautsau has joined #ocaml
ikudrautsau has quit [Max SendQ exceeded]
manud_ has joined #ocaml
ikudrautsau has joined #ocaml
ikudrautsau has quit [Max SendQ exceeded]
ikudrautsau has joined #ocaml
ikudrautsau has quit [Max SendQ exceeded]
ikudrautsau has joined #ocaml
talzeus has quit [Remote host closed the connection]
cantstanya has quit [Ping timeout: 240 seconds]
Neros has joined #ocaml
Snark has joined #ocaml
malc_ has joined #ocaml
darkf has quit [Quit: Leaving]
cantstanya has joined #ocaml
ikudrautsau has left #ocaml []
csakatok_ has quit [Remote host closed the connection]
<orbitz>
companion_cube: are you going to split it out and push to opam?
<companion_cube>
I need to polish it first
<companion_cube>
(you can try it if you want)
<companion_cube>
I'm not exactly sure, for instance, that Arbitrary.fix has the right signature
csakatoku has joined #ocaml
csakatoku has quit [Ping timeout: 260 seconds]
q66 has quit [Quit: Leaving]
q66 has joined #ocaml
kay__ has quit [Remote host closed the connection]
Drup has joined #ocaml
ontologiae_ has joined #ocaml
Yoric has quit [Ping timeout: 245 seconds]
beckerb has joined #ocaml
kay_ has joined #ocaml
ollehar has quit [Ping timeout: 245 seconds]
q66 has quit [Quit: Leaving]
zRecursive has left #ocaml []
q66 has joined #ocaml
ollehar has joined #ocaml
<argp>
i figured out how to build a 32-bit version of ocaml on osx
<argp>
the INSTALL file needs an update in the relevant part
<argp>
what's the proper way of sending this update?
<argp>
mailing list?
q66 has quit [Quit: Leaving]
<argp>
pull request on github?
<Kakadu>
maybe both:)
<Kakadu>
AFAIR the was maillist for compiler-developers only but I don't know link now
leone has joined #ocaml
<Kakadu>
argp: Also you can create bug in mantis and link your patches there
<Drup>
argp: mantis is the best way
<argp>
ok, thank you both, mantis it is
q66 has joined #ocaml
Yoric has joined #ocaml
adesso has joined #ocaml
adesso has quit [Client Quit]
adesso has joined #ocaml
leone has quit [Ping timeout: 240 seconds]
ontologiae_ has quit [Ping timeout: 240 seconds]
mort___ has quit [Quit: Leaving.]
ontologiae_ has joined #ocaml
adesso has quit []
Sim_n has joined #ocaml
Simn has quit [Ping timeout: 240 seconds]
davekong has quit [Ping timeout: 264 seconds]
ontologiae_ has quit [Ping timeout: 248 seconds]
tobiasBora has joined #ocaml
Yoric has quit [Ping timeout: 256 seconds]
tobiasBora has quit [Quit: Konversation terminated!]
mfp has quit [Ping timeout: 245 seconds]
mfp has joined #ocaml
ulfdoz has joined #ocaml
mort___ has joined #ocaml
ski has quit [Ping timeout: 245 seconds]
ski has joined #ocaml
cdidd has quit [Remote host closed the connection]
mort___ has quit [Quit: Leaving.]
talzeus has joined #ocaml
talzeus has quit [Remote host closed the connection]
talzeus has joined #ocaml
SrPx has quit [Ping timeout: 250 seconds]
demonimin has quit [Remote host closed the connection]
malc_ has quit [Quit: leaving]
demonimin has joined #ocaml
mort___ has joined #ocaml
demonimin_ has joined #ocaml
demonimin has quit [Ping timeout: 245 seconds]
<caseyjames>
has anyone here done work with pomap or generally posets?
tane has joined #ocaml
talzeus has quit [Ping timeout: 245 seconds]
asmanur has quit [Ping timeout: 248 seconds]
asmanur has joined #ocaml
talzeus has joined #ocaml
davekong has joined #ocaml
talzeus has quit [Remote host closed the connection]
talzeus has joined #ocaml
cesar_ has joined #ocaml
cesar_ is now known as Guest55036
ulfdoz has quit [Read error: Operation timed out]
talzeus has quit [Remote host closed the connection]
ulfdoz has joined #ocaml
<ggole>
Lack of polymorphism in exceptions can be annoying. I'd like to report "a bad thing happened and the cause is <datum>", but can't. Is there a good workaround?
<pippijn>
hm
<pippijn>
I don't know of a good one
<pippijn>
you could use a universal type thing
<pippijn>
with an inject/project pair
<ggole>
Hmm... would I have to pass the projector around everywhere?
<pippijn>
yes
<ggole>
I'm not sure it's worth it :/
<pippijn>
or maybe in the exception
<ggole>
OK, thanks
<pippijn>
no, not in the exception
<ggole>
I've got no problem unpacking the exception, since I'll know the right type there
<pippijn>
you could functorise everything to get rid of the polymorphism
<ggole>
It's raising it
<ggole>
Yeah, but introducing a functor just for errors...
<pippijn>
if you have a limited choice of data types that can cause a failure, make a sum type over them
<ggole>
There's exactly one type that can cause (this particular) failure, but it is a type argument
<pippijn>
hmm
<pippijn>
you could go with a failure function
<ggole>
Wait, I have a record that I could stash an injector in
<pippijn>
injector is a special case of a failure function
<ggole>
Or that, yep
octet8 has quit []
<ggole>
Seems a bit ugly, but it would work.
<pippijn>
it's not that ugly
<pippijn>
it's an ad-hoc version of monadic exceptions
<pippijn>
in fact
<pippijn>
ggole: that failure function could raise an exception containing the 'a
<pippijn>
because you know the type when constructing the function
<pippijn>
you can have a local exception type for that particular 'a
<ggole>
Ah, hmm
<ggole>
Don't think that will be necessary, since the type in question is a parameter of my data structure.
<ggole>
It's available for everything... except exceptions :/
<ggole>
Yes, a failure function is the way to go. Thanks for the input!
ygrek_ has joined #ocaml
Kakadu has quit [Read error: Operation timed out]
Yoric has joined #ocaml
madroach has quit [Ping timeout: 264 seconds]
ihm1 has joined #ocaml
mcclurmc has quit [Quit: Leaving.]
mort___ has quit [Quit: Leaving.]
iZsh has quit [Quit: Coyote finally caught me]
iZsh has joined #ocaml
iZsh has quit [Excess Flood]
iZsh has joined #ocaml
chrisdotcode has joined #ocaml
chrisdotcode_ has quit [Ping timeout: 252 seconds]
mort___ has joined #ocaml
ygrek_ has quit [Ping timeout: 252 seconds]
Marco__ has joined #ocaml
gnuvince has joined #ocaml
gnuvince has quit [Changing host]
gnuvince has joined #ocaml
rossberg has quit [Ping timeout: 260 seconds]
q66_ has joined #ocaml
<caseyjames>
Hi, I just did a opam update and opam upgrade and its wiped out all of my packages -- it can't find core or anything, is this a common problem with opam?
q66 has quit [Ping timeout: 248 seconds]
<jpdeplaix>
caseyjames: no. Did you report this ?
<caseyjames>
It just happend, so not yet. where do I report it to? Is the implication that this isn't something thats common. I just got OCaml setup a month ago and it was a bit of a nightmare - I was very apprehensice about updating anything as I figured it might go this way
<jpdeplaix>
caseyjames: please put your console output inside ```
nikki93 has joined #ocaml
<caseyjames>
I dont get what you mean, inside backticks like ``code`` ?
<jpdeplaix>
yes
<jpdeplaix>
but I see why. Some package upgrade fails
<jpdeplaix>
mmmh what version of opam have you ?
<caseyjames>
how do i find out?
Snark has quit [Ping timeout: 240 seconds]
<jpdeplaix>
opam --version
<caseyjames>
1.0.0
<jpdeplaix>
mmmh, I see. Please use the 1.1 beta
<jpdeplaix>
the 1.0 is not very stable
<caseyjames>
I will definitely look into how I go about upgrading to that than. I'm halfway through reinstalling the core stuff so I can get to a meeting. The install process isn't opam ugrade is it?
<caseyjames>
phew... at least it installed an tuareg is working again - that was nearly disastrous. Thanks for the tipss
caseyjames has quit [Quit: Page closed]
Guest55036 has quit [Remote host closed the connection]
nikki93 has quit [Remote host closed the connection]
nikki93 has joined #ocaml
<ollehar>
a question about lwt...
<ollehar>
when doing
<ollehar>
Printf.eprinf "foo"
<ollehar>
Lwt_main.run (main)
<ollehar>
"foo" will never be printed. Any reason why?
<ollehar>
However, if I instead write Lwt_io.eprintl "bar", bar will be printed
<ollehar>
<code>
<jpdeplaix>
ollehar: it's not the same function
<jpdeplaix>
the first one misses a \n
<ollehar>
jpdeplaix: thanks for your help. getting the same result, though. my real problem is a database update which won't get run. maybe I should create a lwt thread and run it in that?