<drewolson>
i'm new to ocaml, i've tried to `open Option` and `open Option.Syntax`. I've also looked at the PR that added this capability and i don't see any definitions for `let*` or `let+` added for specific types.
<Fardale>
I don't see let* in the documentation
<Fardale>
If you want to use it you need to define as they did in the article.
<drewolson>
still a bit strange to me that these aren't predefined in the stdlib for monadic types
<d_bot>
<despairblue> Hey, I'm using Base and try to avoid `open Poly`. Now for most data types it's ok to write a `compare` function, I'm just wondering if for variants that's also the case since this get's super tedious. Is this really the best way to do this I wonder:
<d_bot>
<despairblue>
<d_bot>
<despairblue> ```
<d_bot>
<despairblue> open Base
<d_bot>
<despairblue>
<d_bot>
<despairblue> type status =
<d_bot>
<despairblue> | Ready
<d_bot>
<despairblue> | Shutting_Down
<d_bot>
<despairblue> | Not_Ready
<d_bot>
<despairblue>
<d_bot>
<despairblue> (* using polymorphic compare *)
<d_bot>
<despairblue> let is_ready status = status = Ready
<d_bot>
<despairblue> @rgrinberg Interesting, what's it called? I usually avoid ppx where I can since everytime I use them they end up breaking whenever I upgrade any dependency.
<d_bot>
<rgrinberg> > Yeah, I'm not writing a compare, just the equal. I don't think a compare is sensible for most variants.
<d_bot>
<rgrinberg> @despairblue it’s very sensible if you want a map or a set
<d_bot>
<rgrinberg> > @rgrinberg Interesting, what's it called? I usually avoid ppx where I can since everytime I use them they end up breaking whenever I upgrade any dependency.
<d_bot>
<rgrinberg> @despairblue ppx_compare_conv
<d_bot>
<despairblue> Which in my case is not "most cases" 😉
<d_bot>
<despairblue> @rgrinberg thanks, I may give it a try, but a ppx seems a bit overkill for a list of options for now 🙂
Haudegen has quit [Read error: Connection reset by peer]
madroach has joined #ocaml
<d_bot>
<despairblue> > @rgrinberg Interesting, what's it called? I usually avoid ppx where I can since everytime I use them they end up breaking whenever I upgrade any dependency.
<d_bot>
<despairblue>
<d_bot>
<despairblue> Yep, just tried to install it and it does not compile, usually some ppxlib error 😿
<d_bot>
<despairblue>
<d_bot>
<despairblue> ```
<d_bot>
<despairblue> info building @opam/ppx_compare@opam:v0.12.0@1c0426c7: done
<d_bot>
<despairblue> Fatal error: exception File "lib/CohttpServer.re", line 78, characters 4-10: let operators are not supported before OCaml 4.08
<d_bot>
<despairblue> Raised at file "src/migrate_parsetree_408_407_migrate.ml", line 7, characters 2-49
<d_bot>
<despairblue> Called from file "src/migrate_parsetree_408_407_migrate.ml", line 57, characters 8-40
<d_bot>
<despairblue> Called from file "src/migrate_parsetree_408_407_migrate.ml", line 84, characters 10-30
<d_bot>
<despairblue> ```
<d_bot>
<despairblue>
<d_bot>
<despairblue> Goes on forever like this. I also don't really understand it since I use OCaml 4.09.1000, which is above 4.08 🤷🏽♀️
<d_bot>
<rgrinberg> Why are you using such an ancient version of ppx_compare?
<d_bot>
<despairblue> Dunno, that's what esy's solver spit out. I'll try installing a newer version but I fear one of my depa fórceps that old version.
<d_bot>
<despairblue>
<d_bot>
<despairblue> I'll try in an hour :)
bartholin has quit [Ping timeout: 260 seconds]
RalfJ has quit [Remote host closed the connection]
RalfJ has joined #ocaml
TheLemonMan has joined #ocaml
bartholin has joined #ocaml
berberman_ has joined #ocaml
berberman has quit [Ping timeout: 268 seconds]
hnOsmium0001 has joined #ocaml
Haudegen has joined #ocaml
<d_bot>
<despairblue> actually I'm using 0.12.0, which is only 2 minor versions behind, why would that be ancient? 😕
<d_bot>
<despairblue> Mhh, could it bee that ppx_compare does not specify the version ranges of it's dependencies correctly? That's something that I seem to find a lot in the ocaml ecosystem. There are a lot of packages that claim to be compatible with a version of another package but then you get a compile error. Either the versions are too open or a lot of packages don't take semver that srsly and break on a minor version I feel.
<d_bot>
<despairblue>
<d_bot>
<despairblue> I'll check if I can install 0.13 at least.
<d_bot>
<rgrinberg> > actually I'm using 0.12.0, which is only 2 minor versions behind, why would that be ancient? 😕
<d_bot>
<rgrinberg> @despairblue nobody makes sure that old versions stay working with ppx. So in practice, that means only the latest version is usable
<d_bot>
<rgrinberg> > Mhh, could it bee that ppx_compare does not specify the version ranges of it's dependencies correctly? That's something that I seem to find a lot in the ocaml ecosystem. There are a lot of packages that claim to be compatible with a version of another package but then you get a compile error. Either the versions are too open or a lot of packages don't take semver that srsly and break on a minor version I feel.
<d_bot>
<rgrinberg> >
<d_bot>
<rgrinberg> > I'll check if I can install 0.13 at least.
<d_bot>
<rgrinberg> @despairblue the absence of a conflict is not evidence for compatibility 🙂
<d_bot>
<despairblue> True that, I just wish that every time the observable interface of a package changes in a backwards incompatible way the publisher would be forced to do a major bump. Otherwise the value of versioning is pretty low. People could just have one number that they keep increasing 😄
<d_bot>
<despairblue> I now kept going through all dependencies and just kept upgrading. Now everything is latest and works 👍🏽
<d_bot>
<despairblue>
<d_bot>
<despairblue> Still wondering why it failed even when I forced all jane street package to stay on 0.12 🤷🏽♂️
<d_bot>
<rgrinberg> Perhaps you need a different version of omp?
<d_bot>
<rgrinberg> Btw, how are you using let operators in reason?
<d_bot>
<rgrinberg> I thought reason doesn’t have them
<d_bot>
<despairblue> Right, I did not check that version, maybe it was not compatible with 0.12 versions.
<d_bot>
<despairblue>
<d_bot>
<despairblue> Well, I've been trying to upgrade packages for a while now. Now everything's up to date, which is nice. Usually I just go pkg by pkg until I hit a compile error. Seems upgrading everything to latest also works sometimes. In the past I had bad experiences with it ^^
<d_bot>
<despairblue> > Btw, how are you using let operators in reason?
<d_bot>
<despairblue>
<d_bot>
<despairblue>
<d_bot>
<despairblue> It's been there for a while, have to find the PR. Let me check.
mmohammadi9812 has quit [Ping timeout: 268 seconds]
<d_bot>
<rgrinberg> I think that’s the issue then. You need a version of ppxlib that uses a newer ast. 0.12 is still using the old ast that doesn’t have let ops
<d_bot>
<despairblue> Ah that was the reason for my bad experiences with ppxes then. Now I'm on 0.19, so I can start to use them all over the place :D
<d_bot>
<despairblue>
<d_bot>
<despairblue> Just kidding, but some of them look really useful. Thanks for the help 🙂
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
ggole has quit [Quit: Leaving]
<companion_cube>
Indeed, version constraints are all over the place.
<companion_cube>
And ppx based things are especially fragile
mmohammadi9812 has joined #ocaml
bartholin has quit [Ping timeout: 272 seconds]
amiloradovsky has quit [Remote host closed the connection]
amiloradovsky has joined #ocaml
bartholin has joined #ocaml
bartholin has quit [Quit: Leaving]
jnavila has quit [Quit: Konversation terminated!]
vicfred_ has joined #ocaml
aaaaaa has joined #ocaml
vicfred has quit [Ping timeout: 246 seconds]
tane has quit [Quit: Leaving]
Haudegen has quit [Quit: No Ping reply in 180 seconds.]