testcocoon has quit [Quit: Coyote finally caught me]
yacks has joined #ocaml
pango_ has joined #ocaml
mikurubeam has quit [Read error: Connection reset by peer]
pango has quit [Ping timeout: 260 seconds]
drvitek has left #ocaml []
mikurubeam has joined #ocaml
ousado_ has joined #ocaml
yacks has quit [Read error: Operation timed out]
yacks has joined #ocaml
def-lkb_ has joined #ocaml
Qworkescence has joined #ocaml
fasta has quit [*.net *.split]
dwmw2_gone has quit [*.net *.split]
_so has quit [*.net *.split]
def-lkb has quit [*.net *.split]
flux has quit [*.net *.split]
ousado has quit [*.net *.split]
ousado_ is now known as ousado
ousado has quit [Changing host]
ousado has joined #ocaml
TDJACR_ has joined #ocaml
TDJACR_ has quit [Client Quit]
fasta has joined #ocaml
dwmw2_gone has joined #ocaml
flux has joined #ocaml
fasta has quit [Max SendQ exceeded]
_so has joined #ocaml
fasta has joined #ocaml
marblen has quit [Quit: marblen]
jave has quit [Read error: Operation timed out]
jave has joined #ocaml
fantasticsid has joined #ocaml
q66 has quit [Remote host closed the connection]
marblen has joined #ocaml
marblen has quit [Client Quit]
_so has quit [Read error: Connection reset by peer]
so- has joined #ocaml
fantasticsid has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
clan has joined #ocaml
emmanuelux has quit [Quit: emmanuelux]
yroeht1 has joined #ocaml
BiDOrD has quit [Read error: Connection reset by peer]
BiDOrD has joined #ocaml
olasd_ has joined #ocaml
snarkyboojum_ has joined #ocaml
TDJACR_ has joined #ocaml
yroeht has quit [Ping timeout: 255 seconds]
bacam_ has joined #ocaml
olasd has quit [Ping timeout: 255 seconds]
snarkyboojum has quit [Ping timeout: 255 seconds]
TDJACR has quit [Ping timeout: 255 seconds]
bacam has quit [Ping timeout: 255 seconds]
cods has quit [Ping timeout: 255 seconds]
cods has joined #ocaml
asmanur has quit [Ping timeout: 260 seconds]
asmanur has joined #ocaml
def-lkb has joined #ocaml
def-lkb_ has quit [Ping timeout: 245 seconds]
mehdid_ has joined #ocaml
Asmadeus_ has joined #ocaml
_eko_ has joined #ocaml
smango_ has joined #ocaml
zzz_ has quit [Ping timeout: 260 seconds]
mehdid has quit [Ping timeout: 255 seconds]
_eko has quit [Ping timeout: 255 seconds]
Asmadeus has quit [Ping timeout: 255 seconds]
chris2 has quit [Ping timeout: 260 seconds]
smango has quit [Ping timeout: 260 seconds]
bacam_ has quit [*.net *.split]
snarkyboojum_ has quit [*.net *.split]
clan has quit [*.net *.split]
tizoc has quit [*.net *.split]
Leonidas has quit [*.net *.split]
Enjolras has quit [*.net *.split]
bitbckt has quit [*.net *.split]
chris2_ has joined #ocaml
Asmadeus_ has quit [Changing host]
Asmadeus_ has joined #ocaml
weie has joined #ocaml
zzz_` has joined #ocaml
bacam_ has joined #ocaml
snarkyboojum_ has joined #ocaml
clan has joined #ocaml
tizoc has joined #ocaml
Leonidas has joined #ocaml
Enjolras has joined #ocaml
bitbckt has joined #ocaml
smango_ is now known as smango
UncleVasya has joined #ocaml
ohama has joined #ocaml
Icarot has joined #ocaml
UncleVasya has quit [Ping timeout: 245 seconds]
donor has joined #ocaml
Kakadu has joined #ocaml
smango has quit [Ping timeout: 248 seconds]
smango has joined #ocaml
yacks has quit [Ping timeout: 260 seconds]
testcocoon has joined #ocaml
yacks has joined #ocaml
Asmadeus_ is now known as Asmadeus
cdidd has joined #ocaml
noam_ has quit [Ping timeout: 245 seconds]
ohama has quit [Ping timeout: 250 seconds]
mikurubeam has quit [Ping timeout: 256 seconds]
noam has joined #ocaml
ttamttam has joined #ocaml
Yoric has joined #ocaml
ohama has joined #ocaml
mikurubeam has joined #ocaml
Icarot has quit [Ping timeout: 255 seconds]
thizanne has quit [Ping timeout: 248 seconds]
leoncamel has quit [Ping timeout: 272 seconds]
UncleVasya has joined #ocaml
gustav_ has joined #ocaml
Cyanure has joined #ocaml
tianon has quit [Ping timeout: 264 seconds]
hto has quit [Read error: Connection reset by peer]
tianon has joined #ocaml
olasd_ is now known as olasd
leoncamel has joined #ocaml
ttamttam has left #ocaml []
chambart has joined #ocaml
hto has joined #ocaml
Icarot has joined #ocaml
testcocoon has quit [Quit: Coyote finally caught me]
testcocoon has joined #ocaml
ollehar has joined #ocaml
Icarot has quit [Ping timeout: 256 seconds]
marblen has joined #ocaml
pango_ is now known as pango
thelema has quit [Ping timeout: 264 seconds]
tane has joined #ocaml
tane has quit [Remote host closed the connection]
tane has joined #ocaml
thelema has joined #ocaml
chambart has quit [Ping timeout: 246 seconds]
noam_ has joined #ocaml
ttamttam has joined #ocaml
noam has quit [Ping timeout: 248 seconds]
cdidd has quit [Remote host closed the connection]
Derander has quit [Ping timeout: 252 seconds]
smerz has joined #ocaml
Derander has joined #ocaml
cdidd has joined #ocaml
chambart has joined #ocaml
q66 has joined #ocaml
ontologiae has joined #ocaml
ttamttam has left #ocaml []
chris2_ is now known as chris2
ontologiae has quit [Ping timeout: 256 seconds]
tchernobog has joined #ocaml
<tchernobog>
hello, i am a new user of ocaml, and I am trying to write a trivial fibonacci sequence generator, but I always get type errors
<tchernobog>
let fibonacci = let rec fibonacci_generator a b (_:unit) = (b, fibonacci_generator (a+b) b) in fibonacci_generator 0 1 ();;
<tchernobog>
can someone help me to understand the type error?
<Kakadu>
> fibonacci_generator (a+b) b
<Kakadu>
you have only 2 arguments, but function wants three
<tchernobog>
I wanted to use currying
<tchernobog>
so that I can return a tuple (value, next generator)
<Kakadu>
than what type of fibbonacci_generator do u except?
<tchernobog>
in my head, the function should return a tuple with as the first component the next value in the sequence
<tchernobog>
and as the second component a partially applied function for getting the next value
<pippijn>
by the way, (_:unit) can be written more simply as ()
ttamttam has joined #ocaml
ttamttam has left #ocaml []
<tchernobog>
pippijn: thanks for that
<tchernobog>
btw, I realised that the two arguments are swapped, but it's the typing error that bothers me
<orbitz>
what is the type error?
ontologiae has joined #ocaml
<Kakadu>
> fibonacci_generator (a+b) b
<Kakadu>
Error: This expression has type int * (unit -> int * 'a)
<Kakadu>
but an expression was expected of type int * 'a
<tchernobog>
(wrt. fibonacci_generator b (a+b)) → Error: This expression has type unit -> int * 'a but an expression was expected of type 'a The type variable 'a occurs inside unit -> int * 'a
<tchernobog>
Kakadu: uhm, yours is different
<Kakadu>
I was written only inner function
<tchernobog>
Kakadu: ok
<Kakadu>
it seems that your type is a litlle bit cyclic
<tchernobog>
Kakadu: that's the whole point :-)
<tchernobog>
I thought OcaML was able to manage it
<tchernobog>
Haskell is
<orbitz>
haskell is quite lazy
<tchernobog>
orbitz: yes, I am trying to emulate that behaviour, more or less
<tchernobog>
by creating a closure over the next values
<tchernobog>
and evaluating it only when requested
<orbitz>
tchernobog: the more natural way would probably be through the Stream module
<orbitz>
if you want this lazyevaluation
<orbitz>
let rec fib_gen a b = [< 'b; fib_gen b (a + b) >]
<tchernobog>
orbitz: I see. I wanted this to work to show how one could re-write a lazy function in an eager-evaluated language
<orbitz>
tchernobog: that will give you the lazy-ish semantics you want, I belive
<tchernobog>
I think resorting to streams works, as you pointed out, but partially defeats my goal of using only currying, closures and recursion
<tchernobog>
anyway, thanks
<orbitz>
Hrm there must be some cute type annotation that will make this wok
yacks has quit [Ping timeout: 260 seconds]
SanderM has joined #ocaml
SanderM has quit [Client Quit]
SanderM has joined #ocaml
<def-lkb>
You have to enable equirecursive types using -rectypes extension to do so without annotation :
<def-lkb>
Without equirecursive types (that is, isorecursive types):
<def-lkb>
type 'a lazy_stream = Next of 'a * 'a lazy_stream lazy_t
<def-lkb>
let rec fib n0 n1 = Next (n1, lazy (fib n1 (n0 + n1)));;
josch has joined #ocaml
chambart has quit [Ping timeout: 246 seconds]
<josch>
hi, I have the following line in two different files:
<josch>
module IntSet = Set.Make(struct type t = int let compare = Pervasives.compare end)
<josch>
but they seem to be incompatible with each other
<josch>
when the function in one file returns an IntSet, then it is incompatible to the IntSet defined in the other file
<josch>
now suppose the two files are named A.ml and B.ml
<josch>
how do I avoid having to write A.IntSet all the time?
<josch>
sure one way would be to write let module IntSet = A.IntSet
<josch>
but I was expecting that this is not necessary
<josch>
or is it?
chambart has joined #ocaml
<josch>
can i maybe pursuade ocaml that the IntSet declared in A.ml is the exact same as the one in B.ml?
<companion_cube>
you should define the module only in one place, I suppose
<companion_cube>
in a.ml, you can refer to B.IntSet
<def-lkb>
josch, what you want is Applicative functors, what you get are Generative functors
<def-lkb>
You have to extract struct type t = int let compare = Pervasives.compare end to a separate module
<def-lkb>
say intType.ml
<def-lkb>
then, by using Set.Make (IntType) in both A and B, ocaml should be able to see that they are in fact the same
rwmjones has quit [Ping timeout: 256 seconds]
<josch>
def-lkb: thanks
<josch>
alright, I now created a common definition and included it with let module IntSet = ... in all other files where I need it - this works fine :)
rwmjones has joined #ocaml
SanderM has quit [Remote host closed the connection]
yacks has joined #ocaml
osa1 has joined #ocaml
<def-lkb>
josch: if you always use the IntSet, why not create
<def-lkb>
intSet.ml: include Set.Make(struct type t = int let compare = compare end)
<def-lkb>
the same* IntSet
<josch>
def-lkb: hm... i didnt like the idea to have one file with only one line in it i guess
<def-lkb>
ok, I can understand
ttamttam has joined #ocaml
paolooo has joined #ocaml
ollehar has quit [Ping timeout: 255 seconds]
osa1 has quit [Quit: Konversation terminated!]
mackwic_ has joined #ocaml
<mackwic_>
Hey guys
<mackwic_>
was checking out the last batteries-included
<mackwic_>
what are these *.mlv files ?
<Yoric>
Good :)
<mackwic_>
Hey Yoric ! _o/ how are you since the ffos app day ?
mye has joined #ocaml
<mackwic_>
hl thelema : about these mlv ?
<tchernobog>
def-lkb: sorry, was at lunch; but -rectypes solves the issue
<tchernobog>
def-lkb: everything works as expected just passing that option
<Yoric>
mackwic_: I'm fine, thanks. But who are you? :)
SanderM has joined #ocaml
<def-lkb>
tchernobog: ok, good
<mackwic_>
Yoric, héhé, do you remember the little guy with his huge laptop that cries because pentadactyl is no more supported in FF ? The one that annoy kaze when looking at the clock of gaia
<Yoric>
Yep :)
<Yoric>
Still waiting for someone to write FFOS apps with Ocsigen :)
<mackwic_>
Lol, crazy idea. Who use Ocsigen but INRIA ?
<mackwic_>
even ocamlforge don't use it
<mackwic_>
That said, could be very fun
<Yoric>
besport uses ocsigen
pango_ has joined #ocaml
mackwic__ has joined #ocaml
chris2_ has joined #ocaml
SanderM_ has joined #ocaml
olasd_ has joined #ocaml
<mackwic__>
(I also need ISO8601 dates and I think that would be nice to have correct time handling in Batteries)
bacam_ is now known as bacam
Derander_ has joined #ocaml
jave_ has joined #ocaml
SanderM has quit [*.net *.split]
mackwic_ has quit [*.net *.split]
Derander has quit [*.net *.split]
smerz has quit [*.net *.split]
chris2 has quit [*.net *.split]
olasd has quit [*.net *.split]
jave has quit [*.net *.split]
pango has quit [*.net *.split]
mackwic__ has quit [Quit: _o/]
chris2_ is now known as chris2
mackwic__ has joined #ocaml
smerz has joined #ocaml
tchernobog has quit [Quit: leaving]
<mackwic__>
This chan is really representative of the OCaml community :)
thizanne has joined #ocaml
mackwic__ has quit [Ping timeout: 260 seconds]
<orbitz>
i hope that is a compliment
<vbmithr>
lol :)
<Yoric>
Also, ocsigen was started much after ocamlforge, if my memory serves.
ollehar has joined #ocaml
smerz has quit [Read error: Operation timed out]
clan has quit [Remote host closed the connection]
shp has joined #ocaml
<shp>
hi
<shp>
i'd like to round a float number 2 digits after the comma, is there a build-in function for this ?
pango_ is now known as pango
tane has quit [Ping timeout: 245 seconds]
<shp>
i will use (ceil (number *. 100.))/. 100
tane has joined #ocaml
mackwic__ has joined #ocaml
mikurubeam has quit [Quit: When I come back, please tell me in what new ways you have decided to be completely wrong.]
mikurubeam has joined #ocaml
olasd_ is now known as olasd
mikurubeam is now known as Guest69029
Guest69029 has quit [Client Quit]
mackwic__ is now known as mackwic
mikurubeam has joined #ocaml
chambart has quit [Ping timeout: 246 seconds]
mackwic has quit [Ping timeout: 260 seconds]
darkf has quit [Quit: Leaving]
paolooo has quit [Quit: Page closed]
ollehar has quit [Ping timeout: 252 seconds]
shp has quit [Ping timeout: 246 seconds]
lopex has quit [Ping timeout: 252 seconds]
gustav_ has quit [Ping timeout: 260 seconds]
ben_zen is now known as McZen
ttamttam has left #ocaml []
McZen is now known as ben_zen
marblen has quit [Quit: marblen]
oriba has joined #ocaml
smerz has joined #ocaml
gustav_ has joined #ocaml
Cyanure has quit [Remote host closed the connection]
emmanuelux has joined #ocaml
lopex has joined #ocaml
inv has quit [Read error: Connection reset by peer]
leoncamel has quit [Quit: WeeChat 0.3.9.2]
contempt has quit [Ping timeout: 256 seconds]
contempt has joined #ocaml
leoncamel has joined #ocaml
fraggle_ has quit [Read error: Connection reset by peer]
<kaustuv>
Well, the fantasy ocamlbuild doesn't have that bug!
<adrien>
"Cross-compiling a MinGW binary from Linux is also part of the standard OCaml distribution." <- :-)
<adrien>
"LablTk, Graphics, Str and Num are dropped from the standard distribution. They survive as community-maintained libraries." <- that's happening but a bit differently
<adrien>
I prefer to keep Str and Num, and ocamlbuild and ocamldoc to be out
<companion_cube>
adrien: and you can't do it via a ocaml plugin for ocamlbuild?
<adrien>
well, I enjoyed the fw and I generally agree with it since it could simplify some aspects
<adrien>
companion_cube: oasis does it
<adrien>
it's a bit like "there's an app for it"
<adrien>
(because my OS doesn't handle it)
<adrien>
considering you can only have one ocamlbuild plugin at once, that's really annoying
<kaustuv>
adrien: Surel pcre-ocaml is far superior to Str?
<adrien>
companion_cube: actually, I'm not sure that you can solve this bug: i.e. automatically copying the appropriate files
<kaustuv>
adrien: likewise, zarith vs. Num
<adrien>
oasis have them hard-coded in the config file
<adrien>
has*
<adrien>
kaustuv: well, I think such libs are important in a default installation but something else could replace them
<adrien>
a default installation without a regexp implementation would be very annoying =/
<kaustuv>
Well, sure, if you consider "default installation" to be equivalent to "OCaml Platform"
<companion_cube>
my ideal OCaml would have a real standard library shipped with ot...
<companion_cube>
it*
<kaustuv>
I just don't see why Inria is wasting resources on these ancient libraries
<companion_cube>
and typeclasses :D
<companion_cube>
I don't think they waste much time
<adrien>
kaustuv: I do some scripting with ocaml and Str has been very useful
<adrien>
there's basically _no_ activity in otherslibs/str
<kaustuv>
I'm not saying remove Str from the OCaml ecosystem entirely, just from the default installation. It might give other---better---libraries room to breathe
<companion_cube>
maybe OCaml's ecosystem (not necessarily the core language, but the platform/tools) shouldn't be managed by Gallium, but rather by a consortium (with ocamlpro in it, for instance)
<adrien>
I'm probably the only one here but I like the size of the standard library (plus otherlibs/): it's not too bit and not too small :-)
<companion_cube>
it's better than nothing, sure :)
<pippijn>
adrien: ah yes, the local includes
<kaustuv>
It's just the right size for building OCaml compilers.
<pippijn>
adrien: fun times :)
<adrien>
until you have > 10 members on your consortium, you're better with no consortium ;p
<companion_cube>
come on, there should be 10 entities that are interested in that :)
<pippijn>
adrien: myocamlbuild.ml would have -I ../../../../src/blah/include stuff in it
<adrien>
actually the stdlib is slightly smaller than what's required
<adrien>
ocaml itself has a couple additional libs which are sadly not exported
<adrien>
pippijn: yup, or use oasis ;-)
<companion_cube>
adrien: oh, what are those ?
<adrien>
the thing I _really_ dislike with ocamlbuild is that it aims at being too simple and that simply doesn't work out
<adrien>
companion_cube: one in ocamlbuild
<companion_cube>
it does if you don't use C stubs, adrien
Jalumar has joined #ocaml
<adrien>
packs
<adrien>
they're not a lot of fun with ocamlbuild
<companion_cube>
but they still are doable
<companion_cube>
just a line in _tags, and a .mlpack
<companion_cube>
that's not too hard
<adrien>
it would need _one_ thing: the ability to list the files it should look at and make groups of them
<adrien>
sure, it's sexy not to have to list the files
<adrien>
but it ends up way more complicated
<pippijn>
I use omake now
<adrien>
companion_cube: until two packs have the same module in them :-)
<pippijn>
it's perfect in theory and almost perfect in practice
<adrien>
or one file has a module named "foo" in it and there's also foo.ml; you don't use both at the same time but ocamlbuild won't know that
<kaustuv>
I agree in general that ocamlbuild today is just not ideal in many respects, but maybe we can change that. Not sure who in Inria/Gallium has any free time to work on this, so maybe the best approach is to just fix it ourselves.
<adrien>
pippijn: I was really set off by omake when I saw that one of their example is creating GTK+ bindings
<companion_cube>
a problem is that when something is wrong with ocaml tools/libs, people prefer to write their own
<pippijn>
adrien: I haven't seen that
<adrien>
kaustuv: I'm way more interested in ocp-build right now
<companion_cube>
that's why there are so many alternatives, for such a small community :/
<pippijn>
why did that put you off?
<adrien>
I believe ocamlbuild is flawed by design ;-)
<adrien>
pippijn: it's a build system, not a binding generator!
<kaustuv>
adrien: If ocp-build were to replace ocamlbuild, I would consider that a victory as well.
<pippijn>
ok
<adrien>
replace, I don't know
<pippijn>
I agree, they went a little far
<rks_>
adrien: have you tried ocp-build already?
<pippijn>
they have a complete lexer (regular grammar) and parser (context free grammar) in there
<adrien>
I've been working on cross-compilation support and something I'd really want to see is everything that isn't the compiler *outside* of the compiler tree
<adrien>
maybe you'd have to build ocaml, install it, then build ocamldoc, isntall it, go back to the ocaml sources and run "make doc"
<adrien>
but it'd be so much simpler
<adrien>
rks_: had a quick look at it but haven't had the time
<kaustuv>
adrien: Do you consider Camlp4 part of the compiler? It takes 80% of the time to build the ocaml distribution from source.
iZsh has quit [Ping timeout: 264 seconds]
<pippijn>
but it has everything you could ever need for a build system and more
<adrien>
ocaml cross-compiler, yypkg, release at work, that has kept me busy ;p
<adrien>
kaustuv: no, outside
<pippijn>
a C parser written in omake script is just fooling around
<adrien>
and that's the way it's already going
<rks_>
ok :)
<adrien>
pippijn: that's the "more" I don't really like
<pippijn>
you don't have to use that
<pippijn>
I'm using a small subset of omake features
<adrien>
I still think it's better to have a declarative language for build systems
<pippijn>
and they work well
<pippijn>
adrien: it's declarative
<pippijn>
totally declarative
<adrien>
probably with a way to invoke external stuff
<pippijn>
purely functional
<adrien>
it's only declarative and it manages making gtk+ bindings? that's scary
<pippijn>
it generates META files and handles installation
<ollehar>
Hello
<ollehar>
I get this error when trying to combine two syntax extensions:
<ollehar>
Camlp4: Uncaught exception: Not_found
<ollehar>
its dyntype.syntax and json-tc.syntax
<ollehar>
Anyone recognize this?
<ollehar>
They work independently.
<adrien>
that's a possible issue with camlp4 syntax extensions: no guarantee several of them work together
<adrien>
do you need both in the same file?
<ollehar>
yes, for the same type even
iZsh has joined #ocaml
<adrien>
pippijn: I agree that omake looks fine and I'll be looking at it when I have some time to try to move away from ocamlbuild
<adrien>
really not sure how it'll stand in my eyes when compared to ocp-build
<pippijn>
adrien: my main reason for omake is that I use many languages, not just ocaml
<pippijn>
and I would like to have a unified build system
<companion_cube>
I hope ocamlpro will live long, to maintain their tools :)
<pippijn>
and a unified testing process for all projects
<adrien>
companion_cube: I hope their tools don't need a lot of maintenance ;-)
<companion_cube>
also :)
<adrien>
ollehar: tried swapping the order in which they're applied?
Icarot has joined #ocaml
<kaustuv>
is there any reason to believe that OCamlPro won't live long? Aren't they backed by Jane Street and other shadowy organizations? (I honestly have no idea.)
Zerker has joined #ocaml
<orbitz>
Jane Street is a shady organization?
<orbitz>
shadowy i mean
<ollehar>
adrien: yes. I will try ocaml toplevel, too.
<companion_cube>
kaustuv: i don't know :
<companion_cube>
:)
<adrien>
zi sikrit order of janest
<kaustuv>
Hmm, on the OCamlPro website: "Compared to other languages, OCaml code is as concise as Python code (thanks to full type inference), but runs as fast as C code (thanks to its native code compiler), and more reliably than Java code (thanks to its powerful statically enforced type-system)."
<kaustuv>
I might agree with s/is/tends to be/
<rks_>
adrien: :D
<companion_cube>
it may be a bit overstated :D
nimred has joined #ocaml
<adrien>
kaustuv: you're forced to make such statements if you want to attract people
<kaustuv>
Also, I don't think I said Jane St. was shadowy. I just don't know who is backing OCamlPro. I might not have expressed it correctly.
<adrien>
being fully honest and giving a confidence interval with detailled benchmark results would be quite offputting :P
<adrien>
kaustuv: iirc ocamlpro has a list of customer
<adrien>
see at least their blog for a recent article on their activities
<pippijn>
being fully honest about ocaml's native code performance might be offputting, if you expect performance close to that of C
<adrien>
the real reason is because it makes your sentences longer
<adrien>
put your broad and maybe exxagerated statements on your frontpage
<adrien>
provide full data on other pages
<pippijn>
right
<adrien>
get people interested first
<adrien>
I tried doing it the other way round for yypkg and it makes everything way longer and way less readable