pikachuyann has quit [Remote host closed the connection]
grettke has quit []
stephenjudkins has quit [Read error: Connection reset by peer]
stephenjudkins has joined #ocaml
mjonsson has joined #ocaml
valross has joined #ocaml
Amorphous has quit [Ping timeout: 252 seconds]
Amorphous has joined #ocaml
cthuluh has quit [Remote host closed the connection]
cthuluh has joined #ocaml
zubeen has joined #ocaml
<zubeen>
how can i define a type pair in ocaml?
mjonsson has quit [Remote host closed the connection]
<julm>
type t = int * string
<julm>
or type ('a, 'b) t = 'a * 'b
<julm>
or type ('a, 'b) t = {a:'a; b:'b}
mjonsson has joined #ocaml
<orbitz>
type pear = delicious
<orbitz>
is there anyway to have mutually recursive functions in ocaml?
<orbitz>
besides like Y combinator?
<julm>
let rec f () = .. g () .. and g = .. f () ..
<julm>
let rec f () = .. g () .. and g () = .. f () .. ; sorry
<orbitz>
I can't od it top level though right?
<orbitz>
I suppose I don't need ot for this
lamawithonel_ has quit [Ping timeout: 264 seconds]
lamawithonel has joined #ocaml
ulfdoz has quit [Ping timeout: 265 seconds]
Yoric has joined #ocaml
stephenjudkins has quit [Quit: stephenjudkins]
ttamttam has joined #ocaml
valross has quit [Remote host closed the connection]
ygrek has joined #ocaml
diml has quit [Ping timeout: 265 seconds]
Yoric has quit [Quit: Yoric]
Yoric has joined #ocaml
diml has joined #ocaml
Yoric has quit [Quit: Yoric]
pheredhel has joined #ocaml
ttamttam has quit [Remote host closed the connection]
init1 has joined #ocaml
ninegrid has quit [Read error: Operation timed out]
iris1 has quit [Ping timeout: 265 seconds]
ttamttam has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
Yoric has joined #ocaml
rwmjones_gone is now known as rwmjones
ttamttam has quit [Remote host closed the connection]
mattam has quit [Remote host closed the connection]
mattam has joined #ocaml
ttamttam has joined #ocaml
Modius has quit [Quit: I'm big in Japan]
mfp has quit [Read error: Connection reset by peer]
ftrvxmtrx has joined #ocaml
init1 has quit [Quit: Quitte]
init1 has joined #ocaml
ztfw has joined #ocaml
ikaros has joined #ocaml
ztfw has quit [Read error: Connection reset by peer]
ztfw has joined #ocaml
mfp has joined #ocaml
<zubeen>
how do i represent n as a nativeint type? I am writing a module which would work on integers and its output would be something like (n,n+1,1) or something. How do i model n?
iris1 has joined #ocaml
ygrek has quit [Ping timeout: 245 seconds]
boscop_ has joined #ocaml
boscop has quit [Ping timeout: 265 seconds]
ygrek has joined #ocaml
pikachuyann has joined #ocaml
<xl0>
Any ideas, what is the license of the DAWOC?
_andre has joined #ocaml
ygrek has quit [Remote host closed the connection]
ygrek has joined #ocaml
mfp has quit [Quit: Leaving]
mfp has joined #ocaml
mikemc has joined #ocaml
mikemc has quit [Quit: Leaving]
zubeen has quit [Ping timeout: 252 seconds]
mikemc has joined #ocaml
mikemc has quit [Client Quit]
mikemc has joined #ocaml
zubeen has joined #ocaml
<zubeen>
how can i define a list of zeros of infinite lenght?
<zubeen>
length*
<flux>
zubeen, let rec a = 0::a
<flux>
however, such a construct isn't very useful nor generic..
ikaros has quit [Quit: Leave the magic to Houdini]
Man_of_Wax has joined #ocaml
<zubeen>
flux: type element = list;; i want to get a list of 0's of length list.lenght
<zubeen>
is there an easy way of achieving that/
<Man_of_Wax>
hi all, I have a program which use a buffer to save a very large string. On a 32bit machine I reach the 16MiB string limit, so I found some libreries that implements string buffers with ropes. The problem is this program use a List.map operator and obviusly this doesn't work for rope buffers. What is the more convenient way to reimplement a list.map function that works with ropes?
<flux>
xuyou contruct such a list one zero at a time
<flux>
oops, he's gone
<zubeen>
flux: i am here
<zubeen>
oh i get that.. just write a function which gives zeros
<zubeen>
when required
<zubeen>
makes life simple..
<zubeen>
flux i dont think it is a good way though, any suggestions?
mjonsson has quit [Remote host closed the connection]
boscop_ is now known as boscop
ttamttam has quit [Remote host closed the connection]
<zubeen>
can i do something likemodule type SEMIRING =
<zubeen>
functor (N : int) ->
<zubeen>
sig end
<zubeen>
sig .. end
ttamttam has joined #ocaml
ttamttam has left #ocaml []
<flux>
zubeen, a lazy coder's solution: Array.to_list (Array.make 42 0)
<orbitz>
flux: is this incorrect: let rec foo = bar () and rec bar () = 2;; (i get a compiler error)
<flux>
orbitz, drop the second rec
<flux>
although it might still be incorrect..
<flux>
you mean foo () ?
<orbitz>
This kind of expression is not allowed as right-hand side of `let rec'
<orbitz>
works with foo ()
<orbitz>
thanks flux
zubeen has quit [Read error: No route to host]
zubeen has joined #ocaml
<orbitz>
In stream parsing, is there prefered place to put in the consumption of irreelvant whitespace?
<orbitz>
awesom! working as expected
xl0 has joined #ocaml
thieusoai has joined #ocaml
_andre has quit [Quit: leaving]
_andre has joined #ocaml
<orbitz>
Where can i learn about code/text generation in Ocaml? I have a data structure I want to be abel to turn into XML
zubeen has quit [Ping timeout: 240 seconds]
<rwmjones>
orbitz: lots of alternatives ... simplest may be to recurse over the structure and use printf
<rwmjones>
which is what we do in the libguestfs generator
<rwmjones>
other ways to do it include macros
<hcarty>
orbitz: I'm not sure if it's any more useful in this case than the generic printf, but Batteries has Print.printf which allows you to write custom printers for your types.
<orbitz>
I think I'm just goint to have my datastructure map pretty directly to teh XML I want
<orbitz>
and recursing it with printf's shoudl work
joewilliams is now known as joewilliams_away
<hcarty>
orbitz: You could use CDuce if the whole project is XML-based
<orbitz>
No in this case the production is the only XML part. I'm creating a tree that will represent jobs for this distributed workflow tool
<orbitz>
so i want to produce my entire flow of jobs and dump the XML out and hit run
yezariaely has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
_andre has quit [Quit: leaving]
_andre has joined #ocaml
joewilliams_away is now known as joewilliams
gnuvince_ has quit [Quit: ""]
ftrvxmtrx has joined #ocaml
yezariaely has quit [Quit: Leaving.]
lpereira has joined #ocaml
ulfdoz has joined #ocaml
<flux>
xml-light is wayyy simpler than CDuce
<adrien>
probably not as complete unfortunately
<adrien>
and support for dtd isn't perfect
<flux>
we were talking about generating xml here, and alternatives offered were printf, right?-)
<adrien>
xD
<adrien>
I hadn't seen that part ;-)
<hcarty>
And PXP is somewhere in between, from what I understand
Yoric has quit [Quit: Yoric]
<adrien>
I find pxp quite complex, takes some time to get used to its API again each time
<hcarty>
I've only used it once, but for that one project it worked where xml-light did not.
<adrien>
what about xmlm btw,
<adrien>
?
<hcarty>
That may have been luck more library capability
stephenjudkins has joined #ocaml
<hyperboreean>
hi guys, I know I've asked this before, but I can't remember ... what's the program that allows history for the ocaml repl ?
<adrien>
commonly: ledit or rlwrap
<adrien>
s/commonly/usually/
<hyperboreean>
adrien: thanks
<hyperboreean>
and another question: is there a way I can compile basic test .ml files from within the repl ?
<adrien>
Sys.command "ocamlc -c test.ml";;
<adrien>
/o\
<adrien>
what do you want to achieve?
<hyperboreean>
:)
<hyperboreean>
I am using emacs with tuareg and running the repl inside it
<hyperboreean>
and it's not very productive to use a system command to compile each time I modify the code
<adrien>
I think there's some magic with emacs but I don't use emacs so I can't help :p
stephenjudkins has quit [Read error: Connection reset by peer]
<hyperboreean>
yeah, I can probably do some key binding for the compile command, but I am just getting started with emacs (it seems it has better support for functional languages than vim)
<hcarty>
Both emacs and vim have support for (at least) calling make with various targets
<hcarty>
I think they both support compilation, but I don't know how either of these are done
iago has joined #ocaml
Yoric has joined #ocaml
zubeen has joined #ocaml
<ulfdoz>
As long as you don't end up writing you ocaml-compiler in emacs-lisp.
pikachuyann has quit [Quit: Quitte]
ulfdoz_ has joined #ocaml
ulfdoz has quit [Ping timeout: 240 seconds]
ulfdoz_ is now known as ulfdoz
Tianon has quit [Ping timeout: 272 seconds]
Tianon has joined #ocaml
Tianon has quit [Changing host]
Tianon has joined #ocaml
Yoric has quit [Quit: Yoric]
pikachuyann has joined #ocaml
_andre has quit [Quit: *puff*]
tautologico has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
fschwidom has joined #ocaml
tautologico has quit []
tautologico has joined #ocaml
ulfdoz has quit [Ping timeout: 272 seconds]
ygrek has quit [Ping timeout: 245 seconds]
fschwidom has quit [Remote host closed the connection]
tautologico has quit [Quit: tautologico]
ftrvxmtrx has joined #ocaml
lamawithonel has quit [Remote host closed the connection]
lamawithonel has joined #ocaml
lpereira has quit [Quit: Leaving.]
lamawithonel has quit [Remote host closed the connection]