adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 4.00.1 http://bit.ly/UHeZyT | http://www.ocaml-lang.org | Public logs at http://tunes.org/~nef/logs/ocaml/
emmanuelux has quit [Remote host closed the connection]
wagle_ is now known as wagle
avsm has joined #ocaml
avsm has quit [Ping timeout: 260 seconds]
larhat has quit [Quit: Leaving.]
iago has quit [Quit: Leaving]
astertronistic has quit [Ping timeout: 260 seconds]
xavierm02 has quit [Quit: Leaving]
sepp2k has quit [Remote host closed the connection]
ulfdoz has quit [Ping timeout: 246 seconds]
ulfdoz has joined #ocaml
vaati has quit [Ping timeout: 265 seconds]
avsm has joined #ocaml
madroach has quit [Ping timeout: 244 seconds]
tautologico has joined #ocaml
madroach has joined #ocaml
cdidd has quit [Read error: Operation timed out]
avsm has quit [Ping timeout: 260 seconds]
Progster has quit [Ping timeout: 245 seconds]
walter_ has joined #ocaml
walter_ has quit [Remote host closed the connection]
walter has joined #ocaml
Yoric has joined #ocaml
avsm has joined #ocaml
avsm has quit [Read error: Operation timed out]
rgrinberg has quit [Read error: Connection reset by peer]
Yoric has quit [Ping timeout: 252 seconds]
rgrinberg has joined #ocaml
avsm has joined #ocaml
avsm has quit [Read error: Operation timed out]
lolcathost has joined #ocaml
tac has joined #ocaml
tautologico has quit [Quit: tautologico]
<coldpizza72i> whats the equivalent of "insert x t = T a x b where (a,b) = partition x t" in ocaml
elixey has quit [Remote host closed the connection]
<_habnabit> coldpizza72i, let insert x t = let a, b = partition x t in T a x b
<coldpizza72i> _habnabit: hmmm i getting a syntax error with that
<_habnabit> coldpizza72i, what's T
<coldpizza72i> type heap = E | T of heap * Elem.t * heap
<_habnabit> T (a, x, b)
<coldpizza72i> thanks
avsm has joined #ocaml
avsm has quit [Ping timeout: 252 seconds]
mfp has quit [Ping timeout: 248 seconds]
<coldpizza72i> _habnabit: can u help me with this http://ideone.com/n6VwVc
tac has quit [Quit: Page closed]
coldpizza72i has quit [Quit: coldpizza72i]
Yoric has joined #ocaml
astertronistic has joined #ocaml
avsm has joined #ocaml
avsm has quit [Ping timeout: 252 seconds]
larhat has joined #ocaml
tac has joined #ocaml
mjonsson has quit [Read error: Operation timed out]
pango is now known as pangoafk
mjonsson has joined #ocaml
answer_42 has joined #ocaml
lolcathost has quit [Ping timeout: 255 seconds]
andreypopp has joined #ocaml
Neros has quit [Quit: No Ping reply in 180 seconds.]
djcoin has joined #ocaml
Neros has joined #ocaml
tac has quit [Quit: Page closed]
mjonsson has quit [Read error: Operation timed out]
gnuvince has quit [Ping timeout: 256 seconds]
rgrinberg has quit [Read error: Connection reset by peer]
lolcathost has joined #ocaml
Cyanure has joined #ocaml
ankit9 has joined #ocaml
hkBst has joined #ocaml
hkBst has quit [Changing host]
hkBst has joined #ocaml
mrpantoufle has quit [Quit: leaving]
avsm has joined #ocaml
beckerb has joined #ocaml
Pantoufle has joined #ocaml
avsm has quit [Read error: Operation timed out]
rwmjones has quit [Ping timeout: 255 seconds]
Cyanure has quit [Remote host closed the connection]
rwmjones has joined #ocaml
cdidd has joined #ocaml
cago has joined #ocaml
Cyanure has joined #ocaml
avsm has joined #ocaml
ocp has joined #ocaml
avsm has quit [Read error: Operation timed out]
thomasga has joined #ocaml
lolcathost has quit [Remote host closed the connection]
ftrvxmtrx has joined #ocaml
avsm has joined #ocaml
Yoric has quit [Ping timeout: 252 seconds]
_andre has joined #ocaml
avsm has quit [Quit: Leaving.]
ankit9 has quit [Ping timeout: 256 seconds]
astertronistic has quit [Ping timeout: 260 seconds]
bru has joined #ocaml
cago has quit [Read error: Connection reset by peer]
<bru> Bonjour !
<bru> I have a type declared as:
<bru> type status = | A | B | C | D;;
<bru> how can I iterate the values it can have without expliciting them?
<flux> you cannot
<bru> :(
<flux> well, there are a couple alternatives: there could be a syntax extension that generates a list of those values for you
<flux> or one could make use of the unsafe features to generate those values, but that would be quite frowned upon, not to mention fragile/dangrous
<bru> given my ocaml level that could get a bit ugly…
<flux> I think in practice people just create a list containing those values
<flux> sadly it cannot be checked to contain them all
<flux> (maybe possible with polymorphic variants..)
<bru> thank you for all those pointers
<adrien> well, soon, with RTTI...
avsm has joined #ocaml
avsm1 has joined #ocaml
avsm has quit [Ping timeout: 244 seconds]
mcclurmc is now known as mcclurmc_away
andreypopp has quit [Quit: sleep]
sepp2k has joined #ocaml
<bru> One more question: I do a List.map fun myList
<bru> with fun : myType -> unit
<bru> therefore the List.map returns a () list
<bru> how can I convert it to a simple ()?
<bru> I'm doing "function (ul : unit list) -> ()) (myListOfUnits)"
<flux> hmm
<flux> you mean you want to use List.iter fun myList ?
Yoric has joined #ocaml
avsm1 has quit [Quit: Leaving.]
ontologiae has joined #ocaml
bru has quit [Ping timeout: 260 seconds]
mcclurmc_away is now known as mcclurmc
Cyanure has quit [Remote host closed the connection]
avsm has joined #ocaml
mfp has joined #ocaml
avsm has quit [Quit: Leaving.]
bru has joined #ocaml
UncleVasya has joined #ocaml
<bru> flux, I was not aware of List.iter, thank you!
xavierm02 has joined #ocaml
cago has joined #ocaml
Neros has quit [Ping timeout: 256 seconds]
walter has quit [Remote host closed the connection]
avsm has joined #ocaml
cago has quit [Quit: Leaving.]
avsm has quit [Ping timeout: 251 seconds]
<hcarty> wieczyk: To expand on _habnabit's answer a bit - many/most modules in Batteries have Foo.enum (convert to enum) and Foo.of_eunm (convert from enum) functions.
<flux> I almost read that as unenum, which would be a fun function name..
<hcarty> flux: That will be the function using first class modules to do the same thing :-)
<hcarty> unenum (module BatList) some_enum
rgrinberg has joined #ocaml
<hcarty> Gives a list, clearly.
avsm has joined #ocaml
Neros has joined #ocaml
mjonsson has joined #ocaml
coldpizza72i has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
coldpizza72i has quit [Quit: coldpizza72i]
tac has joined #ocaml
rgrinberg has quit [Read error: Connection reset by peer]
tac has quit [Client Quit]
rgrinberg has joined #ocaml
gnuvince has joined #ocaml
<flux> hmm, so how about general direct conversion, map_container (module List) (module Set) identity ["hello", "world"] :)
ontologi1e has joined #ocaml
Neros has quit [Ping timeout: 260 seconds]
ontologiae has quit [Ping timeout: 256 seconds]
Neros has joined #ocaml
mehdid has quit [Ping timeout: 260 seconds]
mehdid has joined #ocaml
sivoais has quit [Ping timeout: 252 seconds]
tac has joined #ocaml
mjonsson has quit [Ping timeout: 265 seconds]
tac has quit [Quit: Page closed]
bru has quit [Ping timeout: 252 seconds]
BiDOrD_ has quit [Ping timeout: 240 seconds]
BiDOrD has joined #ocaml
UncleVasya has left #ocaml []
avsm has quit [Quit: Leaving.]
avsm has joined #ocaml
avsm has quit [Read error: Connection reset by peer]
<hcarty> flux: Exactly! Calling the function probably requires more typing than doing the conversion manually... but that seems like a small price to pay.
smondet has joined #ocaml
<hcarty> I'm not sure how to get the function to type properly though.
tane has joined #ocaml
Neros has quit [Ping timeout: 260 seconds]
avsm has joined #ocaml
coldpizza72i has joined #ocaml
toolslive1 has left #ocaml []
travisbrady has joined #ocaml
sivoais has joined #ocaml
Neros has joined #ocaml
Neros has quit [Ping timeout: 260 seconds]
f[x] has quit [Quit: Leaving]
madroach has quit [Quit: leaving]
Neros has joined #ocaml
<thelema> hcarty: I can't seem to make it type properly either... the type parameters seem to keep me from being able to nail down the types...
<thelema> the best I can do is:
<thelema> # module type E1 = sig type elt type t val enum : t -> elt Enum.t val of_enum : elt Enum.t -> t end;;
<thelema> # let map_container (type a) (type b) (type c) (type d) m1 m2 f t = let module M1 = (val m1:E1 with type t = a and type elt = c) in let module M2 = (val m2:E1 with type t = b and type elt = d) in M1.enum t |> Enum.map f |> M2.of_enum;;
<thelema> val map_container : (module E1 with type elt = 'a and type t = 'b) -> (module E1 with type elt = 'c and type t = 'd) -> ('a -> 'c) -> 'b -> 'd = <fun>
tane has quit [Quit: Verlassend]
avsm has quit [Quit: Leaving.]
Neros has quit [Ping timeout: 260 seconds]
Neros has joined #ocaml
BiDOrD has quit [Read error: Connection reset by peer]
BiDOrD has joined #ocaml
coldpizza72i has quit [Quit: coldpizza72i]
sivoais has quit [Ping timeout: 252 seconds]
ftrvxmtrx has joined #ocaml
tac has joined #ocaml
sivoais has joined #ocaml
Cyanure has joined #ocaml
Neros has quit [Ping timeout: 260 seconds]
avsm has joined #ocaml
jamii has joined #ocaml
Yoric has quit [Ping timeout: 252 seconds]
fraggle_laptop has joined #ocaml
avsm has quit [Ping timeout: 252 seconds]
<hcarty> thelema: Same trouble/result here
<thelema> actually, maybe a higher-kinded type is needed, to parameterize the 't' of /'a t/
bru has joined #ocaml
hkBst has quit [Quit: Konversation terminated!]
mietek has quit [Quit: leaving]
avsm has joined #ocaml
hto_ has quit [Ping timeout: 240 seconds]
hto has joined #ocaml
Neros has joined #ocaml
trotro has joined #ocaml
rwmjones is now known as rwmjones_KVMForu
rwmjones_KVMForu is now known as rwmjonesKVMForum
coldpizza72i has joined #ocaml
<coldpizza72i> Can someone help me with this http://ideone.com/n6VwVc
<thelema> | T(a,x,b) as t ->
<Qrntz> write «T (a, x, b)» instead of «(T a x b)»
<Qrntz> I think I already mentioned that yesterday
<coldpizza72i> Qrntz: perhaps i was signed out
<Qrntz> might be
vaati has joined #ocaml
<Qrntz> you're using Haskell style which doesn't always work in OCaml
tane has joined #ocaml
<coldpizza72i> Qrntz: http://ideone.com/AdMaWo
trotro has quit [Quit: Leaving]
<Ptival> | (T (a,x,b)) t
<Ptival> what's that t there?
<Ptival> and on the previous line
<coldpizza72i> type heap = E | T of heap * Elem.t * heap
<coldpizza72i> oh uh
<coldpizza72i> I'm in class now. ill look at it later
coldpizza72i has quit [Quit: coldpizza72i]
ontologi1e has quit [Ping timeout: 260 seconds]
fraggle_laptop has quit [Remote host closed the connection]
travisbrady has quit [Quit: travisbrady]
jonathandav has quit [Read error: Connection reset by peer]
avsm has quit [Quit: Leaving.]
travisbrady has joined #ocaml
vaati has quit [Ping timeout: 252 seconds]
jamii has quit [Ping timeout: 244 seconds]
vaati has joined #ocaml
jamii has joined #ocaml
BiDOrD_ has joined #ocaml
BiDOrD has quit [Ping timeout: 255 seconds]
sepp2k has quit [Read error: Connection reset by peer]
sepp2k has joined #ocaml
mcclurmc is now known as mcclurmc_away
Anarchos has joined #ocaml
coldpizza72i has joined #ocaml
<Anarchos> hi coldpizza72i
djcoin has quit [Quit: WeeChat 0.3.9]
<coldpizza72i> hi
<Anarchos> coldpizza72i how are your red-black trees ?
<coldpizza72i> Anarchos: working
<Anarchos> :)
rwmjonesKVMForum has quit [Ping timeout: 255 seconds]
<Anarchos> coldpizza72i was it a homework ?
<coldpizza72i> kinda of
<coldpizza72i> why
<Anarchos> simple guess due to the scholar aspect :)
<coldpizza72i> what scholar aspect?
<Anarchos> coldpizza72i red black tree and nothing around :)
Tobu has quit [Remote host closed the connection]
Jeaye has joined #ocaml
rwmjonesKVMForum has joined #ocaml
Tobu has joined #ocaml
Jeaye has quit [Quit: WeeChat 0.3.9]
avsm has joined #ocaml
avsm has quit [Client Quit]
emmanuelux has joined #ocaml
avsm has joined #ocaml
avsm has quit [Client Quit]
coldpizza72i has quit [Quit: coldpizza72i]
pangoafk is now known as pango
coldpizza72i has joined #ocaml
coldpizza72i has quit [Client Quit]
vaati has quit [Ping timeout: 240 seconds]
mfp has quit [Read error: Connection reset by peer]
coldpizza72i has joined #ocaml
Yoric has joined #ocaml
madroach has joined #ocaml
mfp has joined #ocaml
BiDOrD_ has quit [Ping timeout: 260 seconds]
CoverSlide has quit [Remote host closed the connection]
CoverSlide has joined #ocaml
_andre has quit [Quit: leaving]
coldpizza72i has quit [Quit: coldpizza72i]
travisbrady has quit [Quit: travisbrady]
travisbrady has joined #ocaml
Anarchos is now known as nantralien
nantralien is now known as Anarchos
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
Yoric has quit [Quit: Instantbird 1.3a1pre -- http://www.instantbird.com]
Yoric has joined #ocaml
testcocoon has quit [Quit: Coyote finally caught me]
BiDOrD has joined #ocaml
ulfdoz has quit [Ping timeout: 260 seconds]
bru has quit [Remote host closed the connection]
testcocoon has joined #ocaml
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
rgrinberg has quit [Read error: Connection reset by peer]
tane has quit [Quit: Verlassend]
coldpizza72i has joined #ocaml
avsm has joined #ocaml
travisbrady has quit [Quit: travisbrady]
answer_42 has quit [Quit: WeeChat 0.3.9]
avsm has quit [Quit: Leaving.]
travisbrady has joined #ocaml
Yoric has quit [Ping timeout: 246 seconds]
andreypopp has joined #ocaml
<coldpizza72i> I'm not sure why I'm having problems with this http://ideone.com/AdMaWo
<thelema> | (T (a,x,b)) as t ->
<coldpizza72i> thelema: are you sure thats what i want?
<thelema> coldpizza72i: no, what do you want?
<coldpizza72i> thelema: I'm look at a haskell implementation that has merge (T a x b) t = T (merge ta a) x (merge tb b) where (ta,tb) = partition x t
<coldpizza72i> I don't think as is appropriate here
<thelema> ah, t is a second parameter?
<thelema> then let rec merge z t = match z with...
<coldpizza72i> ohh
<coldpizza72i> thelema: any idea why I'm getting these http://ideone.com/begIeY
<thelema> you're missing commas
<coldpizza72i> thelema: before y and c?… i tried that and get syntax error
<thelema> and parentheses
<coldpizza72i> o
<coldpizza72i> oops
srcerer has joined #ocaml
<coldpizza72i> niceee
coldpizza72i has quit [Quit: coldpizza72i]
andreypopp has quit [Quit: sleep]
Submarine has quit [Ping timeout: 244 seconds]
thomasga has quit [Quit: Leaving.]
avsm has joined #ocaml
Yoric has joined #ocaml
Neros_ has joined #ocaml
avsm has quit [Quit: Leaving.]
Neros has quit [Ping timeout: 265 seconds]
smondet has quit [Ping timeout: 240 seconds]
Cyanure has quit [Remote host closed the connection]
emmanuelux has quit [Remote host closed the connection]
gnuvince has quit [Ping timeout: 256 seconds]
Yoric has quit [Ping timeout: 252 seconds]
mjonsson has joined #ocaml
travisbrady has quit [Quit: travisbrady]
avsm has joined #ocaml
sgnb has quit [Read error: Connection reset by peer]
sgnb has joined #ocaml
sgnb has quit [Read error: Connection reset by peer]
mjonsson has quit [Remote host closed the connection]
tac has quit [Quit: Page closed]
mjonsson has joined #ocaml
larhat has quit [Quit: Leaving.]
sepp2k has quit [Remote host closed the connection]
gnuvince has joined #ocaml