<dmbaturin>
If we are talking about breaking backwards compatibility, I would love to see it as Lwt_log.rule type, and rule_of_string : string -> Lwt_log.rule -> Pervasives.result :)
<dmbaturin>
* rule_of_string : string -> rule and load_rule : rule -> result that is
<aantron>
the log module bothers me, if it bothers you, open an issue and state your wishes :) i am willing to break backwards compatibility, we do it gradually like this https://github.com/ocsigen/lwt/issues/293
<aantron>
(in case you need to reuse existing names)
<aantron>
in fact i am using Logs in my generator, which is otherwise a proper lwt program :p
<dmbaturin>
I definitely would like to improve the built-in log module nonetheless. I mostly like the approach, and that it's built-in.
<aantron>
fair enough. PRs are welcome. as long as gradualism is respected, new approaches/replacements/deprecations can happen immediately. we just cant remove or alter the behavior of existing names quickly
<dmbaturin>
Well, I can imagine. Given it's one of the most popular packages in opam. ;)
<aantron>
:P
<dmbaturin>
A result'y version of load_rules, and then a version that takes a rule type instead of string can be gradual enough I guess.
smondet has quit [Ping timeout: 265 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
<mfp>
Lwt_util disappared with no prior warning; it only had some list iterators (subsumed by Lwt_list), and regions (which were deemed replaceable by Lwt_pool)
<aantron>
when was that? did it cause pain?
<mfp>
now, as it turns out, Lwt_util.resize_region can't be done with Lwt_pool
<mfp>
around 2.4.1 IIRC
<aantron>
dmbaturin: well gradualism concerns only the existing load_rules. i would say make the dream API, the one with the best arguments in favor, and we add it under a different name. then implement load_rules on top of it
<aantron>
or just leave load_rules alone
<mfp>
... I've ended up copying Lwt_util's old region code to a couple places
<mfp>
e.g. using regions to control parallelism and changing it dynamically
<aantron>
hmmm. well i hope to avoid this kind of thing in the future.. meanwhile i guess i should take a look at this deleted code. another thing in the todo list...
<mfp>
so the take away moral is... if something is removed because it's subsumed by another thing, make sure that is really the case :-)
<mfp>
in this case that'd be a Lwt_pool.resize : 'a Lwt_pool.t -> int -> unit function (and thus using pools of unit to replace the former regions)
<dmbaturin>
aantron: Speaking of which, I wonder about names. (add|load|...)_rule_safe?
ryanartecona has quit [Quit: ryanartecona]
<aantron>
whatever makes sense. parse_rule maybe? just an idea
<aantron>
i am not sure which function that's referring to anyway
ryanartecona has joined #ocaml
<dmbaturin>
Right now just the -> result versions of existing load_rules
<aantron>
dmbaturin: in that case i'd say actually just choose the optional argument route and no new function, because it seems like your idea to have a separate type for a rule is better
<aantron>
for those that want to programmatically set the rules
michbad has joined #ocaml
<aantron>
so i'd rather not add 2 new APIs over time :)
<dmbaturin>
Ok, I'll start with optional exception then. Any particular exception you'd want to see it raise?
<aantron>
actually that function already exists, add_rule
<dmbaturin>
Or add a new exception for this?
<aantron>
probably Failure
<aantron>
that would be consistent with somewhat similar functions like int_of_string, and i think Invalid_argument is meant more for programming errors, rather than problems with potential user input
<dmbaturin>
Yeah, add_rule takes level which is a sum type, the rest of the rule is still string though. I'll need to look at the internal representation of rules as it is now, but I was thinking about making the pattern an ADT too, as opposed to * literal in it.
<aantron>
yeah. but i dont think * are going to be as big of a cause of problems as the semicolons and arrows. section patterns have much less structure to worry about
<aantron>
which is not to say that lwt_log shouldnt be fixed up :)
<dmbaturin>
Anyway, adding exception is a good excuse to familiarize myself with the module.
milodavis has quit [Ping timeout: 246 seconds]
<dmbaturin>
aantron: While we are at it, what do you think of adding a level_of_string counterpart of string_of_level?
<dmbaturin>
That would be handy for typical "loglevel = notice" kind of config statements.
smondet has joined #ocaml
<aantron>
im for it. id say if you need it for your code, PR it
<aantron>
mfp: if you want to add Lwt_pool.resize, PR is welcome, however glancing at the API, it seems that some provision for eagerly destroying pool items needs to be provided..?
<aantron>
Lwt_pool likes another API that needs some attention.. urgh
<mfp>
hhmmm Lwt_pool has no concept of resource termination
<aantron>
yeah
<mfp>
just half-so, implicit in check/validate
<aantron>
e.g. the limit maybe should be orthogonal to the reuse of resources. but i dont know if any actual user cares about that. it makes me uneasy though
<aantron>
yes
<mfp>
it's quite a major overhaul of the API, almost makes me think that regions (= "pools of unit") could be treated separately to avoid opening that can of worms (if the functionality is deemed worthy of being put back in Lwt)
<aantron>
its possible, but i think resize may be useful in Lwt_pool as well. the user can be promised that the destroy function is only needed/called if resize is called with a smaller number than the present limit. if very paranoid, one could use phantom types or something else to prevent the possibility of resizing unless the user opts in
<mfp>
a dispose : 'a -> Lwt.t param called when validate or check fails, or an element is discarded because the pool has become smaller?
<mfp>
*unit* Lwt.t
<aantron>
yes
<mfp>
there's the Q of whether it's run asynchronously
<aantron>
ah yes
<mfp>
doesn't feel like other Lwt_pool.use should wait for termination
michbad has quit [Remote host closed the connection]
<aantron>
i would guess that they should by default
<mfp>
hmm the create function is run synchronously, yes
<mfp>
or not? /me checks code
<mfp>
ah, other threads are not blocked by create
infinity0 has quit [Remote host closed the connection]
jmasseo has joined #ocaml
infinity0 has joined #ocaml
leah2 has quit [Ping timeout: 260 seconds]
smondet has quit [Ping timeout: 258 seconds]
FreeBirdLjj has joined #ocaml
ryanartecona has quit [Quit: ryanartecona]
FreeBirdLjj has quit [Ping timeout: 250 seconds]
AlexRussia has quit [Ping timeout: 260 seconds]
smondet has joined #ocaml
al-damiri has quit [Quit: Connection closed for inactivity]
moei has quit [Quit: Leaving...]
noddy has quit [Ping timeout: 252 seconds]
Algebr` has quit [Ping timeout: 246 seconds]
d0nn1e has quit [Ping timeout: 250 seconds]
d0nn1e has joined #ocaml
<dmbaturin>
aantron: https://github.com/ocsigen/lwt/pull/306 I've never contributed to lwt before, so if anything in that code is against the project conventions, let me know.
lambda_foo has quit [Quit: Connection closed for inactivity]
silver has quit [Quit: rakede]
leah2 has joined #ocaml
jimt_ is now known as jimt
noddy has joined #ocaml
FreeBirdLjj has joined #ocaml
pyon has quit [Quit: Goddammit, Emacs.]
unyu has joined #ocaml
moei has joined #ocaml
zv has quit [Ping timeout: 258 seconds]
ziyourenxiang has joined #ocaml
jao has quit [Remote host closed the connection]
zv has joined #ocaml
mfp has quit [Ping timeout: 250 seconds]
pierpa has quit [Ping timeout: 258 seconds]
ygrek_ has quit [Ping timeout: 265 seconds]
luzie has quit [Quit: luzie]
luzie has joined #ocaml
jao has joined #ocaml
Muzer has quit [Read error: Connection reset by peer]
jao has quit [Remote host closed the connection]
jao has joined #ocaml
desmond has joined #ocaml
<desmond>
kind peeps: how do I tell .merlin to allow [@@deriving show]; and how do I tell ocamlc or corebuild or ocamlbuild to link accordingly?
Muzer has joined #ocaml
zirman has quit [Remote host closed the connection]
<copy`>
desmond: For merlin add `PKG pkgname` for ocamlbuild add `-pkg pkgname`
<copy`>
Where pkgname is ppx_deriving.show and possibly also ppx_deriving
yegods has joined #ocaml
maattdd has joined #ocaml
yegods has quit [Client Quit]
FreeBirdLjj has quit [Remote host closed the connection]
maattdd has quit [Ping timeout: 260 seconds]
<desmond>
copy`: thanks! that worked for ocamlbuild and it compiles & runs fine. but merlin is not satisfied, marks the derived show_foo as error in editor.
<copy`>
Also add "S ." and "B _build" if you don't have them
nomicflux has joined #ocaml
nomicflux has quit [Quit: nomicflux]
noddy has quit [Ping timeout: 268 seconds]
<desmond>
hmm... tried that + many other combos to satisfy .merlin, no luck. but at least ocamlbuild is happy :-)
<desmond>
my test code is just this: type file = { name : string; perm : int } [@@deriving show];; show_file { name = "dir"; perm = 0o755 };;
<copy`>
This works for me, what error are you getting?
<desmond>
red editor squiggly under show_file, [merlin] unbound value show_file, type _ = file -> 'a
<copy`>
I'm using this .merlin: `B _build\nS .\nPKG ppx_deriving.show`
<copy`>
It looks like your .merlin isn't being loaded or merlin can't find the package
<desmond>
oh, looks like i tried too many variations in my .merlin, just reset it to yours and it works fine
<desmond>
i had a REC in there on line 1 ... too fancy for a noob like me
<desmond>
thanks for the patience and the help!
<copy`>
Sure, no problem
lopex has quit [Quit: Connection closed for inactivity]
zirman has joined #ocaml
zirman has joined #ocaml
zirman has quit [Changing host]
desmond has quit [Ping timeout: 260 seconds]
zirman has quit [Ping timeout: 260 seconds]
FreeBirdLjj has joined #ocaml
Orion3k has quit [Ping timeout: 258 seconds]
malc_ has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 245 seconds]
noddy has joined #ocaml
noddy has quit [Ping timeout: 248 seconds]
AlexRussia has joined #ocaml
rgrinberg has quit [Remote host closed the connection]
tmtwd has joined #ocaml
jao has quit [Ping timeout: 258 seconds]
ryanartecona has joined #ocaml
freusque has joined #ocaml
zirman has joined #ocaml
troydm has quit [Ping timeout: 252 seconds]
zirman has quit [Ping timeout: 264 seconds]
AlexRussia has quit [Ping timeout: 256 seconds]
tmtwd has quit [Read error: Connection reset by peer]
tmtwd has joined #ocaml
tmtwd has quit [Remote host closed the connection]
copy` has quit [Quit: Connection closed for inactivity]
freusque has quit [Ping timeout: 250 seconds]
ryanartecona has quit [Quit: ryanartecona]
freusque has joined #ocaml
trepta has quit [Ping timeout: 264 seconds]
FreeBirdLjj has joined #ocaml
freusque has quit [Ping timeout: 246 seconds]
FreeBirdLjj has quit [Ping timeout: 248 seconds]
calculemus has joined #ocaml
zirman has joined #ocaml
zirman has quit [Ping timeout: 250 seconds]
unyu has quit [Quit: brb]
lambda_foo has joined #ocaml
larhat has joined #ocaml
Simn has joined #ocaml
malc_ has quit [Remote host closed the connection]
calculemus has quit [Ping timeout: 258 seconds]
FreeBirdLjj has joined #ocaml
calculemus has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 246 seconds]
lopex has joined #ocaml
calculemus has quit [Ping timeout: 245 seconds]
calculemus has joined #ocaml
dmi3y has joined #ocaml
larhat has quit [Quit: Leaving.]
dmi3y has quit [Client Quit]
dmi3y has joined #ocaml
kakadu_ has joined #ocaml
kakadu has quit [Ping timeout: 268 seconds]
larhat has joined #ocaml
_andre has joined #ocaml
infinity0 has quit [Remote host closed the connection]
ziyourenxiang has quit [Quit: Leaving]
mfp has joined #ocaml
sepp2k has joined #ocaml
zirman has joined #ocaml
zirman has quit [Changing host]
zirman has joined #ocaml
zirman has quit [Ping timeout: 246 seconds]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 264 seconds]
larhat has quit [Quit: Leaving.]
sepp2k has quit [Ping timeout: 258 seconds]
larhat has joined #ocaml
dmi3y has quit [Quit: dmi3y]
dmi3y has joined #ocaml
dmi3y has quit [Quit: dmi3y]
sepp2k has joined #ocaml
jnavila has joined #ocaml
dmi3y has joined #ocaml
infinity0 has joined #ocaml
AlexRussia has joined #ocaml
shinnya has joined #ocaml
silver has joined #ocaml
zirman has joined #ocaml
zirman has quit [Changing host]
zirman has joined #ocaml
jnavila has quit [Ping timeout: 260 seconds]
noddy has joined #ocaml
AlexRussia has quit [Ping timeout: 260 seconds]
jbrown has quit [Quit: Leaving]
chindy has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
Hetu has joined #ocaml
dmi3y has quit [Quit: dmi3y]
dmi3y has joined #ocaml
ziyourenxiang has joined #ocaml
jnavila has joined #ocaml
freusque has joined #ocaml
<aantron>
dmbaturin: thanks, i will reply in the PR :)
sepp2k has quit [Quit: Leaving.]
zirman has quit [Remote host closed the connection]
zirman has joined #ocaml
AlexRussia has joined #ocaml
AlexRussia has quit [Ping timeout: 268 seconds]
jnavila has quit [Ping timeout: 256 seconds]
zirman has quit [Remote host closed the connection]
sepp2k has joined #ocaml
lambda_foo has quit [Quit: Connection closed for inactivity]
zirman has joined #ocaml
jnavila has joined #ocaml
dmi3y has quit [Quit: dmi3y]
rgrinberg has joined #ocaml
sh0t has quit [Ping timeout: 250 seconds]
sh0t has joined #ocaml
d0nn1e has quit [Ping timeout: 265 seconds]
d0nn1e has joined #ocaml
dmi3y has joined #ocaml
dmi3y has quit [Client Quit]
jnavila has quit [Read error: Connection reset by peer]
jnavila has joined #ocaml
dmi3y has joined #ocaml
ohama has quit [Ping timeout: 246 seconds]
ohama has joined #ocaml
nomicflux has joined #ocaml
sh0t has quit [Read error: Connection reset by peer]
sh0t has joined #ocaml
ziyourenxiang has quit [Quit: Leaving]
Hetu has quit [Quit: Verlassend]
johnelse has quit [Quit: leaving]
johnelse has joined #ocaml
freusque has quit [Ping timeout: 252 seconds]
pierpa has joined #ocaml
shinnya has quit [Ping timeout: 252 seconds]
dmi3y has quit [Quit: dmi3y]
jnavila has quit [Ping timeout: 256 seconds]
dmi3y has joined #ocaml
dmi3y has quit [Quit: dmi3y]
larhat has quit [Quit: Leaving.]
troydm has joined #ocaml
noddy has quit [Ping timeout: 264 seconds]
agarwal1975 has joined #ocaml
troydm has quit [Ping timeout: 264 seconds]
hannes has quit [Quit: Coyote finally caught me]
hannes has joined #ocaml
obadz has quit [Quit: WeeChat 1.5]
MercurialAlchemi has joined #ocaml
FreeBirdLjj has joined #ocaml
octachron has joined #ocaml
Lightsephi has quit [Quit: leaving]
jao has joined #ocaml
yomimono has joined #ocaml
sepp2k has quit [Quit: Leaving.]
freusque has joined #ocaml
Algebr` has joined #ocaml
kakadu_ has quit [Quit: Konversation terminated!]
nicoo has quit [Ping timeout: 250 seconds]
lopex has quit [Quit: Connection closed for inactivity]
nicoo has joined #ocaml
kakadu has joined #ocaml
ryanartecona has joined #ocaml
Algebr` has quit [Ping timeout: 252 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
Algebr` has joined #ocaml
smondet has quit [Ping timeout: 245 seconds]
sepp2k has joined #ocaml
johnelse has quit [Quit: leaving]
Algebr` has quit [Ping timeout: 265 seconds]
chindy has quit [Remote host closed the connection]
smondet has joined #ocaml
FreeBirdLjj has joined #ocaml
sepp2k has quit [Ping timeout: 248 seconds]
FreeBirdLjj has quit [Ping timeout: 258 seconds]
noddy has joined #ocaml
ygrek_ has joined #ocaml
wtetzner has joined #ocaml
Algebr` has joined #ocaml
zirman has quit [Remote host closed the connection]
zirman has joined #ocaml
kamog has joined #ocaml
sepp2k has joined #ocaml
milodavis has joined #ocaml
smondet has quit [Quit: ERC (IRC client for Emacs 24.5.1)]
sdml[m] has joined #ocaml
sdml[m] has left #ocaml ["User left"]
_andre has quit [Quit: leaving]
average has quit [Quit: leaving]
nullx002 has quit [Quit: EliteBNC free bnc service - http://elitebnc.org - be a part of the Elite!]
dmi3y has joined #ocaml
AlexRussia has joined #ocaml
jnavila has joined #ocaml
ryanartecona has quit [Quit: ryanartecona]
dmi3y has quit [Quit: dmi3y]
yomimono has quit [Ping timeout: 264 seconds]
al-damiri has joined #ocaml
zirman has quit [Remote host closed the connection]
nullcatxxx_ has joined #ocaml
KV has joined #ocaml
zirman has joined #ocaml
freusque has quit [Ping timeout: 246 seconds]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 250 seconds]
nullcatxxx_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
luzie has quit [Quit: luzie]
average has joined #ocaml
zirman has quit [Remote host closed the connection]
_luzie has joined #ocaml
_luzie has quit [Remote host closed the connection]
avery_ has joined #ocaml
ryanartecona has joined #ocaml
noddy has quit [Ping timeout: 256 seconds]
Algebr` has quit [Ping timeout: 268 seconds]
nullcatxxx_ has joined #ocaml
nullcatx_ has joined #ocaml
jnavila has quit [Remote host closed the connection]
Athas has joined #ocaml
<Athas>
Hi, as far as I can see in the OCaml manual, type variables are permitted to have a trailing apostrophe. So, how does OCaml disambiguate the character constant 'a' from the type variable 'a' (that is, a type variable of name "a'")?
nomicflux has quit [Quit: nomicflux]
nullcatxxx_ has quit [Ping timeout: 258 seconds]
Algebr` has joined #ocaml
<S11001001>
Athas: I'd guess that because type expressions occur in different contexts than value expressions
nomicflux has joined #ocaml
<Athas>
So it uses a context-sensitive lexer?
<mfp>
Athas: AFAICS it doesn't. $ echo "type 'a' t = 'a'" > aa.ml && ocamlc -c aa.ml File "aa.ml", line 1, characters 5-8: Error: Syntax error
<Athas>
Interesting. So I guess 'a' is always parsed as a character literal?
<mfp>
camlp4 also chokes on it type 'a' t = 'a';; Error: Parse error: [type_declaration] expected after "type" (in [str_item])
nullcatxxx_ has joined #ocaml
<Athas>
I guess that is how it has to be done.
<mfp>
seems so, the lexer is recognizing a char literal
<Drup>
(in any cases, the lexer is certainly not context sensitive, at least not in that way)
<Athas>
Thanks! This is illuminating.
Algebr` has quit [Ping timeout: 245 seconds]
<mfp>
type 'a_' t = 'a_' works you can always alpha-rename the type variables anyway, so...
nullcatx_ has quit [Ping timeout: 250 seconds]
nullcatxxx_ has quit [Ping timeout: 260 seconds]
Simn has quit [Read error: Connection reset by peer]
ryanartecona has quit [Quit: ryanartecona]
Algebr` has joined #ocaml
zirman has joined #ocaml
octachron has quit [Quit: Leaving]
KV has quit [Ping timeout: 265 seconds]
kamog has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 245 seconds]
rwmjones|hols|af is now known as rwmjones
rwmjones is now known as rwmjones|hols
zirman has quit [Remote host closed the connection]
MercurialAlchemi has quit [Ping timeout: 250 seconds]
zirman has joined #ocaml
kakadu has quit [Remote host closed the connection]
agarwal1975 has quit [Quit: agarwal1975]
KV has joined #ocaml
KV has quit [Ping timeout: 256 seconds]
zirman has quit [Remote host closed the connection]