<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…]
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?
<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>
<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]