companion_cube changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.11 release notes: https://caml.inria.fr/pub/distrib/ocaml-4.11/notes/Changes | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
mfp has quit [Ping timeout: 240 seconds]
mfp has joined #ocaml
mfp has quit [Ping timeout: 260 seconds]
mfp has joined #ocaml
mfp has quit [Ping timeout: 240 seconds]
mro_name has joined #ocaml
mro_name has quit [Ping timeout: 250 seconds]
waleee-cl has quit [Quit: Connection closed for inactivity]
ansiwen has quit [Quit: ZNC 1.7.1 - https://znc.in]
ansiwen has joined #ocaml
mro_name has joined #ocaml
mro_name has quit [Ping timeout: 276 seconds]
mro_name has joined #ocaml
cantstanya has quit [Remote host closed the connection]
cantstanya has joined #ocaml
mro_name has quit [Ping timeout: 260 seconds]
mro_name has joined #ocaml
mro_name has quit [Ping timeout: 260 seconds]
narimiran has joined #ocaml
wonko7 has joined #ocaml
gahr has joined #ocaml
xenu has quit [Quit: leaving]
Serpent7776 has joined #ocaml
xenu has joined #ocaml
mro_name has joined #ocaml
mro_name has quit [Remote host closed the connection]
mro_name has joined #ocaml
<sim642> Why am I getting this arity error even though the type equation and representation are literally the same: https://gist.github.com/sim642/3d8d2dffc604c0007d93d82d57b373e0
mro_name has quit [Remote host closed the connection]
<sim642> I want this in order to attach a custom deriver to t which must know the type of priv field to be PrivD.t, not something polymorphic, because the deriver needs to call functions from that module
<sim642> I expected the equation _and_ representation syntax to exactly allow me to do that since I cannot have a polymorphic deriver
mro_name has joined #ocaml
mro_name has quit [Client Quit]
<zozozo> sim642: why not simply use `type t = PrivD.t basecomponents_t` ? you don't really need to repeat the names of the fields
jbrown has quit [Remote host closed the connection]
<sim642> For the ppx deriver I do because otherwise I'd have to reinvent the wheel in my custom deriver that performs the type substitution to get the record type with PrivD.t for the corresponding field instead of a type variable 'a
<sim642> That might be technically possible, but seems like a really overkill thing to do
<sim642> The equation+representation syntax gives the deriver direct access to the representation with that type there, so I wouldn't have to worry about it
<sim642> a la ppx_import I guess
<sim642> But I don't understand how "PrivD.t basecomponents_t" has a different arity than the following record: they're both monomorphic
<octachron> It is the type constructor that has a different arity
<octachron> For re-export, the type constructors need to match exactly
<sim642> So the equation-representation compatibility check is actually comparing just basecomponents_t with the representation record?
<octachron> It is comparing `t` (and the rest of the definition) with `basecomponennts_t`
<sim642> But why is that a problem when I have both an equation and a representation? If I have just the equation or just the representation then there's no issue
nicoo has quit [Remote host closed the connection]
Haudegen has joined #ocaml
nicoo has joined #ocaml
<octachron> Because with a re-export, you are re-exporting an existing definition. The original and re-exported type definition needs to match exactly.
White_Flame has quit [Ping timeout: 250 seconds]
<d_bot> <EduardoRFS> sadly there is no unification between definitions
<d_bot> <EduardoRFS> why is that @octachron ? Noticed that this is rejected recently
<d_bot> <EduardoRFS>
<d_bot> <EduardoRFS> ```ocaml
<d_bot> <EduardoRFS> module X : sig
<d_bot> <EduardoRFS> type 'a t constraint 'a = int
<d_bot> <EduardoRFS> end = struct type 'a t end
<d_bot> <EduardoRFS> `````
<d_bot> <octachron> What is supposed to happen to all potential `float t` in the implementation?
White_Flame has joined #ocaml
<d_bot> <octachron> In particular, consider the case when the signature is extended with `type any = Any: 'a t -> any val v: any`
olle has joined #ocaml
Guest443 has joined #ocaml
Guest443 has left #ocaml [#ocaml]
<d_bot> <EduardoRFS> YES, you're a genius, this is the kind of answered I was hoping for. Thank you. While on the signature 'a would be an int, because internally it can be different, you would have unsoundness.
mfp has joined #ocaml
gahr has quit [Ping timeout: 260 seconds]
gahr_ has joined #ocaml
olle has quit [Ping timeout: 260 seconds]
anton_5[m] has quit [Quit: Idle for 30+ days]
nullcone has joined #ocaml
mro_name has joined #ocaml
<d_bot> <Drup> @bikal that API reminds me of something ๐Ÿ˜„
<d_bot> <Drup> Congrats for OTR, it looks pretty nice. I never took the time to write that PPX, but it's something I always wanted to do
<d_bot> <Drup> (i'm not sure about the name, because "OTR" is often used for "Off The Record", but that's a bit independent)
TheLemonMan has joined #ocaml
hackhorn has joined #ocaml
hackinghorn has quit [Ping timeout: 246 seconds]
<d_bot> <Drup> Oh, you hid the combinators to only present the PPX, hmmmm.
<d_bot> <dinosaure> yeah, it will be useful to expose the GADT behind for non-ppx users (like me)
mro_name has quit [Remote host closed the connection]
<d_bot> <Drup> @dinosaure Without the ppx, it's pretty much a subset of Furl
<d_bot> <dinosaure> but `furl` is unreleased :p
<d_bot> <Drup> that stoped you before ?
<d_bot> <dinosaure> a bit, I would like to release some of mine with `furl` but it's ok, such project are experimental
<d_bot> <Drup> How much do you use the list combinators ?
<d_bot> <Et7f3> You can give multiple -e for GNU sed (and possibly other sed)
<d_bot> <dinosaure> only for the dispatch but it's fine, we should ask @bikal to expose GADTs as `furl` does ๐Ÿ™‚
<d_bot> <Drup> the current dispatch mechanism for Furl is a bit problematic (it uses an encoding into regex, which is .... clumsy, to say the least. I think it's buggy too)
mro_name has joined #ocaml
<d_bot> <bikal> Thank you and thank you, @octachron , @dinosaure for fielding my questions regarding OCaml GADT. I am really impressed with the capability of OCaml GADT now ๐Ÿ™‚
<d_bot> <bikal> "off the record" ... haha. I didn't think of that. But yeah, I couldn't come up with a better name. I was going to go for 'r0' following dbuenzli tradition but thought not. ๐Ÿ™‚
gahr_ is now known as gahr
<d_bot> <Drup> heh, no, don't x)
<d_bot> <Drup> so, what did you use exactly for the PPX ? does it conform to the URI templates RFC ?
<d_bot> <bikal> Yep. I found combinator approach to dsl a bit cludgy and presented a bit of a learning curve than had to be so went with only ppx approach. Let's see if this works better.
<d_bot> <xvw> Yeah OTR is nice!
<d_bot> <xvw> Years ago I'd written an un-usable ppx for dealing with typed routes. ^^
<d_bot> <Drup> I think that depends a lot on the people (and ... on the chosen syntax :D). I would suggest exposing both.
<d_bot> <bikal> It uses `ocaml-uri` package underneath so I think so. But not too sure.
<d_bot> <bikal> `ppxlib` for ppx.
<d_bot> <Drup> hmm, I think it would be worth it separating the part that builds uri-templates (checked against the RFC, and all that)
<d_bot> <Drup> although URI templates are a bit weird, but ... well, it's the only standard with have
<d_bot> <bikal> Yeah. that is in my TODO list after v1.0.0.
<d_bot> <bikal> For Otr, I am using `mdx` for some testing and for writing the user guide. `mdx` and `odoc` are both very good. Thanks @jonludlam and 'gpetiot'. If there could be a workflow to integrate these two tools together to present a unified doc then it would be awesome. Right now, the user guide is separate from the odoc generated API doc.
<d_bot> <Drup> For the combinators, I would suggest to use the right associative operator (instead of the current left one).
<d_bot> <bikal> okay
<d_bot> <bikal> How does an operator become left or right associative? Is there some keyword to use when declaring such infix function?
<d_bot> <Drup> No, I mean that it should be `literal : ('a, 'b) url -> string -> ('a, 'b) url`
<d_bot> <Drup> and same for decoder
<d_bot> <Drup> it's the natural way to create URLs: you add stuff at the end
<d_bot> <bikal> ah okay
<d_bot> <bikal> yes, that makes sense in a combinator approach.
tane has joined #ocaml
olle has joined #ocaml
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
gahr has quit [Quit: leaving]
gahr has joined #ocaml
mro_name has quit [Quit: Leaving...]
kakadu has quit [Ping timeout: 268 seconds]
kakadu has joined #ocaml
bartholin has joined #ocaml
kakadu has quit [Remote host closed the connection]
kakadu has joined #ocaml
doelie has quit [Ping timeout: 276 seconds]
nullcone has quit [Quit: Connection closed for inactivity]
<d_bot> <dj charlie> cheers m8
<d_bot> <Anurag> <https://github.com/anuragsoni/routes> is released and has no ppx
<d_bot> <Drup> Oh, I forgot about that one too
<d_bot> <Et7f3> Also if it is just for human maybe you can use ? for second digit. so one transform is done
Haudegen has quit [Quit: Bin weg.]
gahr has quit [Ping timeout: 250 seconds]
gahr has joined #ocaml
gahr has quit [Remote host closed the connection]
gahr has joined #ocaml
jbrown has joined #ocaml
Tuplanolla has joined #ocaml
gahr has quit [Remote host closed the connection]
<d_bot> <undu> I'm getting a signature mismatch between the implementation and the definition of a type, and I'm not sure why, should the type be more general in the implementation?:
<d_bot> <undu> val debug :
<d_bot> <undu> (unit Lwt.t, Format.formatter, unit, unit Lwt.t) format4 ->
<d_bot> <undu> unit Lwt.t
<d_bot> <undu> val debug : ('a, Format.formatter, unit, unit Lwt.t) format4 -> 'a
<d_bot> <undu> The error states that the first is not included in the second one
<Drup> that type in an implementation is fishy, it should be more general
gahr has joined #ocaml
zolk3ri has joined #ocaml
<d_bot> <undu> might as well fix that type, I'm trying to update the logging code in shared-block-ring
gahr has quit [Remote host closed the connection]
TheLemonMan has joined #ocaml
Haudegen has joined #ocaml
gahr has joined #ocaml
<d_bot> <PatJ> Hello people! It was time I joined I guess
<d_bot> <Butanium> hi
<d_bot> <PatJ> (I'm Thomas Blanc from OCamlPro btw)
<d_bot> <undu> The problem was the variable number of parameters, I had to change the implementation to use Format.ksprintf and ended up with a signature of
<d_bot> <undu> val debug : ('a, unit, string, unit Lwt.t) format4 -> 'a
<Drup> undu: use `kasprintf`, never `ksprintf`.
gahr has quit [Ping timeout: 276 seconds]
gahr has joined #ocaml
st8less has quit [Quit: WeeChat 2.9]
<d_bot> <undu> The docs don't warn about that, could you explain?
<companion_cube> o/ @PatJ
mxns has joined #ocaml
mxns_ has quit [Ping timeout: 245 seconds]
<d_bot> <octachron> @undu : the not-a sprintf functions are not composable.
st8less has joined #ocaml
<companion_cube> (maybe ksprintf should actually be deprecatedโ€ฆ)
<Drup> it really really should, I tried :(
<companion_cube> did anyone protest?!
<Drup> Weis did last time, but it was a while, maybe he melowed
andreas303 has quit [Remote host closed the connection]
andreas303 has joined #ocaml
st8less has quit [Ping timeout: 276 seconds]
<olle> 2/3 vote :)
st8less has joined #ocaml
gahr has quit [Ping timeout: 250 seconds]
gahr has joined #ocaml
waleee-cl has joined #ocaml
<d_bot> <Et7f3> Hy (I was an intern)
boxscape has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
olle has quit [Ping timeout: 252 seconds]
boxscape has quit [Ping timeout: 268 seconds]
bartholin has quit [Quit: Leaving]
Haudegen has joined #ocaml
waleee-cl has quit [Quit: Connection closed for inactivity]
tane has quit [Quit: Leaving]
tane has joined #ocaml
White_Flame has quit [Remote host closed the connection]
White_Flame has joined #ocaml
guriya has joined #ocaml
guriya has quit [Quit: Connection closed]
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
narimiran has quit [Ping timeout: 265 seconds]
Serpent7776 has quit [Quit: leaving]
waleee-cl has joined #ocaml
hackhorn has quit [Quit: Leaving]
Tuplanolla has quit [Quit: Leaving.]
wonko7 has quit [Ping timeout: 252 seconds]
tane has quit [Quit: Leaving]