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/
bastienleonard has quit [Ping timeout: 240 seconds]
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
herrschreinerei has joined #ocaml
<herrschreinerei> Hello. I am having trouble dealing with the result monad from Lwt. It seems to collide with Stdlib.result.
<herrschreinerei> Here is my code https://pastebin.com/MFGL7evL
rgrinberg has joined #ocaml
<herrschreinerei> damn right on time when rgrinberg enters the chat :D
<herrschreinerei> Let's put it differently, how do I access the Error constructor from Lwt_result.
<companion_cube> it's the same constructor
<companion_cube> it should be in scope, `Error`
<d_bot> <davi_wms> Hi everyone
<companion_cube> o/
<d_bot> <davi_wms> Does anyone know how to configure Dream with CORS? I'm getting the following error while using it with a frontend React app:
<d_bot> <davi_wms>
<d_bot> <davi_wms> 01.07.22 01:06:18.720 dream.log INFO REQ 26 OPTIONS /graphql 127.0.0.1:39404 Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.0.0 6
<d_bot> <davi_wms> 01.07.22 01:06:18.720 dream.graphql ERROR REQ 26 Method OPTIONS; must be GET or POST
<d_bot> <davi_wms> 01.07.22 01:06:18.720 dream.log WARN REQ 26 404 in 184 μs
<d_bot> <davi_wms> It's from a different port so it will request OPTIONS to the server, but the endpoint is not configured for it
<williewillus> what discord-irc bridge is being used here? looking to set up something similar for another channel
<herrschreinerei> hmmm ok that's an important information already. Anyway, I think I was looking at the wrong place.
<companion_cube> I think it's matterbridge?
<companion_cube> @Bluddy knows
<williewillus> matterbridge looks nice, thanks
<d_bot> <Bluddy> Yep that's the one
waleee has quit [Ping timeout: 255 seconds]
xgqt has quit [Ping timeout: 246 seconds]
xgqt has joined #ocaml
perrierjouet has quit [Quit: WeeChat 3.5]
perrierjouet has joined #ocaml
raskol has joined #ocaml
perrierjouet has quit [Quit: WeeChat 3.5]
perrierjouet has joined #ocaml
jpds has quit [Ping timeout: 268 seconds]
jpds has joined #ocaml
tizoc has quit [Quit: Coyote finally caught me]
tizoc has joined #ocaml
<herrschreinerei> hmmm I am still not managing to get this monad working. I must be missing something very basic because it should not be that hard.
<herrschreinerei> How do you pattern match an 'à Lwt t
<herrschreinerei> It seems to me that the patterns Ok _ and Error _ should match every case.
<herrschreinerei> yet I get This pattern matches values of type ('a, 'b) result
<d_bot> <geoff> You can't match on an `Lwt.t`
<herrschreinerei> yeah I got it. I am mixing up types
<herrschreinerei> Gosh I am tired, I should probably take a pause
<herrschreinerei> I think I am encountering some sort of architectural limitation of opium. I will make it work eventually.
nfc has quit [Ping timeout: 260 seconds]
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Haudegen has joined #ocaml
ansiwen has quit [Quit: ZNC 1.7.1 - https://znc.in]
ansiwen has joined #ocaml
mbuf has joined #ocaml
bobo_ has joined #ocaml
spip has quit [Ping timeout: 272 seconds]
rgrinberg has joined #ocaml
rgrinberg has quit [Client Quit]
raskol has quit [Ping timeout: 246 seconds]
terrorjack has quit [Ping timeout: 272 seconds]
terrorjack has joined #ocaml
<herrschreinerei> So, I am trying to get an opium handler working. Here is the code of the routes module https://controlc.com/4412e9d1
<herrschreinerei> The retrieval endpoint should issue an http request and pass the body of that request to the response.
<herrschreinerei> The problem is that my retrieval handler issue the request when the application start. After that, I always receive the same page, it is like the value is bound.
sagax has joined #ocaml
<herrschreinerei> ok I think I have fixed it. retrieval is a closure so it certainly binds the value for the entire runtime.
chrisz has quit [Ping timeout: 260 seconds]
chrisz has joined #ocaml
Serpent7776 has joined #ocaml
<reynir> for a second I forgot about the opium framework and thought opium would be an obvious explanation why you were tired :D
<herrschreinerei> hehe they share some effects
Tuplanolla has joined #ocaml
<herrschreinerei> no tbh opium is really nice. I vastly prefer the cowboy interface to the rack interface (what they went for in opium) but still, it's nice to use.
noonien6 has joined #ocaml
noonien has quit [Ping timeout: 272 seconds]
noonien6 is now known as noonien
Haudegen has quit [Quit: No Ping reply in 180 seconds.]
azimut has joined #ocaml
Haudegen has joined #ocaml
bartholin has joined #ocaml
<d_bot> <pseud> Speaking of opium (a few hours later).
<d_bot> <pseud> Any good examples of using opium for small RESTy services using JSON ? Have seen "Making a CRUD in OCaml (as a millionaire in Cambodia)" (great title, btw). But it stops short a little.
<d_bot> <pseud> For example, pleading me NOT to use a certain function, but never doubling back and finding a better solution.
<d_bot> <pseud>
<d_bot> <pseud> Is there anything in writing perhaps ? Or any good, small'ish projects on e.g. Github that you'd recommend looking at ?
hsw_ has joined #ocaml
hsw has quit [Ping timeout: 272 seconds]
gopiandcode has quit [Ping timeout: 246 seconds]
gopiandcode has joined #ocaml
noonien has quit [Ping timeout: 268 seconds]
gopiandcode has quit [Ping timeout: 246 seconds]
gopiandcode has joined #ocaml
noonien6 has joined #ocaml
hsw__ has joined #ocaml
hsw_ has quit [Ping timeout: 272 seconds]
Haudegen has quit [Quit: Bin weg.]
bartholin has quit [Ping timeout: 240 seconds]
bartholin has joined #ocaml
<d_bot> <Drup> Is someone around familiar with the compilation of OCaml objects ?
<d_bot> <Drup> In particular: in which case does something like this is fine: https://bpa.st/HD6A ?
<d_bot> <Drup> (cc @octachron , maybe zozozo ? :p)
<d_bot> <Drup> (I'm aware there exists private fields in OCaml, but I need to access them from the outside here for a syntax extension)
<zozozo> Drup : I asked Pierre and he said that, even though it was really not a good idea (I'll spare you the exact words, :p ), you don't really lie about the type, so it should be fine
<d_bot> <Drup> Noted, I'll take that as garantie that Pierre that this will not break 😄 😄
<d_bot> <Drup> (say hello from me 👋 )
Everything has joined #ocaml
<zozozo> XD
<zozozo> Drup : Pierre says hello back, ^^
<d_bot> <Drup> (would the compiler be able to remove the "useless" call to o#field ? :p)
<zozozo> Hm ... Flambda shouldn't, as the call could have arbitrary effects (and flambda cannot inline method calls for now, and for a long time I suspect)
<d_bot> <Drup> mmh, but If I hide the method call behind a thunk, it should not affect typing and be removable
<d_bot> <octachron> If the call is just here to obtain the type, would `let (_:(<field:'a; ..>) = o in` not work too?
<d_bot> <Drup> ... true !
Haudegen has joined #ocaml
azimut_ has joined #ocaml
azimut has quit [Ping timeout: 268 seconds]
<d_bot> <octachron> Otherwise, in term of semantics: since `:>` is a no-op in the untyped semantics, it seems like it would be pretty hard to optimize away the private field? (and nothing of the sort is done in the compiler).
bartholin has quit [Quit: Leaving]
raskol has joined #ocaml
<d_bot> <Drup> that was partially my question, so I guess it's fine yeah
<d_bot> <Drup> (the converse in the module system is completely false :p)
<companion_cube> https://ahrefs.github.io/ocamlformat/ ahah nice
Manis_ has joined #ocaml
<d_bot> <darrenldl> reminds me of looking at rust's formatting tooling the other day, where they try to make it very configurable
gdd1 has quit [Ping timeout: 255 seconds]
gdd1 has joined #ocaml
gdd1 has quit [Excess Flood]
<companion_cube> I still think rust's syntax is more easily formatted than OCaml's
rgrinberg has joined #ocaml
gdd1 has joined #ocaml
<d_bot> <darrenldl> true
gdd1 has quit [Excess Flood]
gdd1 has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
raskol has quit [Ping timeout: 268 seconds]
kakadu_ has joined #ocaml
rgrinberg has joined #ocaml
kakadu has quit [Ping timeout: 256 seconds]
waleee has joined #ocaml
raskol has joined #ocaml
chrisz has quit [Ping timeout: 255 seconds]
chrisz has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
Everything has quit [Quit: leaving]
mbuf has quit [Quit: Leaving]
bastienleonard has joined #ocaml
Manis_ has quit [Quit: Manis_]
chrisz has quit [Ping timeout: 240 seconds]
szkl has joined #ocaml
chrisz has joined #ocaml
raskol has quit [Ping timeout: 256 seconds]
bobo_ has quit [Read error: Connection reset by peer]
bobo_ has joined #ocaml
<sim642> companion_cube, that's neat, although I'm a bit confused about the config box
<sim642> I would've thought that changing the options gives you the config file with those options
zebrag has joined #ocaml
kurfen has quit [Quit: ZNC 1.8.2 - https://znc.in]
kurfen has joined #ocaml
omegatron has quit [Quit: Power is a curious thing. It can be contained, hidden, locked away,and yet it always breaks free.]
raskol has joined #ocaml
Haudegen has joined #ocaml
kakadu_ has quit [Remote host closed the connection]
omegatron has joined #ocaml
raskol has quit [Ping timeout: 246 seconds]
waleee has quit [Ping timeout: 240 seconds]
waleee has joined #ocaml
raskol has joined #ocaml
Guest9654 has joined #ocaml
<d_bot> <pseud> Just going to ask again to feel out my luck 🙂
<d_bot> <pseud>
<d_bot> <pseud> Good, small projects or articles/writeups on how to write a rest service in ocaml ? Opium preferred (because I've played with it a little), but any other reasonably used library is OK.
Guest9654 has left #ocaml [#ocaml]
motherfsck has quit [Ping timeout: 240 seconds]
raskol has quit [Ping timeout: 268 seconds]
raskol has joined #ocaml
raskol has quit [Ping timeout: 246 seconds]
raskol has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
raskol has quit [Ping timeout: 246 seconds]
rgrinberg has joined #ocaml
perrierjouet has quit [Quit: WeeChat 3.5]
azimut_ has quit [Remote host closed the connection]
jpds has quit [Remote host closed the connection]
jpds has joined #ocaml
azimut has joined #ocaml
Serpent7776 has quit [Quit: leaving]
perrierjouet has joined #ocaml
waleee has quit [Ping timeout: 268 seconds]
zebrag has quit [Ping timeout: 264 seconds]
waleee has joined #ocaml
waleee has quit [Ping timeout: 260 seconds]
motherfsck has joined #ocaml
jpds has quit [Remote host closed the connection]
jpds has joined #ocaml
raskol has joined #ocaml
<companion_cube> @Drup: funny, I actually reimplemented a form of OBDD today
<companion_cube> pretty cool
<companion_cube> I wonder what a mix of BDD and congruence closure would look like
waleee has joined #ocaml
jpds has quit [Remote host closed the connection]
jpds has joined #ocaml
Tuplanolla has quit [Quit: Leaving.]
raskol has quit [Ping timeout: 246 seconds]
jpds has quit [Remote host closed the connection]
jpds has joined #ocaml
azimut_ has joined #ocaml
azimut has quit [Ping timeout: 268 seconds]
waleee has quit [Ping timeout: 246 seconds]
raskol has joined #ocaml
raskol has quit [Ping timeout: 246 seconds]
raskol has joined #ocaml