dylan changed the topic of #ocaml to: OCaml 3.09.1 available! Archive of Caml Weekly News: http://sardes.inrialpes.fr/~aschmitt/cwn/ | A free book: http://cristal.inria.fr/~remy/cours/appsem/ | Mailing List: http://caml.inria.fr/bin/wilma/caml-list/ | Cookbook: http://pleac.sourceforge.net/
cookoo has joined #ocaml
cookoo has quit []
ski_ is now known as ski
Skal has joined #ocaml
Snark has joined #ocaml
ski has quit [Remote closed the connection]
ski_ has joined #ocaml
ski_ is now known as ski
khaladan has joined #ocaml
mrsolo__ has quit [Read error: 104 (Connection reset by peer)]
mrsolo__ has joined #ocaml
pango is now known as pangoafk
khaladan_ has joined #ocaml
pangoafk has quit [Read error: 104 (Connection reset by peer)]
pangoafk has joined #ocaml
khaladan has quit [Read error: 110 (Connection timed out)]
khaladan_ is now known as khaladan
mrsolo__ has quit [Read error: 104 (Connection reset by peer)]
mrsolo__ has joined #ocaml
rillig has joined #ocaml
mikeX has joined #ocaml
<ulfdoz> caml.inria.fr dead or is it me?
vodka-goo has joined #ocaml
<ulfdoz> The host is there, but no http.
* pangoafk nods
<mikeX> indeed, timeout
khaladan_ has joined #ocaml
Revision17 has quit [Read error: 110 (Connection timed out)]
khaladan has quit [Read error: 110 (Connection timed out)]
khaladan_ is now known as khaladan
khaladan_ has joined #ocaml
pangoafk is now known as pango
khaladan has quit [Read error: 110 (Connection timed out)]
khaladan_ is now known as khaladan
_fab has joined #ocaml
glorb has left #ocaml []
vodka-goo has quit ["using sirc version 2.211+KSIRC/1.3.11"]
khaladan_ has joined #ocaml
pango is now known as pangoafk
khaladan has quit [Read error: 110 (Connection timed out)]
khaladan_ is now known as khaladan
pangoafk is now known as pango
sieni_ is now known as sieni
Skal has quit [Remote closed the connection]
pango is now known as pangoafk
pangoafk is now known as pango
sieni has quit [Read error: 110 (Connection timed out)]
_JusSx_ has joined #ocaml
mikeX_ has joined #ocaml
mikeX has quit [Read error: 113 (No route to host)]
mikeX_ has quit [Read error: 110 (Connection timed out)]
ski_ has joined #ocaml
ski has quit [Nick collision from services.]
ski_ is now known as ski
Amorphous has quit [Read error: 110 (Connection timed out)]
<ulfdoz> Am I right? Due to the lack of polymorphic functions, there is no way to constrain a type variable to types over which are special function defined (e.g. "greater than")?
<zmdkrbou> "lack of polymorphic functions" ?
<ulfdoz> For example, greater than in haskell has type: "sort :: Ord a => [a] -> [a]", which means I can apply sort to all lists of values over which an order is defined.
<ulfdoz> s/greater than/sort/1
<zmdkrbou> then just define a function greater than which requires a 'a argument *and* a comparison function over this 'a type
<ski> ocaml has polymorphic functions
<ulfdoz> Hm, nice and elegant idea. I've made too much haskell.
<ski> it doesn't have *constrained* polymorphism
<ulfdoz> Ok, so I draw a wrong conclusion from functions / and /. for integers or floats.
<zmdkrbou> ocaml doesn't allow operators overloading
<zmdkrbou> ut overloading is just a dirty way of achieving some polymorphism
<ski> 'ut' ?
<zmdkrbou> +b
<ski> m
<zmdkrbou> n
<ski> (though 'constrained polymorphism' is much better than plain 'ad-hoc overloading')
* zmdkrbou doesn't know if haskell's polymorphism is better than ocaml's one
ski_ has joined #ocaml
<ulfdoz> imho it is a quite good solution.
ski has quit [Nick collision from services.]
ski_ is now known as ski
Amorphous has joined #ocaml
bluestorm has joined #ocaml
Smerdyakov has joined #ocaml
ski_ has joined #ocaml
ski has quit [Nick collision from services.]
ski_ is now known as ski
sieni_ has joined #ocaml
Schmurtz has joined #ocaml
CLxyz has quit [Connection timed out]
Revision17 has joined #ocaml
Banana has quit [Read error: 104 (Connection reset by peer)]
Banana has joined #ocaml
CLxyz has joined #ocaml
pango is now known as pangoafk
Bigb[a]ng is now known as Bigbang
Bigbang is now known as Bigb[a]ng
pangoafk is now known as pango
Revision17 has quit [Remote closed the connection]
Revision17 has joined #ocaml
mikeX has joined #ocaml
Snark has quit ["Leaving"]
davidfetter has joined #ocaml
<davidfetter> hello
clausen has joined #ocaml
<clausen> hi all
<clausen> I've been thinking about developing a statistics system based on ocaml
<clausen> the existing systems (like R, octave, etc.) are not statically typed, which I find annoying
<clausen> one nice feature of R et al is you can treat scalars and vectors as the same thing
<clausen> (eg: x + y; abs(x); x^2...)
<clausen> is there a straight-forward way of doing this in ocaml as well?
<clausen> (efficiently)
<davidfetter> n00b question: what's wrong with line 5 of this program? http://rafb.net/paste/results/LckACs27.html
<bluestorm> let
<bluestorm> let ... = ... ;
<bluestorm> should be let ... = ... in
<bluestorm> or let ... = ... ;;
<clausen> hmmm, ocaml doesn't seem to have any overloading at all.. float uses +. ...
<bluestorm> ; is wrong (he wait the blong to finish)
<bluestorm> so lines 3 and 4 are false
<bluestorm> but it is only detected line 5, when he see that your block closure isn't coherent
<bluestorm> here you should use let ... = ... ;;
<bluestorm> (because you still use these vars in further code)
<davidfetter> ok
* davidfetter edits...
<davidfetter> thanks :)
<mikeX> clausen: have a look at g'caml: http://web.yl.is.s.u-tokyo.ac.jp/~furuse/gcaml/
<clausen> mikeX, thanks
<clausen> why are + and +. separate?
<clausen> they aren't in Haskell!
<mikeX> well that's no excuse
<clausen> well, it seems more elegant to have + : Num a => a -> a -> a
<clausen> than to have two separate functions
<clausen> (that's what polymorphism is all about!)
<mikeX> o'caml does not have this kind of polymorphism
bluestorm has quit [Remote closed the connection]
<mikeX> only parametric
<clausen> thanks... I guess it isn't going to do what I want then
<mikeX> you can use variant types
<mikeX> type numeric = Int of int | Float of float
<mikeX> or something like that
<clausen> but that won't allow you to force types to match, right?
<mikeX> what do you mean by that?
<clausen> In haskell, you can write a function f : Num a => a -> a
<clausen> which means it maps integers to integers, floats to floats, etc.
<clausen> it will never map an integer to a float
<mikeX> what do you mean by 'map'?
<clausen> the mathematical meaning of map...
<clausen> a function f : X -> Y (math notation) maps X to Y
* mikeX not good with math :(
<clausen> suppose I wrote f x = x*x
<clausen> and f : Num a = a -> a
<clausen> if I give an integer in... say, 2, then I get an integer out... 4
<clausen> if I put a float in, say 1.1, then I get a float out... 1.01
<mikeX> well, if you passed the operator as well you could
Anarchos has joined #ocaml
<mikeX> clausen: http://pastebin.ca/44282
<mikeX> that adds ints with ints and floats with floats
<clausen> mikeX, that only complains at runtime, though
<clausen> (right?)
<mikeX> yes
<clausen> I was hoping the compiler could enforce it at compile time
<clausen> (in haskell, this is possible)
<clausen> are you familiar with red-black trees?
<clausen> (if you do, then I can wow you with haskell's type system!)
<mikeX> well not too familiar
<clausen> well, in haskell, you can enforce that a binary tree is a red-black tree at compile time!
<clausen> that is, if you write a function that say, adds an item to a red-black tree
<clausen> the compiler can check at compile time that the function will always output a valid red-black tree!
<mikeX> :)
<ski> (thus making sure that the red-black-tree invariants are kept)
_JusSx_ has quit [Client Quit]
<Anarchos> clausen what is A red black tree ?
<clausen> Anarchos, do you know what a binary tree is?
<Anarchos> clausen yes
<clausen> a red black tree is a special type of binary tree, which tries to keep the tree balanced cheaply
<clausen> this way, it can guarantee O(log n) insertions, deletions and lookups
<clausen> in the worst case
<clausen> (as opposed to binary trees, which have degenerate cases giving Omega(n) worst case for these ops)
<Anarchos> but where does the red/black name come from ^
<Anarchos> ?
<clausen> each node in the tree is labelled "red" or "black"
<clausen> for a tree to be a valid red-black tree, all red nodes must have black parents (IIRC)
<Anarchos> ok
davidfetter has left #ocaml []
<ski> (wasn't there one more invariant ?)
mikeX has quit ["leaving"]
<clausen> I have to think in 2-3-4 trees first, and then translate
<clausen> I think red nodes label the parent of a 2-3-4 node
<clausen> so, each black node needs a red parent
clausen has left #ocaml []
Anarchos has left #ocaml []
_fab has quit [Remote closed the connection]
<Demitar> Anyone spotted a nice solution for flipping images in ocamlsdl? (Since in opengl they are expected to be upside down.)
* Demitar writes his own little utility function.
Canon828 has joined #ocaml
dark_light has joined #ocaml
Canon828 has quit [Client Quit]
Anarchos has joined #ocaml
slipstream has joined #ocaml
ellisonch has left #ocaml []
ellisonch has joined #ocaml
slipstream-- has quit [Connection timed out]
Anarchos has quit [Read error: 110 (Connection timed out)]
dark_light has quit ["Fui embora"]
<fluxx> hmm, in opengl, aren't you in control of the coordinate system?
<fluxx> (that was rhetoric)
<fluxx> you might be right, though, I haven't touched opengl for a long time :)
rillig has quit [Remote closed the connection]