pkrnj has quit [Quit: Computer has gone to sleep.]
brianmwaters has quit [Quit: Page closed]
Icarot has joined #ocaml
madroach has quit [Ping timeout: 248 seconds]
madroach has joined #ocaml
yacks has joined #ocaml
emmanuelux has quit [Remote host closed the connection]
Icarot has quit [Ping timeout: 252 seconds]
Jalumar has quit [Ping timeout: 248 seconds]
rwmjones has quit [Ping timeout: 256 seconds]
leoncamel has quit [Quit: WeeChat 0.3.9.2]
leoncamel has joined #ocaml
rwmjones has joined #ocaml
LeNsTR is now known as lenstr
paddymahoney has joined #ocaml
emias has quit [Ping timeout: 248 seconds]
emias has joined #ocaml
Icarot has joined #ocaml
Icarot has quit [Remote host closed the connection]
gnuvince has joined #ocaml
ulfdoz has quit [Ping timeout: 240 seconds]
Icarot has joined #ocaml
mcsquiggedy has quit [Quit: Leaving]
Icarot has quit [Quit: quit()]
pkrnj has joined #ocaml
Icarot has joined #ocaml
Yoric has joined #ocaml
adotbrown has quit [Ping timeout: 250 seconds]
ttamttam has joined #ocaml
pango_ has joined #ocaml
pango has quit [Ping timeout: 248 seconds]
Yoric has quit [Ping timeout: 256 seconds]
Icarot has quit [Ping timeout: 255 seconds]
djcoin has joined #ocaml
Icarot has joined #ocaml
paddymahoney has quit [Remote host closed the connection]
Qworkescence has quit [Quit: This computer has gone to sleep]
hkBst has joined #ocaml
paddymahoney has joined #ocaml
mikurubeam has quit [Ping timeout: 245 seconds]
mikurubeam has joined #ocaml
hkBst has quit [Ping timeout: 245 seconds]
hkBst has joined #ocaml
hkBst has quit [Read error: Connection reset by peer]
hkBst_ has joined #ocaml
hkBst_ has quit [Changing host]
hkBst_ has joined #ocaml
Qworkescence has joined #ocaml
ttamttam has quit [Quit: ttamttam]
Qworkescence has quit [Disconnected by services]
ttamttam has joined #ocaml
Yoric has joined #ocaml
Qworkescence has joined #ocaml
fraggle_ has quit [Ping timeout: 240 seconds]
pkrnj has quit [Quit: Computer has gone to sleep.]
pkrnj has joined #ocaml
kaustuv has joined #ocaml
gnuvince has quit [Ping timeout: 260 seconds]
cago has joined #ocaml
mika1 has joined #ocaml
cdidd has joined #ocaml
hkBst_ has quit [Ping timeout: 256 seconds]
Kakadu has joined #ocaml
hkBst_ has joined #ocaml
Yoric has quit [Ping timeout: 264 seconds]
anderse has joined #ocaml
ocp has joined #ocaml
ottbot has joined #ocaml
maufred has quit [Quit: Lost terminal]
maufred has joined #ocaml
osa1 has joined #ocaml
<osa1>
I've loaded a .cma file from ocamltop with #load, now how can I know it's module name ?
<osa1>
I'm trying open FileNameOfCmaFile but doesn't work
<Kakadu>
cma can contain many modules, AFAIR
ttamttam has quit [Remote host closed the connection]
<osa1>
Kakadu: is there a way to browse them ?
<Kakadu>
ocamlobjinfo, but I'm not very sure
<osa1>
Kakadu: ok so ocamlobjinfo shows that it has a unit named Label but I can't open it, why ?
<osa1>
I know it's a module(I wrote the code)
<osa1>
ok so basically what I want to do is this: I have an OCaml program and I want to use it as a library. I've removed the main function, and then compiled it to .cma, but now I can't load and open it from ocamltop.
<osa1>
whatever, I'm compiling for system-wide installation
<osa1>
without opam
lopex has quit []
lopex has joined #ocaml
mehdid_ is now known as mehdid
<osa1>
yay
<osa1>
I have ocamlbrowser \o/
<osa1>
yeah now how can I inspect a .cma file ?
zbroyar has joined #ocaml
<adrien_oww>
define inspect?
<Kakadu>
I usually use it like ocamlfind browser -package core
<osa1>
adrien_oww: list exposed modules
<adrien_oww>
module X = NameOfTheModule
<adrien_oww>
that's a fairly common way
<Kakadu>
It implcitly addes `-I path` parameters to ocamlbrowser
<Kakadu>
osa1
<Kakadu>
^^
<osa1>
adrien_oww: NameOfTheModule is unknown in my case
<osa1>
ok, let me rephrase my problem: I decided using an OCaml program(have a main function) as a library and I compiled it to a .cma. Now I'm loading it in ocamltop but can't open any modules(it's name is toy.cma but I can't even open Toy)
<osa1>
any ideas?
Icarot has joined #ocaml
<Kakadu>
so what?
<Kakadu>
open ocamlbrowser where toy.cma is located
<Kakadu>
You will see some modules in the left side
<osa1>
Kakadu: it only shows standard modules, I think
<Kakadu>
You can remove `ocamlc -where` from Modules->Path Editor menu to reduce modules count
<osa1>
it doesn't show the packages I expect to see
<osa1>
Kakadu: now it's empty (removed stdlibs)
<Kakadu>
Maybe you foreget to add cmx files while creating cmxa?
<osa1>
I have .cma in the same folder.
<osa1>
Kakadu: I don't know, it's size is 1.1M
<Kakadu>
can u build it again?
<Kakadu>
rebuild*
<osa1>
ok I'm away for 5 minutes then I'll rebuild
<Kakadu>
ok, I'm away for dinner
mcclurmc has joined #ocaml
<companion_cube>
thelema: is there a reason for BatMap's polymorphic maps not to take an optional comparison function?
<osa1>
Kakadu: this is the command that I use to compile to .cma, is that correct: ocamlc -a -g -unsafe -I someFolder cmoFiles -o myProgram.cma
mye has joined #ocaml
Jalumar has joined #ocaml
Icarot has quit [Ping timeout: 252 seconds]
_andre has joined #ocaml
pango_ is now known as pango
<hcarty>
companion_cube: I don't remember the details of the discussion, but from what I remember it came down to it being too easy to make mistakes and too hard to keep track of assumptions about which comparison function is being used.
<Kakadu>
osa1: I have tried your command and my cma file is without modules too
adotbrown has joined #ocaml
tane has joined #ocaml
fraggle_ has joined #ocaml
Icarot has joined #ocaml
<osa1>
OK, another question, is there a way to manually point some .cmo files when using ocamlbuild ?
adotbrown has quit [Ping timeout: 255 seconds]
Jalumar has quit [Ping timeout: 248 seconds]
Jalumar has joined #ocaml
rwmjones has quit [Read error: Operation timed out]
osa1_ has joined #ocaml
osa1 has quit [Ping timeout: 245 seconds]
<companion_cube>
hcarty: yes, I've been thinking about that too
<companion_cube>
maybe you can use phantom types to make clear which map uses which comparison function
<companion_cube>
but agreed, that's lessa fe
<companion_cube>
less safe
<companion_cube>
hcarty: would you talk about your idea of 'a Index.t on batteries-devel?
mikurubeam has quit [Quit: When I come back, please tell me in what new ways you have decided to be completely wrong.]
Yoric has quit [Ping timeout: 264 seconds]
Yoric has joined #ocaml
<kaustuv>
Why do people like polymorphic map so much?
Jalumar has quit [Read error: Connection reset by peer]
<osa1_>
what's the command to link every dependency statically and generate a .cma file ?
<kaustuv>
osa1_: .cma is byte-code. Did you mean .cmxa? In any case, ocamlopt cannot normally generate statically linked binaries
<companion_cube>
kaustuv: I like functors less and less
<kaustuv>
companion_cube: but polymorphic comparison is asking for your foot to be shot off eventually
<companion_cube>
kaustuv: I want polymorphic maps parametrized by comparison functions, not by the generic one
<companion_cube>
but still with type ('a,'b) Map.t
<kaustuv>
but there are no parametrically polymorphic functions of type 'a -> 'a -> int, so somewhere or the other you will have to depend on Pervasives.compare
<kaustuv>
(well, none that satisfy the axioms of comparison...)
mye_ has joined #ocaml
mye has quit [Ping timeout: 252 seconds]
mye_ is now known as mye
<companion_cube>
no, I want val empty : cmp:('a -> 'a -> int) -> ('a,'b) t
<companion_cube>
but of course you call it with monomorphic comparison functions
<companion_cube>
if it returns None, then the element is not part of the index, right? ;)
<hcarty>
I'd rather avoid pushing off errors to exceptions at runtime
mikurubeam has joined #ocaml
<companion_cube>
(this, or an exception)
<hcarty>
companion_cube: My original response to your mem request was to say, "return an 'element option from your get function and you won't need it" :-)
<companion_cube>
:D
<companion_cube>
sometimes it can be more efficient to test before, right?
<companion_cube>
(but maybe that's a detail)
<kaustuv>
exceptions are very rarely more efficient than an option, since allocation is effectively free
<hcarty>
kaustuv: I imagine that's true for even more cases if you're wrapping an extra function call around everything
<hcarty>
companion_cube: I may be convinced of the utility of modify. If you wrap a database handle, for example, it could be useful to read from and write to the same index.
<hcarty>
companion_cube: And an extra type parameter could be used to track mutability of the underlying structure.
<companion_cube>
hcarty: indeed
<companion_cube>
for files, for mutable containers...
<hcarty>
('index, 'element, [`mutable | `immutable]) t or something like that
<hcarty>
companion_cube: Yep
<hcarty>
Files! Right, that was the other extra resource I was thinking of
<companion_cube>
like, having the same interface for an array or for a memory-mapped file...
<companion_cube>
(Big_array iirc)
<hcarty>
companion_cube: That's the original reason I put this together
mye has quit [Quit: mye]
<companion_cube>
:)
<hcarty>
companion_cube: Seamless switching between arrays and mmap'd bigarrays
<zorun>
is there a way, using ocamlbuild, to build a .dot file describing the dependencies between a collection of modules?
<zorun>
ocamldoc does that, but it's tiresome to have to list all the modules by hand
<zorun>
(also, in the right order)
<companion_cube>
no idea :/
<adrien_oww>
ocamldep
<zorun>
well, ocamlbuild is supposed to be able to handle talking to ocamldep by itself
<zorun>
I'm pretty sure ocamlbuild could do what I want right away, if only it was documented :/
<hcarty>
zorun: It may need some myocamlbuild.ml customization, or the trunk version of OCaml
<hcarty>
zorun: IIRC there have been some changes to ocamlbuild's handling of ocamldoc over the last few months.
<zorun>
hcarty: oh, right
<zorun>
that is, after the 4.00.1 release?
<hcarty>
zorun: I think so
mye has joined #ocaml
thomasga has joined #ocaml
mikurubeam has quit [Ping timeout: 255 seconds]
<companion_cube>
is there an introduction guide to Bench?
<hcarty>
companion_cube: set/modify introduces some trouble with map
<companion_cube>
hcarty: it only makes sense for mutable containers
<hcarty>
companion_cube: No, sorry - the function map
<hcarty>
companion_cube: Not the module/data structure :-)
<companion_cube>
oh
<companion_cube>
what is wrong with map?
<hcarty>
Ah, never mind. I was mixing up the code in my head.
<hcarty>
let map index f = { index with ... set = (fun i x -> index.set i (f x)) }
<hcarty>
Nope
<hcarty>
let map index f = { index with get = (fun i -> f (index.get i)); set = (fun i x -> ???) }
<hcarty>
There may need to be two map functions. map_mut and map_immut.
<hcarty>
Or map can only be applied to immutable indexes
Yoric has quit [Ping timeout: 256 seconds]
<kaustuv>
osa1_: If needed, here's a variant that shows how to use libraries and include paths in the toplevel: http://pastebin.com/QgQDBXZJ
<osa1_>
kaustuv: I can repeat your first paste
yacks has quit [Remote host closed the connection]
<kaustuv>
osa1_: by the way, don't use -unsafe. Just don't.
<osa1_>
ok
<rks_>
:D
anderse__ has joined #ocaml
anderse has quit [Ping timeout: 255 seconds]
anderse__ is now known as anderse
<osa1_>
fuck that, I'm gonna move all files in one folder and compile them altogether
kaustuv has left #ocaml []
<hcarty>
companion_cube: I pushed an update with mutability support
<hcarty>
companion_cube: For now the map function only works on immutable structures. A map_mutable function could be added with a function map over set and get.
<hcarty>
s/a function/functions to/
milosn_ has joined #ocaml
milosn has quit [Ping timeout: 260 seconds]
q66 has joined #ocaml
mfp has quit [Ping timeout: 248 seconds]
rwmjones has joined #ocaml
travisbrady has joined #ocaml
osa1_ has quit [Ping timeout: 245 seconds]
cago has left #ocaml []
mfp has joined #ocaml
ontologi1e has joined #ocaml
yacks has joined #ocaml
yacks has quit [Max SendQ exceeded]
yacks has joined #ocaml
yacks has quit [Remote host closed the connection]
ontologiae has quit [Ping timeout: 245 seconds]
mye has quit [Ping timeout: 252 seconds]
ontologi1e has quit [Read error: Connection reset by peer]
mye has joined #ocaml
mye has quit [Client Quit]
ontologiae has joined #ocaml
ontologi1e has joined #ocaml
ontologiae has quit [Read error: Connection reset by peer]
ontologi1e has quit [Ping timeout: 245 seconds]
<fasta>
Is there some tool which shows the documentation of a symbol under point?
_eko_ is now known as _eko
<companion_cube>
hcarty: I still don't get the problem with map and mutable structures
ontologiae has joined #ocaml
smondet has joined #ocaml
<fasta>
I set OCAMLPATH to ~/ocaml, then loaded utop, where ~/ocaml contains foo.ml. Why doesn't open Foo;; work then (it's not found)?
<companion_cube>
you have to load it before
<companion_cube>
#use "foo.ml";; maybe ?
<fasta>
companion_cube: I want to use this in compiled code.
<fasta>
companion_cube: with OASIS.
<fasta>
companion_cube: thanks
chambart has joined #ocaml
yacks has joined #ocaml
darinmorrison has joined #ocaml
fraggle_ has quit [Ping timeout: 245 seconds]
darkf has quit [Quit: Leaving]
<hcarty>
fasta: You can't access Foo (of foo.ml) without compiling foo.ml -> foo.cm* first.
<hcarty>
companion_cube: How do you apply the mapping function to a "set" call?
ttamttam has quit [Quit: ttamttam]
<companion_cube>
oh, ok, you need a reverse map
<companion_cube>
what we actually need is lenses ;)
<fasta>
I don't get why anyone would make it possible to install a broken library, however.
<fasta>
You have all of these type systems to prevent human error.
<fasta>
But then in these cases (which are trivial!), you leave it out.
<fasta>
"you" being whoever wrote this nonsense.
Icarot has quit [Ping timeout: 250 seconds]
marblen has quit [Quit: marblen]
<fasta>
adrien: victory
<fasta>
They do show a warning when uninstalling some non-existent library, but showing a warning when the symbols are possibly missing is of course too much to ask for.
milosn_ is now known as milosn
ottbot has joined #ocaml
aolien has joined #ocaml
<aolien>
Bonsoir, à tout hasard est ce que quelqu'un connait l'équivalent de l'instruction return en C pour ocaml? Si j'ai dans un parcours de liste la condition a = 5, alors on renvoit directement 5 en stoppant la récursion, sauriez vous comment faire?
<aolien>
merci
<adrien>
fasta: ah, good to hear
<adrien>
aolien: 1- this channel is english-speaking, there's #ocaml-fr if you want
<adrien>
2- there is no built-in equivalent
<adrien>
don't try to have a direct 1:1 mapping between C and OCaml :-)
<aolien>
Ok, good evening, do you know the equivalent of the intruction return in C in Ocaml? Fo example, if i have the condition a = 5 in a recursion on a list, how to return 5 by stopping immediately the recursion?
milosn has quit [Ping timeout: 264 seconds]
aolien has quit []
Icarot has joined #ocaml
milosn has joined #ocaml
belaid has joined #ocaml
<fasta>
He already left?
marblen has joined #ocaml
<fasta>
He just wanted to have a continuation.
<fasta>
if a=5 then "already done" ... would be one :)
<adrien>
it's fairly late in france
pango has quit [Ping timeout: 245 seconds]
pango has joined #ocaml
Kakadu has quit []
anderse has quit [Quit: anderse]
cdidd has quit [Read error: Connection reset by peer]
<adrien>
bash-4.2# uname -a
<adrien>
Linux nabucho 3.6.0 #45 SMP Sat Dec 1 18:31:13 CET 2012 x86_64 AMD Phenom(tm) II X4 955 Processor AuthenticAMD GNU/Linux
<adrien>
bash-4.2# file _build/src/oUnit.{o,cmxs}
<adrien>
_build/src/oUnit.o: 80386 COFF executable not stripped - version 30821
<adrien>
_build/src/oUnit.cmxs: PE32 executable (DLL) (console) Intel 80386, for MS Windows
<adrien>
soon, soon
<adrien>
custom-linking is undoable however
mcsquiggedy has joined #ocaml
ollehar has quit [Ping timeout: 245 seconds]
ollehar has joined #ocaml
ottbot has quit [Ping timeout: 260 seconds]
adotbrown has joined #ocaml
Icarot has quit [Ping timeout: 248 seconds]
Associat0r has quit []
ottbot has joined #ocaml
Icarot has joined #ocaml
contempt has quit [Ping timeout: 252 seconds]
dysoco has joined #ocaml
contempt has joined #ocaml
Icarot has quit [Ping timeout: 248 seconds]
Icarot has joined #ocaml
mcsquiggedy has quit [Ping timeout: 255 seconds]
Yoric has quit [Ping timeout: 256 seconds]
dysoco has quit [Quit: THERE IS INSUFFICIENT DATA FOR A MEANINGFUL ANSWER]
cdidd has joined #ocaml
mye has quit [Quit: mye]
Icarot has quit [Ping timeout: 248 seconds]
Yoric has joined #ocaml
cdidd has quit [Remote host closed the connection]
cdidd has joined #ocaml
ontologiae has quit [Ping timeout: 264 seconds]
milosn_ has joined #ocaml
milosn has quit [Ping timeout: 264 seconds]
ocp has quit [Quit: Leaving.]
Icarot has joined #ocaml
sgnb has quit [Read error: Connection reset by peer]
Yoric has quit [Ping timeout: 256 seconds]
sgnb has joined #ocaml
ottbot has quit [Read error: Operation timed out]
ottbot has joined #ocaml
sgnb has quit [Ping timeout: 240 seconds]
sgnb has joined #ocaml
mcsquiggedy has joined #ocaml
sgnb has quit [Read error: Connection reset by peer]
sgnb has joined #ocaml
ottbot has quit [Read error: Operation timed out]
Icarot has quit [Remote host closed the connection]
sgnb has quit [Ping timeout: 250 seconds]
Icarot has joined #ocaml
milosn has joined #ocaml
q66 has quit [Remote host closed the connection]
milosn_ has quit [Ping timeout: 245 seconds]
q66 has joined #ocaml
thomasga has quit [Quit: Leaving.]
watermind has joined #ocaml
sgnb has joined #ocaml
Icarot has quit [Ping timeout: 256 seconds]
sgnb has quit [Ping timeout: 250 seconds]
watermind has quit [Quit: Konversation terminated!]