<d_bot>
<joris> Extprot is extensible in many way. Of course you cannot really remove things but you can stop using them
mmohammadi9812 has quit [Ping timeout: 240 seconds]
mmohammadi9812 has joined #ocaml
mxns has joined #ocaml
mxns has quit [Ping timeout: 260 seconds]
Haudegen has joined #ocaml
decentpenguin has quit [Read error: Connection reset by peer]
narimiran has joined #ocaml
decentpenguin has joined #ocaml
Serpent7776 has joined #ocaml
inkbottle has joined #ocaml
zebrag has quit [Ping timeout: 260 seconds]
shawnw has joined #ocaml
osa1 has quit [Quit: osa1]
osa1 has joined #ocaml
osa1_ has quit [Quit: osa1_]
Geekingfrog_ is now known as Geekingfrog
osa1_ has joined #ocaml
osa1_ has quit [Quit: osa1_]
osa1 has quit [Quit: osa1]
osa1 has joined #ocaml
osa1_ has joined #ocaml
<d_bot>
<joris> btw, i had a service like this too. I wrote migration "manually" twice, then i moved it to mysql :p
borne has joined #ocaml
osa1 has quit [Quit: osa1]
osa1 has joined #ocaml
mxns has joined #ocaml
mxns has quit [Ping timeout: 272 seconds]
aaaaaa has joined #ocaml
osa1_ has quit [Quit: osa1_]
andreas31 has quit [Ping timeout: 240 seconds]
nicoo has quit [Ping timeout: 240 seconds]
aaaaaa has quit [Quit: leaving]
nicoo has joined #ocaml
andreas31 has joined #ocaml
Tuplanolla has joined #ocaml
steenuil has joined #ocaml
hnOsmium0001 has quit [Quit: Connection closed for inactivity]
<Leonidas>
wokalski: We tend to use Protobuf. For all the bad things to be said about it, the interop and compatibility are very useful
<d_bot>
<joris> agree. Extprot is some kind od "lesser" protobuf, with first class support for ocaml constructs. I think i would just use protobuf now, but at work extprot is here for a while, and protobuf was much less powerful and supported in ocaml now
<d_bot>
<joris> the advantage of extprot is that it supports ADT well, and sum types extension works well, while protobuf is still very tied to java/go/c++ world with enum and unions
<d_bot>
<Drup> I hate it and love it at the same time
<vsiles>
ouch
<vsiles>
I'm not a big fan of `let compare = compare`, but at least I can explain it quickly. This seems a bit too far
<vsiles>
I mean: ` let length and nth and filter and mem
<vsiles>
`
<vsiles>
wtf ?
<d_bot>
<Drup> it's kinda amazing, tbh
<vsiles>
noobs are going to cry :)
<d_bot>
<ggole> That's quite clever, but on the downside, it's quite clever.
<vsiles>
:D
<vsiles>
"too clever for its own good" ?
<d_bot>
<Drup> I like the binding operator one the most, I think.
<d_bot>
<joris> @vsiles otoh this is unlikely to be written in real code. Mostly useless
aaaaaa has quit [Read error: Connection reset by peer]
<d_bot>
<joris> i mean not without let operators
aaaaaa has joined #ocaml
<d_bot>
<joris> i have some syntaxic existential question. I have a ppx extension let%bind name = "some_string" that parses string and translate it. Problem is, i want to add additional user provide values alongside, that is transparent to the ppx
<d_bot>
<joris> so internally it would be ```let name = bind name props [%bind_expr "foo" ]
<d_bot>
<joris> ```
<d_bot>
<joris> not sure how to embed that nicely into ocaml syntax. Because internally the ppx needs to process the name and the expr
<d_bot>
<Drup> Use attributes instead of extensions ?
<d_bot>
<joris> how does it help ?
<d_bot>
<Drup> `let[@bind user provided values] name = "some string"
<d_bot>
<joris> i can put arbitrary ocaml expression inside attrs 😮
<d_bot>
<Drup> or `let%bind name = "some string" [@opt user provided values]`
<d_bot>
<joris> oh right, that is what deriving does. Good idea thanks
<d_bot>
<joris> i like the second form, especially since it is optional
mxns has joined #ocaml
<d_bot>
<Drup> you can even compress: `let%bind[@opt ... ] name = ...`
amiloradovsky has quit [Remote host closed the connection]
amiloradovsky has joined #ocaml
amiloradovsky has quit [Remote host closed the connection]
amiloradovsky has joined #ocaml
nkly has quit [Quit: ZNC 1.6.6+deb1ubuntu0.2 - http://znc.in]
mxns has quit [Ping timeout: 240 seconds]
amiloradovsky has quit [Remote host closed the connection]
amiloradovsky has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
amiloradovsky has quit [Remote host closed the connection]
amiloradovsky has joined #ocaml
<d_bot>
<EduardoRFS> there was any discussion on the OCaml side about having `let monadic` with ASCII? In reason you can do
<d_bot>
<EduardoRFS>
<d_bot>
<EduardoRFS> ```
<d_bot>
<EduardoRFS> let (let.await) = Lwt.bind;
<d_bot>
<EduardoRFS> let (let.ok) = Result.ok;
<d_bot>
<EduardoRFS> ```
<d_bot>
<EduardoRFS> and it's pretty useful when using multiple monads at the same time
<d_bot>
<joris> it was discussed but reject iirc. But i agree it would be better 😦
<d_bot>
<Drup> it's also super verbose, you can have multiple monads easily if you want
<d_bot>
<joris> easily how ?
<d_bot>
<Drup> `let (let@!!?) = Foo.bind and (let~&$) = Baz.bind in ...`
<d_bot>
<craigfe> (Easy if you like constructing increasingly-ridiculous ASCII soup.)
<def>
yep, much cleaner with names
<d_bot>
<joris> @Drup i don't call this "easily" because i write ocaml, not haskell
<d_bot>
<joris> and i'm not a fan of emoji like you x)
amiloradovsky has quit [Ping timeout: 240 seconds]
<companion_cube>
`let👍 x = …`
Haudegen has joined #ocaml
<companion_cube>
so, joris == enjolras? :p
<def>
let (let*) (def, arg) k = def arg k;;
<def>
let option = (fun x k -> match x with None -> None | Some x -> k x);;
<def>
let* test = option, None in Some "foo";;
andreas31 has quit [Remote host closed the connection]
<def>
using curryfication, we can even get `let* value = await (...) in something value`
<def>
s/curryfication/partial function
andreas31 has joined #ocaml
gareppa has quit [Read error: Connection reset by peer]
mxns has joined #ocaml
raver has quit [Read error: Connection reset by peer]
bartholin has quit [Quit: Leaving]
<d_bot>
<EduardoRFS> `you can have multiple monads easily if you want`, `let@!!?` I hope that was a joke
<d_bot>
<Ulugbek> In the meantime, having something like `let*?` and `let+?` more common/standard to work with `option` type would be nice -- somewhat similar to Rust's `let v = opt_v?`
<d_bot>
<Drup> the choice of operator was, the affirmation wasn't 🙂
raver has joined #ocaml
Haudegen has quit [Ping timeout: 240 seconds]
Haudegen has joined #ocaml
motherfsck has quit [Quit: quit]
vicfred has joined #ocaml
<d_bot>
<joris> @def smart
waleee-cl has joined #ocaml
<def>
let (let*) def k = def k;;
<def>
let await = Lwt.bind;;
<def>
let* v = await p in Lwt.return_some v;;
<def>
However error messages can get ... unfriendly :]
<def>
(Some kind of wrapping might help)
<d_bot>
<Drup> you are approximately that close to create monad transformers: ''
<d_bot>
<EduardoRFS> That is really cool
<companion_cube>
let transformers
<d_bot>
<EduardoRFS> But then it would be better to go back to ppx to have better error message
<companion_cube>
Ulugbek: it's done with local opens, in Ocaml, I think
<companion_cube>
you'd do `let open Option in let+ a = a and+ b = b in …`
<Leonidas>
btw, ppx_let supports multiple monads via names, without operator soup
<Leonidas>
it is very strange that the let* proposal is just so much worse than what we already have
<companion_cube>
what do you mean "by name"?
<companion_cube>
ah, let%foo ?
TheLemonMan has joined #ocaml
<Leonidas>
sth like `let%bind.Result foo = bar in`
<companion_cube>
seems quite verbose :p
<d_bot>
<joris> It is not meant to be the default
<d_bot>
<joris> You open the most generic monad in scope and use specific monad inside
<d_bot>
<EduardoRFS> Yeah, I wanted `let.ok`
<companion_cube>
well, let operators are simple and part of the language, so I guess it's nice :p
<d_bot>
<joris> Think result and option
<Leonidas>
companion_cube: I'll take let%bind.Deferred.Result over let@!!? any day
<companion_cube>
or you know, you can avoid strawmen
<companion_cube>
and define `let (let*?) = …` in your file or prelude or whatever
<companion_cube>
with goto-def and type hints, too
<Leonidas>
the fact that the readability of such ascii operators is awful still stands
<Leonidas>
where each library or file has its own definitions, so let*? is sometimes this monad, sometimes it is that monad :/
<d_bot>
<Anurag> Leonidas: yeah `match%...` is used a lot by us at work as well. It along with `ppx_sexp_conv` are probably the two ppxes we use the most.
<d_bot>
<Anurag> *it => ppx_let
<companion_cube>
does ppx_let handle applicatives too?
<d_bot>
<Anurag> Yes it does.
<companion_cube>
how do you choose?
<companion_cube>
(woah, proper match operators, not just `let* x = x in match x with …` as I thought it'd be)
<d_bot>
<EduardoRFS> companion_cube: there is no reason, Reason is using the same AST and accepts words
<companion_cube>
:o
<d_bot>
<EduardoRFS> the code that I sent before is native ocaml
<d_bot>
<EduardoRFS> well native reason which is ocaml
<companion_cube>
I mean, it's a parser thing anyway
<companion_cube>
so we could still have `let!foo`, heh?
<companion_cube>
(cc Drup what do you think of that)
<d_bot>
<EduardoRFS> I was thinking on proposing that sometime ago, that is why I started this discussion again
<companion_cube>
another hell thread!!!
<companion_cube>
but yeah, that sounds useful
<d_bot>
<EduardoRFS> I do `.` for bind and `+` for map, so `let.await`, Lwt.bind and `let+await`, Lwt.map
<d_bot>
<Drup> no opinion, I don't really care honesty
<d_bot>
<EduardoRFS> that is a +1 for me
steenuil_ has joined #ocaml
steenuil has quit [Ping timeout: 246 seconds]
shawnw has quit [Ping timeout: 260 seconds]
Haudegen has quit [Quit: Bin weg.]
camlriot42 has joined #ocaml
hnOsmium0001 has joined #ocaml
tane has joined #ocaml
nullcone has joined #ocaml
borne has quit [Ping timeout: 244 seconds]
Haudegen has joined #ocaml
borne has joined #ocaml
mmohammadi9812 has quit [Quit: Quit]
jnavila has joined #ocaml
aaaaaa has joined #ocaml
borne has quit [Ping timeout: 246 seconds]
mxns has quit [Ping timeout: 268 seconds]
TheLemonMan has quit [Quit: Lost terminal]
berberman has joined #ocaml
berberman_ has quit [Ping timeout: 264 seconds]
aaaaaa has quit [Quit: leaving]
mxns has joined #ocaml
borne has joined #ocaml
mxns has quit [Ping timeout: 246 seconds]
mxns has joined #ocaml
ransom has joined #ocaml
neiluj has joined #ocaml
neiluj has quit [Changing host]
neiluj has joined #ocaml
inkbottle has quit [Quit: Konversation terminated!]
inkbottle has joined #ocaml
jnavila has quit [Quit: Konversation terminated!]
jnavila has joined #ocaml
jnavila has quit [Client Quit]
amiloradovsky has joined #ocaml
jnavila has joined #ocaml
jnavila has quit [Client Quit]
ransom has quit [Read error: Connection reset by peer]
narimiran has quit [Ping timeout: 260 seconds]
amiloradovsky has quit [Remote host closed the connection]
ransom has joined #ocaml
amiloradovsky has joined #ocaml
borne has quit [Ping timeout: 244 seconds]
neiluj has quit [Ping timeout: 260 seconds]
neiluj has joined #ocaml
borne has joined #ocaml
neiluj has quit [Ping timeout: 246 seconds]
neiluj has joined #ocaml
neiluj has quit [Ping timeout: 264 seconds]
neiluj has joined #ocaml
Hrundi_V_Bakshi has joined #ocaml
ransom has quit [Ping timeout: 260 seconds]
ransom has joined #ocaml
neiluj has quit [Ping timeout: 260 seconds]
Hrundi_V_Bakshi has quit [Client Quit]
neiluj has joined #ocaml
Hrundi_V_Bakshi has joined #ocaml
ransom has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
neiluj has quit [Ping timeout: 256 seconds]
amiloradovsky has quit [Remote host closed the connection]
amiloradovsky has joined #ocaml
ransom has joined #ocaml
neiluj has joined #ocaml
neiluj has quit [Remote host closed the connection]
neiluj has joined #ocaml
tane has quit [Quit: Leaving]
neiluj has quit [Ping timeout: 272 seconds]
Jesin has quit [Quit: Leaving]
Serpent7776 has quit [Quit: leaving]
neiluj has joined #ocaml
neiluj has quit [Changing host]
neiluj has joined #ocaml
mxns has quit [Ping timeout: 264 seconds]
mxns has joined #ocaml
neiluj has quit [Ping timeout: 260 seconds]
neiluj has joined #ocaml
neiluj has quit [Ping timeout: 272 seconds]
neiluj has joined #ocaml
neiluj has quit [Remote host closed the connection]
neiluj has joined #ocaml
neiluj has quit [Changing host]
neiluj has joined #ocaml
Jesin has joined #ocaml
amiloradovsky has quit [Ping timeout: 268 seconds]
neiluj has quit [Remote host closed the connection]
neiluj has joined #ocaml
Hrundi_V_Bakshi has quit [Ping timeout: 258 seconds]