mbishop changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | Grab Ocaml 3.10.0 from http://caml.inria.fr/ocaml/release.html (featuring new camlp4 and more!)
david_koontz has quit []
seafoodX has joined #ocaml
buluca has quit ["Leaving."]
buluca has joined #ocaml
seafoodX has quit []
wy has joined #ocaml
<wy> Hey, is there a ocaml mode for emacs?
seafoodX has joined #ocaml
seafoodX has quit [Client Quit]
mordaunt has joined #ocaml
buluca has quit [Read error: 113 (No route to host)]
darinm has joined #ocaml
robozni has quit ["leaving"]
unfo- has quit [zelazny.freenode.net irc.freenode.net]
unfo- has joined #ocaml
unfo-ninja has joined #ocaml
unfo- has quit [zelazny.freenode.net irc.freenode.net]
unfo- has joined #ocaml
unfo- has quit [zelazny.freenode.net irc.freenode.net]
mordaunt has quit [Read error: 104 (Connection reset by peer)]
wy has quit ["Leaving"]
unfo- has joined #ocaml
unfo- has quit [Connection timed out]
thesoko has quit [Remote closed the connection]
thesoko has joined #ocaml
screwt898 has quit [Remote closed the connection]
Abo-Marwan91 has quit [Remote closed the connection]
Abo-Marwan91 has joined #ocaml
screwt898 has joined #ocaml
thesoko has quit [Remote closed the connection]
thesoko has joined #ocaml
darinm has quit []
thesoko has quit [Remote closed the connection]
p_a_u_l has quit [Read error: 110 (Connection timed out)]
mrsolo has joined #ocaml
darinm has joined #ocaml
asmanur has joined #ocaml
buluca has joined #ocaml
vpalle has joined #ocaml
buluca has quit [Read error: 113 (No route to host)]
Le-Chuck_ITA has joined #ocaml
<Le-Chuck_ITA> Hi all
<Le-Chuck_ITA> I would like to model categories into ocaml, and I am looking for advice on how to model functors
love-pingoo has joined #ocaml
darinm_ has joined #ocaml
darinm has quit [Read error: 104 (Connection reset by peer)]
darinm_ has quit [Client Quit]
Tetsuo has joined #ocaml
Le-Chuck_ITA has left #ocaml []
schme has joined #ocaml
Yoric[DT] has joined #ocaml
darinm has joined #ocaml
resuser has joined #ocaml
<resuser> hi
<resuser> I have a beginner's question
<resuser> I want to declare something like
bluestorm_ has joined #ocaml
<resuser> type t1 = t2 of t3 * t4 | t5 of t2 * t6
<resuser> that is using t2 defined in the same declaration in next type
<resuser> but ocaml won't let.
<bluestorm_> hm
<bluestorm_> actually the "foo of bar" form can't allow that
<bluestorm_> because foo must be a constructor, wich is not a type
<resuser> okey
<resuser> so how to do?
<bluestorm_> hm
<bluestorm_> what are you trying to do ?
<bluestorm_> type foo = A of int | B of foo * int
<bluestorm_> would work
<resuser> stop compiler warning about unmatched subtypes of t5
<bluestorm_> t5 isn't a type
<resuser> constructor that is,
<resuser> Hmm. I see the point.
<resuser> So it's kind of 'union' as in C?
<asmanur> yes
<resuser> thanks. lemme retry something
<pango> but safe ;)
schme has quit [Read error: 110 (Connection timed out)]
<resuser> btw, which editor is good for caml?
<resuser> I use eclipse with Ocaml extension
<resuser> but it won't do deep printing while debugging
<resuser> camelia is crashy and rough
<asmanur> emacs.
<resuser> It has debugging integration?
<Yoric[DT]> OcaIDE is nice.
<resuser> OcalIDE won't do debugging I think
mrsolo has quit ["Leaving"]
<asmanur> resuser: you can code without debugging integration :)
<resuser> The page says it does, but It didn't work for me
<resuser> asmanur: I am modifying ben pier's code :)
<resuser> So I spend time debugging for understanding it, make a change and then try to understand what I have changed :)
<asmanur> ok
Yoric[DT] has quit ["Ex-Chat"]
<resuser> Ill' try xemacs some of these days.
schme has joined #ocaml
<resuser> Yoric[DT]: Just for note, it was odt that did not support debugging. my bad. ocalide requires 3.3 And I need to keep 3.2 that's why I let it go.
resuser has left #ocaml []
schme` has joined #ocaml
schme has quit [Read error: 110 (Connection timed out)]
salierix has joined #ocaml
yminsky has joined #ocaml
cbtf has joined #ocaml
<cbtf> !logs
yminsky has quit []
<cbtf> cmeme: help
yminsky has joined #ocaml
<cbtf> flux: botsmack
<cbtf> where is the bot?
<cbtf> *** clog is CLOG (Channel LOGger) http://tunes.org/~nef/logs/
Yoric[DT] has joined #ocaml
robozni has joined #ocaml
* Yoric[DT] is having a few problems with his feisty -> gutsy update.
resuser has joined #ocaml
schme` is now known as schme
<salierix> What's a good ocaml book?
<rwmjones> salierix, http://www.ocaml-tutorial.org has a list
* Yoric[DT] is currently in the process of acquiring "OCaml for Scientists".
<Yoric[DT]> It's supposed to be good, but I haven't managed to put my hands on it yet.
pango- has joined #ocaml
<rwmjones> yeah, I've read it, it's good if not a bit pricey
<rwmjones> don't whatever you do buy the book which I was "involved" in ...
<schme> salierix: Just stay away from Practical ocaml.
<c> heh, the one w/ 1/5 stars on amzn?
<rwmjones> heh, that's the one
<schme> It would not surprise me if it had 1 out of 5.
<rwmjones> it's an anti-book. You'll actually learn more by not reading it
<schme> :S
<salierix> I heard about that book. :)
<salierix> What's so bad about it?
<Yoric[DT]> What happened ?
<rwmjones> http://blog.merjis.com/2006/11/08/practical-ocaml/ is all I can say without the possibility of being sued
<salierix> Are tutorials and books from around 2000-2001 still good?
<Yoric[DT]> Mostly.
pango- is now known as pango_
<Yoric[DT]> rwmjones: interesting.
* Yoric[DT] is one of the many proof-readers of Real World Haskell.
<Yoric[DT]> I find that book mostly quite well written.
Demitar has quit [Read error: 110 (Connection timed out)]
pango has quit [Remote closed the connection]
yminsky has quit []
asmanur has quit [Read error: 110 (Connection timed out)]
asmanur has joined #ocaml
Smerdy has joined #ocaml
Smerdy is now known as SmerdyLaptop
Abo-Marwan91 has quit [Remote closed the connection]
screwt898 has quit [Remote closed the connection]
EliasAmaral has joined #ocaml
screwt898 has joined #ocaml
l_a_m has joined #ocaml
Abo-Marwan91 has joined #ocaml
yminsky has joined #ocaml
yminsky has quit []
yminsky has joined #ocaml
yminsky has quit [Client Quit]
<Yoric[DT]> ...still dist-upgrading Ubuntu.
<salierix> I've never really liked ubuntu.
rektide has joined #ocaml
<rektide> i am a total newb, how do i concat two list of integers?
<rektide> oh right i forgot to turn the two list of integers into a list duh
<rektide> let r = List.concat [m;n];;
<rektide> can anyone recommend a good introduction tutorial
<Yoric[DT]> Actually, it's just as simple to do m @ n.
<Yoric[DT]> Or List.append m n
<bluestorm_> rektide: http://ocaml-tutorial.org/ ?
<Yoric[DT]> List.concat is meant for concatenating an arbitrary number of lists at once.
* Yoric[DT] seconds bluestorm_.
<Yoric[DT]> mmmhhh...
<rektide> thanks, its hard for me as a newbie to know what resources are quality. ocaml-tutorial.org was the first one i found but for all i know there could've been something 100x better
* Yoric[DT] assumes that some of his fonts were just uninstalled. The resulting display is, well, surprising.
<Yoric[DT]> rektide: also take a look at "Developing applications with Objective Caml".
<bluestorm_> rektide: i haven't read ocaml-tutorial
<rektide> Yoric[DT]: I will do that, thank you.
<bluestorm_> (as it kind of didn't existed when i was learning ocaml)
<bluestorm_> "Developing applications with Objective Caml" is a very complete book
<bluestorm_> but it's not really "easy"
<Yoric[DT]> Well, it probably depends on rektide's level with other languages.
* Yoric[DT] considers contributing to the OCaml tutorial at some point.
<rektide> i'm fairly new to ML but otherwise i'm a competent programmer in most declaratives
<rektide> i've been writing an imperative runtime for .net code so i figured i need to learn some functional languages
<bluestorm_> here it is
<rektide> s/fairly new/total newb/
<Yoric[DT]> So I guess the aforementioned book is probably a good start, too.
<Yoric[DT]> The later chapters about user interfaces are obsolete, but that's about it.
<bluestorm_> chapters 2 and 3 are necessary
<bluestorm_> 4 is useful
<bluestorm_> and other ones can be picked at will
<bluestorm_> i guess you'll spend most of your time learning the chapter 2 anyway
<rektide> ty for your kind recommendations
jdavis_ has quit [Read error: 110 (Connection timed out)]
cbtf has left #ocaml []
filp has joined #ocaml
EliasAmaral has quit [Read error: 104 (Connection reset by peer)]
EliasAmaral has joined #ocaml
ygrek has joined #ocaml
Ober has quit [Read error: 104 (Connection reset by peer)]
Tetsuo has quit ["Leaving"]
Tetsuo has joined #ocaml
ober has joined #ocaml
ober is now known as Ober
darinm has quit []
Ober has quit [Client Quit]
Ober has joined #ocaml
Yoric_ has joined #ocaml
Yoric[DT] has quit [Read error: 113 (No route to host)]
Jedai has joined #ocaml
l_a_m has quit [Remote closed the connection]
Ober has quit [Remote closed the connection]
Ober has joined #ocaml
vpalle has quit [Connection timed out]
Torment has quit [Read error: 110 (Connection timed out)]
jdavis_ has joined #ocaml
Yoric_ has quit ["Ex-Chat"]
<rektide> how do i get a certain member from a list of objects?
<SmerdyLaptop> Ill-defined question
<rektide> how do i get a list of member values from a list of objects?
<SmerdyLaptop> Do you know how to get a member of an object?
<rektide> how do i ask a well defined question resembling the question "how do i get a list of member values from a list of objects?"
<bluestorm_> List.map (fun obj -> obj.member) list ?
<flux> actually it's obj#member, but I guess the question is that is that what he's asking
<flux> is -> is is
<flux> uh, never mind
<bluestorm_> ? :D
<bluestorm_> recursive s/is/is is/ would be a funny thing to try
<flux> fortunately sed-expressions aren't ;)
<rektide> where can i get reference information? i'd like to know the purpose of List.choose for example
<bluestorm_> List.choose ?
<bluestorm_> iirc that doesn't exist
<rektide> you appear to be correct, my mistake
Yoric[DT] has joined #ocaml
Yoric[DT] has quit [Remote closed the connection]
asmanur has quit [Remote closed the connection]
salierix has quit ["Leaving"]
resuser has quit ["CGI:IRC (Session timeout)"]
buluca has joined #ocaml
<rektide> does this make sense to anyone: val it : (('a -> 'b option) -> 'a list -> 'b list)
<rektide> i dont understand what this function expects
<SmerdyLaptop> What have you been reading to learn OCaml?
<rektide> i only just just got to page 29 on polymorphism & type constraints
<SmerdyLaptop> Page 29 of what?
<rektide> Developing applications in OCaml
<SmerdyLaptop> I think that's the book I've heard bad things about.
<SmerdyLaptop> Might want to try the tutorial in the manual instead.
<rektide> its an oreilly book
<SmerdyLaptop> Oh, the bad one was APress.
<rektide> this one has come recommended by two channel denziens
<SmerdyLaptop> At any rate, if the book is any good, it either already introduced all the concepts you need, or the context makes it clear that you don't need to understand that type.
<rektide> i havent seen anything else comprable online
kelaouchi has quit ["leaving"]
<rektide> i thought i understood, but its not working as i expected
<SmerdyLaptop> What did you expect?
<rektide> thisfun fun x->x*2 listofints should be valid
<SmerdyLaptop> How did you decide that by reading the type?
<rektide> (('a -> 'b option) -> 'a list -> 'b list), first param is a fun going from a -> b, second param is a list of a
<SmerdyLaptop> No, you ignored the identifier [option].
<rektide> i certainly did
<SmerdyLaptop> You can't do that kind of thing and expect to arrive at valid conclusions.
<rektide> i'm not seeing option described in this ocaml book
<rektide> i have no idea what it means
<SmerdyLaptop> How did you come to encounter it?
<rektide> its in this function i'm trying to use
<rektide> or trying to understand rther
Yoric[DT] has joined #ocaml
<SmerdyLaptop> And how did you come upon that function?
<rektide> a documentation page with a big list of functions and explanations for what the functions do
<rektide> i figured i'd ditz around and run the functinos and look at the output
<rektide> but i cant even figure out how to execute this one. X/
<rektide> its a Type for optional values
<rektide> "option"
<SmerdyLaptop> You shouldn't try to read the standard library documentation until you're further into the book.
<rektide> i dont even understand what the syntax means
<rektide> ('a -> 'b [some type])
<SmerdyLaptop> Yup. Keep reading and you'll learn what that syntax means.
<rektide> unfortunately their explanation does not appear to be written in english
* Yoric[DT] is now installing godi for OCaml 3.10 .
<Yoric[DT]> rektide: what's the problem ?
<rektide> this function is using a syntax i dont understand and cannot find decent documentation on
<rektide> (('a -> 'b option) -> 'a list -> 'b list)
<rektide> i dont really know how those polymorphics are working
<Yoric[DT]> Give me a few minutes and I'll teach this to you.
* Yoric[DT] goes and prepare some tea first :)
* rektide follows suit
<rektide> thank you!
<pango_> there's definitely some weirdness about 'a option in the book; the link to 'a option documentation points no some infinitely void space between Array module and Printf module
<pango_> the only mention about 'a option is in Weak module description, but it's short (and not the most likely place one would search explanation for it)
<SmerdyLaptop> You have to know to look at the Pervasives page.
<SmerdyLaptop> But that wouldn't help rektide, as it defines [option] using a general mechanism that rektide doesn't know about yet.
<bluestorm_> rektide: where are you in the book ?
<pango_> there's nothing at that place in the french version either, so it's not a problem of translation
<rektide> page 32
<bluestorm_> rektide: "Iteration of composition" ?
<rektide> yes
<rektide> i kept thinking the answer was somewhere in the type restriction section
<Yoric[DT]> rektide: ok, infusion in progress, explanation may start.
<Yoric[DT]> Do you understand what aaa -> bbb means if aaa and bbb are types ?
<rektide> important q: green, black, or oolong?
<Yoric[DT]> Actually not real tea but I don't know the term in English.
<rektide> yes, but i havent made it to types yet
<bluestorm_> depends on your timezone
<rektide> i know that aaa and bbb are types
<Yoric[DT]> If aaa and bbb are types, then aaa -> bbb is the type of functions that tahe one argument of type aaa and return a value of type bbb.
<rektide> and that the function maps from aaa to a bbb value
<Yoric[DT]> s/tahe/take.
<Yoric[DT]> Exactly.
<rektide> right
<Yoric[DT]> 'a, 'b and 'anything are polymorphic types
ita has joined #ocaml
<Yoric[DT]> In the world of .Net or Java, they're called "generics".
<rektide> they represent "some type"
<Yoric[DT]> So a type 'a must actually be understood (for any 'a, 'a).
<Yoric[DT]> The type of the identity function is 'a -> 'a (that is, for any 'a, 'a -> 'a).
<rektide> right
<Yoric[DT]> Do you follow me to this point ?
<rektide> yes, i follow.
<Yoric[DT]> ok
<Yoric[DT]> Now, some types are parametrized.
<Yoric[DT]> In OCaml, the name of the parameter is written before the name of the type.
<Yoric[DT]> So a list of elements of type x is written x list.
<Yoric[DT]> So a list of elements of type x is written x list .
<Yoric[DT]> (just removing the dot)
<Yoric[DT]> In .Net/Java, this would be List<x>
* rektide nods
<rektide> not there yet in my reading but i think i grasp that
<Yoric[DT]> The last element in the type expression you mention earlier is the "option".
<Yoric[DT]> Do tell me if the .Net/Java comparisons help you.
<Yoric[DT]> If they don't, I'll just drop them :)
<rektide> thusfar they've been unnecessary, but in the future who knows
<rektide> everything so far has been simple
<Yoric[DT]> (anyway, .Net/Java generics are essentially an inferior rip-off of ML polymorphism)
<Yoric[DT]> ok
<rektide> i see option is: type Option<'a>
<Yoric[DT]> The type option is a sum type, which is the more powerful counterpart of enums+unions in C or enums in Java.
<Yoric[DT]> It is defined as
<Yoric[DT]> type 'a option = Some
<Yoric[DT]> Sorry,
<Yoric[DT]> type 'a option = Some of 'a | None
<Yoric[DT]> In other words, a value of type 'a option may have two possible structures:
<Yoric[DT]> * either it's Some(x) , for some x of type 'a
<Yoric[DT]> * or it's the constant None .
<bluestorm_> hm
<rektide> is None a language keyword?
<bluestorm_> Yoric[DT]:
<bluestorm_> maybe you could just skip option
<Yoric[DT]> No, it's a constant defined in type 'a option = Some of 'a | None .
<bluestorm_> and wait for him to read the next part of the chapter
<bluestorm_> (type declarations and pattern matching)
<Yoric[DT]> bluestorm_: fair enough.
<Yoric[DT]> Just one more word.
<bluestorm_> :p
<bluestorm_> afk
<Yoric[DT]> rektide: you can consider this "type 'a option = ..." as the definition of a Java enum.
<Yoric[DT]> An imperfect equivalent in Java would be http://pastebin.com/m365daa16 .
<Yoric[DT]> Now, rektide, you're on your own.
* rektide is reading
<Yoric[DT]> Enjoy.
<Yoric[DT]> When you figure it out, you may be interested to learn that there's a new (optional) syntax you can use instead of the original one.
<Yoric[DT]> It looks slightly less surprising for people who come from the world of imperative programming, plus it relies less on subtleties.
screwt898 has quit [Remote closed the connection]
Abo-Marwan91 has quit [Remote closed the connection]
EliasAmaral has quit [Remote closed the connection]
love-pingoo has quit [Read error: 110 (Connection timed out)]
<Yoric[DT]> Good night everyone.
screwt898 has joined #ocaml
Yoric[DT] has quit ["Ex-Chat"]
Lena has joined #ocaml
kelaouchi has joined #ocaml
<rektide> soo... This expression has type (int -> int) option but is here used with type 'a -> 'b option.... why isnt this polymorphizing from int->int to 'a -> `b
ygrek has quit [Remote closed the connection]
<Tetsuo> maybe 'a -> 'b option is the same as 'a -> ('b option)
<Tetsuo> and thus, not compatible with foo option
<rektide> ahhhhh ok
<rektide> now you're thinking with portals^H^H^H^H^H^H^Hocaml
<rektide> why does let f = fun (a:int) -> Some a*2;; realize a has to be an int, why does it throw "use of the overloaded operator '( * )'"
<rektide> *doesnt
<pango_> because * is not overloaded
<pango_> ocaml doesn't support overloading
<rektide> why would i be overloading?
<rektide> let l = 2*2;; works
<rektide> a has to be an int so why would some a*2 be overloading anything?
<pango_> you just have a problem of priorities then, try let f = fun (a:int) -> Some (a*2);;
<pango_> or let f = fun a -> Some (a*2) or let f a = Some (a*2)
<rektide> ahh excellent
<rektide> i'm sorry i'm so stupid. :/
<rektide> thank you for your assistance
<pango_> np... Here "Some a" is underlined when the error is displayed, that's as important as the error message ;)
Tetsuo has quit ["Leaving"]
Lena has quit [Read error: 110 (Connection timed out)]
Demitar has joined #ocaml
yminsky has joined #ocaml
filp has quit ["Bye"]
kelaouchi has quit [Read error: 104 (Connection reset by peer)]
kelaouchi has joined #ocaml
crathman has joined #ocaml
univac is now known as ee
ee is now known as eesti
eesti is now known as univac
rektide has quit ["go rockies"]
Abo-Marwan91 has joined #ocaml
Mr_Awesome has quit [Read error: 110 (Connection timed out)]
bluestorm_ has quit [Remote closed the connection]