gildor changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.12.0 http://bit.ly/aNZBUp
cthuluh_ has joined #ocaml
cthuluh has quit [Disconnected by services]
Asmadeus has quit [Ping timeout: 252 seconds]
cthuluh_ is now known as cthuluh
iago has quit [Quit: Leaving]
mjonsson has joined #ocaml
drunK has quit [Remote host closed the connection]
tmaeda has quit [Ping timeout: 276 seconds]
Amorphous has quit [Read error: Operation timed out]
tmaeda has joined #ocaml
Amorphous has joined #ocaml
ninegrid has joined #ocaml
boscop has quit [Ping timeout: 252 seconds]
valross has joined #ocaml
boscop has joined #ocaml
elehack has joined #ocaml
junis has quit [Ping timeout: 240 seconds]
Tianon has quit [Remote host closed the connection]
Tianon has joined #ocaml
Tianon has quit [Changing host]
Tianon has joined #ocaml
Tianon has quit [Remote host closed the connection]
Tianon has joined #ocaml
Tianon has quit [Changing host]
Tianon has joined #ocaml
Tianon has quit [Ping timeout: 276 seconds]
Tianon has joined #ocaml
Tianon has quit [Changing host]
Tianon has joined #ocaml
elehack has quit [Quit: not a typewriter]
Tianon has quit [Ping timeout: 240 seconds]
Tianon has joined #ocaml
Tianon has quit [Changing host]
Tianon has joined #ocaml
wuj has joined #ocaml
wuj has quit [Remote host closed the connection]
rwmjones has quit [Ping timeout: 272 seconds]
rwmjones has joined #ocaml
joewilliams is now known as joewilliams_away
ulfdoz has joined #ocaml
ikaros has joined #ocaml
Fullma has joined #ocaml
valross has quit [Remote host closed the connection]
logicus has joined #ocaml
iratsu` has joined #ocaml
ulfdoz has quit [Read error: Operation timed out]
ikaros has quit [*.net *.split]
agolsme has quit [*.net *.split]
iratsu has quit [*.net *.split]
Yoric has joined #ocaml
mfp has quit [Ping timeout: 252 seconds]
mfp has joined #ocaml
Asmadeus has joined #ocaml
Yoric has quit [Quit: Yoric]
ttamttam has joined #ocaml
ygrek has joined #ocaml
zubeen has quit [Read error: Connection reset by peer]
ygrek has quit [Ping timeout: 245 seconds]
boscop_ has joined #ocaml
boscop has quit [Ping timeout: 252 seconds]
ftrvxmtrx has joined #ocaml
boscop_ has quit [Ping timeout: 255 seconds]
ztfw has joined #ocaml
init1 has joined #ocaml
th5 has joined #ocaml
zubeen has joined #ocaml
npouillard has quit [Read error: Connection reset by peer]
npouilla1d has joined #ocaml
npouilla1d has quit [Ping timeout: 272 seconds]
lamawithonel_ has joined #ocaml
Nahra` has joined #ocaml
ttamttam has quit [Ping timeout: 255 seconds]
lamawithonel has quit [Ping timeout: 255 seconds]
Nahra has quit [Remote host closed the connection]
npouillard has joined #ocaml
_andre has joined #ocaml
Amorphous has quit [Ping timeout: 252 seconds]
Amorphous has joined #ocaml
init1 has quit [Quit: Quitte]
init1 has joined #ocaml
Yoric has joined #ocaml
init1 has quit [Client Quit]
init1 has joined #ocaml
ygrek has joined #ocaml
boscop has joined #ocaml
dsturnbull has joined #ocaml
init1 has quit [Quit: Quitte]
init1 has joined #ocaml
Nahra` has quit [Remote host closed the connection]
nimred has joined #ocaml
<zubeen> val print : format.formatter -> int -> unit
<zubeen> how can i overload this print function?
<adrien> what do you want to overload with?
<zubeen> i want to use the print function
<zubeen> adrien: is there a document which talks about format.formatter
<zubeen> ?
<adrien> well, 'man Format'
<adrien> you can't overload functions in ocaml, however you don't need for that one: Format should definitely give enough margin
<zubeen> adrien: i need to use this print function which should use the input function (format.formatter -> int); how would this look like using printf.printf?
ttamttam has joined #ocaml
<adrien> hmmm, 'Format.formatter -> int -> unit' means that your function print takes too arguments
<adrien> also, where is your 'print' function from?
<adrien> and, with Printf.printf, you can go for something like : 'let i = 42 in Printf.printf "foo : %d\n" i'
<zubeen> i am writing a module for my research and want to print the results
<adrien> You may consider this module as providing an extension to the printf
<adrien> facility to provide automatic line breaking. The addition of
<adrien> pretty-printing annotations to your regular printf formats gives you
<adrien> fancy indentation and line breaks.
<adrien> unless you have big chunks of code to output, Printf is probably better
<zubeen> ok
<zubeen> i think i will use printf then, thank you
th5 has quit [Quit: th5]
fabjan has quit [Read error: Connection reset by peer]
fabjan has joined #ocaml
fabjan has quit [Read error: Connection reset by peer]
fabjan has joined #ocaml
fabjan has quit [Read error: Connection reset by peer]
fabjan has joined #ocaml
Modius has quit [Read error: Connection reset by peer]
Modius has joined #ocaml
fabjan has quit [Read error: Connection reset by peer]
fabjan has joined #ocaml
fabjan has quit [Read error: Connection reset by peer]
fabjan has joined #ocaml
mjonsson has quit [Remote host closed the connection]
<hcarty> thelema: Would it be worth adding an ocamlscript example to the Batteries documentation/examples? That may provide a slightly easier way to get up an running with Batteries, at least for people with ocamlscript available
<hcarty> ocamlscript can be installed from GODI. I'm not sure if it's available for Debian, Ubuntu and Fedora.
Nahra has joined #ocaml
hurrycane has joined #ocaml
<hurrycane> hello
<hurrycane> anyone online
<hurrycane> i just a little help
ttamttam has quit [Remote host closed the connection]
<hcarty> hurrycane: Go ahead and ask - if someone is able to help, they will.
<hurrycane> perfect
<hurrycane> i have this module Codage
<hurrycane> to use it i just do open Codage ;;
<hurrycane> in the module I have tree functions
<hurrycane> val creer ’a array -> string array -> ’a codage:.
<hurrycane> val code ’a -> ’a codage -> string:.
<hurrycane> val code ’a -> ’a codage -> string:.
<hurrycane> the last one is decode
<hurrycane> i create the module with let codage = creer alphabet_source code;;
<hurrycane> where alphabet_source and code are 2 arrays
<hurrycane> how do I call the code function
<hurrycane> on the module
<hurrycane> kind of a stupid question I think
<hurrycane> but it eludes me
<hurrycane> @hcarty any ideas?
<hcarty> hurrycane: I can't spend much time, but this may help - http://www.ffconsultancy.com/products/ocaml_for_scientists/chapter1.html
<hurrycane> i've worked in general with
<hurrycane> ocaml
<hurrycane> to do small stuff
<hurrycane> but this thing is madness
<hcarty> hurrycane: I think you have a bit of a mixup in terminology - Codage is a module, while codage is a value
<hurrycane> yep
<hurrycane> codage is a value
<hurrycane> and i have to call
<hurrycane> code
<hurrycane> val code ’a -> ’a codage -> string:.
<hcarty> code foo codage
<hurrycane> nope
<hurrycane> not working
<hcarty> Well, that's how it would be called :-) What's the error?
<hurrycane> # code codage a;;
<hurrycane> Error: This expression has type string but an expression was expected of type
<hurrycane> char Codage.codage Codage.codage
<hcarty> hurrycane: You have it backwards
<hurrycane> # code;;
<hurrycane> - : 'a -> 'a Codage.codage -> string = <fun>
<hcarty> code foo codage
<hurrycane> code codage "a";;
<hurrycane> # code a codage;;
<hurrycane> Error: This expression has type char Codage.codage
<hurrycane> but an expression was expected of type string Codage.codage
<hurrycane> a is the string
<hurrycane> :)
<hcarty> Right
<hcarty> You have it backwards
<hcarty> "val code : 'a -> 'a codage -> string"
<hurrycane> so
<hurrycane> code codage string
<hurrycane> right?
<hcarty> No
<hcarty> code string codage
<hurrycane> ok
<hurrycane> tried that
<hurrycane> # a;;
<hurrycane> - : string = "a"
<hurrycane> so a is string
<hurrycane> # code a codage;;
<hurrycane> Error: This expression has type char Codage.codage
<hurrycane> but an expression was expected of type string Codage.codage
<hcarty> What is codage?
<hurrycane> ah
<hcarty> Ok, then you need to give it a char
<hcarty> Not a string
<hurrycane> yeah
<hurrycane> :)
<hurrycane> it works now
<hurrycane> code 'a' codage;;
<hurrycane> thanks :)
<hurrycane> you just saved me
<hcarty> The type errors are clear as mud until you understand what they're telling you :-)
<hcarty> You're welcome - glad to help
joewilliams_away is now known as joewilliams
hurrycane has quit [Quit: hurrycane]
joewilliams is now known as joewilliams_away
ftrvxmtrx has quit [Quit: Leaving]
eb4890 has joined #ocaml
joewilliams_away is now known as joewilliams
drunK has joined #ocaml
Yoric has quit [Quit: Yoric]
rwmjones is now known as rwmjones_gone
ulfdoz has joined #ocaml
ftrvxmtrx has joined #ocaml
hto has quit [Quit: Lost terminal]
hto has joined #ocaml
eb4890 has quit [Quit: Leaving]
<adrien> btw, if anyone is making new bindings for lablgtk and has segfaults when converting an enum from/to C, tell me, I have a patch to lablgtk for that
<hcarty> adrien: Submitted upstream, I hope :-)
<adrien> I asked for a branch :p
<adrien> so no, not yet, but it will be
<adrien> I use godi and handling patches with godi is *that* funny so it's a good incentive to upstream everything ;-)
<hcarty> Yes, GODI's patch management could use some help. It's been easier to create new packages of the patched code at times.
<adrien> I find that local patches are actually ok but when you don't have the patch right at once (and you never do): start godi, set to rebuild, ok it, start processing, ok the rebuild of deps, start once again, it's just too much, I wish I could always give a git/svn/darcs/whatever repo to fetch the sources from
Nahra has quit [Changing host]
Nahra has joined #ocaml
<hcarty> adrien: That would be excellent - a "godi-foo-vcs" package which always pulls and rebuilds from a given repo branch
<adrien> it's possible for lablgtk but only from svn and only yes/no: not possible to tell where to get it, nor which rev.
<hcarty> Provided in a generic manner, so the logic doesn't need to be duplicated for every packages
<adrien> but thinking more about it, I wanted a brute-force application that rebuilt libraries and everything depending on them after each update, on several platforms
yezariaely has joined #ocaml
<adrien> (so you know when you use a bashism or a a gnu-ism for instance, or when you break another lib)
<hcarty> It sounds like OASIS-DB may be able to do something like that
<adrien> godi with such a change would probably do the job nicely
<hcarty> Eventually
<adrien> yeah, could help
roconnor has joined #ocaml
<adrien> if everything is using oasis, it'd be much easier
<roconnor> can I give default values to record fields in the declairation?
<adrien> not that I know, usually I make a default one and use the "with" syntax
<adrien> type t = { a : int; b = int }
<adrien> let default_t = { a = 0; b = 0; }
<roconnor> ah
<adrien> and later on:
<roconnor> that works well here
<adrien> let some_new_t = { default_t with a = 42 }
<adrien> :-)
<adrien> at last oasis-db/godi would allow to skip the boring part and go to the funnier one: managing dozens of clients, cpu time, memory usage, which revisions to test... :-)
<roconnor> is ther a function analogous to and :: [Bool] -> Bool from Haskell?
<hcarty> roconnor: List.for_all?
<roconnor> List.for_all (fun x -> x)
<hcarty> roconnor: I'm very not familiar with Haskell, but the signatures look similar
<hcarty> Indeed
ftrvxmtrx has quit [Ping timeout: 240 seconds]
ftrvxmtrx has joined #ocaml
yezariaely has left #ocaml []
stephenjudkins has joined #ocaml
ulfdoz_ has joined #ocaml
ulfdoz has quit [Read error: Operation timed out]
ulfdoz_ is now known as ulfdoz
roconnor has quit [Ping timeout: 252 seconds]
ftrvxmtrx has quit [Read error: Connection reset by peer]
_andre has quit [Quit: *puff*]
fraggle_ has quit [Ping timeout: 276 seconds]
yezariaely has joined #ocaml
yezariaely has left #ocaml []
ftrvxmtrx has joined #ocaml
ikaros has joined #ocaml
snarkyboojum has quit [Ping timeout: 265 seconds]
fraggle_ has joined #ocaml
snarkyboojum has joined #ocaml
lpereira has joined #ocaml
Nahra has quit [Remote host closed the connection]
drunK has quit [Remote host closed the connection]
Nahra has joined #ocaml
grettke has joined #ocaml
<grettke> seems like there's a lot of overlap between F# and OCaml
<adrien> well, not unexpected :p
<grettke> heh
<grettke> much cross-pollination?
<gildor> grettke: F# was greatly influenced by OCaml
<gildor> grettke: with older version of F# you can compile OCaml code
<grettke> gildor: neat
<gildor> grettke: I am not sure it is still the case today
MS_ has joined #ocaml
MS_ has left #ocaml []
<grettke> gildor: Are fsharpers learning OCaml and OCamlers learning F#? I mean... is that an interest?
<hcarty> grettke: There does some to be some mix between users. However, F# is rather weak in its Linux support, and OCaml is (from what I understand) similarly weak in its Windows support
<gildor> F# has a lot of .NET idiosyncrasy so basically doing OCaml and F# is not the same thing
<grettke> The idea of being able to do F# on .NET at work and OCaml/F# on a cluster is... neat.
<gildor> hcarty: well Windows support for OCaml is not that bad
<gildor> hcarty: just consider that OCaml can compile with msvc/cygwin/mingw
<adrien> yeah, it works quite well, the problem is more with the packaging of libs (getting a full environment on windows is [ currently :p ] hard)
<hcarty> gildor: I've never used it, just heard complaints. But that was a while ago, and I've never attempted it myself.
lpereira has quit [Quit: Leaving.]
<gildor> I tend to think that cluster computing is the Linux garden
<grettke> adrien: yes I see many posts on compiling with vc++/minq/cygwin...
<hcarty> That's good to hear - better cross platform support is always nice
<grettke> adrien: I've just been using it on cygwin
<gildor> I won't risk using a Windows computer to do cluster
<grettke> gildor: of course
<hcarty> Between ocamlnet and ocamlmpi there should be decent support for cluster computing in OCaml
<gildor> so basically, F# is an entry point for C#er into the functional world
<hcarty> Not to mention JoCaml and Camlp3l
<gildor> you keep a lot of idionsyncrasis of the .NET world and help functional beginner to get a grasp on your programming paradigm
<grettke> gildor: yea it is pretty wild
peddie has joined #ocaml
peddie has quit [Client Quit]
olauzon has joined #ocaml
stephenjudkins has quit [Quit: stephenjudkins]
ccasin has quit [Quit: Leaving]
pheredhel has quit [Quit: ZNC by prozac - http://znc.sourceforge.net]
ygrek has quit [Ping timeout: 245 seconds]
ygrek has joined #ocaml
pikachuyann has joined #ocaml
stephenjudkins has joined #ocaml
joewilliams is now known as joewilliams_away
ztfw has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
ikaros has quit [Quit: Leave the magic to Houdini]
stephenjudkins has quit [Ping timeout: 265 seconds]
joewilliams_away is now known as joewilliams
stephenjudkins has joined #ocaml
stephenjudkins_ has joined #ocaml
init1 has quit [Quit: Quitte]
stephenjudkins has quit [Ping timeout: 240 seconds]
stephenjudkins_ is now known as stephenjudkins
ygrek has quit [Ping timeout: 245 seconds]
zubeen has quit [Read error: No route to host]
<iris1> hi
<iris1> I have a newbie question
<iris1> when I have a type that is supposed to contain a bunch of similar records, I can do two things
<iris1> type f1 = { foo: int; bar: int }
<iris1> type f2 = Foobar of int * int
<iris1> The latter has the advantage that I can later add something else like "Barfoo of int * int * float" to it
<iris1> I am assuming therefore that f2 takes more space to store than f1
<iris1> Other than this, what are the pros and cons of the two choices?
<iris1> Is one obviously better or more idiomatic?
<iris1> Thank you!
olauzon has quit [Quit: olauzon]
<orbitz> iris1: If you want a record of things, use a record, if you want an algebraic datatyep use that
<orbitz> if you just want to name osmething you can do type f2 = int * int
<orbitz> iris1: in other words, use your best judgement to use the most meaningful solution, don't concern yoursel fiwth space