<aantron>
yes. i just want to say another view is that i think it should still be possible to have a "lazy" stream made from a list, though im okay with "eager" being the default. i guess it will still be possible using from_direct no matter what, but i would have to think/study usages to consider such a major increase in verbosity for this use case
<seliopou>
for my part, i think my use case conveys my views
<seliopou>
but could elaborate
<seliopou>
right got it. that's something that i'm less concerned about because, though an empirical question admittedly, the uses of from_direct are probably not that abundant and the overhead not that bad.
<aantron>
oh and while im okay with eager being the default in a new library, i might not be able to change it so easily due to backwards compatibility, if it seems like people rely on this in any real way
<seliopou>
quick github search suggests that from_direct isn't used much
dsheets has joined #ocaml
<seliopou>
i think most uses of of_list are going to be people constructing cohttp bodies
<aantron>
searched dependees of lwt for of_list, looks like mostly cohttp, and mirage projects
<seliopou>
yeah
<aantron>
at least in opam
<seliopou>
lots of Lwt_stream.of_list []
<aantron>
its still a change to be careful about, due to not being encoded in the type system
<aantron>
ok lets assume we are making it eager
<aantron>
and forget of_string for now :p
<Drup>
(sidenote: I'm pretty sure lwt is used in a certain amount of codebases that are not in opam)
<aantron>
yep, thats what i meant by my earlier comment
<aantron>
i had a large such code base :)
_y has quit [Disconnected by services]
dsheets has quit [Ping timeout: 244 seconds]
<seliopou>
yeah i ran into that once or twice as well
<seliopou>
I can't imagine a list big enough to break a memory limit here though
noddy has joined #ocaml
<seliopou>
or even just add significant pressure to the os
<seliopou>
but anyways, my motives are clear: the streaming body use-case
<seliopou>
so in terms of base necessity, you can predict what i would want from that
<seliopou>
beyond that, it's minimizing hair on the interface
<aantron>
i guess you want to make it as easy as possible for your users to construct streams, for which you know if they are "closed" or not (in the sense of side effects we discussed), without making your users jump through hoops to mark them closed
seangrove has joined #ocaml
noddy has quit [Client Quit]
amnn has joined #ocaml
dsheets has joined #ocaml
<aantron>
so
amnn_ has quit [Ping timeout: 276 seconds]
<aantron>
it seems like 1) all constructors in lwt can be given a lazy interpretation (and afaik currently have such), which is one reason i favor it 2) some can also be given an eager one
<aantron>
3) for some of the ones that can be given both, the argument is that it is largely an implementation detail
<aantron>
so it shouldnt matter
<aantron>
4) but due to is_closed, the implementation detail is partially exposed
dsheets has quit [Ping timeout: 276 seconds]
dsheets has joined #ocaml
thimoteus has left #ocaml ["WeeChat 1.4"]
dsheets has quit [Ping timeout: 276 seconds]
seangrove has quit [Ping timeout: 250 seconds]
<aantron>
i guess the issue of making of_list "eager" can be made to go away completely, by adding a new internal representation option that uses the existing list spine
<aantron>
which can be done in the future
<seliopou>
still a bit uneasy about calling certain things "eager" but I follow still
<aantron>
yeah. "eager" is in quotes for this reason
<aantron>
:)
<seliopou>
ah, yeah
<seliopou>
adding a constructor for lists would require adding one for arrays
<aantron>
yes
<seliopou>
we have slight disagreements still but i believe we are on the same page now
<seliopou>
how would you like to proceed?
<aantron>
i think for the time being, can you just add, in your PR, for each of of_list, of_array, of_string, documentation that the stream created is immediately closed, i.e. the element queue is created immediately?
<seliopou>
That sounds good
<aantron>
we/i/someone can come up with a general mechanism later, and also mess with the internal representation to avoid any problems that may come up if they do come up
<aantron>
a general closing mechanism*
<seliopou>
my vote would be for a make/init sort of deal like in my gist, but i'll leave it to you or others
<seliopou>
more commits incoming
<aantron>
i will probably still think for a while about whether to merge this part of the PR, mostly it will be depend on grepping through opam package sources and thinking about what they do, and how likely private code is to be affected, and any comments other people will have
<aantron>
but it looks like it can be made to make sense in the docs without looking like an exception, and made to not break existing code
<aantron>
but might need more massaging :)
<seliopou>
how about instead I just open anothe pr for the change in close semantics?
<seliopou>
that way everything that everybody agrees with gets in, and this can be discussed further if necessary
bba has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<seliopou>
in a centralized place
<aantron>
yeah, that sounds good
amnn has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Algebr>
I have this, which doesn't typecheck, let foo = object%js val foo = Js.string "Hello" end
<Algebr>
let () = foo##.item := Js.string "Some field"; print_endline "Hello" and doesn't typecheck because .item does not exist as part of the type. How can I satisfy the typechecker about this, let it blow up at runtime if it doesn't exist/etc. I tried explicity giving the type for foo and adding a .. in <blah; ..> Js.t
<Algebr>
FreeBirdLjj has quit [Ping timeout: 276 seconds]
govg has joined #ocaml
rgrinberg has joined #ocaml
A19774941 has joined #ocaml
A1977494 has quit [Ping timeout: 260 seconds]
dsheets has joined #ocaml
dsheets has quit [Ping timeout: 260 seconds]
noethics has joined #ocaml
noethics has left #ocaml [#ocaml]
nicholasf has quit [Remote host closed the connection]
nicholasf has joined #ocaml
nicholasf has quit [Remote host closed the connection]
nicholasf has joined #ocaml
<Algebr>
why can't I declare an object type as: type foo = <field_1: unit -> string; .. >
dsheets has joined #ocaml
FreeBird_ has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
rgrinberg has quit [Ping timeout: 246 seconds]
dsheets has quit [Ping timeout: 244 seconds]
dsheets has joined #ocaml
dsheets has quit [Ping timeout: 250 seconds]
darkf has quit [Read error: Connection reset by peer]
darkf has joined #ocaml
dsheets has joined #ocaml
dsheets has quit [Ping timeout: 250 seconds]
copy` has quit [Quit: Connection closed for inactivity]
dsheets has joined #ocaml
dsheets has quit [Ping timeout: 265 seconds]
wolfcore has quit [Ping timeout: 250 seconds]
kushal has joined #ocaml
slash^ has joined #ocaml
wolfcore has joined #ocaml
dsheets has joined #ocaml
darkf_ has joined #ocaml
darkf has quit [Disconnected by services]
darkf_ is now known as darkf
dsheets has quit [Ping timeout: 260 seconds]
dsheets has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
kushal has quit [Quit: Leaving]
FreeBirdLjj has joined #ocaml
dsheets has quit [Ping timeout: 265 seconds]
tmtwd has joined #ocaml
dsheets has joined #ocaml
dsheets has quit [Ping timeout: 260 seconds]
dsheets has joined #ocaml
dsheets has quit [Ping timeout: 260 seconds]
govg has quit [Ping timeout: 276 seconds]
dsheets has joined #ocaml
dsheets has quit [Ping timeout: 276 seconds]
kushal has joined #ocaml
dsheets has joined #ocaml
yegods has quit [Remote host closed the connection]
dsheets has quit [Ping timeout: 260 seconds]
tmtwd has quit [Ping timeout: 260 seconds]
dsheets has joined #ocaml
dsheets has quit [Ping timeout: 252 seconds]
govg has joined #ocaml
dsheets has joined #ocaml
dsheets_ has joined #ocaml
dsheets has quit [Read error: Connection reset by peer]
dsheets_ has quit [Ping timeout: 276 seconds]
badon has quit [Ping timeout: 246 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
badon has joined #ocaml
AlexRussia has quit [Ping timeout: 276 seconds]
Simn has joined #ocaml
<Algebr>
I'm using first class modules and I have a type definition in one of them, I also have a function that accepts a module of a particular signature. now it seems kind of silly that every time when giving an anon module, aka makeing struct end on the fly, I have to provide the type definition explicity. I suppose an alternative is to globally define the type, but that is not elegant.
<lyxia>
do you have an example? If you write F(struct ... end), I don't think the struct ... end part needs a type annotation to fit F's argument.
<lyxia>
ah you mean the type in struct
<Algebr>
module type FOO = sig type foo val bar : foo end
<Algebr>
then: let func (module B : FOO) = ....
<Algebr>
whatever you pass to func will always have to define type foo, would be easier to only have to provide bar
<Algebr>
seems redundant.
<lyxia>
Does defining foo in another module count as "globally defined"
<lyxia>
You have to specify foo somewhere at least
nicholasf has quit [Ping timeout: 252 seconds]
kushal has quit [Quit: Leaving]
dsheets has joined #ocaml
dsheets has quit [Remote host closed the connection]
dsheets has joined #ocaml
myst|fon has joined #ocaml
tane has joined #ocaml
<def`>
Algebr: type 'bar foo = (module FOO with type foo = 'bar);;
<def`>
let foo (type bar) (conan : bar) : bar foo = (module struct type foo = bar let bar = conan end);;
<def`>
val foo : 'a -> 'a foo = <fun>
<def`>
Is that what you asked for?
<def`>
(the type foo is redundant, it is just an alias for (module FOO with type foo = 'bar))
mengu has joined #ocaml
<lupine>
I compiled a thing \o/
mengu has quit [Remote host closed the connection]
kushal has joined #ocaml
<Drup>
Algebr: Js.Unsafe .coerce ? :D
<Algebr>
def`: wow let me try that
<Drup>
Algebr: alternatively, I think there is a way to declare fields without initializing them, with virtual
larhat has joined #ocaml
dsheets has quit [Read error: Connection reset by peer]
<Algebr>
just doing the definition of type 'bar foo gives me a type error that ends in :Their kinds differ
dsheets has joined #ocaml
IntTree has quit [Quit: Leaving.]
j0sh has quit [Ping timeout: 246 seconds]
j0sh has joined #ocaml
nicholasf has joined #ocaml
dhil has joined #ocaml
yomimono has joined #ocaml
jwatzman|work has joined #ocaml
<orbitz>
Is there a way to do module Foo = Somethign.Make(Bar) in a .mli file?
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
<lyxia>
module Foo : module type of Something.Make(Bar)
dsheets has quit [Remote host closed the connection]
dsheets has joined #ocaml
<orbitz>
Thanks
Sorella has quit [Quit: Connection closed for inactivity]
<aantron>
@seliopou thanks
amnn has joined #ocaml
silver has joined #ocaml
amnn has quit [Read error: Connection reset by peer]
amnn_ has joined #ocaml
amnn_ has quit [Read error: Connection reset by peer]
amnn has joined #ocaml
myst|fon has quit [Quit: Connection closed for inactivity]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
kakadu has joined #ocaml
nicholasf has quit [Remote host closed the connection]
<def`>
Algebr: then you gave the wrong definition of FOO
nicholasf has joined #ocaml
jwatzman|work has quit [Quit: jwatzman|work]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
nicholasf has quit [Remote host closed the connection]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
dsheets has quit [Remote host closed the connection]
<Drup>
Algebr: this is a very good, but I think you should split the part that are grossly unsafe
kushal has quit [Quit: Leaving]
<Drup>
good idea*
<Algebr>
like <!>
<Drup>
It's not the only one :p
<Algebr>
heh, okay, next round up of functions I will do that
<Drup>
Also, Instead of 'a, try to use "_ Js.t" whenever possible
<Algebr>
I use them for places that take Js.Unsafe.any, not a Js.t
<Drup>
well, yes, but for example "merge : 'a -> 'a -> < .. > Js.t"
<Drup>
It's always incorrect to use the 'a with anything else than a Js.t
<Algebr>
right! ah
<Drup>
(there are others)
<Drup>
You can aim for being, hum, "minimally unsafe" :D
<Algebr>
heh, fixing fixing.
<Algebr>
I got I got most of them, but would only be 3 minutes of your time for a PR..hint
bba has joined #ocaml
yegods has joined #ocaml
boegel has quit [Remote host closed the connection]
dsheets has quit [Remote host closed the connection]
boegel has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
struktured has joined #ocaml
saruta has quit [Ping timeout: 246 seconds]
bba has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
saruta has joined #ocaml
_y has joined #ocaml
kushal has joined #ocaml
struktured has quit [Quit: Konversation terminated!]
lokien_ has joined #ocaml
kushal has quit [Read error: Connection reset by peer]
yomimono has quit [Ping timeout: 250 seconds]
dsheets has joined #ocaml
dsheets has quit [Remote host closed the connection]
dsheets has joined #ocaml
<maker>
ojai
<maker>
*ohai
<maker>
is there a way to remove that annoying .native suffix from executables built with _oasis?
<maker>
looking this up on Google give me the weirdest results
jwatzman|work has joined #ocaml
<edwin>
when you install them the suffix should get removed
<edwin>
you have the suffixes only in the build dir
dhil has quit [Ping timeout: 276 seconds]
rgrinberg has joined #ocaml
ggole has joined #ocaml
kdas_ has joined #ocaml
<maker>
oh, I see
tmtwd has joined #ocaml
kdas_ is now known as kushal
kushal has quit [Changing host]
kushal has joined #ocaml
jeffmo has joined #ocaml
jeffmo has quit [Client Quit]
erbse has joined #ocaml
yomimono has joined #ocaml
govg has quit [Quit: leaving]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
tennix has joined #ocaml
kushal has quit [Quit: Leaving]
thibm has joined #ocaml
dhil has joined #ocaml
FreeBird_ has joined #ocaml
FreeBird_ has quit [Remote host closed the connection]
FreeBirdLjj has quit [Ping timeout: 276 seconds]
dsheets has quit [Remote host closed the connection]
sh0t has joined #ocaml
kushal has joined #ocaml
dhil has quit [Ping timeout: 252 seconds]
dsheets has joined #ocaml
Yutsa has joined #ocaml
d0nn1e has quit [Ping timeout: 240 seconds]
FreeBirdLjj has joined #ocaml
d0nn1e has joined #ocaml
hcarty has joined #ocaml
<Yutsa>
Hello
tennix has quit [Ping timeout: 240 seconds]
copy` has joined #ocaml
diphuser has joined #ocaml
<reynir>
1Hello
jwatzman|work has quit [Quit: jwatzman|work]
martinkl_ has joined #ocaml
sh0t has quit [Ping timeout: 276 seconds]
amnn has quit [Read error: Connection reset by peer]
amnn has joined #ocaml
amnn has quit [Read error: Connection reset by peer]
amnn has joined #ocaml
sh0t has joined #ocaml
amnn_ has joined #ocaml
amnn has quit [Read error: Connection reset by peer]
amnn_ has quit [Read error: Connection reset by peer]
amnn has joined #ocaml
ocaml122 has joined #ocaml
<ocaml122>
Anyone have experience compiling mutually recursive modules? I cannot get access to any modules but the first one defined in this manner. Not sure why. I have an mli file too. A separate mli per module, which is duplicative, seems to help a bit, but doesn't get me all the way.
<gasche>
ocaml122: you can't have mutually recursive compilation units
<gasche>
(you can have recursive modules, but local to a single .ml/.mli file)
<gasche>
two tricks to avoid cyclic dependencies across module are parametrization and mutable hook
<ocaml122>
Does that mean I cannot refer to all the modules recursively defined outside that single ml/mli file?
<gasche>
no, this you can do
bitbckt has quit [Ping timeout: 276 seconds]
<ocaml122>
That is my problem...I can refer to the first modules but no the others.
<maker>
if there was already something like that "apply" in ocaml
<maker>
that function would have been glorious
<gasche>
gloriously complicated
<ggole>
toolslive: I know this trick, it's good fun
<ggole>
Not something I would really recommend though
<toolslive>
it's also a bit heavy on the compiler.
<maker>
oh cool
<gasche>
maker: your code is already rather difficult to understand4~
<gasche>
(sorry)
<maker>
gasche: can you elaborate why? You think that curry-ing in make_body is difficult, or the List.map?
<gasche>
let p path = s.dir.root ^ path in Printf.sprintf {|...|} (p s.dir.new_autz) (p s.dir.new_cert) ...
epilys has joined #ocaml
<maker>
why
<maker>
I mean it's okay
yegods has quit [Remote host closed the connection]
<gasche>
there, 4 lines of code instead of 10
<gasche>
and no higher-order function
<lyxia>
if you don't want to pattern match on the list, you could move the record keys in the list as well
<lyxia>
and then print using a fold
<gasche>
it's simpler, shorter, better
<maker>
yes thanks, gasche, but I was trying to learn something new
<Drup>
maker: you just did
<gasche>
you can learn arbitrarily complex things, of course, I gave you the manual reference
<Drup>
do not try to be clever for no reason :D
<epilys>
I have #require "core.top";; etc on ocamlinit, however when I run "let second = (String.split (input_line file) ~on: ' ');" with ocaml I get "Error: Unbound value String.split", any ideas?
jwatzman|work has quit [Quit: jwatzman|work]
<epilys>
also with ocamlopt
<gasche>
I was just illustrating my point that "the best choice is not to use them"
<epilys>
and utop
<gasche>
as in, if you use GADT for this problem, you may make it work but it will still be bad code
<hcarty>
Drup: Being clever for no reason can be a fun way to learn why/when to avoid more compex language features
<gasche>
on the other hand, it's good to be curious
<gasche>
there are too phases when learning a new concept: first you learn to use it, then you learn not to use it
<hcarty>
gasche: And both are important steps!
<gasche>
and I'm not having illusions that beginners of today would be more reasonable than those of yesterday
<gasche>
go write unreadable code, go
<gasche>
(but hm, "glorious" is not quite the right way to put it)
<hcarty>
epilys: I suspect you need "open Core.Std" in your code
<epilys>
hcarty, that gives me an "Error: Unbound module Core" error
<epilys>
core is installed with opam
<hcarty>
epilys: I don't usually use Core so I'm not sure - "core.top" may not be the correct package name, but that's a guess
nicholasf has quit [Remote host closed the connection]
<epilys>
hcarty, I have tried "core.std" and "core" along with "core.top" and "core.syntax" which were there ever since I installed ocaml
<epilys>
I never use core as well but I need it for a university assignment (Strings)
<hcarty>
epilys: For me, '#require "core";;' then
<hcarty>
'open Core.Std;;' works from utop
<epilys>
hcarty, Gives me the same error
jeffmo has joined #ocaml
nicholasf has joined #ocaml
octachron has joined #ocaml
Sorella has joined #ocaml
BitPuffin has joined #ocaml
Algebr has quit [Read error: Connection reset by peer]
Algebr has joined #ocaml
tane has quit [Quit: Verlassend]
erbse has left #ocaml [#ocaml]
dsheets has quit [Remote host closed the connection]
yegods has joined #ocaml
rgrinberg has quit [Ping timeout: 276 seconds]
diphuser has quit [Ping timeout: 260 seconds]
<hcarty>
epilys: If you're using opam is it possible you're in a different switch than the one which has core installed?
dhil has joined #ocaml
larhat has quit [Quit: Leaving.]
rgrinberg has joined #ocaml
<epilys>
hcarty, how do I find core's switch?
<hcarty>
epilys: If you haven't been explicitly changing switches then that's most likely not your problem
<epilys>
hcarty, I might have long ago, so I don't really remember
<hcarty>
epilys: Are you sure core is installed?
<epilys>
`opam install core` says it is installed
<reynir>
does »eval $(opam config env)« fix it?
<epilys>
no, it was one of the first thing I tried
<reynir>
Ok :-)
<hcarty>
Does 'ocamlfind list | grep core' show you anything?
<epilys>
It does, core, core.top
<epilys>
and core.syntax
<hcarty>
epilys: Maybe it's an old version of core without that function? I'm down to almost blind guessing at this point
<hcarty>
epilys: You can try '#show String;;' in utop
<epilys>
hcarty, whoah you seem to be correct, no split there
<epilys>
version 112.24.00
ocaml657 has joined #ocaml
<hcarty>
Ignoring backwards compatibility with pre-4.02.3 OCaml, does using (** *) comments for documentation vs attributes matter?