companion_cube changed the topic of #ocaml to: Discussion about the OCaml programming language | http://www.ocaml.org | OCaml 5.0 released(!!1!): https://ocaml.org/releases/5.0.0.html | Try OCaml in your browser: https://try.ocamlpro.com | Public channel logs at https://libera.irclog.whitequark.org/ocaml/
troydm has quit [Ping timeout: 265 seconds]
troydm has joined #ocaml
chrisz has quit [Ping timeout: 256 seconds]
chrisz has joined #ocaml
spip has quit [Quit: Konversation terminated!]
motherfsck has joined #ocaml
Haudegen has joined #ocaml
motherfsck has quit [Ping timeout: 250 seconds]
Everything has quit [Ping timeout: 268 seconds]
Everything has joined #ocaml
John_Ivan has quit [Ping timeout: 240 seconds]
ansiwen has quit [Quit: ZNC 1.7.1 - https://znc.in]
ansiwen has joined #ocaml
motherfsck has joined #ocaml
bgs has joined #ocaml
bgs has quit [Remote host closed the connection]
bgs has joined #ocaml
motherfsck has quit [Ping timeout: 240 seconds]
bgs has quit [Remote host closed the connection]
bartholin has joined #ocaml
hsw has quit [Remote host closed the connection]
hsw has joined #ocaml
bartholin has quit [Quit: Leaving]
<discocaml> <froyo> is there a cute way to compose compares
<discocaml> <froyo> instead of doing let c = compare l0 r0 in if c <> 0 then c else let c = compare l1 r1 in if c <> 0 ...
dhil has joined #ocaml
xd1le has joined #ocaml
<discocaml> <octachron> `let chain f x y g w z = let r = f x y in if r = 0 then g w z else r`?
<discocaml> <NULL> If you're using the polymorphic compare, you can use `compare (l0, l1, ...) (r0, r1, ...)`
wingsorc has quit [Ping timeout: 248 seconds]
spip has joined #ocaml
dmbaturin_ is now known as dmbaturin
m5zs7k has quit [Ping timeout: 240 seconds]
m5zs7k has joined #ocaml
<discocaml> <froyo> NULL: I'm not, octachron: l0..n r0..n are fields in l & r structures
<discocaml> <froyo> let big_compare l r = cute way in which compares are composed for l & r fields
<discocaml> <octachron> `chain (chain compare x.field0 y.field0 compare) x.field1 y.field1 compare x.field2 y.field2`
<discocaml> <octachron> But you can go fancy: https://gist.github.com/Octachron/a96d56576c89bee3120721e20caab950
<discocaml> <octachron> (at least flambda seems to be able to avoid the polymorphic comparison for the two first fields)
riverdc has quit [Quit: quitting]
riverdc has joined #ocaml
gareppa has joined #ocaml
gareppa has quit [Remote host closed the connection]
<discocaml> <froyo> I was imagining some trick that uses the fact that compare returns int but this is way cool :P
Haudegen has quit [Quit: Bin weg.]
John_Ivan has joined #ocaml
Haudegen has joined #ocaml
<discocaml> <mwzm> why do I get an unbound constructor error for the following code?
<discocaml> <mwzm> ```
<discocaml> <mwzm> module type StackSig = sig
<discocaml> <mwzm> type 'a stack
<discocaml> <mwzm> end
<discocaml> <mwzm>
<discocaml> <mwzm> module ListStack : StackSig = struct
<discocaml> <mwzm> type 'a stack =
<discocaml> <mwzm> | Empty
<discocaml> <mwzm> | Entry of 'a * 'a stack
<discocaml> <mwzm>
<discocaml> <mwzm> end
<discocaml> <mwzm>
<discocaml> <mwzm> let _ = ListStack.Entry (1, ListStack.Empty);;
<discocaml> <mwzm> ```
<discocaml> <deepspacejohn> the `: StackSig` module type annotation hides the implementation, so code outside of your `ListStack` module can't "see" the constructors.
<discocaml> <deepspacejohn> It can only see exactly what's described in `StackSig`.
<discocaml> <deepspacejohn> You can either remove the `: StackSig` annotation to export the full definition of `ListStack` or you can add more information to the `StackSig` module type.
waleee has joined #ocaml
jonge[m] has joined #ocaml
<jonge[m]> Hi, i have a question about the market situation of ocaml. It seems that ocaml usage is growing this year for some reason. Is that correct, or is it just my social media bubble?
<companion_cube> it's hard to tell, but there is some buzz because of OCaml 5 I think
motherfsck has joined #ocaml
waleee has quit [Ping timeout: 265 seconds]
Tuplanolla has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
John_Ivan has quit [Quit: Disrupting the dragon's slumber one time too often shall eventually bestow upon all an empirical and indiscriminate conflagration that will last for all goddamn eternity.]
dme2_ has quit [Ping timeout: 248 seconds]
bgs has joined #ocaml
Haudegen has joined #ocaml
spip has quit [Quit: Konversation terminated!]
spip has joined #ocaml
Anarchos has joined #ocaml
waleee has joined #ocaml
Anarchos has quit [Client Quit]
<discocaml> <RegularSpatula> What does `proj` stand for in that gist?
<discocaml> <RegularSpatula> (in `| (typ, proj) :: q ->`)
<companion_cube> no idea, it's just a variable
<companion_cube> what's the context?
<discocaml> <octachron> projector or projection
<discocaml> <RegularSpatula> ah thought that might be it
<discocaml> <RegularSpatula> octachron: what was your training btw, math?
<discocaml> <RegularSpatula> (if you dont mind me asking)
<discocaml> <octachron> math as an undergraduate then (mathematical) physics
<discocaml> <RegularSpatula> ah cool
alexherbo2 has joined #ocaml
wingsorc has joined #ocaml
reynir1 is now known as reynir
waleee has quit [Ping timeout: 248 seconds]
waleee has joined #ocaml
waleee has quit [Remote host closed the connection]
waleee has joined #ocaml
bartholin has joined #ocaml
bgs has quit [Remote host closed the connection]
dhil has quit [Ping timeout: 250 seconds]
alexherbo2 has quit [Remote host closed the connection]
xd1le has quit [Quit: xd1le]
hannes has quit [Ping timeout: 240 seconds]
hannes has joined #ocaml
waleee has quit [Ping timeout: 250 seconds]
waleee has joined #ocaml
alexherbo2 has joined #ocaml
waleee has quit [Ping timeout: 250 seconds]
alexherbo2 has quit [Remote host closed the connection]
waleee has joined #ocaml
alexherbo2 has joined #ocaml
waleee has quit [Ping timeout: 250 seconds]
bartholin has quit [Quit: Leaving]
waleee has joined #ocaml
greenbagels has quit [Ping timeout: 250 seconds]
jsoo has quit [Ping timeout: 250 seconds]
ebb has quit [Ping timeout: 250 seconds]
jsoo_ has joined #ocaml
cross has quit [Ping timeout: 250 seconds]
cross has joined #ocaml
Tuplanolla has quit [Quit: Leaving.]
ebb has joined #ocaml
greenbagels has joined #ocaml
Haudegen has quit [Ping timeout: 256 seconds]