<vishesh>
I just installed jane street core. repl and utop work fine, but when I execute my script I get "unbound module Core"
<ygrek_>
you need to bind core tightly
<ygrek_>
otherwise it gets wild
igoroliveira has quit [Quit: Connection closed for inactivity]
carts has quit [Ping timeout: 246 seconds]
FreeBirdLjj has joined #ocaml
echo-area has joined #ocaml
swgillespie has joined #ocaml
<vishesh>
ygrek_: How do I do that? I kind of going crazy here. Followed the instructions in docs
<vishesh>
So if do this "ocamlfind ocamlopt -linkpkg -thread -package core test.ml -o test" I could compile and run. Anyway I can just do "ocaml test.ml"?
<reynir>
companion_cube: I first tried with zarith :)
<solrize>
ok gnite everyone, i'll post some of these timings to andy's blog tomorrow if i remember to
<solrize>
thanks
<companion_cube>
oh sorry
<companion_cube>
11s, ok
<companion_cube>
not bad
<freehck>
solrize: good night
<freehck>
people, btw, who's andy? )
darkf_ has joined #ocaml
darkf has quit [Ping timeout: 246 seconds]
mort___ has joined #ocaml
igstan has quit [Quit: igstan]
Bahman has quit [Read error: Connection reset by peer]
Bahman has joined #ocaml
kdas_ has quit [Quit: Leaving]
kushal has joined #ocaml
<Mike57_>
Is there a way to set a #trace in a recursive *inner* function?
<Mike57_>
or do I have to break it out to the top level>
<Mike57_>
or do I have to break it out to the top level?
rgrinberg1 has joined #ocaml
<companion_cube>
you probably have to lift it out to the toplevel
rgrinberg1 has quit [Ping timeout: 246 seconds]
kushal has quit [Quit: Leaving]
python476 has quit [Ping timeout: 246 seconds]
<Mike57_>
Thanks: that's what I thought, but just wondered it there a trick I didn't know about
echo-area has quit [Remote host closed the connection]
accname has joined #ocaml
<accname>
hi
jonludlam has joined #ocaml
kushal has joined #ocaml
<accname>
can someone help me with a little problem?
python476 has joined #ocaml
Simn has joined #ocaml
<ely-se>
accname: not yet, you first have to state the problem.
<accname>
:) of course
<accname>
well basically I am working with hol light. to use it I have to use it via #use "hol.ml"
<accname>
the problem is that I changed some code and it produces errors. To investigate what the errors are I would like to print the output of #use into a file
<accname>
is that possible?
igstan has joined #ocaml
<fds>
freehck: I assume solrize means Andy Wingo of Guile fame.
libertas_ has joined #ocaml
<fds>
That could obviously be an faulty assumption, mind.
Bahman has quit [Quit: Ave atque vale]
libertas has joined #ocaml
libertas_ has left #ocaml [#ocaml]
mort___ has left #ocaml [#ocaml]
jgjl has joined #ocaml
mtesseract has quit [Ping timeout: 240 seconds]
mtesseract has joined #ocaml
superboum_ has joined #ocaml
<freehck>
fds: thank you
<freehck>
btw, I've visited Andy Wingo weblog and found it has an ugly backgroud acid-red color. I could change it in CSS editor in Firefox, but of course changes are dropped after reloading page or following a link.
<freehck>
Do somebody know how to make these changes persistent? :)
<freehck>
I know it's out the scope of the channel but why not... :)
FreeBird_ has joined #ocaml
igstan has quit [Quit: igstan]
FreeBirdLjj has quit [Ping timeout: 250 seconds]
FreeBird_ has quit [Ping timeout: 240 seconds]
mort___ has joined #ocaml
<freehck>
Well, Stylish addon is what has solved that problem. :)
<companion_cube>
accname: good question
<companion_cube>
can you write into foo.ml #use "hol.ml", then run ocaml foo.ml > log_file ?
netrobyatmobile has joined #ocaml
ia0 has quit [Quit: leaving]
ia0 has joined #ocaml
<accname>
I'll try that. I forgot to mention that I am using "rlwrap ocaml"
<companion_cube>
this is just for runnign the script non interactively, so don't use rlwrap there
<accname>
nah doesn't work. Syntax error for the > symbil
<accname>
nah doesn't work. Syntax error for the > symbol
<companion_cube>
ocaml file.ml > something? it's standard bash
<companion_cube>
sh, even
<accname>
I got it
<accname>
ocaml file.ml > output.txt
<accname>
:D
<accname>
that does work, didnt think about that
<companion_cube>
yes
<accname>
thank you
<companion_cube>
you're welcome :)
<freehck>
accname: Could I alse advice you to use merlin editor? It's very powerful.
<freehck>
*also
<companion_cube>
but it's not necessarily easy to use with HOL
<companion_cube>
since HOL is meant to be used within a toplevel
ygrek_ has quit [Ping timeout: 240 seconds]
<freehck>
aah, HOL Light... I missed this.
<accname>
:) I was about to look at merlin
<accname>
but thanks for mentioning I will still look at it
sgnb has joined #ocaml
accname has quit [Ping timeout: 246 seconds]
rgrinberg1 has joined #ocaml
rgrinberg1 has quit [Ping timeout: 240 seconds]
Haudegen has quit [Ping timeout: 260 seconds]
bjorkintosh has quit [Quit: Leaving]
<freehck>
Does somebody know where ocaml looks for modules by default?
<freehck>
I need to pack an rpm of the upstream ocaml for our project, and need to build some modules.
<freehck>
And the real question is: how to build them without opam, and where to put them after build?
grouzen has joined #ocaml
superboum_ has quit [Ping timeout: 240 seconds]
bjorkintosh has joined #ocaml
sepp2k has joined #ocaml
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
igstan has joined #ocaml
Haudegen has joined #ocaml
<sgnb>
freehck: `ocamlc -where`
nopf has joined #ocaml
<freehck>
sgnb: hm... and could it be changed?
<freehck>
is it decided while building ocaml or with some kind of config?
<ely-se>
why does it pick u instead of failing with an ambiguity error?
tg has joined #ocaml
<freehck>
ely-se: the same thing will happen if you do "type thing = string";;
<freehck>
all the strings you create after this will be tracted as having thing type.
<freehck>
I think it's not an error. It's just a type redefinition.
<ely-se>
oh ok
<ely-se>
so t and u are the same thing
<freehck>
Yep, they can be used in place of each other. I tested it with strings but I'm pretty sure it should be for such types too.
Haudegen has joined #ocaml
<ely-se>
then why can't you just write { a = 1, b = 2 } without type definitions in scope?
<freehck>
s/,/;/
<ely-se>
yeah
<freehck>
The type should have a name, isn't it?
ryanartecona has joined #ocaml
<ely-se>
it says "Error: Unbound record field a" but since apparently record types are structural I don't see why this should be forbidden
<freehck>
This error message hardly correlate to the real reasons of error happen. But usually when you're coding not in the toplevel the compiler can evaluate the type of structure you really need and provide you with more useful message.
<freehck>
For example: "Some record fields are undefined: nodev"
<freehck>
The error message you get is caused by the information leak about the type you should get after evaluating the code in the toplevel. So it suppose that it should be a structure, and I can only assume that it suppose this structure to have no fields.
<freehck>
ely-se: I don't really sure about the word "leak".
<freehck>
I wanted to have a sense of "not enough of"
<freehck>
*I'm not really sure
igstan has quit [Quit: igstan]
<freehck>
aaah. My english hambles sometimes.
igstan has joined #ocaml
Haudegen has quit [*.net *.split]
metadave has quit [*.net *.split]
sivoais has quit [*.net *.split]
<freehck>
Wow. The changelog for Ocaml Debian package has commits signed by Stefano Zacchiroli. :)
<flux>
no, t and u aren't the same thing in ely-se's example
<flux>
and records are not structurally typed in ocaml, only modules and objects are
<flux>
and I suppose in some sense polymorphic variants?
Haudegen has joined #ocaml
metadave has joined #ocaml
sivoais has joined #ocaml
sivoais has quit [Max SendQ exceeded]
sivoais has joined #ocaml
<freehck>
Hm... I have mistaken.
<flux>
easy way to see it: type t = { a : int } let a = { a = 42 } type u = { a : int } let _ = a = { a = 42 }
<freehck>
type x = {x:int};;
<freehck>
type y = {x:int};;
<freehck>
let v : x ref = ref {x=1};;
<freehck>
-> Error: This expression has type y ref but an expression was expected of type x ref
<freehck>
-> Type y is not compatible with type x
<flux>
but, ocaml has this new cool feature to somewhat help with dealing with the accidental redefinitions
<flux>
let _ = a = ({a = 42} : t) maybe works :)
<freehck>
flux: but why does it work for strings?
<freehck>
type the_string = string;;
<freehck>
print_endline "123";;
<flux>
that's just a type alias
<freehck>
aaaah...
<flux>
but { } defines a new record type
<flux>
I suppose you could say t is an alias to the new record type, but the record type nevertheles is a new type
emaphis has joined #ocaml
<flux>
and you can only define new record types with type t = { .. } syntax :)
badon has quit [Ping timeout: 264 seconds]
<freehck>
flux: but why records of the same fields are considered as different?
<flux>
well, why would you have them in the first place?
<flux>
btw, you can type: type u = t = { x : int }
<ely-se>
flux: ok I understand!
<freehck>
I dunno.
<freehck>
I think I actually don't need them.
ncthom91 has joined #ocaml
<freehck>
Okay, it's simpler and more safe to separate them of course.
badon has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 264 seconds]
python476 has quit [Ping timeout: 246 seconds]
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ely-se has quit [Quit: leaving]
zoetus has joined #ocaml
<zoetus>
hello everyone!
<zoetus>
do people here use oasis for builds?
<zoetus>
i seem to have confused it such that it refuses to build my project
ryanartecona has quit [Quit: ryanartecona]
lopex has joined #ocaml
<companion_cube>
zoetus: can you give more details?
<zoetus>
sure: i get this message "The file 'btc/src/META' generated for the library 'btc_support' is already used for the library 'btc_targets'"
<zoetus>
i'm confused because this META file does not even exist
<zoetus>
previously, btc_support and btc_targets were libraries with a common FindLibParent
<companion_cube>
it might be in _build/btc/src/META
<zoetus>
but i changed my _oasis file so that they are separate
<companion_cube>
oasis relies on ocamlbuild
<companion_cube>
well, first, rm -rf _build
<companion_cube>
there might be leftovers
<zoetus>
i looked there, but nothing
<zoetus>
find . -name "META" gets nothing :(
<zoetus>
ok, i blew away the _build directory, same error
<companion_cube>
and you ran oasis setup again? or are you using the dynamic stuff?
<zoetus>
i was, yeah
<companion_cube>
hmm :s
<companion_cube>
can I see the _oasis file? if it's on the web?
<zoetus>
it doesn't matter what i do, `oasis setup -setup-update {dynamic|weak}` both give me the same error
<zoetus>
oops, that was an outdated version -- updated now
<companion_cube>
oh ok, don't put two sublibraries in the same directory
<companion_cube>
because oasis will confuse them (too general _tags files)
<companion_cube>
so _targets and _support are in the same dir but have distinct dependencies, that will not do
<zoetus>
yeah :(
<zoetus>
ah, so moving support into a subdirectory seems to have had some effect: now i get the same error, but the conflict seems to be between btc_core and btc_targets
<zoetus>
probably for the same reason
<companion_cube>
I saw the old version (before you updated the gist) and every sublib/binary was in its own directory
<zoetus>
those libraries actually are in the same directory, i think the only difference is that i'm using FindLibName/Parent
tmtwd has joined #ocaml
<zoetus>
awesome! that fixed it! thank you so much!
<zoetus>
i do have another question that's (i think) unrelated to my lack of oasis understanding
<zoetus>
i recently updated my ocaml compiler to 4.2.3, and now when i build anything i get the following warning (several times):
<zoetus>
findlib: [WARNING] Interface topdirs.cmi occurs in several directories: /usr/local/lib/ocaml/compiler-libs, /usr/local/lib/ocaml
<freehck>
People, I have an argument with a colleage. It's about the coding style in ocaml. The question is what is better: to provide all the functions with types or to left it to time inference?
<companion_cube>
zoetus: I have the same, sometimes; no idea why
<companion_cube>
freehck: it's a matter of taste. My rule: I write a .mli file with types + doc for public functions
<freehck>
I argue that it's better to left in to type inference, and specify types only in .mli files.
<companion_cube>
private functions I don't usually annotate with types, except when they are really really complicated
<Drup>
(or when you need too)
<companion_cube>
(yes)
<companion_cube>
(spéciale dédicasse GADTs)
<ely-se>
I annotate all top-level bindings with types.
<zoetus>
is there any way to get rid of that? it makes my builds really noisy
<zoetus>
like, every invocation of ocamlfind gives me that warning
<zoetus>
i also have issues that i wasn't seeing pre-upgrade, where names of modules in my project are clashing with ones in /usr/local/lib/ocaml/compiler-libs
ril has joined #ocaml
<freehck>
ely-se: I'm sorry, but I can have a little misunderstanding what a top-level is. Is it a set of functions provided with .mli files?
<ely-se>
sorry-module-level bindings
<ely-se>
I don't know what the official term is
<freehck>
thx.
rgrinberg1 has joined #ocaml
rgrinberg1 has quit [Ping timeout: 240 seconds]
<zoetus>
it is kind of a drag that i can't define a module named 'Env' because one with that name already exists in 'compiler-libs/ocamlcommon.cmxa'
<zoetus>
?
igstan has quit [Quit: igstan]
<zoetus>
it's weird that that wasn't an issue before 4.2.3 also
<companion_cube>
yeah, this is annoying
<companion_cube>
the lack of namespace in general
michael_lee has joined #ocaml
grouzen has quit [Quit: Lost terminal]
<zoetus>
especially if i'm writing a compiler, chances are i'm going to have a lot of name clashes
<Drup>
zoetus: you can "solve" that with pack
<Drup>
(also, the name classhes only if they are linked together, Env is only going to clash if you link to compiler-libs)
<companion_cube>
that still prevents you from loading your code in the toplevel
<Drup>
oh, right
ryanartecona has joined #ocaml
<zoetus>
hmm, i don't see where i'm doing that
<zoetus>
i mean linking to compiler-libs
rgrinberg1 has joined #ocaml
dts|pokeball is now known as nchambers
FreeBirdLjj has joined #ocaml
<zoetus>
is there some way in the 'opam' file to require a base version of ocaml for my package?
<def`>
available: [ocaml-version >= "4.00.0"]
ryanartecona has quit [Quit: ryanartecona]
accname has quit [Ping timeout: 246 seconds]
darkf_ is now known as darkf
yomimono has joined #ocaml
BitPuffin has quit [Read error: Connection reset by peer]
netrobyatmobile has quit [Quit: Connection closed for inactivity]
groovy2shoes has joined #ocaml
slash^ has joined #ocaml
BitPuffin has joined #ocaml
igoroliveira_ has joined #ocaml
jeroud_ has joined #ocaml
badon_ has joined #ocaml
badon has quit [Disconnected by services]
badon_ is now known as badon
stomp_ has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 250 seconds]
kdas_ has joined #ocaml
ril has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
drmem has joined #ocaml
raphaelsss has joined #ocaml
RichN has quit [Ping timeout: 240 seconds]
stomp has quit [Ping timeout: 240 seconds]
kushal has quit [Ping timeout: 240 seconds]
schoppenhauer has quit [Ping timeout: 240 seconds]
jeroud has quit [Ping timeout: 240 seconds]
Maelan has quit [Ping timeout: 240 seconds]
igoroliveira has quit [Ping timeout: 240 seconds]
andreypopp has quit [Ping timeout: 240 seconds]
luzie has quit [Ping timeout: 240 seconds]
tobiasBora has quit [Ping timeout: 240 seconds]
fold1 has quit [Ping timeout: 240 seconds]
jeroud_ is now known as jeroud
igoroliveira_ is now known as igoroliveira
tobiasBora has joined #ocaml
fold2 has joined #ocaml
raphaelss has quit [Ping timeout: 246 seconds]
andreypopp has joined #ocaml
rgrinberg1 has quit [Ping timeout: 265 seconds]
ril has joined #ocaml
luzie has joined #ocaml
Maelan has joined #ocaml
FreeBirdLjj has joined #ocaml
schoppenhauer has joined #ocaml
raphaelssss has joined #ocaml
ely-se has quit [Quit: leaving]
raphaelsss has quit [Ping timeout: 252 seconds]
ollehar has joined #ocaml
jabesed has joined #ocaml
rgrinberg1 has joined #ocaml
zpe has quit [Remote host closed the connection]
ollehar has quit [Remote host closed the connection]
yomimono has quit [Ping timeout: 276 seconds]
ryanartecona has joined #ocaml
groovy3shoes has joined #ocaml
groovy2shoes has quit [Disconnected by services]
groovy3shoes is now known as groovy2shoes
t4nk538 has joined #ocaml
lukky513 has joined #ocaml
jgjl has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
troydm has joined #ocaml
^elyse^ has joined #ocaml
kdas_ is now known as kushal
kushal has quit [Changing host]
kushal has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
rgrinberg1 has quit [Ping timeout: 240 seconds]
Kakadu has quit [Ping timeout: 246 seconds]
<t4nk538>
I've not had time to experiment, but if anyone knows the answer, please enlighten me. If I write a module using core's async and now I want to use it from another module that has been written using Lwt, would that work? Would there be any performance or other issues? I fear I'm screwed.
<companion_cube>
I'm afraid Async and Lwt don't play together well
jwatzman|work has joined #ocaml
Kakadu has joined #ocaml
sgnb has quit [Ping timeout: 240 seconds]
<flux>
some effort was for writing a common interface for them, but apparently they are so subtly different that it turned out difficult..
tane has joined #ocaml
libertas has quit [Ping timeout: 272 seconds]
sgnb has joined #ocaml
jonludlam has quit [Ping timeout: 260 seconds]
pacmann has joined #ocaml
python476 has joined #ocaml
jabesed has quit [Ping timeout: 240 seconds]
NingaLeaf has joined #ocaml
darkf has quit [Quit: Leaving]
orbifx has joined #ocaml
python476 has quit [Quit: Page closed]
<NingaLeaf>
Is there a way to increment a ref variable within an Array.iter? - ex. Array.iter (fun x -> Printf.printf "[%i] %s\n" (incr c) x) a => Error: This expression has type unit but an expression was expected of type.
<companion_cube>
what is c?
<NingaLeaf>
let c = ref 0
<companion_cube>
and a : string array?
<companion_cube>
(fun x -> sprintf "[%i] %s\n" !c x; incr c)
<NingaLeaf>
let check_input = let c = ref 0 in let a = Sys.argv in
<NingaLeaf>
;;
<NingaLeaf>
Array.iter (fun x -> Printf.printf "[%i] %s\n" (incr !c) x) a
Kakadu has quit [Quit: Page closed]
ril is now known as ril[away]
python476 has joined #ocaml
<companion_cube>
yeah well, try what I wrote above
<NingaLeaf>
yes this worked!
<NingaLeaf>
thank you!
<flux>
I suppose if you want to be complicated, printf "%i" (incr c; !c) works as well :-)
<companion_cube>
heh
<companion_cube>
not the same !!
psy_ has quit [Ping timeout: 250 seconds]
<companion_cube>
(let x = !c in incr c; x) would work
ril[away] is now known as ril
ggole has quit []
ryanartecona has quit [Quit: ryanartecona]
^elyse^ has quit [Quit: Leaving]
MercurialAlchemi has quit [Ping timeout: 272 seconds]
madroach has quit [Read error: Connection reset by peer]
MercurialAlchemi has joined #ocaml
madroach has joined #ocaml
^elyse^ has joined #ocaml
zpe has joined #ocaml
rand has quit [Quit: leaving]
<sgeisenh>
How come nobody suggested iteri?
<sgeisenh>
let check_input =
<sgeisenh>
let a = Sys.argv in
<flux>
well, it's probably more important to learn how that was built with incr without using Array.iteri than just use it for this particular problem :)
yomimono has joined #ocaml
<sgeisenh>
refs are ugly and I like to keep my benign effects hidden away
pierpa has joined #ocaml
octachron has joined #ocaml
michael_lee has quit [Remote host closed the connection]
sepp2k has quit [Quit: Leaving.]
pierpa has quit [Remote host closed the connection]
pierpa has joined #ocaml
psy_ has joined #ocaml
python476 has quit [Ping timeout: 246 seconds]
yomimono has quit [Ping timeout: 240 seconds]
Hetu has joined #ocaml
ocaml320 has joined #ocaml
Kakadu has joined #ocaml
ocaml320 has quit [Client Quit]
<mrvn>
ups
ryanartecona has joined #ocaml
<orbitz>
Hello, if I have two types, a and b, how can I say that i don't care what a and b are, but a must be a subtype of b?
lobo has joined #ocaml
ncthom91 has joined #ocaml
Hetu has quit [Ping timeout: 264 seconds]
Hetu has joined #ocaml
tane has quit [Ping timeout: 250 seconds]
ril has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<companion_cube>
orbitz: can't do, I think
orbifx has quit [Ping timeout: 276 seconds]
kushal has quit [Quit: Leaving]
slash^ has quit [Read error: Connection reset by peer]
<orbitz>
dang
uggwar has quit [Ping timeout: 240 seconds]
BitPuffin has quit [Ping timeout: 276 seconds]
ryanartecona has quit [Read error: No route to host]
ril has joined #ocaml
zoetus has quit [Ping timeout: 246 seconds]
tane has joined #ocaml
rgrinberg1 has joined #ocaml
raphaelssss has quit [Ping timeout: 272 seconds]
ryanartecona has joined #ocaml
rgrinberg1 has quit [Ping timeout: 272 seconds]
ygrek_ has joined #ocaml
freehck has quit [Remote host closed the connection]
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
t4nk538 has quit []
badon has quit [Ping timeout: 272 seconds]
Hetu has quit [Quit: Verlassend]
ollehar has joined #ocaml
ceryo has joined #ocaml
badon has joined #ocaml
ygrek_ has quit [Remote host closed the connection]
ygrek has joined #ocaml
octachron has quit [Quit: Leaving]
ril has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ril has joined #ocaml
ceryo_ has joined #ocaml
ceryo has quit [Ping timeout: 260 seconds]
Guest38 has joined #ocaml
rgrinberg1 has joined #ocaml
rgrinberg1 has quit [Ping timeout: 264 seconds]
ryanartecona has quit [Quit: ryanartecona]
Algebr has joined #ocaml
ceryo_ has quit [Ping timeout: 264 seconds]
tani has joined #ocaml
zpe has quit [Remote host closed the connection]
tane has quit [Ping timeout: 240 seconds]
tani has quit [Ping timeout: 240 seconds]
^elyse^ has quit [Quit: Leaving]
bbc has quit [Ping timeout: 252 seconds]
emaphis has quit [Quit: by by]
mac10688 has joined #ocaml
ivan\ has quit [Ping timeout: 246 seconds]
ygrek has quit [Ping timeout: 250 seconds]
ivan\ has joined #ocaml
tane has joined #ocaml
ygrek has joined #ocaml
tane has quit [Ping timeout: 260 seconds]
badon_ has joined #ocaml
badon has quit [Disconnected by services]
badon_ is now known as badon
bbc has joined #ocaml
tane has joined #ocaml
tane has quit [Remote host closed the connection]
ril has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
zpe has joined #ocaml
jave_ has quit [Ping timeout: 240 seconds]
zpe has quit [Ping timeout: 244 seconds]
lobo has quit [Ping timeout: 260 seconds]
jave has joined #ocaml
Algebr has quit [Remote host closed the connection]
ncthom91 has joined #ocaml
jeffmo has quit [Quit: jeffmo]
Simn has quit [Read error: Connection reset by peer]