Kakadu2[m] has quit [Remote host closed the connection]
barkmadley[m] has quit [Remote host closed the connection]
M-jimt has quit [Remote host closed the connection]
M-martinklepsch has quit [Remote host closed the connection]
srenatus[m] has quit [Remote host closed the connection]
M-pesterhazy has quit [Remote host closed the connection]
M-ErkkiSeppl has quit [Remote host closed the connection]
regnat[m] has quit [Remote host closed the connection]
Bluddy[m] has quit [Remote host closed the connection]
M-Illandan has quit [Remote host closed the connection]
tane has quit [Quit: Leaving]
Kakadu2[m] has joined #ocaml
myst|fon has joined #ocaml
Algebr` has quit [Remote host closed the connection]
Algebr` has joined #ocaml
Simn has joined #ocaml
picolino has quit [Ping timeout: 240 seconds]
picolino has joined #ocaml
Submarine has joined #ocaml
antoro is now known as antoro_
cuicui has joined #ocaml
antoro_ is now known as antoro
<tormen>
Drup: I picked your proposition (https://bpaste.net/show/5f92a1ea438a). Yes indeed the cast is what I needed :) ... 1 operator and 1 type well placed and TADA :)) ... de la magie :)) hehe. Thanks a lot. So far it does seem to do what I want I will have the final results by tomorrow.
<tormen>
ggole_: Thanks for you answer as well, made me learn about the "constraint" keyword (meaning : now I know that it exists and have a ROUGH idea of what it does ... :)) - Thanks!
<tormen>
:)
<tormen>
Ocaml feels like Yoga or Aikido ;)
<tormen>
... a LIVE-TIME task to *really* MASTER ;)
zpe has quit [Read error: Connection reset by peer]
haesbaert has joined #ocaml
ontologiae has joined #ocaml
zpe has joined #ocaml
yomimono has joined #ocaml
picolino has quit [Ping timeout: 244 seconds]
picolino has joined #ocaml
picolino has quit [Ping timeout: 264 seconds]
fraggle_ has joined #ocaml
kamog has joined #ocaml
zpe has quit [Remote host closed the connection]
<mrvn>
Algebr`: constrain yourself, your smile is showing.
<Algebr`>
haha
cuicui has quit [Ping timeout: 258 seconds]
yomimono has quit [Ping timeout: 250 seconds]
bPqArhZYBx has quit [Remote host closed the connection]
lol_u_phail1 has left #ocaml [#ocaml]
copy` has joined #ocaml
kamog` has joined #ocaml
kamog has quit [Ping timeout: 276 seconds]
ontologiae has quit [Ping timeout: 244 seconds]
<orbitz>
Drup: I have a new challenge :)
<Drup>
Oh dear.
<orbitz>
Ohh I think I just got it
<orbitz>
I am trying to take a module, of type sig type 'a t end and a value of type m t and turn it into a module of type sig type m type t end where m is the m of my input type. Doe that make sense/
<orbitz>
But I think I just figured it out, it required a lot of Foo with type = somethign
<Drup>
At this point, I would like to summarize what you are doing: You are writing a function that takes a dictionnary of functions accompagnied by a value that goes with those functions.
<orbitz>
the dictionary also has a type in it
<Drup>
I'm going to spell it differently, just to make the point clair: It's an object so please use the real object system dammit è_é
<Drup>
clear*
<orbitz>
No fun in that
<orbitz>
Uh-oh, "Their kinds differ." death knell
pierpa has quit [Ping timeout: 240 seconds]
kamog` is now known as kamog
Simn has quit [Read error: Connection reset by peer]
axiles has quit [Ping timeout: 240 seconds]
d0nn1e has quit [Ping timeout: 244 seconds]
d0nn1e has joined #ocaml
bruce_r has joined #ocaml
rgrinberg has joined #ocaml
axiles has joined #ocaml
mengu has joined #ocaml
bruce_r has quit [Remote host closed the connection]
johnelse has joined #ocaml
ontologiae has joined #ocaml
kamog has quit [Remote host closed the connection]
ontologiae has quit [Ping timeout: 244 seconds]
johnelse has quit [Ping timeout: 244 seconds]
<tormen>
Drup: Nice Link about the koans !! *lol* :)))
<tormen>
(so true)
bacam_ is now known as bacam
dakk has joined #ocaml
tane has joined #ocaml
obj_magic has quit [Ping timeout: 250 seconds]
chelfi has quit [Ping timeout: 250 seconds]
chelfi has joined #ocaml
DanielRichman has quit [Ping timeout: 250 seconds]
DanielRichman has joined #ocaml
obj_magic has joined #ocaml
pyon has quit [Quit: brb]
pierpa has joined #ocaml
pyon has joined #ocaml
<rgrinberg>
Is it possible to enable backtraces in exceptions raised in myocamlbuild.ml?
zpe has joined #ocaml
<Drup>
rgrinberg: you could stick "Printexc.record_backtrace true" at the top of the file.
<rgrinberg>
Drup: ah yes. thanks.
maker has quit [Ping timeout: 250 seconds]
tmtwd has joined #ocaml
<tormen>
hmm. what is the best way to obtain a (unique) list of the keys in a hashtable ?
<Algebr`>
keys of a hashtable would always be unique, by definition no?
<Algebr`>
perhaps a first approximation would be to use fold and just collect the keys
<tormen>
Algebr`: For now I had this: let ht_keys hshtbl = ht_fold (fun k _ acc -> k::acc) hshtbl [] ... but just realized that fold yields keys multiple times if they have multiple values associated to them.
<tormen>
;)
<tormen>
... but then you would need to "|uniq" the keys still somehow
<tormen>
(how one does this the best in ocaml: no idea yet)
<tormen>
... seems so clumsy
<tormen>
maybe there is a better datastructure than Hashtbl if you need O(1) access to the used keys ?
<mrvn>
or don't insert duplicate keys?
<tormen>
.. okey maybe not O(1) necessarily but an "easy" access to the keys ... hmm I just don't want to use a horse as a milk-cow here ;)
<tormen>
in my case I need duplicates and then want to loop over the uniqu keys and find_all accociated values to use them grouped together :)
maker has joined #ocaml
<Drup>
do you need duplicated to replacement ?
<tormen>
?
<Drup>
Do you really need to have duplicated keys, or do you just need to change the value of a key at some point ?
<tormen>
my keys are categories. Each category holds a list of IDs. I grab all ids and then sort (class) them by category (into the Hashtbl).
<tormen>
Then I need to process all the ids of a certain category, so loop over the keys and use find_all ... ?
<tormen>
like Hashtbl.map_keys f:key->'a my_hash_table :)
<tormen>
where f key -> let ids = my_hash_table.find_all key in do_something_usefull ids
ontologiae has joined #ocaml
<tormen>
... use a Set to uniqui-fy the keys that I either gather with fold or while filling the my_hash_table in the first place ?
<Algebr`>
horse as a milk-cow
<ggole_>
Sounds like you want a table from keys to lists of values
<ggole_>
Hmm, you can use the tying-the-knot trick for term data types to do some interesting things
<ggole_>
eg, type incomplete = I of incomplete base | Hole and you have a representation of terms with parts missing
ontologiae has quit [Ping timeout: 252 seconds]
mengu has quit []
adelbertc has joined #ocaml
antoro is now known as antoro_
<tormen>
mrvn: you are right! This should be (one of) the simplest ways to get where I want to be ;) ... store lists as values in my Hashtbl and use a find to check if a key is member and then append the new value to a LIST...
<tormen>
ggole_: Unfortunately I am not able to transpose what you told me onto my problem, sorry :(
<tormen>
I
<tormen>
did not want to type "I" ;)
<toolslive>
why not fold the hashtbl into a set ?
<tormen>
toolslive: its what I proposed before :) ... not sure which way is quicker (more performant) ? :) ... feels equal...
<toolslive>
performance depends on a lot of things. O(_) only gets you asymptotical reasoning which might be a bit inaccurate
slash^ has quit [Read error: Connection reset by peer]
octachron has joined #ocaml
agile_cyborg has joined #ocaml
Simn has joined #ocaml
kakadu has joined #ocaml
pyon has quit [Quit: Fix <strike>life</strike> config.]
M-Illandan has quit [Remote host closed the connection]
Kakadu2[m] has quit [Remote host closed the connection]
Bluddy[m] has quit [Remote host closed the connection]
M-jimt has quit [Remote host closed the connection]
M-ErkkiSeppl has quit [Read error: Connection reset by peer]
M-martinklepsch has quit [Write error: Connection reset by peer]
srenatus[m] has quit [Remote host closed the connection]
barkmadley[m] has quit [Read error: Connection reset by peer]
regnat[m] has quit [Remote host closed the connection]
M-pesterhazy has quit [Remote host closed the connection]
agile_cyborg has quit [Ping timeout: 258 seconds]
phase_ has joined #ocaml
<octachron>
gasche, are there fundamental obstacles to compute exact dependency cycles within ocamldep or it is only a pratical approximation?
Kakadu2[m] has joined #ocaml
zpe has quit [Remote host closed the connection]
Anarchos has joined #ocaml
Xizor has joined #ocaml
<zozozo>
octachron: open statements are tricky iirc
<flux>
it seems the compiler would be able to do it easily, even though it would mean recursively invoking it
<flux>
when you find an unknown module, check if matching file name is available in search directory, etc
agile_cyborg has joined #ocaml
tmtwd has quit [Ping timeout: 276 seconds]
dakk has quit [Quit: Leaving]
dakk has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 264 seconds]
<mrvn>
flux: better to have a backchannel to the build channel. The missing module might be generated, e.g. mly.
<mrvn>
s/build channel/build system/
ggole_ has quit []
<gasche>
octachron: ocamldep design is syntactic
<gasche>
you could compute better dependencies, but it would be a different tool, I think from inside the type-checker
<gasche>
(and implementing it there is a difficult problem)
Simn has quit [Quit: Leaving]
cantstanya has joined #ocaml
ygrek has joined #ocaml
<octachron>
gasche, even with a syntactic approximation, would it not possible to compute a list of submodule of opened modules and refine the dependency computation?
<mrvn>
octachron: you get too many depends.
<mrvn>
octachron: open A, open B. Is that B or A.B?
<flux>
how about a 'much simpler' compiler? that isn't able to see types, but does understand module names in the syntax?
<mrvn>
it has to compute functors at least
<flux>
yes, but I wonder if that too would be much simpler if it can just skip typing
<flux>
basically understand only the "module language"
<octachron>
mrvn: open A: stop computation of dependency, compute the dependencies and list of toplevel module of A, then resume the computation of dependencies of the current module
<mrvn>
sure. But you don't solve any problems. The simpler compiler still has to find and recursively compile modules. Nothing changed in the problem.
<flux>
it changes so that it doesn't need to built inside the ocaml compiler..
<flux>
maybe built on top of ppx?
<mrvn>
(which applies to both flux and octachron)
<mrvn>
flux: but that's not the hard part.
<flux>
what is the hard part?
<mrvn>
flux: finding files and recursing
<flux>
doesn't sound to me finding files and recursing should be very hard..
<octachron>
mrvn, isn't that just a (little bit peculiar) topological sort?
<gasche>
I wrote a blog post about that, I think
<gasche>
(or maybe a blog post draft)
<mrvn>
two main problems as far as I see: 1) generated files might not exist yet, 2) parallel building
AlexRussia has quit [Ping timeout: 258 seconds]
<flux>
how does ocamldep solve the generated-files-problem?
<gasche>
it's hard to separate scope/binders-computation from typing, it's hard to parallelize, it's hard to restart computation without eating too much memory
<gasche>
in practice people are content with ocamldep as a quick&dirty approximation, so it's hard to justify the work
<mrvn>
flux: ocamldep I think just outputs the depends without recursion and can produce too many depends, e.g. A + B instead of A + A.B
<flux>
can it create superfluous dependencies? wouldn't that mean ie. make would then require those source files to exist?
<mrvn>
flux: I think so
<flux>
I mean superfluous top-level modules
<flux>
and that list isn't filtered against existing file names?
<mrvn>
flux: A may not exist
<flux>
I mean if I tell make that foo is made of a.cmo and b.cmo, make certainly requires those to be buildable..
<mrvn>
try it
<flux>
so I made a test
<flux>
foo.ml: open A open B
<flux>
ocamldep foo.ml produces no dependency rles
<flux>
and if I rename a.ml to a.mly, again no dependencies are produced
regnat[m] has joined #ocaml
M-martinklepsch has joined #ocaml
M-jimt has joined #ocaml
<flux>
iow, it doesn't handle generated code, you get to handle them yourself ;)
M-ErkkiSeppl has joined #ocaml
barkmadley[m] has joined #ocaml
M-pesterhazy has joined #ocaml
Bluddy[m] has joined #ocaml
srenatus[m] has joined #ocaml
M-Illandan has joined #ocaml
<zozozo>
flux: well, stand to reason that ocamldep cannot know about all tools that may generate ml code
<mrvn>
flux: so it drops anything it can't find
<flux>
zozozo, obviously
<flux>
zozozo, doesn't mean it couldn't have special rules for the most common one ;)
<mrvn>
My idea is simple: 1) output depends as a side effect of compiling, 2) have a callback to the build system so the compiler can recurse when it looks for a file
<flux>
I guess the easiest way to overcome this is to do: .depends: generatedfile.ml
<flux>
mrvn, well, it's going to be difficult to integrate that to most anything but ocamlbild
<zozozo>
flux: I agree, but the question then becomes: what are the most common one ?
<flux>
zozozo, mly and mll, because they come with the compiler?
<mrvn>
flux: would be simple with MAKE
<gasche>
ocamldep just takes an OCaml source file and output an approximation of dependencies
<mrvn>
flux: I would have build system set some ENV var and it then executes that
<gasche>
also, calling dependencies during the build may create memory usage issues
<gasche>
which may require a rearchitecture of the compiler to be properly solved
<mrvn>
gasche: memory is cheap.
<gasche>
I think many people have had many ideas on this topic, but in practice the statu quo is more convenient
<flux>
gasche, but wouldn't it be nice to have this problem solved once and for all.. ;)
<mrvn>
flux: so many problems, so little time
AlexRussia has joined #ocaml
adelbertc has quit [Quit: Connection closed for inactivity]
tane has quit [Quit: Leaving]
ontologiae has joined #ocaml
Nahra has quit [Ping timeout: 244 seconds]
AlexRussia has quit [Ping timeout: 260 seconds]
AlexRussia has joined #ocaml
octachron has quit [Quit: Leaving]
pierpa has quit [Ping timeout: 250 seconds]
Heasummn has joined #ocaml
tmtwd has joined #ocaml
ontologiae has quit [Ping timeout: 250 seconds]
zpe has joined #ocaml
ygrek_ has joined #ocaml
ygrek has quit [Ping timeout: 264 seconds]
zpe has quit [Ping timeout: 276 seconds]
Heasummn has quit [Quit: Leaving]
Heasummn has joined #ocaml
Xizor has quit []
Nahra has joined #ocaml
kakadu has quit [Remote host closed the connection]
zpe has joined #ocaml
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]