<thelema>
I wonder if I'm taking all the fun out of making unit tests for batteries by doing it myself
groovy2shoes has quit [Read error: Connection reset by peer]
groovy2shoes has joined #ocaml
groovy2shoes has quit [Changing host]
groovy2shoes has joined #ocaml
drunK has joined #ocaml
ModusPwnens has joined #ocaml
<ModusPwnens>
hello
<ModusPwnens>
if anybody can help an ocaml noob, I am getting a type error and I'm not sure why. Here is the pastebin of my code: http://pastebin.com/0Q4D5UTD
<ModusPwnens>
I know its a simple error because I am just learning it =/
<ModusPwnens>
but i don't understand how to debug these errors..
<thelema>
putting [] around your recursive call is the mistake
<thelema>
clone x (n-1) is already a list
<thelema>
[clone x n-1] is a list of lists
<ModusPwnens>
*sigh* of course..
<thelema>
then x :: clone x (n-1)
<ModusPwnens>
thanks. In the future, is there an easier way to figure out these things or does it just take practice..
<thelema>
practice helps. For type errors, I use tuareg's ability to tell me the type of something
<thelema>
C-c C-t, if I've compiled with -annot
<ModusPwnens>
whoa, what is tuareg?
<thelema>
an emacs mode for ocaml
<thelema>
the normal emacs mode has this as well.
<ModusPwnens>
Oh, and that would help me with these simple type errors?
<thelema>
well, it might. You can also annotate types sometimes.
<thelema>
tuareg would be able to tell you what the ocaml compiler thinks some of the types are
<thelema>
annotations would give you an error if the type wasn't what you annotated
<ModusPwnens>
so for annotations, I would just start ocaml with the -annot flag?
<thelema>
i.e. let rec clone x n : 'a list = ...
<thelema>
-annot will produce an annotation file that gets read by emacs
<ModusPwnens>
or would i #use "myfile.ml" -annot
<thelema>
ocamlc -annot myfile.ml -o myfile
<ModusPwnens>
Hmm..ok. Thanks!
myu2 has joined #ocaml
groovy2shoes has quit [Quit: groovy2shoes]
Associat0r has quit [Quit: Associat0r]
ulfdoz_ has joined #ocaml
ulfdoz has quit [Ping timeout: 246 seconds]
ulfdoz_ is now known as ulfdoz
myu2 has quit [Remote host closed the connection]
drunK has quit [Remote host closed the connection]
Amorphous has quit [Ping timeout: 272 seconds]
Amorphous has joined #ocaml
f[x] has quit [Ping timeout: 246 seconds]
f[x] has joined #ocaml
myu2 has joined #ocaml
ModusPwnens has quit [Quit: Page closed]
tautologico has quit [Quit: tautologico]
NaCl is now known as SodiumChloride
joewilliams is now known as joewilliams_away
cyanure has joined #ocaml
drunK has joined #ocaml
<eye-scuzzy>
[A
<SodiumChloride>
[B
Snark_ has joined #ocaml
Yoric has joined #ocaml
cyanure has quit [Quit: Quitte]
sgnb has quit [Read error: Operation timed out]
sgnb has joined #ocaml
ulfdoz has quit [Ping timeout: 272 seconds]
<eye-scuzzy>
[A and [B sat on the tube
<eye-scuzzy>
[A dropped, [B gone
<eye-scuzzy>
the was left on the tube ?
* eye-scuzzy
*shrugs*
<eye-scuzzy>
*that
ftrvxmtrx has joined #ocaml
drunK has quit [Remote host closed the connection]
Snark_ is now known as Snark
Yoric has quit [Quit: Yoric]
rixed_ has quit [Quit: reboot]
ygrek has joined #ocaml
ikaros has joined #ocaml
ttamttam has joined #ocaml
ygrek has quit [Remote host closed the connection]
Snark has quit [Read error: Operation timed out]
Snark has joined #ocaml
Yoric has joined #ocaml
ygrek has joined #ocaml
hto has quit [Read error: Connection reset by peer]
hto has joined #ocaml
_andre has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
ikaros has quit [Quit: Leave the magic to Houdini]
ygrek has quit [Ping timeout: 240 seconds]
avsm has joined #ocaml
myu2 has quit [Remote host closed the connection]
boscop has joined #ocaml
ftrvxmtrx has joined #ocaml
Edward_ has joined #ocaml
hyperboreean has quit [Remote host closed the connection]
hyperboreean has joined #ocaml
waterChip has joined #ocaml
Associat0r has joined #ocaml
cyanure has joined #ocaml
eye-scuzzy has quit [Quit: leaving]
myu2 has joined #ocaml
jm has joined #ocaml
waterChip has quit [Ping timeout: 260 seconds]
rixed has joined #ocaml
waterChip has joined #ocaml
waterChip has quit [Client Quit]
bzzbzz has joined #ocaml
waterChip has joined #ocaml
waterChip has quit [Client Quit]
Edward_ has quit []
Edward_ has joined #ocaml
ikaros has joined #ocaml
ikaros has quit [Read error: Operation timed out]
ikaros has joined #ocaml
avsm has quit [Quit: Leaving.]
hto has quit [Quit: Lost terminal]
hto has joined #ocaml
eye-scuzzy has joined #ocaml
ttamttam has quit [Remote host closed the connection]
Snark has quit [Quit: Ex-Chat]
seafood has joined #ocaml
seafood has quit [Read error: Connection reset by peer]
hto has quit [Read error: Connection reset by peer]
seafood has joined #ocaml
ikaros has quit [Read error: Operation timed out]
gmarik has joined #ocaml
seafood has quit [Quit: seafood]
Associat0r has quit [Quit: Associat0r]
Edward_ has quit []
Edward_ has joined #ocaml
ikaros has joined #ocaml
edwin has joined #ocaml
joewilliams_away is now known as joewilliams
hto has joined #ocaml
joewilliams is now known as joewilliams_away
avsm has joined #ocaml
avsm has quit [Client Quit]
hto has quit [Read error: Connection reset by peer]
joewilliams_away is now known as joewilliams
ygrek has joined #ocaml
Edward_ has quit []
jonafan_ has joined #ocaml
avsm has joined #ocaml
jonafan has quit [Ping timeout: 265 seconds]
oriba has joined #ocaml
ikaros has quit [Quit: Leave the magic to Houdini]
smerz has joined #ocaml
avsm has quit [Quit: Leaving.]
sepp2k has joined #ocaml
Anarchos has joined #ocaml
examachine has joined #ocaml
<examachine>
hi there :)
<Anarchos>
how can i store an interacvtive session into a .cmo file ?
ulfdoz has joined #ocaml
<eye-scuzzy>
man script
<examachine>
i have a problem with ocamlbuild of ocaml-3.12.0 and cryptokit. ocaml-3.12.0 doesn't seem to install ocamlbuild.cmx which the ocamlbuild call in cryptokit installation fails to find. am i misconfiguring ocaml?
<eye-scuzzy>
may be
<eye-scuzzy>
how to you setup ocaml ?
<orbitz>
examachine: problem wiht a cmx is probably not specifying to create native compiler
<examachine>
ah so i need to make opt.opt? what do i do :) lost in the build maze
<examachine>
i set it up as ./configure -prefix $HOME/local
joewilliams is now known as joewilliams_away
<examachine>
and then i made, make world; make opt; make install
<adrien>
opt.opt creates ocamlopt.opt, which is not *required*
<adrien>
*not*
<adrien>
but at this point, if it's a new install, I'd use godi
<examachine>
i'm installing on a remote cluster that doesn't have ocaml at all so i was compiling everything from source myself
ikaros has joined #ocaml
<adrien>
godi doesn't require ocaml to run
<examachine>
ok i got it, it says only 3.11 is supported though?
<adrien>
run bootstrap_stage1 with --section 3.12, it works perfectly
<adrien>
'-section 3.12'
<examachine>
ah thank you adrien will try it out in a minute :)
jonathandav has quit [Quit: turning my computer off!]
<Anarchos>
how can i store an interacvtive session into a .cmo file ?
Yoric has quit [Read error: Connection reset by peer]
Yoric has joined #ocaml
kaustuv_ has joined #ocaml
<flux>
anarchos, I don't think you can..
<flux>
anarchos, best you can do is to take the history file of your command line editor (say, rlwrap) and build an .ml-file based on that
mikemc has quit [Remote host closed the connection]
<Anarchos>
flux thanks a lot
Yoric has quit [Quit: Yoric]
<examachine>
is github any good i didn't use it yet, i'm mulling over using github over google code for a project.
<Anarchos>
examachine at work and at home i am using svn
<kaustuv_>
examachine: if you want to use git, you don't really have a choice, unless google code has added git support recently
<examachine>
it's not like i want to use git or mercurial. whatever is better :)
<examachine>
i see a lot of people moving from google code to github
<examachine>
so I couldn't decide on where best to put up some GPL'd code :)
<examachine>
are the social aspects of github advantageous?
<kaustuv_>
the "social network" aspects are a distraction, but github has decent forking and issue tracking support
<examachine>
for my personal projects i'm the svn server at my website
<examachine>
even, using
<examachine>
@kaustuv_: the issue tracking system looked a bit primitive to me?
<examachine>
i suppose git is a lot faster than mercurial. is it also better more featureful? it seems git and github makes merges quite easy
<kaustuv_>
"lot faster"? [citation needed]
<kaustuv_>
they are almost equal in features and performance for most cases
<mrvn>
I've never ever been worried about the speed of mercurial.
<kaustuv_>
mercurial just doesn't give you the tools to shoot your foot by default, but with mercurial queues you have a wide and varied assortment of implements to do enact any imaginable horror on your poor defenseless feet
<mrvn>
merging is a week point in mercurial though. If you have multiple people committing to the repository that becomes a real issue.
<examachine>
git might be preferable for larger projects, no wonder why it was so useful for linux. most of the contributions come in the form of parallel commit requests to be reviewed.
<examachine>
so is there a full review system on github?
<mrvn>
On the other hand, as kaustuv_ hints at, git needs getting used too. It has a steap learning curve and you will shoot yourself in the foot at first.
<examachine>
i also checked out gitorious, doesn't look too bad, some crowded projects are using it
<examachine>
@mrvn: ah ok i got it :)
* mrvn
is no op. I work for a living. :)
<examachine>
google code seems to be fast and lean
<kaustuv_>
RT @mrvn, I hate twitterspeak encroaching on everything #twittersucks
<gildor>
examachine: OCaml Forge provide git, hg and svn
<mrvn>
rt?
<gildor>
retweet ?
<kaustuv_>
if you don't know, don't ask to know and be blessed in your ignorance
<mrvn>
List.iter (fun o -> o#enqueue_message "such fun") channel#members
* examachine
can't use twitter
<examachine>
it's for... i don't know... people who think in SO FEW words :D
<gildor>
the thing I don't like on github is that people tend to forget to do release
<kaustuv_>
If you use github, you can also use hg as a client, I believe
<gildor>
google code is nice
<mrvn>
can't form long sentence. Must tweet.
<gildor>
I even meet a regular github user that don't know the command "git tag"
<examachine>
google code is cool, i'm trying out gitorious now
<examachine>
well i'd be set if one of them felt just as comfortable and as fast as unfuddle :D
<gildor>
examachine: is your project OCaml related ?
<examachine>
hmm not really. i have two small projects on ocaml forge, it's pretty nice.
<kaustuv_>
gildor: is Jane St. backing OCaml{core,forge}?
<examachine>
i would put up an ocaml forge page at any rate
<gildor>
kaustuv_: no
<gildor>
examachine: if your project is not ocaml related, google code is really nice
* gildor
stop advertising OCaml Forge to examachine
<examachine>
so what am i going to relesae, an old package manager and an xml library in python, a data mining tool written in C++, a lot of old codes including a graph partitioning by vertex separator tool. i don't know a lot of misc. stuff, and i thought i'd upload them on one of the new hosting sites instead of sourceforge
<gildor>
examachine: I found github interface nice expect when it fails
<gildor>
examachine: why not SF? (maybe the recent compromission pb?)
<gildor>
examachine: I often found the history long to load
<examachine>
@gildor: i think the BTS is always important, google code is ok there, and waiting times are low
<examachine>
i never liked sourceforge i think :D
ymasory has quit [Quit: Leaving]
<gildor>
examachine: I'd go for Google Code
<examachine>
i can hardly bear with the TRAC interface. unfuddle is really nice. the wiki on github looks a bit like that.
<gildor>
kaustuv_: why the fact that Jane St is backing OCaml* is important
<examachine>
@gildor: oh, ok, it'll be easier for them if i ever apply to google for a job
<gildor>
kaustuv_: Jane St is backing oasis-db in fact
<examachine>
hm since i'm here i should learn something from you ocaml hackers :D
<examachine>
are both ocaml-to-javascript compilers written from scratch?
mikemc has joined #ocaml
<gildor>
you mean js_of_ocaml, ocamljs and obrowser ?
<gildor>
examachine: ^^^
<examachine>
i saw some dead code elimination in the ocsigen compiler, but i suppose mostly they weren't designed with an optimizing compiler in mind
<examachine>
js_of_ocaml and ocamljs
<kaustuv_>
gildor: I asked mainly because I saw that janst-core is already oasis-enabled, so I thought maybe they are backing the effort (which would be awesome)
<examachine>
i suppose the proper way to make a new backend for ocaml would still be hacking the real ocaml compiler right?
<gildor>
kaustuv_: they are indeed backing the oasis work
<gildor>
kaustuv_: and they also provide me with some patches
<gildor>
kaustuv_: e.g. for mlpack
<gildor>
kaustuv_: guys from janest seems quite enthusiast about oasis
<gildor>
I suppose that a CPAN for OCaml will improve some aspect of the OCaml Community
<kaustuv_>
gildor: I am enthusiastic about oasis myself, but until there is a godi or a debian package for it, it is hard to get it working. I don't really like running "installer" programs.
<examachine>
of course it would
<examachine>
godi is a great idea i think i'd rather pass on debian packages, they take forever to reach the stable
<examachine>
because of debian-ism i'm still using 3.11 on my OS X machines
<gildor>
kaustuv_: all the deps of oasis has entered Debian unstable this week
<gildor>
kaustuv_: having a debian package for oasis inside Debian is a matter of 1 week
<kaustuv_>
gildor: that's good to hear
<kaustuv_>
gildor: 3.12 is still blocked on some bugs right?
<kaustuv_>
(jocaml?)
<gildor>
kaustuv_: I also have the right to upload packages to GODI and I will upload the deps and oasis itself, when I will have time
<gildor>
kaustuv_: no, 3.12 is mainly blocked by Debian freeze
<kaustuv_>
ah, right, that too.
<gildor>
kaustuv_: when squeeze will be released, we will make a transition to 3.12
<gildor>
and squeeze should be release next week
<examachine>
i had some minor issues using 3.12 but nothing too serious yet :)
<examachine>
i suppose it breaks some ocaml packages though
<gildor>
break some package -> not that much
<gildor>
we have the usual suspect : camlp4 packages using black magic
<examachine>
do a lot of packages use oasis now?
<kaustuv_>
not even all of oasis's dependencies use oasis
<examachine>
well this tool looks more like a package manager than a build/config system :D
<examachine>
a lot of features i think that's nice
<gildor>
oasis itself is a MakeMaker
<gildor>
but with the upcoming oasis-db subsystem
<gildor>
you will be able to "oasis install janest-core"
<kaustuv_>
if you can also do "oasis remove janest-core", you are already superior feature-wise to cabal
<flux>
gildor, will you be able to install that as a regular user?
<examachine>
well the pkg manager approach is better i kinda like that :D
<gildor>
never think about removing ;-)
<gildor>
flux: yes
<examachine>
having written a full package manager in python i can see how it's so nicely doable in ocaml and with a lot of features
<flux>
gildor, that's definitely nice
<gildor>
flux: the really cool point about the oasis-db subsystem will be the possibility to do "oasis register myproject/"
<flux>
gildor, which does what?
<kaustuv_>
"oasis post-to-reddit"
<gildor>
flux: and that will replace myproject by your local version when doing update/install/whatever operation
<flux>
nice
<gildor>
flux: e.g. I am upstream of ocaml-fileutils and want to test my latest version
<examachine>
hmm nobody's using the supercomputer, i can easily run 1024 cores :D
<gildor>
flux: I will register it and ask for a full rebuild of all dependent package using it
<flux>
gildor, that's a big pain in the ass to do with godi :)
<gildor>
however, I won't replace GODI on certain point
<gildor>
e.g. oasis won't compile C libraries for its deps
<gildor>
you will have to use either GODI/Debian packages/compilation by hand
<flux>
well, if it was really desires, I guess it could be implementeed at some point
<kaustuv_>
but ocamlbuild handles .clib, no?
<gildor>
but you will probably have an oasis2godi (just like the oasis2debian I wrote)
<gildor>
kaustuv_: of course, you can build ocaml projects that includes C source files
<kaustuv_>
surely you mean debian_of_oasis!
<gildor>
kaustuv_: but for pcre-ocaml, you need libpcre
<kaustuv_>
gildor: ah, I see
<thelema>
kaustuv_: pushed.
joewilliams_away is now known as joewilliams
Yoric has joined #ocaml
ikaros has quit [Quit: Leave the magic to Houdini]
<kaustuv_>
gildor: firefox rejects the SSL certificate on lists.forge.ocamlcore.org because it doesn't think that it is one of the hosts "*.ocamlcore.org" or "ocamlcore.org". Are you sure wildcards are allowed in certs?
<gildor>
kaustuv_: that is normal (and a know bug)
<gildor>
kaustuv_: the wildcard should be *.forge.ocamlcore.org because wildcard don't traverse .
<gildor>
the cert for forge.ocamlcore.org is *.ocamlcore.org (and it doesn't cost the same prize)
<gildor>
one day, an admin will migrate lists.forge.ocamlcore.org to lists.ocamlcore.org and we will take advantage of the commercial cert of the forge
<kaustuv_>
OK, thanks.
ftrvxmtrx has joined #ocaml
flx_ has joined #ocaml
<gildor>
is there a japanese people her ?
<gildor>
here
<examachine>
ah sysadmins!
<kaustuv_>
I took four years of Japanese in college, but that was ~10 years ago
<gildor>
I need to understand how to write a postal address for someone in japan
<thelema>
lol, me too, except my uni only had 3 years available plus a fourth in high school
<thelema>
kaustuv_: old school - probably built before standardized HTML
<kaustuv_>
last updated 2010.09.10
<kaustuv_>
err, 09.20
<thelema>
yes, but it doesn't say when it was built
<thelema>
and maybe some past uni of his put standard header/footer on automatically
joewilliams is now known as joewilliams_away
examachine has quit [Quit: Page closed]
joewilliams_away is now known as joewilliams
<hcarty>
Is it possible in OCaml to have a function like "val return : ?x:'a -> unit -> 'a" where x is some specific value by default? (for example ?(x = ()))
<Anarchos>
hcarty can you precise your question ?
<hcarty>
Anarchos: "let return ?(x = ()) () = x" does not work for rather obvious reasons
<thelema>
hcarty: nope
<thelema>
well, not using the ?(x=...) syntax
<Anarchos>
hcarty let f = fun 0 -> 'a' | x -> 'y' ?
<Anarchos>
is this ?(x=...) syntax new ?
<thelema>
Anarchos: new in 3.00
<thelema>
optional labeled parameter
<hcarty>
Anarchos: I'm hoping for a polymorphic return value
<Anarchos>
hcarty you can't have a true polymorphic output, only weak variable type
<hcarty>
thelema: I didn't think it was, but I was hoping I missed something. Thank you!
<Anarchos>
or trick with Obj
<thelema>
hcarty: once you have a default, the type of that default becomes the type of that parameter
<thelema>
hcarty: I've wished for it myself
<hcarty>
thelema: That makes sense
<thelema>
it's possible to implement two related algorithms, one for Some x, and another for None
<thelema>
but keeping them both polymorphic is usually troublesome
<thelema>
just use two functions, one for when you have the extra parameter and one for when you don't
<hcarty>
thelema: True. The one can wrap around the other.
<thelema>
yup.
Associat0r has joined #ocaml
drunK has joined #ocaml
<mrvn>
haelix: Your return is None -> unit -> unit | Some 'a -> unit -> 'a. So depending on the optional argument the return type would have to change. Can't be done. use ?x:'a -> unit -> 'a option.
<mrvn>
hcarty: ^^^
drunK has quit [Remote host closed the connection]
<mrvn>
hcarty: or a functor.
<hcarty>
mrvn: I think I'm going to stick with thelema's suggestion of two functions. The hope was for syntax convenience, so a functor defeats the purpose here.
<hcarty>
s/hope/intent/
<hcarty>
And 'a option does as well, because "foo ();" would give a warning
<hcarty>
Neither of these are technical reasons of course, but the original goal isn't particularly technical.
<mrvn>
Maybe in 3.12 you can say 'a. ?x:'a -> unit -> 'a?
<mrvn>
no, never mind. that can't type either.
gmarik has quit [Quit: Leaving.]
Associat0r has quit [Quit: Associat0r]
gmarik has joined #ocaml
edwin has quit [Remote host closed the connection]
ygrek has quit [Ping timeout: 240 seconds]
lamawithonel has joined #ocaml
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
smerz has quit [Quit: Ex-Chat]
cyanure has quit [Remote host closed the connection]
thatch has joined #ocaml
arubin has joined #ocaml
<arubin>
Are there any OCaml books that are worth reading?
<arubin>
Does anything exist other than Practical OCaml?
<thelema>
arubin: that's the caltech book?
<arubin>
That is the Apress book. People do not seem to like it.