companion_cube changed the topic of #ocaml to: Discussion about the OCaml programming language | http://www.ocaml.org | OCaml 5.2.0 released: https://ocaml.org/releases/5.2.0 | Try OCaml in your browser: https://try.ocamlpro.com | Public channel logs at https://libera.irclog.whitequark.org/ocaml/
kron has quit [Remote host closed the connection]
kron has joined #ocaml
Tuplanolla has quit [Quit: Leaving.]
bcksl has quit [Quit: \]
ski has quit [Ping timeout: 244 seconds]
ski has joined #ocaml
bcksl has joined #ocaml
sroso has joined #ocaml
rgrinberg has quit [Quit: My Unrecognized Mac has gone to sleep. ZZZzzz…]
matsurago has joined #ocaml
agentcasey has joined #ocaml
matsurago has quit [Quit: Leaving]
terrorjack4 has quit [Quit: The Lounge - https://thelounge.chat]
terrorjack4 has joined #ocaml
ygrek has joined #ocaml
agentcasey has quit [Quit: leaving]
ygrek has quit [Remote host closed the connection]
zenmov has quit [Ping timeout: 245 seconds]
zenmov has joined #ocaml
matsurago has joined #ocaml
humasect has joined #ocaml
matsurago has quit [Quit: Leaving]
bartholin has joined #ocaml
Serpent7776 has joined #ocaml
<humasect> what is latest ocaml? i've created switch for 5.2, now i see 5.4, can't quite parse list-available
<discocaml> <._null._> 5.2 is the latest release, 5.3 is in beta for now and 5.4 is code for development not in 5.3
<octachron> 5.2.1 for the latest release
<humasect> ohh, that makes sense
<humasect> was unclear because of : https://ocaml.org/p/ocaml/latest
<octachron> The `ocaml` package is a metapackage for all variants of the compiler
<octachron> typically for a released version the package can be provided by `ocaml-system`, `ocaml-base-compiler` and various `ocaml-variants...+variant` packages
<octachron> But the development version of a compiler itself is a variant too, thus the ocaml package for version $n appears as soon as there is a dev branch for this version.
bartholin has quit [Quit: Leaving]
pi3ce has quit [Read error: Connection reset by peer]
pi3ce has joined #ocaml
olle has joined #ocaml
<humasect> ahh, i see thanks octachron
<reynir> /topic could be updated to 5.2.1 ^^
mange has quit [Quit: Zzz...]
<discocaml> <JM> When I doubt, I do `opam switch list-available | grep "Official release"`
rgrinberg has joined #ocaml
pi3ce has quit [Read error: Connection reset by peer]
pi3ce has joined #ocaml
rgrinberg has quit [Quit: My Unrecognized Mac has gone to sleep. ZZZzzz…]
sroso has quit [Quit: Leaving :)]
pi3ce has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
Anarchos has joined #ocaml
Anarchos has quit [Client Quit]
Anarchos has joined #ocaml
Anarchos has quit [Client Quit]
rgrinberg has joined #ocaml
Anarchos has joined #ocaml
Anarchos has quit [Remote host closed the connection]
Anarchos has joined #ocaml
humasect has quit [Ping timeout: 260 seconds]
humasect_ has joined #ocaml
rgrinberg has quit [Quit: My Unrecognized Mac has gone to sleep. ZZZzzz…]
humasect_ has quit [Remote host closed the connection]
humasect has joined #ocaml
humasect has quit [Ping timeout: 248 seconds]
Anarchos has quit [Quit: Vision[]: i've been blurred!]
casastorta has quit [Remote host closed the connection]
casastorta has joined #ocaml
Anarchos has joined #ocaml
humasect has joined #ocaml
humasect has quit [Remote host closed the connection]
Anarchos has quit [Quit: Vision[]: i've been blurred!]
olle has quit [Ping timeout: 244 seconds]
olle has joined #ocaml
<discocaml> <otini_> you’re right, my bad
<olle> In OCaml, when you chain monadic binds togehter, how do you break out of that chain prematurely? Asking because of JS .then() chains, have to throw to break out.
<theblatte> it depends on your monad, if it has an early exit case (eg the Ok/Error result monad) then you can just wrap your monadic operations in () or a let, eg let x = (let* a in let* b = f a in ...)
Haudegen has joined #ocaml
<olle> Yea but imagine your `let* a` contacts an API and you want to abort without running `let* b`?
<discocaml> <getzapped.> I am getting an error `the type variable 'a cannot be deduced from the type parameters` for the `Head` constructor in this gadt, but I am completely lost for why it wont type check
<discocaml> <getzapped.> ```ocaml
<discocaml> <getzapped.> type 'a head
<discocaml> <getzapped.>
<discocaml> <getzapped.> type _ t =
<discocaml> <getzapped.> | Head : (unit -> 'a t) -> 'a head t
<discocaml> <getzapped.> | Node : ('a * 'a t) -> 'a t
<discocaml> <getzapped.> | Tail : 'a head t -> 'a t
<discocaml> <getzapped.> ```
<discocaml> <._null._> Short answer, `'a head` needs to be injective
<discocaml> <getzapped.> meaning?
<discocaml> <getzapped.> or some documentation regarding it?
<discocaml> <._null._> https://ocaml.org/manual/5.2/typedecl.html > injectivity
<theblatte> olle: if it's not set up with a way of short-circuiting future bindings then throwing is the only way. Or if it's your own monad you can add an Error case that gets propagated through by let*
rgrinberg has joined #ocaml
<discocaml> <getzapped.> still dont quite understand why it is not injective, or what needs to be changed for it to be injective
<discocaml> <getzapped.> do i need an injectivity annotation local to the constructor?
<discocaml> <._null._> `type !'a head`
<olle> theblatte: got it
<discocaml> <getzapped.> ah thanks
<discocaml> <octachron> https://stackoverflow.com/questions/70450821/ocaml-meaning-of-in-type-a-t contains an explanation (and at some point I will find the time to transfer it to the manual)
<discocaml> <octachron> Also when using types as tags or functions inside a GADT, you really want to define them as nominal types
<discocaml> <octachron> `type 'a head = private Head` with the variant constructor or record field as a witness of their identity.
<discocaml> <octachron> (which would also make the type injective in all of its parameter, but also allows to prove that for instance `head` ≠ `list`)
jusensei2 has quit [Ping timeout: 252 seconds]
<discocaml> <deepspacejohn> olle: in JS promise chains, you can stop the chain prematurely by returning a rejected promise (Promise.reject) which is conceptually the same as returning an Error result in OCaml
<discocaml> <deepspacejohn> IIRC throwing an exception in a JS promise chain just makes it auto-catch the exception and wrap it in a rejected promise.
rgrinberg has quit [Quit: My Unrecognized Mac has gone to sleep. ZZZzzz…]
jusensei2 has joined #ocaml
<Ankhers> I believe there was conversation about creating a new package manager for ocaml. Is that a project that is still happening? If so, where can I find updates on it?
<discocaml> <otini_> you’re probably thinking of the package management tasks being taken care of by dune
<Ankhers> That might be it. Basically I want to be able to use ocaml without needing to create a switch managed by opam. Is this use case covered by dune? Or will it, if the work is not yet complete?
rgrinberg has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
olle has quit [Ping timeout: 260 seconds]
ygrek has joined #ocaml
<discocaml> <sim642> I think the dune package management preview thing should already cover that in some form
rgrinberg has quit [Read error: Connection reset by peer]
pi3ce has joined #ocaml
dhil has joined #ocaml
Anarchos has joined #ocaml
<discocaml> <otini_> yeah https://preview.dune.build/
<discocaml> <otini_> although it’s still experimental
germ has joined #ocaml
Haudegen has joined #ocaml
bartholin has joined #ocaml
rgrinberg has joined #ocaml
euphores has quit [Quit: Leaving.]
<discocaml> <lecondorduplateau> octachron: why not define `head` as bottom ?
<discocaml> <lecondorduplateau> what is the difference between this approach
<discocaml> <._null._> Do you mean `type head = |` ?
<discocaml> <lecondorduplateau> yes
<discocaml> <._null._> Because even empty types can be aliased, so the compiler doesn't always know whether two empty types are different
<discocaml> <octachron> And thus you cannot be sure that `type 'a head = |` and `type 'a succ = |` are different types.
euphores has joined #ocaml
dhil has quit [Quit: Leaving]
Anarchos has quit [Quit: Vision[]: i've been blurred!]
Anarchos has joined #ocaml
euphores has quit [Read error: Connection reset by peer]
Haudegen has quit [Quit: Bin weg.]
Haudegen has joined #ocaml
olle has joined #ocaml
bartholin has quit [Quit: Leaving]
euphores has joined #ocaml
<discocaml> <lecondorduplateau> I see
bcksl has quit [Ping timeout: 244 seconds]
end has quit [Ping timeout: 265 seconds]
Absalom has quit [Ping timeout: 264 seconds]
oriba has joined #ocaml
bcksl has joined #ocaml
end has joined #ocaml
<Ankhers> Thanks for the information otini_
olle has quit [Ping timeout: 244 seconds]
Anarchos has quit [Quit: Vision[]: i've been blurred!]
rgrinberg has quit [Quit: My Unrecognized Mac has gone to sleep. ZZZzzz…]
vukung has joined #ocaml
rgrinberg has joined #ocaml
vukung has left #ocaml [Leaving]
Tuplanolla has joined #ocaml
Anarchos has joined #ocaml
Anarchos has quit [Quit: Vision[]: i've been blurred!]
Serpent7776 has quit [Ping timeout: 244 seconds]
rgrinberg has quit [Quit: My Unrecognized Mac has gone to sleep. ZZZzzz…]
Absalom has joined #ocaml
rgrinberg has joined #ocaml
rgrinberg has quit [Quit: My Unrecognized Mac has gone to sleep. ZZZzzz…]
ygrek has quit [Remote host closed the connection]
rgrinberg has joined #ocaml
leah2 has quit [Ping timeout: 245 seconds]
leah2 has joined #ocaml
leah2 has quit [Excess Flood]
Anarchos has joined #ocaml
Anarchos has quit [Client Quit]
leah2 has joined #ocaml