<thelema_>
I agree the syntax (and documentation) are not obvious; in fact, [Y with Z := Z] removes Z from the module type of Y.
<thelema_>
So this is actually like (Y - Z), but to make this work in general, you have to give a specific implementation to fill in any blanks with.
<thelema_>
thus (Y : module type of Y with Z := Z)
<Drakken>
thelema_ unfortunately the field labels of the record type I need to use aren't exported.
<Drakken>
also what seems strange to me is that the "with" clause is part of the signature, even though it specifies the implementation. ???
<thelema_>
I don't understand your problem with field labels not being exported
<thelema_>
The with clause is definitely part of the signature, as what's happening is that you're doing `include (Y:typeof Y - Z)
<thelema_>
in order to subtract from a module type, you have to give concrete values for anything abstract, for instance, if you started with the module type `sig type t val x : t end`
<thelema_>
you can't just remove type t from the signature
<thelema_>
yes, you have to specify the full type of t in the signature for X, otherwise it's not available to modules that include X
<Drakken>
But it's not specified in X, so I'll have to copy & paste the source for the whole module.
<thelema_>
you're trying to specify it in Y?
<Drakken>
I mean "they" (field labels) aren't specified.
<Drakken>
exorted
<Drakken>
exPorted
<Drakken>
I need to rewrite a function that creates a record of the type, but the field labels aren't in the signature.
<thelema_>
If you don't have access to the implementation, the implementation could be anything.
<thelema_>
The other option is to break the type system (Obj.magic), but you didn't hear that from me.
<Drakken>
I'll just steal the source code :)
<Drakken>
Incidentally the manual says the way to fully export a record type is [type foo = <typexpr> <type-representation>], where type-represenation ::= { list of field declarations }
<thelema_>
Drakken: type foo = Bar.foo = {a:string}
<thelema_>
or am I thinking something else...
<thelema_>
nope, this is it. If you read the following text, there's 4 cases listed in bold: Abstract type, type abbreviation, new type, re-exported type
KDr2 has joined #ocaml
<thelema_>
these cases match the 4 combinations of presence/absence of typexpr and type-representation
oriba has quit [Quit: oriba]
Submarine has quit [Ping timeout: 272 seconds]
<Drakken>
Oh, _duh_. thelema_ thanks. I totally ignored (all) the square brackets _and_ the (=) sign in type-representation. Now it makes sense :/
iago has quit [Quit: Leaving]
Tobu has quit [Ping timeout: 272 seconds]
thelema_ is now known as thelema
Tobu has joined #ocaml
andreypopp has quit [Quit: Quit]
emmanuelux has quit [Remote host closed the connection]
twittard has quit [Ping timeout: 272 seconds]
Tobu has quit [Ping timeout: 272 seconds]
twittard has joined #ocaml
rwmjones has quit [Read error: Operation timed out]
rwmjones has joined #ocaml
Tobu has joined #ocaml
mjonsson has quit [Remote host closed the connection]
<thelema>
hcarty: perl doesn't need printf because of its string interpolation, but here's the interface I'm providing:
<thelema>
module Make_lev(L:Level_sig)(S:Config) : sig val level : L.t ref val log : L.t -> string -> unit val logf : L.t -> ('a, S.t output, unit) Pervasives.format -> 'a
<thelema>
end
Tobu has quit [Ping timeout: 272 seconds]
philtor has joined #ocaml
letrec has quit [Ping timeout: 260 seconds]
philtor has quit [Ping timeout: 252 seconds]
twittard has quit [Quit: twittard]
Tobu has joined #ocaml
mrvn has joined #ocaml
philtor has joined #ocaml
philtor has quit [Ping timeout: 246 seconds]
MaskRay has joined #ocaml
MaskRay has quit [Changing host]
MaskRay has joined #ocaml
hcarty has quit [Ping timeout: 252 seconds]
andreypopp has joined #ocaml
ulfdoz has joined #ocaml
philtor has joined #ocaml
KDr2 has quit [Read error: Connection reset by peer]
KDr2 has joined #ocaml
cdidd has quit [Ping timeout: 245 seconds]
hcarty has joined #ocaml
twittard has joined #ocaml
letrec has joined #ocaml
philtor has quit [Ping timeout: 260 seconds]
ulfdoz has quit [Ping timeout: 272 seconds]
fantasticsid has joined #ocaml
fantasticsid has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
albacker has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
<adrien>
hi
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
andreypopp has quit [Quit: Computer has gone to sleep.]
pango is now known as pangoafk
ivan\ has quit [Ping timeout: 265 seconds]
ivan\ has joined #ocaml
<Drakken>
hi adrien
Tobu has quit [Ping timeout: 260 seconds]
Submarine has quit [Ping timeout: 246 seconds]
albacker has quit [Quit: Leaving]
Cyanure has joined #ocaml
Tobu has joined #ocaml
emmanuelux has joined #ocaml
ftrvxmtrx has joined #ocaml
letrec has quit [Ping timeout: 244 seconds]
MaskRay has quit [Quit: leaving]
Cyanure has quit [Remote host closed the connection]
edwin has joined #ocaml
MaskRay has joined #ocaml
MaskRay has quit [Changing host]
MaskRay has joined #ocaml
thomasga has joined #ocaml
djcoin has joined #ocaml
cago has joined #ocaml
xenocons has joined #ocaml
fantasticsid has joined #ocaml
Tobu has quit [Ping timeout: 272 seconds]
MaskRay has quit [Quit: leaving]
edwin has quit [Ping timeout: 260 seconds]
Cyanure has joined #ocaml
edwin has joined #ocaml
Tobu has joined #ocaml
KDr2 has quit [Remote host closed the connection]
Tobu has quit [Ping timeout: 272 seconds]
Tobu has joined #ocaml
asdfhjkl has joined #ocaml
_andre has joined #ocaml
letrec has joined #ocaml
gildor has joined #ocaml
lamawithonel has quit [Remote host closed the connection]
Snark has joined #ocaml
ftrvxmtrx has quit [Ping timeout: 245 seconds]
ulfdoz has joined #ocaml
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
iago has joined #ocaml
KDr2 has joined #ocaml
avsm has joined #ocaml
iago has quit [Ping timeout: 252 seconds]
ftrvxmtrx has joined #ocaml
<hcarty>
thelema: printf'ing the code sounds like a good idea
<thelema>
hcarty: it's much more convenient for my common use
<thelema>
although tricky to get the types right
EmmanuelOga has joined #ocaml
gnuvince_ has quit [Remote host closed the connection]
<thelema>
<thelema>
hcarty: does the new interface added to BatLog satisfy your needs?
fantasticsid has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
f[x] has quit [Remote host closed the connection]
asdfhjkl has quit [Read error: Connection reset by peer]
elehack has joined #ocaml
elehack has left #ocaml []
f[x] has joined #ocaml
iago has joined #ocaml
Tobu has quit [Ping timeout: 272 seconds]
Tobu has joined #ocaml
avsm has quit [Quit: Leaving.]
philtor has joined #ocaml
philtor has quit [Ping timeout: 252 seconds]
smondet has joined #ocaml
EmmanuelOga has quit [Ping timeout: 272 seconds]
andreypopp has joined #ocaml
djcoin has quit [Quit: WeeChat 0.3.2]
djcoin has joined #ocaml
andreypopp has quit [Quit: Computer has gone to sleep.]
EmmanuelOga has joined #ocaml
KDr2 has quit [Remote host closed the connection]
rossberg_ has quit [Ping timeout: 260 seconds]
rossberg_ has joined #ocaml
Tobu has quit [Ping timeout: 260 seconds]
cyphase has quit [Read error: Connection reset by peer]
Submarine has quit [Ping timeout: 272 seconds]
andreypopp has joined #ocaml
pangoafk has quit [Ping timeout: 260 seconds]
<hcarty>
thelema: I'm not sure if I would switch to BatLog from my implementation or not.
<thelema>
Because of the date format?
<thelema>
or the on-the-fly config of prefix?
<thelema>
those are the two differences I see.
<hcarty>
How would you disable BatLog.Easy?
<hcarty>
I would like to use SomeLog.Easy.log everywhere in a program, enabling/disabling it from a some single point.
<thelema>
BatLog.Easy.level := `always
<hcarty>
The two differences you pointed out are bothersome but minor. I think I'm getting a better picture of how to use BatLog.
avsm has joined #ocaml
andreypopp has quit [Quit: Computer has gone to sleep.]
<thelema>
I think the date format can be customized. I took my date format (and a lot of ideas on batLog) from the Golang stdlib
Tobu has joined #ocaml
cyphase has joined #ocaml
pangoafk has joined #ocaml
EmmanuelOga has quit [Read error: Connection reset by peer]
andreypopp has joined #ocaml
<hcarty>
I'd use CalendarLib for any printing/parsing of date formats, so that's not the end of the world. The current BatLog date format just doesn't seem as readily human-parsable as ISO 8601 (or whatever YYYY-MM-DD is...)
<thelema>
granted, YYYY/MMDD is a bit odd.
<adrien>
plize, no :P
<adrien>
2012/1220
<thelema>
adrien: dec 20, 2012 -- what's the problem?
<hcarty>
adrien: 2012/2102! Not a real date, but it is a palindrome (dateindrome?)
<adrien>
I meant: no YYYY/MMDD; but generally I'd prefer YYYY/MM/DD or DD/MM/YYYY
<hcarty>
thelema: 2012/1220 could as easily be 2012/12:20
<adrien>
20 déc 2012
<adrien>
french ^ (or something like that)
<adrien>
hcarty: I wanted to write it too but didn't since it wasn't a proper date (yet!)
<hcarty>
thelema: Or 20:12/12:20 for that matter
<hcarty>
In which case 20:12/21:02 is valid
<hcarty>
thelema: Is it possible to, at run time, change the output for a logger generated with Make_lev?
<hcarty>
thelema: That is something that I would like to have, and part of why my implementation has an init function
<thelema>
you re-init the logger?
<hcarty>
Make_lev/Easy doesn't have a way to re-init
<thelema>
at the moment, no - once the logger module is created, it can't be changed. That said, as long as it's created early enough in the execution of the program, it doesn't have to be re-initted
<hcarty>
Or are you asking if that's what I'm looking to do?
<thelema>
yes, I want to know why you want to re-init the logger
andreypopp has quit [Quit: Computer has gone to sleep.]
<thelema>
I assume you want to configure it based on ... some config file
<hcarty>
Sorry - not re-init, but init the first time with some runtime-determined output
<thelema>
if you can arrange your program so that the functor is evaluated after that config file is read
<hcarty>
thelema: Yes, or command line argument or however else it would be customized.
<thelema>
and then any code that depends on it would have to go after it in the link order
<hcarty>
I can, but that requires functorizing everything else over that module.
<hcarty>
Or yes, being very careful with link order
<thelema>
I agree that this isn't the most convenient... hmm
<thelema>
I assume you want to change the output channel?
<hcarty>
Yes
<hcarty>
Similar to your test case
<hcarty>
The BatLog test that is
<thelema>
yes
<thelema>
I'd have to give accessor functions get/set_output for that...
<thelema>
and my implementation wouldn't be anywhere near as pretty. :)
<hcarty>
:-)
<hcarty>
Yes, mine is very pretty for my intended use, and yours is very pretty for yours
<thelema>
actually, the right way to do level is to use if statements at the point of logging, as this cuts out the computation of arguments
<thelema>
but that's best done with syntax extensions, eww.
<hcarty>
thelema: Agreed
<hcarty>
That's a large part of why I didn't go with Bolt
<hcarty>
I have a few syntax extensions I still use in certain places but I've been trying to avoid them more and more.
<hcarty>
Which is kind of unfortunate given all of the cool things they can do.
EmmanuelOga has joined #ocaml
andreypopp has joined #ocaml
<thelema>
I am/will changing Easy so its output is configurable with a function call
andreypopp has quit [Client Quit]
<thelema>
have to get other things done now, so this change will probably land later today
andreypopp has joined #ocaml
cago has quit [Quit: Leaving.]
Cyanure has quit [Remote host closed the connection]
Tobu has quit [Ping timeout: 260 seconds]
djcoin has quit [Quit: WeeChat 0.3.2]
thomasga has quit [Quit: Leaving.]
deafmacro has joined #ocaml
andreypopp has quit [Quit: Computer has gone to sleep.]
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
letrec has quit [Ping timeout: 240 seconds]
thomasga has joined #ocaml
deafmacro has left #ocaml []
Cyanure has joined #ocaml
Tobu has joined #ocaml
Tobu has quit [Changing host]
Tobu has joined #ocaml
sander has joined #ocaml
ulfdoz_ has joined #ocaml
ulfdoz has quit [Ping timeout: 260 seconds]
ulfdoz_ is now known as ulfdoz
andreypopp has joined #ocaml
iago has quit [Read error: Operation timed out]
twittard has quit [Quit: twittard]
oriba has joined #ocaml
twittard has joined #ocaml
Tobu has quit [Ping timeout: 272 seconds]
Xizor has joined #ocaml
smondet has quit [Remote host closed the connection]
Tobu has joined #ocaml
pangoafk is now known as pango
thomasga1 has joined #ocaml
thomasga has quit [Ping timeout: 244 seconds]
iago has joined #ocaml
Tobu has quit [Ping timeout: 272 seconds]
Tobu has joined #ocaml
NihilistDandy has joined #ocaml
smondet has joined #ocaml
Tobu has quit [Ping timeout: 272 seconds]
NihilistDandy has quit []
Tobu has joined #ocaml
thomasga1 has quit [Ping timeout: 244 seconds]
thomasga has joined #ocaml
thomasga has quit [Client Quit]
ftrvxmtrx_ has joined #ocaml
ftrvxmtrx has quit [Remote host closed the connection]
ftrvxmtrx_ has quit [Client Quit]
ftrvxmtrx has joined #ocaml
Kikaxa has joined #ocaml
Tobu has quit [Ping timeout: 272 seconds]
Kikaxa has left #ocaml []
lopex has quit [Excess Flood]
lopex has joined #ocaml
lopex has quit [Excess Flood]
_andre has quit [Quit: leaving]
lopex has joined #ocaml
lopex has quit [Excess Flood]
djcoin has joined #ocaml
r0man has joined #ocaml
lopex has joined #ocaml
EmmanuelOga has quit [Quit: WeeChat 0.3.7-dev]
r0man has quit [Quit: Page closed]
ulfdoz has quit [Ping timeout: 248 seconds]
lopex has quit [Write error: Broken pipe]
bobry has quit [Remote host closed the connection]
joewilliams has quit [Remote host closed the connection]
gmcabrita has quit [Remote host closed the connection]
joewilliams has joined #ocaml
avsm has quit [Read error: Connection reset by peer]
joewilliams has quit [Remote host closed the connection]
joewilliams has joined #ocaml
Tobu has joined #ocaml
Xizor has quit []
gmcabrita_ has joined #ocaml
gmcabrita_ is now known as gmcabrita
yrlnry has quit [Ping timeout: 260 seconds]
Snark has quit [Ping timeout: 245 seconds]
ftrvxmtrx_ has joined #ocaml
ftrvxmtrx has quit [Ping timeout: 252 seconds]
bobry has joined #ocaml
lopex has joined #ocaml
smondet has quit [Remote host closed the connection]
yrlnry has joined #ocaml
avsm has joined #ocaml
Cyanure has quit [Remote host closed the connection]
edwin has quit [Remote host closed the connection]