Zerker has quit [Quit: Colloquy for iPad - Timeout (10 minutes)]
osnr has quit [Quit: Leaving.]
venk has quit [Ping timeout: 252 seconds]
venk has joined #ocaml
fraggle_laptop has quit [Remote host closed the connection]
ygrek has joined #ocaml
Drup has quit [Quit: Leaving.]
talzeus has quit [Remote host closed the connection]
talzeus has joined #ocaml
yacks has quit [Ping timeout: 245 seconds]
talzeus has quit [Ping timeout: 240 seconds]
leroux has left #ocaml []
venk has quit [Ping timeout: 245 seconds]
yacks has joined #ocaml
madroach has quit [Ping timeout: 248 seconds]
madroach has joined #ocaml
ollehar has quit [Ping timeout: 256 seconds]
breakds has quit [Quit: Konversation terminated!]
ygrek has quit [Quit: ygrek]
talzeus has joined #ocaml
dsheets has quit [Ping timeout: 256 seconds]
ygrek has joined #ocaml
oriba has quit [Quit: oriba]
venk has joined #ocaml
jcao219 has joined #ocaml
talzeus has quit [Remote host closed the connection]
talzeus has joined #ocaml
talzeus has quit [Ping timeout: 256 seconds]
darkf has joined #ocaml
chrisdotcode has joined #ocaml
<amiller_>
ousado, thanks for that link i am studying it now
<amiller_>
i have seen that link before but not digested it properly...
<amiller_>
i have a question right now which is how to approach doing building a bunch of generic functions the way i would normally use typeclasses in haskell
talzeus has joined #ocaml
<amiller_>
for example a type directed pretty printer basically
<amiller_>
for example i want to pretty print tuples or printable types
<amiller_>
in haskell i would do something like "instance (Printable a, Printable b) => Printable (a,b)"
<amiller_>
i know that modules in ocaml can be used analogously to type calsses
<amiller_>
i can't figure out what the corresponding thing would be here
<amiller_>
is there a bifunctor in haskell?
<amiller_>
er in ocaml*
<amiller_>
a functor with two parameters?
<amiller_>
In general there can be any number of parameter modules, each of which must be specified with a name and signatur
<amiller_>
ah nvm that isn't a well formed question i'm not sure what i mean yet
gnuvince has joined #ocaml
mattrepl has joined #ocaml
jcao219 has quit [Ping timeout: 252 seconds]
chrisdotcode_ has joined #ocaml
chrisdotcode has quit [Ping timeout: 264 seconds]
jcao219 has joined #ocaml
gautamc has quit [Read error: Connection reset by peer]
talzeus has quit [Remote host closed the connection]
talzeus has joined #ocaml
gautamc has joined #ocaml
talzeus has quit [Remote host closed the connection]
osnr has joined #ocaml
osnr has quit [Client Quit]
osnr has joined #ocaml
osnr has quit [Changing host]
osnr has joined #ocaml
jcao219 has quit [Ping timeout: 268 seconds]
ttamttam has joined #ocaml
ttamttam has quit [Remote host closed the connection]
ggole has joined #ocaml
hto has quit [Quit: leaving]
<flux>
amiller_, you can have multi-parameter functors: module Z = functor (B : T) -> functor (C : T) -> struct .. end;;
<companion_cube>
it's a kind of record, and you want a set of records indexed by some of their fields
<spanish>
let me see
<companion_cube>
like, if you have a record for a phone book, you want to index a set of records by phone number, name, maybe age, etc.
<Drup>
the indexes are used to have fast access and filtering operations.
<spanish>
well, you could look at the source of it, but what does Ixset actually does?
hyperboreean has joined #ocaml
<companion_cube>
it looks like it does a lot of runtime reflection stuff
user_ has joined #ocaml
<Drup>
spanish: the point of my question is "Is there this kind of structure in Ocaml" ;)
<companion_cube>
most signatures use Typeable...
<companion_cube>
Drup: a better question is "how to make such a structure in OCaml" ;)
<spanish>
I'd use, as it's text-related stuff, a dfa holding al the strings, and a fixed vector on the final states of those strings, pointing to relevant result structures
<Drup>
companion_cube: that was the second question, in case the anwser is no :p
user_ has quit [Client Quit]
<Drup>
spanish: it's not text related
<companion_cube>
spanish: it's generic on both the indexes and the type of the elements of the set
<Drup>
spanish: look at the Map in the standard caml library to see the kind of interface we use
<spanish>
still what I said applies, I jsut think in c
<spanish>
if you give me an url Drup?
<gasche>
Drup: what about using a map of map of map ... of map?
<spanish>
ah, you mean the api definition?
<gasche>
the operations should be easy to implement and reasonably efficient
<Drup>
gasche: I'm not sure how a map of map would solve the problem
<companion_cube>
maybe you can do a functor that takes an indexed set with indexes I_1...I_n and make an indexed set with indexes I_1,..I_n, I_{n+1}
<gasche>
Drup: ?
<companion_cube>
(by adding a new map to the module, and corresponding functions)
<companion_cube>
gasche: it's more like a bunch of maps
<spanish>
same with a binary tree interface, which might be much slower
<Drup>
gasche: let's say I have a record { x ; y ; z } and I want to index it by x and y, how would you do that in a map of map ?
<gasche>
'z XMap.t YMap.t
<gasche>
if you only know the y value and want to find all (x,z) bindings, you have it with YMap.find
<Drup>
and how am I supposed to extract an element knowing a y ? I have to look in each X map ?
talzeus has quit [Remote host closed the connection]
<gasche>
if you only know the x value and want to find all (y,z) bindings, that's YMap.map XMap.find
<Drup>
so yeah, it's not efficient at all
<gasche>
how could you do better?
<ggole>
A pair of maps?
<Drup>
gasche: sql tables are more efficient, since it's O(log n) for every indexes
<Drup>
ggole: You would need to maintain the coherences between every map and It will grow with the number of indexes
<gasche>
but what I described is also O(log n), isn't it?
<Drup>
gasche: and IxSet is probably not in O(n) acces
<ggole>
How is that different to indexes in Sql?
<ggole>
And the object itself is stored only once (due to the object semantics of OCaml)
<companion_cube>
hmmm, this looks really tough without typeclasses :(
<companion_cube>
gasche: no, there is the YMap.map
<Drup>
ggole: with mutables fields then ?
<companion_cube>
it's linear, isn't it?
<gasche>
well you only use YMap.map if you want to find all bindings
<Drup>
gasche: no, if you want to acces one element too
<ggole>
I don't see where mutable fields come into it?
<gasche>
Drup: well you can shortcut search
<companion_cube>
gasche: not if the index you want is not the first map
<gasche>
well
<gasche>
you can maintain a pair
<gasche>
('z XMap.t YMap.t * 'z YMap.t XMap.t)
<Drup>
ggole: How would you modify every map at once efficiently ?
<ggole>
Oh, I see
<Drup>
same question for you, gasche
<Cypi>
What's the point of maintaining this pair and not ('z XMap.t, 'z YMap.t) as ggole suggested?
<gasche>
Cypi: you need to be able to intersect
<gasche>
(and those would be multimaps, not single-binding maps)
kaustuv has left #ocaml []
<gasche>
hm
<ggole>
You don't need intersection to find single elements
<ggole>
You can just check equality of parts
<Drup>
the problem is that the complexity of your structure explode violently when you add more bindings
<Drup>
more indexes*
<ggole>
I think you have the same essential complexity as with two, just with more bits
<ggole>
So it would be a bit slow
<ggole>
And I don't really see a way around that tbh
<Drup>
ggole: I was talking about the complexity of the structure, not the operation, indeed
<ousado>
there are K-D Tress
<ousado>
*Tres
<ousado>
urgh
<ousado>
which also have that problem
<gasche>
k-d trees are mostly an optimization on ('z XMap.t YMap.t)
<ggole>
Yes, if you work in many dimensional spaces the computational value of a particular split is diminished
<ggole>
That's unavoidable: people usually resort to mapping to fewer dimensions using some hashing scheme
<gasche>
this is also my intuition
<Drup>
not sure I understand what you mean, ggole
<ggole>
I don't think it applies to this problem in any case.
<ggole>
Drup: it's called the curse of dimensionality
<ousado>
Drup: you might want to look at the boost multiindex implementation
<ggole>
In many dimensions, the value you get by partitioning space into two is lessened because the spaces are so vast
<ggole>
So you need many splits and thus a large, slow data structure.
<Drup>
ggole: ok
ontologiae has joined #ocaml
<Drup>
If we throw away the functional constraints, I can just use multiples maps pointing to mutables objects. there is still a small problems with updates
<spanish>
are you tied to ocaml in that project?
<Drup>
I'm using eliom, so you could say so :)
<gasche>
Drup: are each index injective?
<Drup>
gasche: it would be an acceptable limitation
<gasche>
I mean is there a unique {x;y;z} for each y?
<gasche>
because that changes the performance characteristics quite lot
<spanish>
hehe, they should have used c :D
<Drup>
spanish: no :)
<gasche>
I don't think using tuples of single-dimension maps is a good idea for non-injective indices
<gasche>
but obviously that's optimal for injective indices
<Drup>
gasche: I was assuming that my indexes where uniques
<spanish>
or else ask ocaml developers to add decent indexing primitives
<gasche>
spanish: (?!) this should be developed as a library
<spanish>
so gasche?
<gasche>
hm I'm not sure who you mean by "ocaml developpers", isn't Drup one?
<gasche>
so
<spanish>
ah, I don't know?
<ggole>
If the parts are all unique, I really think that a bunch of maps would be ok
<ggole>
Unless you want many, many indexes
<gasche>
yes that's optimal
<gasche>
but if the indices are not bijective
<gasche>
I think map of map ... of map are better
<gasche>
(or you need an ordering on the values)
<Drup>
we can assume I can provide ordering on the indexes
<ggole>
So you look up z and have potentially many (linear in the size of the data set) equal values?
<ggole>
Maps of maps seems like a pretty big hammer to hit that problem with
<Drup>
And I don't feel that you can have O(ln n) acces with maps of maps. that's my biggest concern
<Drup>
But tuples of map may work, if we assume that 1) you're indexes are unique 2) you have every indexes in the structure.
<Drup>
so if you want to update a field, you can just search for it in the other structures
<Drup>
in O(ln n)
<Drup>
s/you're/your
<ggole>
Or you could forget persistent structures and maintain one Hashtbl per index
<ggole>
Uniqueness shouldn't be a problem since they are multimaps already
<companion_cube>
Drup: did you look at my gist? :)
<Drup>
companion_cube: doing it :p
<companion_cube>
it's just an interface, but I think it may be implementable encapsulating maps in objects
<companion_cube>
hmm, the get : 'a -> 'b list may be only 'a -> 'b to simplify
<companion_cube>
hm, no need for a Mixtbl actually
<Drup>
companion_cube: you get_filter take a 'a list ?
<gasche>
companion_cube: how do you select along only a subset of the indices?
<Drup>
your*
<companion_cube>
gasche: here you can only select along one index
<gasche>
weak interfaces :]
<gasche>
thinking about this more
<gasche>
I think if the indices are not unique
<ggole>
Speaking of data structures, I was playing around with an integer specialisation of sets the other day
<ggole>
I managed to beat the stdlib on lookup and build, but lost heavily on union and similar
<gasche>
you can use (t XMap YMap ZMap * z YMap ZMap XMap * z ZMap XMap YMap)
<gasche>
for insertion of an {x;y;z}, you can first select along x, and you'll get a submap of YMap that contains all potentially interesting keys (all y that *have* such an x-binding)
<gasche>
you can use that Y submap to speed up update of the component indexed along y
tag2 has joined #ocaml
<ggole>
Adding an index would be quite a task though
talzeus has joined #ocaml
<Drup>
gasche: how would you create a Make functor for this ?
talzeus has quit [Remote host closed the connection]
<gasche>
hm
<gasche>
in practice I wonder if that's not equivalent to a k-d tree, with large constant factors
<Drup>
companion_cube: I'm not sure about your index class, why do you need all those methods ?
<gasche>
but k-d trees are harder to write without code generation
<gasche>
and Drup has unique indices anyway
<companion_cube>
Drup: so that you can add new elements to the index
<companion_cube>
but I'm working on it
talzeus has joined #ocaml
<Drup>
gasche: from a very basic point of view, I just want a relational table with a correct efficiency :)
speredenn has joined #ocaml
<Drup>
I just want to put whatever I want in it. I could use sql + marshalling, but it seems better with a native data structure
<gasche>
what kind of data is it for?
Snark has quit [Quit: leaving]
<companion_cube>
rhaa
<ousado>
well, which algos do databases use there?
<Drup>
gasche: assume any functional data structure
<Drup>
gasche: but the indexes would still be "simple"
clog has quit [^C]
clog has joined #ocaml
ygrek has quit [Ping timeout: 240 seconds]
<companion_cube>
Drup: actually, I wonder whether it's possible to do this with functors
<Drup>
It would be usefull to have a filter on multiple indexes, but I'm not sure it's possible
<companion_cube>
rhaa, functors are too hard
<bernardofpc>
companion> rhaa, functors are too hard -> :/
<companion_cube>
Drup: updated!
<companion_cube>
bernardofpc: I wanted to make a kind of list of modules, but it's terrible
<companion_cube>
still, I just added one single functor, to make intersection and union more sound
Neros has quit [Ping timeout: 256 seconds]
Neros has joined #ocaml
hyperboreean has joined #ocaml
beginner42 has joined #ocaml
<beginner42>
i am writing an external function. The input parameter has the form type input = A | B. Is it now better to make a pattern match on the ocaml side before calling the c function or should i do that inside the c function?
gal_bolle has joined #ocaml
<ggole>
Safer and easier from the ocaml side
<beginner42>
ggole: what about performance i have read its slightly slower if i dont call the external function directly?
<ggole>
Not sure what you mean
<def-lkb_>
beginner42: it's completely negligible, don't bother with that :)
travisbrady has joined #ocaml
<beginner42>
def-lkb_: thanks, just thought i ask here before i continue writing my code :)
<def-lkb_>
beginner42: what happens is that if the compiler see an external, it's directly compiled as an inline primitive call, otherwise the call is wrapped in a closure
<def-lkb_>
but in practice, this is not something to bother with :p
<vbmithr>
beginner42: I would do the maximum in ocaml
tane has joined #ocaml
<beginner42>
i am trying to write a binding to the zmq library, and thats all about speed, but if its completely negligible than i do all checks on the ocaml side
<vbmithr>
beginner42: have a look at github.com/ocamllabs/ocaml-ctypes
<Armael>
it's all new and shiny
<Armael>
:)
<companion_cube>
beginner42: there already are bindings to ZMQ, aren't they?
<companion_cube>
two of them on opam
<beginner42>
companion_cube: they only use the old 2.2 version, and i am not really satisified with them
<beginner42>
or 2.3 i am not sure
<companion_cube>
beginner42: but you may try to update them?
<Armael>
/w 24
<Armael>
oops.
<beginner42>
companion_cube: i looked at the source code, some things i do like but some things like the mli interface names are not as close to the names offered by the zmq library.
<Armael>
is it really important ?
<Armael>
i think it is better to have a good quality library, even with questionable function names
<beginner42>
Armael: the zmq library is really nice, just the binding i am not satisfied with
<Armael>
yeah, sorry
<Armael>
i mean that it's maybe better to improve the binding instead of rewriting one from scratch
<beginner42>
Armeal: i do absolutely agree. That was also my first attempt, i went to github got me the code and looked how they solved it.
<beginner42>
But personally, there are some things i would like differently, maybe later on i will say it was a mistake and follow their way, but till then its a learning experience :)
tianon has quit [Ping timeout: 276 seconds]
tianon has joined #ocaml
ygrek has joined #ocaml
<hcarty>
gasche, thelema: If RWO and the OCaml Platform going Core + Async, do you have any thoughts on what this means for Batteries?
chrisdotcode has joined #ocaml
<eikke>
same for Lwt :)
<hcarty>
eikke: Indeed!
gal_bolle has quit [Quit: Konversation terminated!]
<Drup>
companion_cube: why do you need the element of the IxSet to be comparable ?
<companion_cube>
Drup: because it also behaves like a regular set, so I build upon Set.Make
<Drup>
huum
speredenn has quit [Quit: Leaving]
<Drup>
companion_cube: how do you would handle update ?
<companion_cube>
Drup: there are the add/remove functions
<companion_cube>
so you remove the old value and add the new one
<Drup>
hum, It probable would be worth it to have a function to do that directly, maybe a little bit optimized
<Armael>
if it's a Set under the hood, i don't think so
ttamttam has joined #ocaml
ttamttam has quit [Client Quit]
<companion_cube>
Drup: you have to change the indexes anyway
ollehar has quit [Ping timeout: 264 seconds]
weie has quit [Quit: Leaving...]
Kakadu_ has quit [Quit: Konversation terminated!]
<Drup>
sure, but at least from the user point of view, is more convenient to have it in the interface
<Drup>
same for a "delete all" that deletes everything according to a predicates
<companion_cube>
indeed
<Drup>
but I could do this myself and send give you the patch :p
<companion_cube>
that's just cosmetic
<companion_cube>
exactly :D
<companion_cube>
if you're on github it's even easier
<Drup>
I'm, I would take the time a bit later ;)
<companion_cube>
perfect ^^
<Drup>
I'm wondering if we can use the structure of the map to have a "range" selector more efficient than a basic O(n) filter
Kakadu has joined #ocaml
<companion_cube>
maybe using Map.split twice
Kakadu has quit [Client Quit]
Kakadu has joined #ocaml
breakds has quit [Quit: Konversation terminated!]
Kakadu has quit [Quit: Konversation terminated!]
Kakadu has joined #ocaml
zpe has joined #ocaml
Yoric has quit [Ping timeout: 256 seconds]
beckerb has quit [Ping timeout: 245 seconds]
skchrko has quit [Quit: Leaving]
weie has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
tane has quit [Quit: Verlassend]
mcclurmc has quit [Ping timeout: 268 seconds]
mika1 has quit [Quit: Leaving.]
eikke has quit [Ping timeout: 252 seconds]
gautamc has quit [Read error: Connection reset by peer]
gautamc has joined #ocaml
Drup has quit [Ping timeout: 248 seconds]
skchrko has joined #ocaml
pango_ has joined #ocaml
travisbrady has quit [Quit: travisbrady]
testcocoon has quit [Read error: Connection reset by peer]
pango has quit [Ping timeout: 256 seconds]
travisbrady has joined #ocaml
eikke has joined #ocaml
pango_ is now known as pango
Drup has joined #ocaml
gnuvince has joined #ocaml
ygrek has quit [Ping timeout: 268 seconds]
testcocoon has joined #ocaml
Yoric has joined #ocaml
<ggole>
Hmm, the RWO book finally has a public version... and the site is falling over.
raichoo has joined #ocaml
emmanuelux has joined #ocaml
ontologiae has quit [Ping timeout: 240 seconds]
ttamttam has joined #ocaml
orbitz_ has quit [Quit: Reconnecting]
orbitz has joined #ocaml
pkrnj has joined #ocaml
ttamttam has left #ocaml []
darkf has quit [Quit: Leaving]
travisbrady has quit [Quit: travisbrady]
tane has joined #ocaml
milosn_ has joined #ocaml
milosn has quit [Ping timeout: 256 seconds]
milosn_ is now known as milosn
ggole has quit []
Yoric has quit [Ping timeout: 248 seconds]
Yoric has joined #ocaml
speredenn has joined #ocaml
pkrnj has quit [Quit: Computer has gone to sleep.]
fraggle_laptop has joined #ocaml
osnr has joined #ocaml
osnr has quit [Changing host]
osnr has joined #ocaml
<pippijn>
is there a function that reads a line from an Lwt_unix socket?
<pippijn>
s/socket/file descriptor
Watcher7|off is now known as Watcher7
<pippijn>
or something to make an in_channel from a file descriptor?
<pippijn>
oh, of_fd
pkrnj has joined #ocaml
lenstr has quit [Ping timeout: 240 seconds]
lopex has quit [Ping timeout: 264 seconds]
ggherdov has quit [Ping timeout: 264 seconds]
bobry has quit [Ping timeout: 248 seconds]
IbnFirnas has quit [Ping timeout: 252 seconds]
LeNsTR has joined #ocaml
travisbrady has joined #ocaml
bobry has joined #ocaml
IbnFirnas has joined #ocaml
ggherdov has joined #ocaml
thizanne has quit [Ping timeout: 246 seconds]
dsheets has quit [Ping timeout: 246 seconds]
ccasin has quit [Read error: Operation timed out]
yacks has quit [Read error: Connection reset by peer]
yacks has joined #ocaml
ccasin has joined #ocaml
pkrnj has quit [Quit: Computer has gone to sleep.]
ontologiae has joined #ocaml
ulfdoz has joined #ocaml
dsheets has joined #ocaml
rly has joined #ocaml
<rly>
How can I remove yojson using opam 1.01. opam remove yojson doesn't work, ocamlfind remove yojson doesn't work.
ollehar has joined #ocaml
<Drup>
rly: why "opam remove yojson" didn't work ? any error messages ?
osnr has quit [Quit: Leaving.]
<rly>
Drup: it doesn't work, because the programmers told the computer to do the wrong thing.
<rly>
Drup: no error messages.
<rly>
Drup: exit status 0
<companion_cube>
any opinion on the fact the RWO doesn't even mention Batteries or Lwt?
<rly>
companion_cube: depends on what the goal of the book is.
<Drup>
rly: are you sure it's not installed on your system with a regular package manager ?
<rly>
companion_cube: since I haven't read it, and it's only on github, I am not going to care yet.
<rly>
companion_cube: even then, there are enough OCaml books already, IMHO.
<companion_cube>
there are actually nice things in this book
<rly>
Drup: my system doesn't even have ocaml4.
<companion_cube>
but it could mention quickly alternatives...
<rly>
companion_cube: also, what do you care?
<rly>
companion_cube: are you related to those libraries?
<companion_cube>
no, but I use lwt
<rly>
companion_cube: lwt has had a bug less than a year ago.
<rly>
companion_cube: doesn't really seem book material to me.
<companion_cube>
are you serious? :D
<rly>
companion_cube: I see no place for buggy libraries in books I'd release.
<companion_cube>
I wouldn't bet on Core and Async being bug-free...
<rly>
Is there a rebuild the world opam command?
<rly>
Otherwise I will have nuke opam myself.
<companion_cube>
bug-free is pretty demanding a requirement
<adrien>
or even matching everyone's need
osnr has joined #ocaml
osnr has quit [Changing host]
osnr has joined #ocaml
<rly>
Writing code with bugs is just trolling.
<companion_cube>
rly: let's all move to coq then
<bernardofpc>
compcert, please
<rly>
companion_cube: some embedded language in Coq in which you can express linear logic + memory constraints.
<companion_cube>
bernardofpc: compcert lets you write buggy C code ;)
<companion_cube>
rly: sure :D
<bernardofpc>
oh
<rly>
companion_cube: + real-time constraints.
<companion_cube>
like a synchronous language?
<bernardofpc>
but does Coq make programs or just proofs ?
<rly>
companion_cube: yes, where possible.
<rly>
companion_cube: that will get rid of the 'why does this take so long' issues.
<companion_cube>
bernardofpc: it can extract programs from proofs
<Drup>
bernardofpc: you can program in Coq, if you really want to
<bernardofpc>
I mean, is it feasible to have an executable compiler written in Coq ?
<companion_cube>
yes, that's what Compcert mostly is (coq compiled to OCaml)
<rly>
I nuked my configuration and it's rebuilding now.
Kakadu_ has joined #ocaml
<def-lkb_>
rly: I think I encountered this bug, I did "opam reinstall yojson" and it somehow managed to get back to a sane situation
<rly>
def-lkb_: heh, too late.
<def-lkb_>
sry :)
<rly>
def-lkb_: it's probably a problem with 1.13.
<rly>
def-lkb_: so, install 1.16 directly should eliminate the issue.
thizanne has joined #ocaml
<def-lkb_>
rly: indeed, after installing 1.16, I was again able to uninstall yojson :)
<rly>
I get curl: empty response :/
<def-lkb_>
then, just retry…
<rly>
def-lkb_: it seems like a bug to me.
<rly>
def-lkb_: opam install individualpackage does work.
<def-lkb_>
rly: it is a bug
<rly>
def-lkb_: opam install a b c d e f ... doesn't.
<def-lkb_>
it seems also related to the number of job
gnuvince has quit [Ping timeout: 246 seconds]
<rly>
All in all opam seems very unstable for a 1.0 version./
<rly>
Unstable being an euphenism for broken piece of sh*t.
<Drup>
on the other side, it allow to distribute ocaml library easily for almost anyone and have incredibly consolidate the ocaml ecosystem
<Drup>
but sure, it's a broken piece of shit, we should never use it
<def-lkb_>
rly: you should open a bug report
<jonafan>
opam is a godsend
Snark has quit [Quit: leaving]
_andre has quit [Quit: leaving]
osnr has quit [Quit: Leaving.]
tane has quit [Quit: Verlassend]
<rly>
opam has a feature to compile multiple projects in parallel, but if the basics don't work and you can only call it with one package at a time, that doesn't work. Great :/
<rly>
A godsend would be something like I described above.
<def-lkb_>
You should report that the basics don't work with your configuration!
<rly>
def-lkb_: I reported it over two weeks ago to the main opam guy.
<rly>
def-lkb_: he came up with weasel reasons.
<rly>
def-lkb_: in short: do you think I am crazy?
* ousado
has a dejavu
<Drup>
ousado: same here.
<rly>
You can check the logs if you don't believe me.
Kakadu_ has quit []
<def-lkb_>
rly: grumpy for sure, crazy probably not
<ousado>
rly: so you write only bug-free code?
weie_ has joined #ocaml
<rly>
There is lots of broken code in the available packages.
raichoo has quit [Quit: leaving]
<rly>
On what platforms is this tested, if any?
<rly>
BleedingEdgeOS?
<rly>
How hard can is possibly be to try to install all available packages in a VM for all the major operating systems before publishing it.
<rly>
can it possibly be*
<rly>
That's what actual companies do before they make a release.
<def-lkb_>
rly: what is sure is that you are not going to improve the situation with such statements
<ousado>
yeah, that's why commecial software is (guess what) bug-free
<adrien>
rly: please refrain from expressing attacks towards people or entities here
<rly>
ousado: commercial software which I have written is bug-free.
<ousado>
..like yours
<ousado>
no doubt
weie has quit [Ping timeout: 245 seconds]
<rly>
ousado: you write ATS now, don't you?
<ousado>
rly: you're not related to fasta in some way, like via identity or something?
<rly>
ousado: clearly, you must also be able to write bug-free code.
<jonafan>
haha install all packages
<jonafan>
this DOES sound pretty familiar
<rly>
jonafan: I don't get the joke.
<rly>
If you deploy a package management solution and the command to install all packages exits with some internal error, I know it wasn't designed to work.
<rly>
I fail to see what's funny about that.
<dsheets>
the test systems are still being developed
<dsheets>
i don't understand why compaction creates garbage?
tane has joined #ocaml
<ousado>
dsheets: what do you mena by garbage exactly?
<dsheets>
major_words? minor_words? am i misunderstanding the meaning of those values?
<ousado>
major words: (*Number of words allocated in the major heap, including the promoted words, since the program was started.*)
* dsheets
dies a little
<ousado>
minor_words :float;(*Number of words allocated in the minor heap since the program was started. This number is accurate in byte-code programs, but only an approximation in programs compiled to native code.
<ousado>
dsheets: and there were no minor collections since that program started
<dsheets>
ousado, indeed... this is making more sense now
speredenn has quit [Quit: Leaving]
BiDOrD has quit [Ping timeout: 276 seconds]
smondet has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
zpe has quit [Remote host closed the connection]
ulfdoz has quit [Ping timeout: 260 seconds]
pkrnj has quit [Quit: Computer has gone to sleep.]
travisbrady has quit [Quit: travisbrady]
thomasga has quit [Quit: Leaving.]
venk has joined #ocaml
eikke has quit [Ping timeout: 264 seconds]
ontologiae has quit [Ping timeout: 264 seconds]
lidenbrock has joined #ocaml
<oriba>
I have a function with some optional args. Now I need a list of these opt-args. Any idea how to handle this? Should I use a record type with the args inside, and then a list of these records?
palm_frond has joined #ocaml
lidenbrock has quit []
<oriba>
I hate cluttered API, and the opt-args already make noise in the signature (the args are polymorphic variants and the signature looks bloaty now)
<oriba>
But how to define a type, who's elements are polymorphic variants??
<oriba>
(I mean record type)
<dsheets>
oriba, type t = { a : [ `None | `A | `B ]; q : [ `None | `Q | `R ] };; let default = { a=`None; q=`None };; { default with q = `R };;
<oriba>
aha, thank you, dsheets
<dsheets>
oriba, you may want to wrap those in options and drop the `None if that makes things easier/clearer
<oriba>
I'm not sure at the moment, if I can drop the polymorphic variants and use sum types instead.
<dsheets>
or do other things to take advantage of any intersection
<oriba>
But the names are clearer when using poly.vartiants
zpe has joined #ocaml
<oriba>
Sometimes I have problems to decide between short names and clear (but longer) names of parameters...
<oriba>
...the polymorphic variants would allow me better names
<oriba>
But clutter the signature...
<dsheets>
type missing = [ `None ];; type a = [ missing | `A ];; type b = [ missing | `B ];;
<oriba>
dsheets, aha, bottum-up type definition...
pkrnj has joined #ocaml
zpe has quit [Ping timeout: 260 seconds]
<oriba>
dsheets, when I use opt-args, I need less typing when I call the function. when I use a record, I need to set all elements of the type, hence I need more typing.
<oriba>
Only way to avoid this, is to use a default-record and then change certain elements...
<dsheets>
oriba, use opt args with named polyvar types?
<dsheets>
or use regular variants and the Module.(expr_with_module_open) syntax?
<oriba>
thats what I have at the moment
<oriba>
But I need a list of the set of optargs
<oriba>
Maybe I should change to list of lists
<dsheets>
make a record type as well and write the convertors?
<oriba>
what?
<oriba>
what do you mean with convertrors?
<oriba>
You mean functions that just change one of the revcord items?
<dsheets>
type args = { f : myfun option; q : myq option } val f : ?f:myfun -> ?q:myq -> int val apply_f : args -> int
<oriba>
list-of polvar-list would maybe give compromise..
<dsheets>
record constructors are another approach
<dsheets>
as you say
tane has quit [Quit: Verlassend]
q66 has quit [Remote host closed the connection]
skchrko_ has joined #ocaml
<oriba>
good night, dsheets will think about the issue. thanks so far.
oriba has quit [Quit: oriba]
palm_frond has left #ocaml []
pkrnj has quit [Quit: Computer has gone to sleep.]