flux changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | 3.11.0 out now! Get yours from http://caml.inria.fr/ocaml/release.html
mattam has quit [Read error: 113 (No route to host)]
vixey has quit [Read error: 101 (Network is unreachable)]
jlouis has quit ["Leaving"]
electricfeel has joined #ocaml
<electricfeel> I am trying to create an opentype: http://codepad.org/YWT1SPED in this snippet, I'd like the parameters 'a and 'b to be open... so that the datastructure isnt limited to a certain pair of types
<electricfeel> i'm not quite sure what the syntax is..
Amorphous has quit [Read error: 110 (Connection timed out)]
Morphous has joined #ocaml
<electricfeel> Actually, I guess what I'm trying to do is kinda stupid.
<electricfeel> Comparing a key that is a string with a key that is an int doesn't make any sense.
<electricfeel> Since the tree I'm using is a BST
<electricfeel> Well, let's say I changed that so it's just a binary tree, so there are no comparisons being made. I'd still ike to make the dictionary type "open", so that once it is instantiated, it is not exclusive to one 'a 'b type
hkBst has quit [Read error: 104 (Connection reset by peer)]
Smerdyakov has quit ["Leaving"]
electricfeel has left #ocaml []
electricfeel has joined #ocaml
<electricfeel> Probably too noobish of a question for this channel :-S
electricfeel has quit []
electricfeel has joined #ocaml
electricfeel has quit [Client Quit]
<thelema> well, if electricfeel comes back, let him know that he can't make open types in ocaml - functions can only return values of a fixed type or one parameterized by the type of that function's arguments.
mbishop_ has joined #ocaml
<thelema> what he's doing is exactly what ocaml allows you to do.
<thelema> (based on his last paste)
mbishop has quit [Read error: 113 (No route to host)]
TaXules has quit [Read error: 60 (Operation timed out)]
TaXules has joined #ocaml
jeddhaberstro has quit []
love-pingoo has joined #ocaml
vixey has joined #ocaml
fschwidom has joined #ocaml
seafood has quit [Read error: 110 (Connection timed out)]
jeremiah has quit [Read error: 104 (Connection reset by peer)]
jeremiah has joined #ocaml
seafood has joined #ocaml
seafood_ has joined #ocaml
seafood_ has quit [Client Quit]
seafood has quit [Read error: 110 (Connection timed out)]
mattam has joined #ocaml
<flux> oh, cool, codepad runs also ocaml code
fschwidom has quit [Connection timed out]
fschwidom has joined #ocaml
marmotine has joined #ocaml
seafood has joined #ocaml
smimou has quit ["bli"]
jonafan has joined #ocaml
stmi has joined #ocaml
jonafan_ has quit [Read error: 113 (No route to host)]
jonafan_ has joined #ocaml
jonafan has quit [Read error: 110 (Connection timed out)]
jonafan has joined #ocaml
Asmadeus has quit [Read error: 60 (Operation timed out)]
Asmadeus has joined #ocaml
jonafan_ has quit [Read error: 110 (Connection timed out)]
jonafan_ has joined #ocaml
seafood has quit []
jonafan has quit [Read error: 110 (Connection timed out)]
_zack has joined #ocaml
itewsh has joined #ocaml
jonafan_ has quit [Read error: 110 (Connection timed out)]
itewsh has quit [Client Quit]
Smerdyakov has joined #ocaml
ikaros has joined #ocaml
Stefan_vK1 has joined #ocaml
Camarade_Tux has joined #ocaml
ikaros has quit [Remote closed the connection]
Stefan_vK has quit [Read error: 110 (Connection timed out)]
Camarade_Tux_ has joined #ocaml
ikaros has joined #ocaml
Camarade_Tux has quit [Read error: 110 (Connection timed out)]
Camarade_Tux_ is now known as Camarade_Tux
Smerdyakov has quit ["Leaving"]
jeddhaberstro has joined #ocaml
sporkmonger has joined #ocaml
Camarade_Tux has quit ["Leaving"]
Camarade_Tux has joined #ocaml
jeremiah has quit [Read error: 104 (Connection reset by peer)]
electricfeel has joined #ocaml
jeddhaberstro has quit []
<electricfeel> I have a question about "open" types: http://codepad.org/9S65uQ4p . I've provided a very concise summary of what I'm trying to do in the paste.
<electricfeel> (* E.g. if i had a function add: (’key, ’value) dictionary -> ’key -> ’value -> (’key, ’value) dictionary *)
<electricfeel> (* I'd like to be able to add (string, int) and (int, string) and (string, string), etc to the same dictionary object. *)
<electricfeel> Sorry for the double line paste...
<flux> you would need to have type key_value = StrStr of (string * string) | IntStr of (int * string) etc
<flux> there are ways to have dynamic types in ocaml, for instance by using the exception system
vixey has quit ["There exists an infinite set!"]
<malc_> 06:32 < thelema> well, if electricfeel comes back, let him know that he can't make open types in ocaml - functions can only return values of a fixed type or one parameterized by the type of that function's arguments.
<malc_> 06:32 -!- mbishop_ [n=martin@unaffiliated/mbishop] has joined #ocaml
<malc_> 06:33 < thelema> what he's doing is exactly what ocaml allows you to do.
<malc_> 06:33 < thelema> (based on his last paste)
jeremiah has joined #ocaml
<electricfeel> ah
_zack has left #ocaml []
<electricfeel> I was reaidng the Hickey book and noticed that there is a type called "option", which includes None and anything not None.
<hcarty> electricfeel: The type is 'a option, and 'a can only be one type for a given value (int option list, for example)
<hcarty> electricfeel: Otherwise you have to use flux's suggestion
<electricfeel> I see. Thanks for the tips.
<hcarty> electricfeel: OCaml does not keep type information around, for the most part, in the compiled code. So having different items in a list (or array or other structure) wouldn't be safe without extra scaffolding
vixey has joined #ocaml
jeddhaberstro has joined #ocaml
_zack has joined #ocaml
Camarade_Tux_ has joined #ocaml
sporkmonger has quit [Read error: 104 (Connection reset by peer)]
<mrvn> re
<mrvn> det: The C part allocates a tuple and returns it as abstract type "context". The other functions then all get a context as first argument.
<mrvn> hcarty, flux: How does that work with exceptions?
<mrvn> electricfeel: You might replace 'key with (Hashtbl.hash <key>) : int if you want to store different keys.
<hcarty> mrvn: I have not used exceptions that way, but I think Yoric[DT] did some work along those lines
<mrvn> As for different values there is also the option of using classes. But that only makes sense when you have common method for the different types you want to store.
Camarade_Tux has quit [Read error: 110 (Connection timed out)]
<mrvn> I have a verry similar case in my code. But for me the 'key part determines what the 'value part is. Is there anything better than type key = FooKey of int | BarKey of int type value = FooVal of foo or BarVal of bar?
<mrvn> I have values only in leafes though. So I can't combine them into a single type.
<mrvn> .oO( Maybe I should change that )
<gildor> mrvn: I see that you pick "GPL license" for libaio-ocaml
<gildor> mrvn: could you use a more open license (e.g. LGPL + exception)
electricfeel has quit []
cataska has quit [Read error: 113 (No route to host)]
electricfeel has joined #ocaml
electricfeel has quit []
electricfeel has joined #ocaml
love-pingoo has quit [Read error: 60 (Operation timed out)]
robocop` has joined #ocaml
robocop` has quit [Client Quit]
Camarade_Tux_ has quit ["Leaving"]
mbishop_ is now known as mbishop
<mrvn> gildor: sure
alexyk has joined #ocaml
<mrvn> Just checked, libaio itself is lgpl too.
Jedai has joined #ocaml
seafood has joined #ocaml
ikaros_ has joined #ocaml
ikaros_ has quit [Client Quit]
alexyk has quit []
alexyk has joined #ocaml
alexyk_ has joined #ocaml
_zack has quit [Read error: 113 (No route to host)]
alexyk_ has quit [Client Quit]
alexyk has quit [Read error: 60 (Operation timed out)]
alexyk has joined #ocaml
seafood has quit []
hkBst has joined #ocaml
Anarchos has joined #ocaml
<Anarchos> thelema i finally succeeded in splitting the local roots per thread :)
<Anarchos> thelema anyway it works for a one thread job, like the ocaml compiler ;)
alexyk_ has joined #ocaml
seafood has joined #ocaml
alexyk has quit [Read error: 104 (Connection reset by peer)]
Anarchos has quit ["Vision[0.8.5-0418]: i've been blurred!"]
<electricfeel> i'm really liking OCaml. I come from a C/Pyton/Java background. This is my first serious foray into functional programming (the only ohter was with Lisp when I took an AI course last semester)
<electricfeel> I just didnt feel comfortable using Common Lisp :-)
<vixey> so you liked ocaml more because of the typing discipline?
alexyk_ has quit [Read error: 110 (Connection timed out)]
jonafan has joined #ocaml
marmotine has quit [Remote closed the connection]
malc_ has quit ["leaving"]
thelema has quit [Read error: 60 (Operation timed out)]
vixey has quit [kornbluth.freenode.net irc.freenode.net]
Stefan_vK1 has quit [kornbluth.freenode.net irc.freenode.net]
shortc|desk has quit [kornbluth.freenode.net irc.freenode.net]
Mr_Awesome has quit [kornbluth.freenode.net irc.freenode.net]
mfp has quit [kornbluth.freenode.net irc.freenode.net]
fy__ has quit [kornbluth.freenode.net irc.freenode.net]
erg has quit [kornbluth.freenode.net irc.freenode.net]
rodge has quit [kornbluth.freenode.net irc.freenode.net]
Demitar has quit [kornbluth.freenode.net irc.freenode.net]
ertai has quit [kornbluth.freenode.net irc.freenode.net]
kelaouchi has quit [kornbluth.freenode.net irc.freenode.net]
seafood has quit [kornbluth.freenode.net irc.freenode.net]
electricfeel has quit [kornbluth.freenode.net irc.freenode.net]
haelix has quit [kornbluth.freenode.net irc.freenode.net]
caligula has quit [kornbluth.freenode.net irc.freenode.net]
petchema_ has quit [kornbluth.freenode.net irc.freenode.net]
maxote has quit [kornbluth.freenode.net irc.freenode.net]
jeremiah has quit [kornbluth.freenode.net irc.freenode.net]
mbishop has quit [kornbluth.freenode.net irc.freenode.net]
hkBst has quit [kornbluth.freenode.net irc.freenode.net]
mattam has quit [kornbluth.freenode.net irc.freenode.net]
cygnus_ has quit [kornbluth.freenode.net irc.freenode.net]
fschwidom has quit [kornbluth.freenode.net irc.freenode.net]
jdev has quit [kornbluth.freenode.net irc.freenode.net]
r0bby has quit [kornbluth.freenode.net irc.freenode.net]
hcarty has quit [kornbluth.freenode.net irc.freenode.net]
jburd has quit [kornbluth.freenode.net irc.freenode.net]
sbok has quit [kornbluth.freenode.net irc.freenode.net]
svenl has quit [kornbluth.freenode.net irc.freenode.net]
gim has quit [kornbluth.freenode.net irc.freenode.net]
gildor has quit [kornbluth.freenode.net irc.freenode.net]
sgnb has quit [kornbluth.freenode.net irc.freenode.net]
orbitz has quit [kornbluth.freenode.net irc.freenode.net]
seafood has joined #ocaml
hkBst has joined #ocaml
electricfeel has joined #ocaml
vixey has joined #ocaml
jeremiah has joined #ocaml
Stefan_vK1 has joined #ocaml
fschwidom has joined #ocaml
mattam has joined #ocaml
mbishop has joined #ocaml
svenl has joined #ocaml
shortc|desk has joined #ocaml
Mr_Awesome has joined #ocaml
haelix has joined #ocaml
caligula has joined #ocaml
petchema_ has joined #ocaml
mfp has joined #ocaml
jdev has joined #ocaml
r0bby has joined #ocaml
kelaouchi has joined #ocaml
ertai has joined #ocaml
rodge has joined #ocaml
erg has joined #ocaml
Demitar has joined #ocaml
fy__ has joined #ocaml
maxote has joined #ocaml
cygnus_ has joined #ocaml
jburd has joined #ocaml
hcarty has joined #ocaml
sbok has joined #ocaml
gim has joined #ocaml
gildor has joined #ocaml
orbitz has joined #ocaml
sgnb has joined #ocaml
stmi has quit [Read error: 60 (Operation timed out)]
stmi has joined #ocaml
vixey has quit ["There exists an infinite set!"]
seafood has quit []
seafood has joined #ocaml
jlouis has joined #ocaml
TaXules has quit [Read error: 60 (Operation timed out)]
acatout has quit [Read error: 145 (Connection timed out)]
alexyk has joined #ocaml
mattam has quit [Read error: 110 (Connection timed out)]
alexyk has quit [Client Quit]
kelaouchi has quit [Read error: 110 (Connection timed out)]
ertai has quit [Read error: 110 (Connection timed out)]
electricfeel has quit []
electricfeel has joined #ocaml
thelema has joined #ocaml
haelix has quit [Read error: 110 (Connection timed out)]
fschwidom has quit [Remote closed the connection]
Smerdyakov has joined #ocaml
TaXules has joined #ocaml