mbishop changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | Grab OCaml 3.10.2 from http://caml.inria.fr/ocaml/release.html (featuring new camlp4 and more!)
postalchris has joined #ocaml
postalchris has quit [Client Quit]
hsuh has joined #ocaml
vpalle has joined #ocaml
sporkmonger has quit []
vpalle has quit ["Lost terminal"]
yangsx has quit [Remote closed the connection]
wy has joined #ocaml
jlouis has quit ["nn"]
Mr_Awesome has joined #ocaml
adu has joined #ocaml
sporkmonger has joined #ocaml
yangsx has joined #ocaml
coucou747 has quit [Read error: 110 (Connection timed out)]
kelaouch1 has joined #ocaml
kelaouchi has quit [Read error: 110 (Connection timed out)]
thelema has joined #ocaml
seafood_ has joined #ocaml
kelaouch1 has quit [Connection reset by peer]
kelaouchi has joined #ocaml
adu has left #ocaml []
thelema has quit ["My damn controlling terminal disappeared!"]
coucou747 has joined #ocaml
hsuh has quit [Remote closed the connection]
postalchris has joined #ocaml
postalchris has quit ["Leaving."]
pants1 has quit ["Leaving."]
prince has joined #ocaml
nuncanada has quit ["Leaving"]
mwc has quit ["Leaving"]
ikaros has joined #ocaml
<coucou747> @+
coucou747 has quit ["bye ca veut dire tchao en anglais"]
vladimir_trs has joined #ocaml
<vladimir_trs> How to point ocamlopt to libraries directory on windows?
<vladimir_trs> have tried "-ccopt -Ldir", it said "ignoring unknown option '-Ldir'"
ikaros_ has joined #ocaml
wy has quit ["Leaving"]
ikaros has quit [Read error: 110 (Connection timed out)]
vladimir_trs has quit ["http://www.mibbit.com ajax IRC Client"]
ygrek has joined #ocaml
jprieur has quit [Remote closed the connection]
Tetsuo has joined #ocaml
hkBst has joined #ocaml
goalieca has quit ["Ex-Chat"]
OChameau has joined #ocaml
seafood_ has quit []
seafood_ has joined #ocaml
yangsx has quit [Read error: 110 (Connection timed out)]
Demitar has joined #ocaml
seafood_ has quit []
munga has joined #ocaml
Demitar has quit [Read error: 110 (Connection timed out)]
schme has joined #ocaml
Yoric[DT] has joined #ocaml
TSC has quit [Read error: 104 (Connection reset by peer)]
<Yoric[DT]> Does anyone know if there's a trivial way to add a dialog box with OCamlSDL ?
coucou747 has joined #ocaml
ikaros_ has quit [Remote closed the connection]
hsuh has joined #ocaml
schme has quit [Read error: 104 (Connection reset by peer)]
schme has joined #ocaml
LordMetroid has joined #ocaml
LordMetroid has quit [Client Quit]
LordMetroid has joined #ocaml
LordMetroid has left #ocaml []
jsk has quit ["Leaving."]
schme has quit [Remote closed the connection]
munga has quit ["Leaving"]
Yoric[DT] has quit ["Ex-Chat"]
ikaros has joined #ocaml
ikaros has quit [Remote closed the connection]
ikaros has joined #ocaml
ikaros has quit [Remote closed the connection]
ikaros has joined #ocaml
hsuh has quit [Remote closed the connection]
ygrek has quit [Remote closed the connection]
johnnowak has joined #ocaml
FZ has joined #ocaml
seafood_ has joined #ocaml
comglz has joined #ocaml
<flux> afaik there isn't
<flux> there are gui libraries for frame buffers, but I don't think any of them are for ocaml
seafood_ has quit []
TheLittlePrince has joined #ocaml
munga has joined #ocaml
munga has quit [Client Quit]
magnusth has joined #ocaml
RobertFischer has joined #ocaml
* RobertFischer does a little dance for his first professional Ocaml project.
<Smerdyakov> What is it?
<RobertFischer> Working for Merjis -- doing some work with CocanWiki.
mwc has joined #ocaml
ygrek has joined #ocaml
<rwmjones> really, jeremy employed you eh?
<rwmjones> good luck, let me know if you have any cocanwiki code questions
<RobertFischer> rwmjones: Yup, got off the phone with Jeremy not too long ago. And don't worry -- you'll be hearing from me. :) Is there a CocanWiki mailing list?
<RobertFischer> Ruby: Closures, You're Doing Them Wrong! http://pastie.caboo.se/177201
magnusth has quit [Remote closed the connection]
comglz_ has joined #ocaml
comglz_ has quit [Client Quit]
johnnowak has quit []
comglz has quit [Read error: 110 (Connection timed out)]
<RobertFischer> rwmjones: Signed up. Thanks!
ttt-- has joined #ocaml
pango_ has quit [Remote closed the connection]
johnnowak has joined #ocaml
RobertFischer has quit ["Taking off -- check out http://smokejumperit.com and http://enfranchisedmind.com/blog/"]
pango_ has joined #ocaml
magnusth has joined #ocaml
Linktim has joined #ocaml
TheLittlePrince has quit [Client Quit]
Yoric[DT] has joined #ocaml
filp has joined #ocaml
magnusth has quit [Remote closed the connection]
<sporkmonger> is there any kind of naming convention in ocaml for functions that return a boolean value like ruby or scheme have? ie, "should_clone?" or "is_valid?"
<flux> rwmjones, btw, you recently asked about how to write a module that wouldn't compile on 32-bit platforms.. does bitmatch require 64 bits?
<flux> or the provided examples?
johnnowak has quit []
marmottine has joined #ocaml
jprieur has joined #ocaml
RobertFischer has joined #ocaml
<rwmjones> flux, no
jlouis has joined #ocaml
* RobertFischer has little faith in the library connection he's on. But he's sitting next to a waterfall in an indoor forest, so that's okay.
RobertFischer has left #ocaml []
RobertFischer has joined #ocaml
delamarche has joined #ocaml
OChameau has quit ["Leaving"]
ttt-- has quit [Read error: 110 (Connection timed out)]
<jonafan> ocsigen?
<RobertFischer> 42.
<jonafan> no way
<jonafan> how do the haskell people model a cyclic graph?
<jlouis> jonafan, maybe by the use of a clever zipper
goalieca has joined #ocaml
<jonafan> maybe i don't know what a zipper is
<jonafan> well... okay
<delamarche> anyone here read 'purely functional data structures'?
<delamarche> I've heard mixed reviews but I am personally finding it to be awesome.
<jonafan> by okasaki?
<delamarche> That's the one.
<jonafan> i've read part of it
<jonafan> i did enjoy it much
<jlouis> delamarche, nice little book
<jlouis> jonafan, Martin Erwigs work may also be of interest to you: http://web.engr.oregonstate.edu/~erwig/papers/abstracts.html#JFP01
<jonafan> this looks like a winner
<delamarche> Whoa, that's cool.
<sporkmonger> if i have an int option is there some way to actually get at the number and operate on it other than match?
<flux> sporkmonger, yes, a function could retrieve the value and cause an exception if it's None
<flux> sporkmonger, or perhaps you could use monads..
<sporkmonger> i mean like
<sporkmonger> if i've got let x = Some 2;;
<sporkmonger> how would i add 2 to the thing inside x in order to get 4?
<sporkmonger> aside from match x with
<Jedai> sporkmonger: If you were in Haskell I would say fmap (+2)
<flux> slightly different ;-) : match a, b with Some a, Some b -> a + b | _ -> failwith "hm, I expected Some, got None"
<flux> oh, I misread what you said
<Jedai> sporkmonger: But you could write a fmap for option in ocaml :
<flux> anyway, the other option is to have a function let unopt = function Some v -> v | None -> assert false, or jedai's way
<Jedai> fmap f Some(x) = Some(f x)
<Jedai> fmap f None = None
<sporkmonger> so there's always going to be some kind of pattern matching used to process variant types?
<Jedai> Well, with proper OCaml syntax
<jlouis> sporkmonger, x is a constant. You can't "add" something to it. You can match on it and then do something with the result though
<flux> sporkmonger, what kind of other solution would you think there could be?
<Jedai> fmap f = function | Some(x) -> Some(f x) | None -> None
<sporkmonger> flux: i have no idea :-P
<sporkmonger> that's why i'm asking
<Jedai> And then you use fmap ((+) 2)
<sporkmonger> interesting
<sporkmonger> i'm mostly asking because i wrote this function, find_cloneable_transition which returns a State.t option and i wasn't quite sure how to get at my return value if it wasn't None
<sporkmonger> but i guess the answer is match state with
<jlouis> In Standard ML there is an Option.map function acting like the Haskell fmap (on option types only). Isn't there something akin in Ocaml?
bluestorm has joined #ocaml
<hcarty> jlouis: I don't think that there is anything like that in the OCaml stdlib
<hcarty> Developing an module for easier handling of option types was discussed briefly on the mailing list though
<jlouis> hcarty, there is a score of function in the Standard ML basis one ought to steal
FZ has quit ["ChatZilla 0.9.81 [Firefox 2.0.0.13/2008031114]"]
<hcarty> I don't use option very often. The mailing list discussion involved using exceptions vs Some/None
RobertFischer has quit ["Taking off -- check out http://smokejumperit.com and http://enfranchisedmind.com/blog/"]
Anarchos has joined #ocaml
<sporkmonger> is there a std library way of doing (pseudo-code) round_to_int(x /. 2.0) rather than truncation?
<Anarchos> i am looking for info about caml_enter_blocking_section_hook : its usage and best practices
<hcarty> sporkmonger: I don't think so. If there is it will be somewhere under here: http://caml.inria.fr/pub/docs/manual-ocaml/libref/
<sporkmonger> yeah, that's where i was looking
<sporkmonger> and i didn't see anything
<sporkmonger> what sub-section would the functions for int / float be in?
<hcarty> sporkmonger: Pervasives most likely
<Jedai> hcarty: Well option is not very convenient if you don't have good utility function to manipulate it, Haskell has those plus the Maybe Monad which is pretty useful to chain action that can fail without being explicit about it
<sporkmonger> yup, there it is
<jlouis> I tend to avoid option if at all possible
<hcarty> sporkmonger: I was using something along the lines of floor (x +. 0.5) as a rounding function in some relatively recent code
<Jedai> jlouis: It's pretty good documentation, it tells right in the type if an operation can fail, and it allows to handle the exceptional case easily
<sporkmonger> yeah, still have to int_of_float that though :-(
<jlouis> Jedai, that is monad speak ;)
<hcarty> sporkmonger: Yes... replacing floor with int_of_float will give an int rather than float result
<jlouis> For some code, the exceptional case is so damn rare that I don't want to bother with it at all
<Jedai> jlouis: There's two responses to that : if the exceptional case is rare for all usage of the function you should use an exception rather than option and if the exceptional case if only rare for your code, you want an utility function : fromSome = function | Some(x) -> x | None -> failwith "I found None where Some is expected"
<hcarty> sporkmonger: Will "let round x = int_of_float (x +. 0.5)" do what you need?
<sporkmonger> yes
<sporkmonger> which is what i did
<bluestorm> there is an Option module in extlib
<bluestorm> the provided functions are not that great, though
<bluestorm> there is no monadic bind
<Anarchos> bluestorm what is a monadic bind ?
Linktim has quit [Remote closed the connection]
<Jedai> Anarchos: Monads are a datastructure and some functions on it that respect certain laws
<Jedai> Anarchos: But the monad for Option is pretty simple :
<Anarchos> Jedai which kind of laws ?
<Jedai> bind o f = match o with | Some x -> f x | None -> None
<Jedai> return x = Some(x)
<Jedai> Anarchos: For example, the bind and return of a monad must be such that : bind (return x) f = f x
<Jedai> bind m return = m
<Jedai> bind (bind m f) g = bind m (fun x -> bind (f x) g)
<sporkmonger> i have to parse some semi-complicated command line args in my program, and the Arg module looked like the right tool for the job, but uhm... i really don't understand the documentation... is there some example code that around somewhere i can take a look at that uses the Arg module?
<Jedai> Anarchos: That may seems abstruse but for most natural monad those rules are evident (try it with the bind and return I defined for Option)
<Anarchos> Jedai i see. Is there a good article on it ?
<Jedai> Anarchos: This bind for option is interesting because it let's you chain call to function that may fail without explicitly matching the option
<Jedai> Anarchos: You have plenty of Monad tutorial around (I first learned about them in my "Programming" course), they're are some for OCaml
<Jedai> For example http://enfranchisedmind.com/blog/2007/08/06/a-monad-tutorial-for-ocaml/ (I don't know if it's any good though)
<Anarchos> Jedai thanks a lot i will look for that at work tomorrow
kotarak has joined #ocaml
kotarak has quit [Client Quit]
kotarak has joined #ocaml
Anarchos has quit ["Vision[0.8.5-0418]: i've been blurred!"]
Axioplase has joined #ocaml
sporkmonger_ has joined #ocaml
<pango_> sporkmonger: found an example in http://linuxgazette.net/issue99/stellingwerff.html ("Command line parameters" chapter)
<sporkmonger_> nice, thanks
ygrek has quit [Remote closed the connection]
sporkmonger has quit [Read error: 110 (Connection timed out)]
<pango_> "It starts with the reserved character '_'." seems to be a typo - keywords start with '-'
bluestorm has quit ["Konversation terminated!"]
Morphous has joined #ocaml
Yoric[DT] has quit ["Ex-Chat"]
asymptote has joined #ocaml
<asymptote> Is FFTW the best bet for an ocaml fft?
ikaros has quit [Remote closed the connection]
marmottine has quit ["Quitte"]
delamarche has quit []
Morphous_ has quit [Read error: 110 (Connection timed out)]
Axioplase has quit ["leaving"]
asymptote has quit ["Leaving"]
LordMetroid has joined #ocaml
kotarak has quit ["Xaide, leka nosht."]
filp has quit ["Bye"]
Tetsuo has quit ["Leaving"]
mwc has quit [Remote closed the connection]
seafood_ has joined #ocaml
delamarche has joined #ocaml
Demitar has joined #ocaml
psnively has joined #ocaml
hkBst has quit ["Konversation terminated!"]
delamarche has quit [Read error: 110 (Connection timed out)]
Oatmeat has joined #ocaml
<Oatmeat> I'm creating a hashtable with Hashtbl.create and then storing a string key with a user-defined type value. When I try to add something to the hashtable I get the error "This expression has type user_type but is here used with type 'a. The type constructor user_type would escape its scope." Can anybody suggest how to fix this?
<Oatmeat> I moved the user_type declaration above the Hashtbl.create and that fixed it
Oatmeat has quit []
seafood_ has quit []
psnively has quit []
jprieur has quit ["Connection reset by beer"]
jlouis has quit ["Leaving"]
yangsx has joined #ocaml
coucou747 has quit ["bye ca veut dire tchao en anglais"]