datkin has quit [Remote host closed the connection]
datkin has joined #ocaml
philtor has joined #ocaml
philtor has quit [Ping timeout: 260 seconds]
gnuvince_ has quit [Quit: ""]
Tobu has joined #ocaml
emporsteigend has joined #ocaml
<emporsteigend>
can I convert BatEnum to a list?
oriba has joined #ocaml
<thelema_>
emporsteigend: List.of_enum
<emporsteigend>
thelema_: thanks brah
<emporsteigend>
thelema_: didn't work
funktronic has left #ocaml []
oriba has quit [Quit: oriba]
emporsteigend has quit [Quit: Page closed]
twittard has joined #ocaml
Tobu has quit [Ping timeout: 260 seconds]
MaskRay has joined #ocaml
MaskRay has quit [Changing host]
MaskRay has joined #ocaml
rixed has quit [Read error: Operation timed out]
rixed has joined #ocaml
mjonsson has quit [Read error: Connection reset by peer]
TaXules has quit [Read error: Operation timed out]
TaXules has joined #ocaml
Tobu has joined #ocaml
andreypopp has joined #ocaml
andreypopp has quit [Quit: Computer has gone to sleep.]
andreypopp has joined #ocaml
ulfdoz has quit [Ping timeout: 272 seconds]
philtor has joined #ocaml
Tobu has quit [Ping timeout: 260 seconds]
Tobu has joined #ocaml
emmanuelux has quit [Ping timeout: 260 seconds]
philtor has quit [Ping timeout: 252 seconds]
andreypopp has quit [Quit: Computer has gone to sleep.]
twittard has quit [Remote host closed the connection]
twittard has joined #ocaml
twittard has quit [Remote host closed the connection]
twittard has joined #ocaml
twittard_ has joined #ocaml
twittard has quit [Ping timeout: 244 seconds]
twittard_ is now known as twittard
MaskRay has quit [Remote host closed the connection]
Tobu has quit [Ping timeout: 260 seconds]
Tobu has joined #ocaml
Tobu has quit [Changing host]
Tobu has joined #ocaml
pango is now known as pangoafk
ftrvxmtrx has quit [Quit: Leaving]
KDr2 has quit [Ping timeout: 244 seconds]
KDr2 has joined #ocaml
edwin has joined #ocaml
edwin has quit [Client Quit]
cago has joined #ocaml
ftrvxmtrx has joined #ocaml
silver has joined #ocaml
asdfhjkl has joined #ocaml
djcoin has joined #ocaml
Submarine has joined #ocaml
Cyanure has joined #ocaml
Tobu has quit [Ping timeout: 272 seconds]
ocp has joined #ocaml
asdfasfd has joined #ocaml
Tobu has joined #ocaml
yezariaely has quit [Ping timeout: 240 seconds]
KDr2 has quit [Remote host closed the connection]
avsm has quit [Quit: Leaving.]
Tobu has quit [Ping timeout: 260 seconds]
yezariaely has joined #ocaml
Tobu has joined #ocaml
snearch has joined #ocaml
avsm has joined #ocaml
yezariae1y has joined #ocaml
yezariaely has quit [Ping timeout: 245 seconds]
mort___ has joined #ocaml
snearch has quit [Quit: Verlassend]
snearch has joined #ocaml
_andre has joined #ocaml
KDr2 has joined #ocaml
cdidd has quit [Remote host closed the connection]
letrec has joined #ocaml
Kakadu has joined #ocaml
letrec has quit [Remote host closed the connection]
letrec has joined #ocaml
asdfasfd has quit [Quit: leaving]
edwin has joined #ocaml
thomasga has joined #ocaml
ocp has quit [Ping timeout: 260 seconds]
thomasga has quit [Ping timeout: 244 seconds]
Tobu has quit [Ping timeout: 272 seconds]
thomasga has joined #ocaml
MaskRay has joined #ocaml
MaskRay has quit [Changing host]
MaskRay has joined #ocaml
Tobu has joined #ocaml
gnuvince_ has joined #ocaml
yezariae1y has quit [Ping timeout: 252 seconds]
yrlnry has joined #ocaml
mort___ has quit [Ping timeout: 244 seconds]
metasyntax|work has joined #ocaml
oriba has joined #ocaml
gnuvince_ has quit [Ping timeout: 252 seconds]
MaskRay has quit [Remote host closed the connection]
gnuvince_ has joined #ocaml
emmanuelux has joined #ocaml
philtor has joined #ocaml
mort___ has joined #ocaml
philtor has quit [Read error: Operation timed out]
KDr2 has quit [Remote host closed the connection]
snearch has quit [Quit: Verlassend]
cdidd has joined #ocaml
<hcarty>
flux: ocamlbrew only supports as much concurrent compilation as OCaml itself does. Which, unfortunately, means none.
<hcarty>
flux: Although it could be possible in some cases to install some of the libraries in parallel.
<hcarty>
flux: You can, however, have multiple ocamlbew installs going at once, as long as they are pointing at different build and install directories.
Drup has joined #ocaml
Drup has left #ocaml []
andreypopp has joined #ocaml
Kakadu has quit [Ping timeout: 245 seconds]
gnuvince_ has quit [Ping timeout: 252 seconds]
Cyanure has quit [Remote host closed the connection]
Submarine has quit [Ping timeout: 244 seconds]
andreypopp has quit [Quit: Computer has gone to sleep.]
letrec has quit [Ping timeout: 245 seconds]
ftrvxmtrx has quit [Quit: Leaving]
cago has quit [Quit: Leaving.]
ulfdoz has joined #ocaml
wagle has quit [Ping timeout: 252 seconds]
gnuvince_ has joined #ocaml
twittard has quit [Remote host closed the connection]
wagle has joined #ocaml
gnuvince_ has quit [Ping timeout: 252 seconds]
djcoin has quit [Quit: WeeChat 0.3.2]
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
andreypopp has joined #ocaml
ulfdoz_ has joined #ocaml
oriba has quit [Quit: oriba]
ulfdoz has quit [Ping timeout: 245 seconds]
ulfdoz_ is now known as ulfdoz
andreypopp has quit [Ping timeout: 244 seconds]
avsm has quit [Quit: Leaving.]
thomasga has quit [Quit: Leaving.]
mcclurmc has quit [Ping timeout: 260 seconds]
iago has joined #ocaml
thomasga has joined #ocaml
twittard has joined #ocaml
thomasga has quit [Client Quit]
mort___ has quit [Quit: Leaving.]
notk0 has joined #ocaml
twittard has quit [Quit: twittard]
<notk0>
hello, for a record that is going to be modified a few times before initialized, eg type t = { foo: string; bar: string ...} let a={foo=""; bar=""}. let b= { a with foo="foo;} let c = { b with bar="bar";}
<notk0>
is there a performance issue in doing this to let's say using mutable and changing each one?
<_habnabit>
notk0, the semantic difference is more meaningful
<notk0>
_habnabit, what do you mean?
<_habnabit>
notk0, if it's mutable, you can't use the intermediate objects
<notk0>
_habnabit, yes, I understand, but I don't plan on using them usually, I don't see an instance where I would need a copy
<_habnabit>
then measure
<notk0>
I am just asking if doing { a with field=bar } is a performance issue, or not that much?
<_habnabit>
if you really think it matters
<notk0>
my question is rather, if I can't initialized the fields all at once, is that the correct way to do it? or is there a more meaningful way?
<_habnabit>
well, you have to initialize them all at once
<notk0>
_habnabit, yes, but I initialize them with meaningless data (as in null strings mostly ) then I recover each field and return a new record and discard the ancient
<_habnabit>
so... don't do that?
<_habnabit>
what's the point of making them if they contain nonsense data
Tobu has quit [Ping timeout: 272 seconds]
<notk0>
_habnabit, because I don't have all the data at once
<_habnabit>
so?
<_habnabit>
then don't make it yet
<notk0>
that would mean store all the fields in a list or something then initialize it
<_habnabit>
what does a list have anything to do with this
<notk0>
there is this association list that has fields and values, and the way this record is initialized right now is a fold left on this field with an empty (basically null data_+) on this list, and the function matches the field and returns { last with field = newvalue}
<notk0>
does this seem bad?
Tobu has joined #ocaml
andreypopp has joined #ocaml
<flux>
I've used this kind of approach: { foo = List.assoc `Foo options; .. } in a situation where I've first collected options by folding another list
<flux>
of course, that will perform even worse :)
<notk0>
flux, so what is a better way to do it?
<flux>
not sure, I haven't yet needed to do that in a situation where performance matters
mort___ has joined #ocaml
<flux>
hmm, I wonder if one could make use of GADTs in this..
pangoafk is now known as pango
twittard has joined #ocaml
mcclurmc has joined #ocaml
<mrvn>
notk0: If they are not used then why construct the records all the time. That needs to memcpy them. Just use "let foo = "" in ... let foo = "foo" in ..." and create the record at the end.
<thelema_>
hmm, if records are first class modules are represented the same, how is the subclassing problem solved for first class modules?
<mrvn>
thelema_: I guess like in objects
<mrvn>
thelema_: doesn't subclassing a module copy the record?
<thelema_>
mrvn: how's it done for objects? I know methods are by a hash lookup
<thelema_>
mrvn: ah, that would make sense.
<mrvn>
thelema_: question 1: do you mean in the type system or the runtime data?
<thelema_>
in runtime
<thelema_>
type system is easy to handle.
<mrvn>
then I think it copies them to fit
<mrvn>
try it :)
<mrvn>
I think there are only three ways to do this: use hashes, copy the record or have a static record with an extra indirection into the module.
<thelema_>
just a curiosity at the moment
Submarine has quit [Ping timeout: 246 seconds]
<mrvn>
thelema_: checked out GADT yet?
<thelema_>
not yet - I'm interested in any response to the last -devl post on GADT
<mrvn>
The lack of type inference seems bad
* ousado
is astonished that notk0's question isn't a FAQ
<thelema_>
mrvn: maybe, but my expectation is that it'll be used for libraries more than client code, and as long as clients have type inference, that's the important thing'
<thelema_>
mrvn: libraries should write out their types anyway
<mrvn>
thelema_: you can't curry GADTs
iago has quit [Quit: Leaving]
<ousado>
notk0: maybe lwt can help you with this
<thelema_>
mrvn: ? no partial application, or that all arguments have to be passed together?
<mrvn>
thelema_: let f = M.foo x in f a; f b; f c; will throw errors on b and c if the type doesn't match a. The GADT properties disapear.
<thelema_>
mrvn: That's just normal value restriction
<thelema_>
no?
<mrvn>
no. It works with let f : (type a) . ....... = M.foo x
<thelema_>
mrvn: does it work if you eta expand?
<mrvn>
thelema_: I think not.
<thelema_>
let f y = M.foo x y in f a; f b; f c?
<mrvn>
thelema_: take my post on the ML and try it
<mfp>
notk0: you'd have to measure the relative speed of the functional and imperative approaches. The latter incurs into the caml_modify overhead (assuming the fields being updated are pointers and not "immediate" types like ints or sum types with only constant constructors). The former will copy the whole structure everytime you do { ... with x = y }, so it could be slower if the record is large enough.
<mfp>
TL/DR: functional a bit more elegant but cost grows with record size
<ousado>
notk0: it would also bee good to know what you need it for - maybe there are alternatives
<mrvn>
the compiler could optimize that to the same code though.
<mrvn>
(not that ocaml do optimization)
mort___ has quit [Quit: Leaving.]
mort___ has joined #ocaml
Tobu has quit [Ping timeout: 260 seconds]
gnuvince_ has joined #ocaml
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
mort___ has quit [Ping timeout: 244 seconds]
Tobu has joined #ocaml
Xizor has joined #ocaml
bzzbzz has joined #ocaml
oriba has joined #ocaml
andreypopp has quit [Quit: Computer has gone to sleep.]
andreypopp has joined #ocaml
ftrvxmtrx has joined #ocaml
_andre has quit [Quit: leaving]
metasyntax|work has quit [Quit: The Spark of Deity ignites in our hands!]
Tobu has quit [Ping timeout: 260 seconds]
letrec has joined #ocaml
ulfdoz has quit [Ping timeout: 246 seconds]
Tobu has joined #ocaml
Tobu has quit [Changing host]
Tobu has joined #ocaml
<notk0>
can a parametrized module, take anything as an argument? let's say a string ?
<notk0>
is a parametrized module a goo idea in this case or should a class be more appropriate ?
<_habnabit>
it could take a module containing a string
<_habnabit>
module type AString: sig val s = string end
<notk0>
_habnabit, a parametrized module can only take other modules as arguments ?
<_habnabit>
AFAIK
<notk0>
I see, so it takes a signature kinda
<notk0>
or an interface
<_habnabit>
val s: string ??
<_habnabit>
something like that
<notk0>
I have a module that has functions that basically take data from a site
<notk0>
and I wanted to make a module that represents a session
<_habnabit>
that's not really what modules do
<notk0>
instead of passing it authentication data, you instantiate it once
<notk0>
so it's better to use an object in that case?
<_habnabit>
false dichotomy !!
<_habnabit>
you can make some opaque type returned from your module
<notk0>
I want to more of emulate an object
<notk0>
as in
<notk0>
Session s= Authenticate data
<notk0>
s.getSomething
<notk0>
s.getSomethingElse
<notk0>
?
<_habnabit>
let s = Session.make data in Session.get_something s
<notk0>
_habnabit, I realize you can pass it an argument, but is it a "good" idea?
<_habnabit>
"why" "not"
<notk0>
I am more used to languages like java, where you would stole the data in an object of that type
<notk0>
and call the functions directly
<_habnabit>
this is ocaml. you do that with module types/functions
<notk0>
so you suggest I don't create a parametrized module just for that?
<_habnabit>
it would be pointless
<notk0>
what if I made a module that would take as it's first argument an authentification type and make a parametrized module that would return a module with the first argument already applied ?
<notk0>
so it's easier to call the functions?
<_habnabit>
you're overcomplicating it
<notk0>
right now the authentication data is a global variable outside the module, and I have the choice of making it an argument to the functions inside the module, or do something else?
<_habnabit>
make a type that represents each of the auth types, then pass that to Session.make
<_habnabit>
let s = Session.make Session.Some_auth_type data in Session.get_something s
<notk0>
I see, so basically each function would take that as an argument got it
<_habnabit>
just like explicit self in python
<notk0>
I haven't programmed in python in a while, and was never a fan of the _self__ thing, must be a prejudice or something
<_habnabit>
there is no __self__
<notk0>
I tried to avoid classes in python
<notk0>
lol
<notk0>
anyway thanks for your help _habnabit , I am going to sleep soon, toodle
notk0 has quit [Remote host closed the connection]
letrec has quit [Ping timeout: 245 seconds]
lorilan is now known as lorilan[dodo]
oriba_ has joined #ocaml
oriba has quit [Ping timeout: 245 seconds]
<adrien>
oh, I hadn't noticed the "unused_declarations" branch
asdfhjkl has quit [Quit: Leaving]
<adrien>
unused value declarations, opens, type declarations, for index (dunno what it is), ancestor (not sure either) and constructor
<adrien>
(and this has been merged a few weeks ago)
<adrien>
and today: unused exceptions
Submarine has quit [Ping timeout: 265 seconds]
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
rjohnson has joined #ocaml
avsm has joined #ocaml
Submarine has quit [Read error: Operation timed out]
oriba_ has quit [Quit: oriba_]
edwin has quit [Remote host closed the connection]
lorilan[dodo] has quit [Ping timeout: 246 seconds]
KDr2 has joined #ocaml
lorilan[dodo] has joined #ocaml
oriba has joined #ocaml
Drup has joined #ocaml
sgnb` has joined #ocaml
sgnb has quit [Read error: Connection reset by peer]