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
theblatte has quit [Ping timeout: 240 seconds]
amiloradovsky has quit [Ping timeout: 260 seconds]
wingsorc has quit [Quit: Leaving]
borne has quit [Ping timeout: 260 seconds]
amiloradovsky has joined #ocaml
amiloradovsky has quit [Ping timeout: 260 seconds]
xenu_ has joined #ocaml
<dmbaturin> companion_cube: Who's maintaining the calendar lib, if anyone does? :)
xenu has quit [Read error: Connection reset by peer]
mxns has joined #ocaml
<d_bot> <Anurag> I don't think it has an active maintainer at the moment.
<dmbaturin> Anurag: Looks like the only alternative is odate which doesn't build with >=4.06, so I need to work on a fix either way.
<d_bot> <Anurag> I think if you have a PR there are still people who have commit rights who might be able to merge (there is codeowners file)
<dmbaturin> Well, you and c-cube are in the repo owners. I have no doubt there are people who can merge a patch. What I've been wondering about if there's anyone else to work on a fix.
<d_bot> <Anurag> not sure if you've noticed this, you'd need to branch off of the `3.x` branch instead of the default `master` (i found this wasn't very clear when i tried to submit a patch last year).
<d_bot> <Anurag> Huh, i'm a codeowner?
<d_bot> <Anurag> *repo owner?
<dmbaturin> Anurag: Ah, sorry, only a contributor.
<d_bot> <Anurag> I was assigned that when i tried to propose a fix for a build issue. I'd need to spend more time with datetime style libraries to feel comfortable working on more invasive changes.
steenuil_ has quit [Read error: Connection reset by peer]
<companion_cube> I also tried to fix iso8601 but it's a pain
<companion_cube> And I'm not sure how to assess if changes are correct :((
<dmbaturin> Hhm. odate's API is unwieldy, but the parser appears to work.
<dmbaturin> https://github.com/hhugo/odate Incompatible with 4.07+ for spurious reasons in its current state.
<dmbaturin> utop # ODate.Unix.From.string (ODate.Unix.From.generate_parser "%F %H:%M" |> Option.get) "2020-11-17 06:05" |> ODate.Unix.Printer.to_iso ;;
<dmbaturin> - : string = "2020-11-17T06:05:00Z"
Jeanne-Kamikaze has joined #ocaml
<companion_cube> Is this more modern than calendar?
theblatte has joined #ocaml
oni-on-ion has joined #ocaml
mfp has quit [Ping timeout: 256 seconds]
xenu_ is now known as xenu
vicfred has quit [Quit: Leaving]
robmyers has quit [Ping timeout: 272 seconds]
robmyers has joined #ocaml
clockish_ has joined #ocaml
clockish has quit [Ping timeout: 272 seconds]
clockish_ is now known as clockish
ygrek has joined #ocaml
waleee-cl has quit [Ping timeout: 272 seconds]
waleee-cl has joined #ocaml
ygrek has quit [Ping timeout: 256 seconds]
ygrek has joined #ocaml
mrallen1 has quit [Ping timeout: 272 seconds]
mrallen1 has joined #ocaml
ygrek has quit [Client Quit]
ygrek has joined #ocaml
ygrek has quit [Client Quit]
ygrek has joined #ocaml
vicfred has joined #ocaml
raver has quit [Read error: Connection reset by peer]
zebrag has quit [Quit: Konversation terminated!]
ggole has joined #ocaml
zebrag has joined #ocaml
zebrag has quit [Client Quit]
ansiwen has quit [Quit: ZNC 1.7.1 - https://znc.in]
mxns has quit [Ping timeout: 246 seconds]
mxns has joined #ocaml
ansiwen has joined #ocaml
mxns has quit [Ping timeout: 256 seconds]
ygrek has quit [Remote host closed the connection]
berberman has quit [Quit: ZNC 1.7.5 - https://znc.in]
berberman has joined #ocaml
amiloradovsky has joined #ocaml
jmct has quit [Ping timeout: 272 seconds]
jmct has joined #ocaml
amiloradovsky has quit [Remote host closed the connection]
amiloradovsky has joined #ocaml
Jeanne-Kamikaze has quit [Ping timeout: 256 seconds]
catern has quit [Ping timeout: 256 seconds]
catern has joined #ocaml
gaussian has quit [Quit: Connection closed]
reynir has quit [Remote host closed the connection]
reynir has joined #ocaml
waleee-cl has quit [Quit: Connection closed for inactivity]
mxns has joined #ocaml
shawnw has joined #ocaml
mxns has quit [Ping timeout: 260 seconds]
decentpenguin has quit [Quit: ZNC crashed or something]
decentpenguin has joined #ocaml
amiloradovsky has quit [Ping timeout: 260 seconds]
Haudegen has joined #ocaml
nullcone has quit [Quit: Connection closed for inactivity]
narimiran has joined #ocaml
Serpent7776 has joined #ocaml
raver has joined #ocaml
jgjl has quit [Ping timeout: 264 seconds]
jgjl has joined #ocaml
Serpent7776 has quit [Read error: Connection reset by peer]
Serpent7776 has joined #ocaml
borne has joined #ocaml
hnOsmium0001 has quit [Quit: Connection closed for inactivity]
steenuil has joined #ocaml
Tuplanolla has joined #ocaml
<d_bot> <joris> Hi, is there a way to make this work ?
<d_bot> <joris> ```
<d_bot> <joris> type ('a, 'b) test = A : (int, int) test | B : ('a, int) test
<d_bot> <joris> type ('a, 'b) test2 = C : ('a, int) test2 | D : (float, 'b) test2
<d_bot> <joris>
<d_bot> <joris> type ('a, 'b) record = { inner : ('a, 'b) test }
<d_bot> <joris>
<d_bot> <joris> type wrapped = Wrapped : ('a, 'b) test2 * ('a, 'b) record -> wrapped
<d_bot> <joris>
<d_bot> <joris> let test (type a b) (record : (a, b) record) wit =
<d_bot> <joris> match record.inner, wit with
<d_bot> <joris> | A, 42 ->
<d_bot> <joris> Wrapped (C, record)
<d_bot> <joris> | B, 0 ->
<d_bot> <joris> Wrapped (D, record)
<d_bot> <joris> | _ -> failwith "error"
<d_bot> <joris> ```
<d_bot> <joris> my understanding is that since b is locally abstract it is not unified to int as an existential inside the second match case so it does not work
<d_bot> <joris> the workaround is to construct a fresh record inside each branch i guess
jgjl has quit [Ping timeout: 256 seconds]
jgjl has joined #ocaml
<d_bot> <craigfe> Or use a pattern alias:
<d_bot> <craigfe> ```ocaml
<d_bot> <craigfe> let test : type a b. (a, b) record -> _ = fun record wit ->
<d_bot> <craigfe> match record, wit with
<d_bot> <craigfe> | { inner = A } as record, 42 -> Wrapped (C, record)
<d_bot> <craigfe> | { inner = B } as record, 0 -> Wrapped (D, record)
<d_bot> <craigfe> | _ -> failwith "error";;
<d_bot> <craigfe> ```
<d_bot> <joris> oh, right, i tried to alias the inner type, but didn't think about descruturing
<d_bot> <joris> thanks
berberman has quit [Quit: ZNC 1.7.5 - https://znc.in]
berberman has joined #ocaml
mxns has joined #ocaml
mxns has quit [Ping timeout: 256 seconds]
shawnw has quit [Remote host closed the connection]
shawnw has joined #ocaml
jbrown has joined #ocaml
shawnw has quit [Remote host closed the connection]
shawnw has joined #ocaml
bartholin has joined #ocaml
<d_bot> <Styxs> hello hello
<d_bot> <Styxs> i had some code such as
<d_bot> <Styxs> ```ocaml
<d_bot> <Styxs> while it < ret do
<d_bot> <Styxs> (* ... *)
<d_bot> <Styxs> ```
<d_bot> <Styxs> where both `it` and `ret` are `int ref`
<d_bot> <Styxs> this compiled perfectly fine on ocamlc 4.9.x and so i assumed it automatically unwraps the refs
<d_bot> <Styxs> however a colleague tried to compile the same code on 4.11.x and the compiler complained
<d_bot> <Styxs> any ideas why?
<Armael> what did the compiler complain about, and are you using Base or an other library that redefines < to only work on ints?
<d_bot> <Styxs> im using Core
<d_bot> <Styxs> ```
<d_bot> <Styxs> File "main.ml", line 36, characters 14-16:
<d_bot> <Styxs> 36 | while it < ret do
<d_bot> <Styxs> ^^
<d_bot> <Styxs> Error: This expression has type int ref
<d_bot> <Styxs> but an expression was expected of type int
<d_bot> <Styxs> ```
<d_bot> <ggole> If you `open Core` I believe that many of the polymorphic operations are shadowed
<Armael> yes
<d_bot> <octachron> All of them are shadowed
<d_bot> <Styxs> but Core was used on both compilers
<d_bot> <octachron> You probably also updated the version of Core
<d_bot> <Styxs> i did
<d_bot> <Styxs> but that would mean they introduce breaking changes?
<def> Yes, Core is full of breaking changes.
<d_bot> <Styxs> thinking of it, i also wasn't able to use `(=)` to compare strings anymore and had to resort to `String.equal`
<d_bot> <ggole> It's not much of a breaking change if you use `open` and that shadows something
<d_bot> <ggole> Otherwise adding any binding to anything would be a breaking change
<d_bot> <ggole> This is exacerbated by `Core` being designed to be used with `open`, I suppose
<d_bot> <octachron> Shadowing polymorphic comparison operators was intended as a breaking change.
<d_bot> <Styxs> well that's pretty annoying tbh
<d_bot> <Styxs> is Core not what most people use?
<theblatte> poly compare is evil so it's so much annoying as something everyone should do anyway :p
<d_bot> <Styxs> how is it evil?
<theblatte> it's slow and will crash your program if there's an opaque type somewhere
<d_bot> <Styxs> but the alternative makes your code quite verbose
<d_bot> <Styxs> as i said above i had to replace `(=)` with `String.equal`
<Armael> it will give you the wrong result if the notion of equality on some data is not (=)
<Armael> for example, if you have sets of strings
<Armael> `module M = Set.Make(String)`
<Armael> then the correct equality on `M.t` is `M.equal`, using `(=)` is a bug
<theblatte> yes it's more verbose to write String.equal, that's the price of renouncing the dark side
<theblatte> until modular implicits :/
mfp has joined #ocaml
FreeBirdLjj has joined #ocaml
<vsiles> you can always use `String.(=)` :D
<vsiles> (sorry, but I don't find it more verbose)
<d_bot> <Styxs> > then the correct equality on M.t is M.equal, using (=) is a bug
<d_bot> <Styxs> how are those different?
<Armael> polymorphic (=) looks at the raw data in memory
<Armael> but internally, sets are represented as trees, and you can have several trees that represent the same set
<Armael> so you'll have instances where M.equal says true, and (=) says false
FreeBirdLjj has quit [Ping timeout: 246 seconds]
<companion_cube> As to what people use, it depends 🤷‍♀️
<d_bot> <Styxs> ah i see
<d_bot> <Styxs> thanks
Haudegen has quit [Quit: Bin weg.]
FreeBirdLjj has joined #ocaml
ygrek has joined #ocaml
vicfred has quit [Quit: Leaving]
Haudegen has joined #ocaml
mxns has joined #ocaml
mxns_ has joined #ocaml
mxns has quit [Ping timeout: 264 seconds]
ygrek has quit [Remote host closed the connection]
raver has quit [Remote host closed the connection]
ygrek has joined #ocaml
mxns_ has quit [Ping timeout: 272 seconds]
vicfred has joined #ocaml
vicfred has quit [Max SendQ exceeded]
vicfred has joined #ocaml
vicfred has quit [Max SendQ exceeded]
vicfred has joined #ocaml
mxns has joined #ocaml
<d_bot> <joris> BTW is comparing ref with polymorphic compare a defined behavior ? (curious from the backlog)
<Armael> I think so
<d_bot> <joris> Hm yeah probably. I was thinking about unboxing but I guess the compiler will always call compare with both boxed or both unboxed
<d_bot> <craigfe> The behaviour is documented, albeit somewhat vaguely: https://docs.mirage.io/ocaml/Stdlib/index.html#val-(=)
<d_bot> <craigfe> "Mutable structures (e.g. references and arrays) are equal if and only if their contents are structurally equal, even if the two mutable objects are not the same physical object"
<d_bot> <craigfe> (I take it back: it's not really vague at all.)
<d_bot> <Drup> it holds up to its name: it's structural
<d_bot> <joris> No right I was stupid. Especially since compare is a c primitive and it would always be called boxed. It would be totally stupid to unbox blindly without tracking kind in opaque function
<d_bot> <joris> I'm too scared of polymorphic compare so I invent problems
waleee-cl has joined #ocaml
<companion_cube> we all are, joris, we all are
zebrag has joined #ocaml
mxns has quit [Ping timeout: 260 seconds]
raver has joined #ocaml
vicfred has quit [Quit: Leaving]
vicfred has joined #ocaml
aaaaaa has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
borne has quit [Quit: WeeChat 2.9]
shawnw has quit [Ping timeout: 260 seconds]
hnOsmium0001 has joined #ocaml
tane has joined #ocaml
mxns has joined #ocaml
TheLemonMan has joined #ocaml
amiloradovsky has joined #ocaml
ggole has quit [Quit: Leaving]
bartholin has quit [Quit: Leaving]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Read error: Connection reset by peer]
FreeBirdLjj has joined #ocaml
reynir has quit [Ping timeout: 240 seconds]
FreeBirdLjj has quit [Read error: Connection reset by peer]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Read error: Connection reset by peer]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
Haudegen has joined #ocaml
reynir has joined #ocaml
Anarchos has joined #ocaml
shmibs has quit [Quit: leaving =o]
shmibs has joined #ocaml
mxns has quit [Ping timeout: 264 seconds]
shmibs has quit [Client Quit]
shmibs has joined #ocaml
mxns has joined #ocaml
berberman has quit [Ping timeout: 272 seconds]
berberman_ has joined #ocaml
mxns has quit [Ping timeout: 256 seconds]
Anarchos has quit [Quit: Vision[0.10.3]: i've been blurred!]
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
Anarchos has joined #ocaml
Anarchos has quit [Client Quit]
amiloradovsky has quit [Remote host closed the connection]
amiloradovsky has joined #ocaml
mxns has joined #ocaml
ygrek has quit [Ping timeout: 240 seconds]
narimiran has quit [Ping timeout: 260 seconds]
amiloradovsky has quit [Remote host closed the connection]
amiloradovsky has joined #ocaml
mxns has quit [Ping timeout: 272 seconds]
amiloradovsky has quit [Ping timeout: 264 seconds]
aaaaaa has quit [Quit: leaving]
FreeBirdLjj has joined #ocaml
Serpent7776 has quit [Quit: leaving]
FreeBirdLjj has quit [Ping timeout: 272 seconds]
olle has joined #ocaml
olle has quit [Ping timeout: 264 seconds]
inkbottle has joined #ocaml
zebrag has quit [Ping timeout: 265 seconds]
tane has quit [Quit: Leaving]
mxns has joined #ocaml
Haudegen has quit [Ping timeout: 256 seconds]
Tuplanolla has quit [Quit: Leaving.]