rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
zebrag has quit [Quit: Konversation terminated!]
rgrinberg has joined #ocaml
gravicappa has joined #ocaml
Techcable has quit [Ping timeout: 240 seconds]
gravicappa has quit [Ping timeout: 260 seconds]
Serpent7776 has joined #ocaml
dwt_ has quit [Ping timeout: 240 seconds]
waleee has joined #ocaml
mro has joined #ocaml
_whitelogger has joined #ocaml
mro has quit [Remote host closed the connection]
x88x88x has quit [Remote host closed the connection]
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
x88x88x has joined #ocaml
x88x88x has quit [Remote host closed the connection]
x88x88x has joined #ocaml
noze` has joined #ocaml
noze` is now known as noze
<noze>
when running `opam remove xyz`, opam tries to upgrade packages
CodeBitCookie[m] has joined #ocaml
<noze>
why
Techcable has joined #ocaml
dwt_ has joined #ocaml
<noze>
(the reason opam is giving me is that it's because of "[upstream or system changes]")
gravicappa has joined #ocaml
jlrnick has joined #ocaml
Haudegen has joined #ocaml
<hackinghorn>
how do I check if a list is empty?
<hackinghorn>
there is no List.empty
<hackinghorn>
length is 0 maybe
<hackinghorn>
oh there is is_empty
<octachron>
You should pattern match the list `match l with [] -> ...`
<noze>
`l = []`
mro has joined #ocaml
mro has quit [Ping timeout: 268 seconds]
jlrnick has quit [Ping timeout: 250 seconds]
mro has joined #ocaml
<d_bot>
<Et7f3> if you do that you will compute length so if the list has many element you will get a long loop and technically 1, 2 or 1_000_000 we don't care
mro has quit [Remote host closed the connection]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
bartholin has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
jlrnick has joined #ocaml
jlrnick has quit [Ping timeout: 256 seconds]
mro has quit [Ping timeout: 268 seconds]
shawnw has quit [Ping timeout: 260 seconds]
xiongxin has joined #ocaml
Anarchos has joined #ocaml
<d_bot>
<Continuation Calculus> yes
<Anarchos>
where can i find some simple samples of colored pretty printing of tree structures ?
Haudegen has quit [Quit: Bin weg.]
romildo has joined #ocaml
perrierjouet has quit [Quit: WeeChat 3.3]
perrierjouet has joined #ocaml
sluigi has joined #ocaml
<sluigi>
How do you check if two objects (which have type an ADT that I defined) are structurally equal in OCaml? I'm using Core
<sluigi>
I tried phys_equal but I created two identical objects and it's saying they're not the same :)
<d_bot>
<NULL> Using `(=)` ?
<sluigi>
I think (=) has type Int -> Int?
<d_bot>
<NULL> Ah right, Core
<d_bot>
<NULL> You define your own equality then, I think
<d_bot>
<NULL> Maybe there's a ppax to do that for you
<d_bot>
<VPhantom> There are explicitly polymorphic operations in Core I think, but I'm not sure that would cover arbitrary objects because it uses the hashing function which has limits (like 10 items in lists I think?)
<d_bot>
<VPhantom> Oh, that PPX looks promising for saving on boilerplate!
<sluigi>
is there something special I have to do to get my compiler to recognize ppx's
<d_bot>
<NULL> Isn't Core's poly equality simply the Stdlib's ? In any case, they advise against polymorphic equality so it's better to write/generate your own
<d_bot>
<NULL> If you use dune, you have to add the ppx to the list of (preprocessor IIRC)
<Leonidas>
VPhantom: ppx_deriving comes with an implementation of `eq` which derives compare.
mro has joined #ocaml
<Leonidas>
sluigi: normally you add it to dune and that's it. The OCaml compiler ignores PPX extension nodes by default.
xiongxin has quit [Ping timeout: 250 seconds]
xiongxin has joined #ocaml
sluigi has quit [Ping timeout: 256 seconds]
<octachron>
The compiler ignores attributes by default, it raises an error on extension nodes ([%ext ... ])
<Leonidas>
Is that new? I remember there was a dune warning about "left-over" extension nodes. Or am I misremembering things?
<octachron>
You probably are thinking of left-over attributes? Non-interpreted extension nodes cannot be interpreted by the compiler, it has no other choices than failing.
Guest9603 has joined #ocaml
Haudegen has joined #ocaml
mro has quit [Read error: Connection reset by peer]
mro_ has joined #ocaml
<companion_cube>
o/
romildo has quit [Quit: Leaving]
mro_ has quit [Remote host closed the connection]
xiongxin has quit [Remote host closed the connection]
<Anarchos>
hello companion_cube. Where can i find examples on prettyprinting with color in terminal ?
<companion_cube>
in the documentation of Fmt or CCFormat
<Anarchos>
companion_cube thanks , i have troubles to see some gallereies of output samples
<companion_cube>
because you can just load it in utop and play with it?
<Anarchos>
i want to debug my formal verifier, and i need to dump proof terms with colors, either i can not understand the mess...
<Leonidas>
Fmt is clearly missing blink and marquee features
<companion_cube>
:D
<companion_cube>
not sure terminals offer that
<Anarchos>
i just need colors, but i have so bad taste, i need to copy log format of others...
<d_bot>
<Et7f3> the jsx just generate a string you can dump with print_endline
mro has quit [Quit: Leaving...]
Haudegen has quit [Quit: Bin weg.]
rgrinberg has joined #ocaml
Anarchos has quit [Quit: Client closed]
bartholin has quit [Quit: Leaving]
kronicmage has joined #ocaml
<kronicmage>
Hey folks, is there an equivalent of Haskell's `(>>) a b = a >>= fun _ -> b` in Jane street core or elsewhere?
<zozozo>
kronicmage: I don't think so, for the very good reason that since ocaml evaluates arguments before the function call, the b argument would not be "hidden"behind the function
<zozozo>
Plus, given the current order of evaluation of arguments, b would be evaluated before a, if I'm not mistaken
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mro has joined #ocaml
Haudegen has joined #ocaml
<d_bot>
<arctumn> Lazy library wont help him?
<kronicmage>
Yeah I was just gonna say that
<kronicmage>
You think we can write `(>>) a b = a >>= \fun _ -> Lazy.force b` instead?
<kronicmage>
It would be less ergonomical then Haskell sure, but maybe we can write a ppx similar to ppx_let for that
<zozozo>
Recent versions of ocaml have had monadic let* operators introduced for that kind of thing actually
<companion_cube>
still kind of sad that `;*` isn't sugar for `let*() = … in`
<d_bot>
<antron> companion_cube: might be very amusing with all the string you can substitute for `*`
mro has quit [Remote host closed the connection]
<companion_cube>
do_a ;!??!?!?!? do_b
<companion_cube>
(gota get the right operator, not ;!??!!¿!?)
<d_bot>
<antron> RIP
<d_bot>
<VPhantom> I wasn't a fan of the chosen syntax for let bindings, but actually using them they quickly grew on me. It's as close as you can get to looking and feeling exactly like regular bindings, especially with the later addition of let punning.
mro has joined #ocaml
Anarchos has joined #ocaml
mro has quit [Remote host closed the connection]
rgrinberg has joined #ocaml
mro has joined #ocaml
namkeleser has joined #ocaml
<d_bot>
<zakkor> is it just me that finds matrices easier to work with using an iterative approach / mutation rather than using a functional approach?
<d_bot>
<NULL> They are not a recursive structure, so they're difficult / annoying to manipulate with recursive functions
vicfred has joined #ocaml
lagash has quit [Ping timeout: 252 seconds]
Serpent7776 has quit [Quit: leaving]
vicfred has quit [Quit: Leaving]
xd1le has joined #ocaml
lagash has joined #ocaml
kolexar has joined #ocaml
Anarchos has quit [Quit: Vision[]: i've been blurred!]