<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/