companion_cube changed the topic of #ocaml to: Discussion about the OCaml programming language | http://www.ocaml.org | OCaml 4.14.0 released: https://ocaml.org/releases/4.14.0.html | Try OCaml in your browser: https://try.ocamlpro.com | Public channel logs at https://libera.irclog.whitequark.org/ocaml/
motherfsck has joined #ocaml
rgrinberg has joined #ocaml
waleee has quit [Ping timeout: 268 seconds]
wilfred has joined #ocaml
bobo_ has quit [Quit: Konversation terminated!]
spip has joined #ocaml
spip has quit [Ping timeout: 246 seconds]
spip has joined #ocaml
Haudegen has quit [Ping timeout: 255 seconds]
raskol has joined #ocaml
motherfsck has quit [Ping timeout: 268 seconds]
motherfsck has joined #ocaml
motherfsck has quit [Ping timeout: 255 seconds]
wilfred has quit [Quit: Connection closed for inactivity]
motherfsck has joined #ocaml
Sankalp has quit [Ping timeout: 268 seconds]
Sankalp has joined #ocaml
azimut has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bartholin has joined #ocaml
rgrinberg has joined #ocaml
rgrinberg has quit [Ping timeout: 272 seconds]
rgrinberg has joined #ocaml
Sankalp has quit [Ping timeout: 268 seconds]
Sankalp has joined #ocaml
raskol has quit [Ping timeout: 246 seconds]
rgrinberg has quit [Ping timeout: 268 seconds]
<d_bot_> <darrenldl> always love the random build failures due to presumably github repacking archive for no good reason
rgrinberg has joined #ocaml
rgrinberg has quit [Ping timeout: 255 seconds]
bartholin has quit [Quit: Leaving]
raskol has joined #ocaml
Tuplanolla has joined #ocaml
raskol has quit [Ping timeout: 255 seconds]
Haudegen has joined #ocaml
cedric has joined #ocaml
cedric has quit [Quit: Konversation terminated!]
<sim642> You mean the archives it automatically generates from tags/releases or even the ones that are explicitly uploaded
<d_bot_> <mseri> Usually only the generated ones suffer from this. The uploaded may fail if they are mistakenly replaced
<d_bot_> <mseri> But that is extremely rare
<d_bot_> <darrenldl> sim642: the auto generated ones yep
<d_bot_> <darrenldl> (going through opam ci errors today, and one dep uses the auto generated archive
<d_bot_> <darrenldl> is there going to be a central storage of source archives at some point?
<d_bot_> <darrenldl> (i am very uninformed about the costs associated with it in case i sound silly : v
omegatron has joined #ocaml
rgrinberg has joined #ocaml
rgrinberg has quit [Ping timeout: 248 seconds]
spip has quit [Quit: Konversation terminated!]
raskol has joined #ocaml
hackinghorn has joined #ocaml
hackinghorn has quit [Changing host]
<sim642> There is https://github.com/ocaml/opam-source-archives but it's not meant for general use
<sim642> And a git repository of archives will scale terribly too
<d_bot_> <darrenldl> true
<d_bot_> <darrenldl> ~~time to create a ocaml solution to it~~
<sim642> With irmin of course
<sim642> There is some kind of cache though I think because those source-archives are recovered from it
hackinghorn has quit [Quit: fBNC - https://bnc4free.com]
xgqt has quit [Ping timeout: 255 seconds]
xgqt has joined #ocaml
<d_bot_> <darrenldl> a hash indexed archive cache would be kinda neat to look at : v
<d_bot_> <darrenldl> well full archive storage perhaps
hackinghorn has joined #ocaml
hackinghorn has quit [Changing host]
hackinghorn has joined #ocaml
Anarchos has joined #ocaml
mro has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
mro has quit [Ping timeout: 255 seconds]
Anarchos has quit [Quit: Vision[]: i've been blurred!]
mro has joined #ocaml
mro has quit [Client Quit]
azimut has quit [Remote host closed the connection]
raskol has quit [Ping timeout: 240 seconds]
azimut has joined #ocaml
<d_bot_> <cod1r> HI
Everything has joined #ocaml
raskol has joined #ocaml
Serpent7776 has joined #ocaml
bartholin has joined #ocaml
<d_bot_> <pseud> noob question, how do I raise a 'Unsupported Media Type' error in Opium ? It seems like it ought to be `(raise Opium.Status.client_error.Unsupported_media_type)`, but ocamllsp complains that `client_error` is unbound, yet https://ocaml.org/u/06099f7dfcce12d3e1e349017875c32a/opium/0.20.0/doc/Opium/Status/index.html implies this is the right approach.
<d_bot_> <NULL> You forgot the \`. You also never prefix a constructor by its type, and I don't think these variants ever need prefixes
<d_bot_> <NULL> So ``raise `Unsupprted_media_type`` should just work
<sim642> Raising a polymorphic variant? that seems wrong
<sim642> But you're right that polymorphic variants don't need to be prefixed with anything
<d_bot_> <pseud> NULL: you're definitely right about the first part 🙂
<d_bot_> <NULL> I kinda forgot that you only raise exceptions
<sim642> `Unsupported_media_type just on its own is of that status type
<d_bot_> <pseud> Yea, I'm really just bumbling about, trying to see if I can play with opium without tearing through entire books of ocaml.
<d_bot_> <pseud> Have done some F# before, though. So felt I had a shot at "playing by ear", guess not :S
<d_bot_> <NULL> I guess you should look for Opium's raise, do you really want to raise an OCaml exception ?
<d_bot_> <NULL> When it comes to OCaml specificities, not prefixing the polymorphic variant should be the only thing to change
<d_bot_> <pseud> Not sure what I want, ideally I just want to abort further execution and have the server return a 415 unsupported media type error to the requesting client.
<sim642> I'm not familiar with Opium but it might not use exceptions for that
<d_bot_> <NULL> I don't know what function you're using, but it should expect a `( Body.t, [ Status.client_error | Status.server_error ] ) Lwt_result.t` somewhere
<sim642> Rather you'd probably have to create some response object with the alternative non-ok status code
<d_bot_> <NULL> And you would use `Lwt_result` to pass the error
raskol has quit [Ping timeout: 246 seconds]
Everything has quit [Quit: leaving]
<d_bot_> <pseud> I think I need to take a step back.
<d_bot_> <pseud>
<d_bot_> <pseud> There's an option type in ocaml, like the Maybe monad in haskell. Is there something like Data.either ?
<d_bot_> <pseud>
<d_bot_> <pseud> As in, my function can EITHER return this message type, OR some status code indicating an error
<sim642> There is Either, but Result is more common because it has Ok/Error instead of Left/Right
<d_bot_> <NULL> There's both an `Either.t` to return two things with a similar status and `result` to return a value or an error (same thing under the hood)
<sim642> And that Lwt_result probably is a version of result with some lwt sprinkled on top
<d_bot_> <NULL> ^
bartholin has quit [Ping timeout: 255 seconds]
azimut has quit [Ping timeout: 268 seconds]
bartholin has joined #ocaml
raskol has joined #ocaml
waleee has joined #ocaml
bartholin has quit [Quit: Leaving]
hackinghorn has quit [Ping timeout: 268 seconds]
hackinghorn has joined #ocaml
hackinghorn has quit [Changing host]
hackinghorn has joined #ocaml
raskol has quit [Ping timeout: 268 seconds]
Haudegen has quit [Ping timeout: 255 seconds]
Tuplanolla has quit [Quit: Leaving.]
<d_bot_> <cod1r> HI