companion_cube changed the topic of #ocaml to: Discussion about the OCaml programming language | http://www.ocaml.org | OCaml 4.12 released: https://ocaml.org/releases/4.12.0.html | Try OCaml in your browser: https://try.ocamlpro.com | Public channel logs at https://libera.irclog.whitequark.org/ocaml/
leah2 has quit [Read error: Connection reset by peer]
waleee has quit [Ping timeout: 244 seconds]
Haudegen has quit [Ping timeout: 244 seconds]
Tuplanolla has quit [Quit: Leaving.]
zebrag has quit [Quit: Konversation terminated!]
mikess has quit [Ping timeout: 272 seconds]
<d_bot> <ggole> OCaml doesn't really have constants at all at the language level
hackinghorn has quit [Quit: Leaving]
unyu has quit [Quit: WeeChat 3.1]
mbuf has joined #ocaml
unyu has joined #ocaml
wonko has joined #ocaml
mro has joined #ocaml
yoctocell has joined #ocaml
waleee has joined #ocaml
waleee has quit [Ping timeout: 264 seconds]
mro has quit [Remote host closed the connection]
<Chouhartem> who needs const when you have unmutable ?
<fluxm> (c++) const is actually quite a nice feature when you do have mutability somewhere. there are some phantom-based implementations of those, but they obvously work only when the type in question has been built with support for them.
<fluxm> I believe there are e.g. mutable/const string libraries out there with phantom types indicating access
bartholin has joined #ocaml
olle_ has joined #ocaml
wonko has quit [Ping timeout: 244 seconds]
Tuplanolla has joined #ocaml
wonko has joined #ocaml
wonko has quit [Ping timeout: 252 seconds]
leah2 has joined #ocaml
oriba has joined #ocaml
Serpent7776 has joined #ocaml
Haudegen has joined #ocaml
mro has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
bartholin has quit [Ping timeout: 252 seconds]
bastienleonard has joined #ocaml
bartholin has joined #ocaml
mro_ has joined #ocaml
mro has quit [Ping timeout: 272 seconds]
thinking-tower has joined #ocaml
thinking-tower has quit [Client Quit]
zebrag has joined #ocaml
zebrag has quit [Quit: Konversation terminated!]
zebrag has joined #ocaml
mro_ has quit [Remote host closed the connection]
mro has joined #ocaml
berberman_ has joined #ocaml
berberman has quit [Ping timeout: 272 seconds]
dhil has joined #ocaml
bartholin has quit [Ping timeout: 256 seconds]
dhil has quit [Ping timeout: 272 seconds]
bartholin has joined #ocaml
dhil has joined #ocaml
octocelly has joined #ocaml
octocelly has quit [Remote host closed the connection]
leah2 has quit [*.net *.split]
Tuplanolla has quit [*.net *.split]
yoctocell has quit [*.net *.split]
leah2 has joined #ocaml
Tuplanolla has joined #ocaml
mikess has joined #ocaml
mbuf has quit [Quit: Leaving]
bartholin has quit [Quit: Leaving]
pippijn has quit [Ping timeout: 252 seconds]
sadiq has quit [Ping timeout: 252 seconds]
vsiles has quit [Ping timeout: 252 seconds]
vsiles has joined #ocaml
sadiq has joined #ocaml
pippijn has joined #ocaml
zebrag has quit [Remote host closed the connection]
waleee has joined #ocaml
zebrag has joined #ocaml
zebrag has quit [Remote host closed the connection]
waleee has quit [Ping timeout: 268 seconds]
waleee has joined #ocaml
zebrag has joined #ocaml
olle_ has quit [Ping timeout: 252 seconds]
zebrag has quit [Remote host closed the connection]
yoctocell_ has joined #ocaml
yoctocell_ has quit [Client Quit]
yoctocell has joined #ocaml
olle_ has joined #ocaml
zebrag has joined #ocaml
olle_ has quit [Ping timeout: 268 seconds]
mikess has quit [Ping timeout: 264 seconds]
wingsorc has joined #ocaml
TheLemonMan has joined #ocaml
mikess has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
zebrag has quit [Remote host closed the connection]
zebrag has joined #ocaml
olle has joined #ocaml
waleee has quit [Ping timeout: 265 seconds]
waleee has joined #ocaml
dhil has quit [Ping timeout: 268 seconds]
bartholin has joined #ocaml
waleee has quit [Ping timeout: 265 seconds]
waleee has joined #ocaml
waleee has quit [Ping timeout: 264 seconds]
notnotdan has quit [Quit: bye]
olle has quit [Ping timeout: 272 seconds]
mro has quit [Quit: Leaving...]
oriba has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
bastienleonard has quit [Ping timeout: 244 seconds]
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
bastienleonard has joined #ocaml
bartholin has quit [Ping timeout: 245 seconds]
mro has joined #ocaml
waleee has joined #ocaml
mro has quit [Quit: Leaving...]
waleee has quit [Ping timeout: 244 seconds]
bartholin has joined #ocaml
koorogi has left #ocaml [WeeChat 3.1]
waleee has joined #ocaml
gareppa has joined #ocaml
olle has joined #ocaml
<olle> Is there a map function that takes the current list item *and* the previous one?
<olle> I want to filter by predicate depending on previous item in a sorted list.
<thizanne> olle: there isn't "as is", but you can do that with a fold
<thizanne> something like List.fold_right (fun current (previous, result) -> if predicate previous elem then (current, current :: result) else (current, result))
waleee has quit [Ping timeout: 272 seconds]
waleee has joined #ocaml
waleee has quit [Ping timeout: 272 seconds]
waleee has joined #ocaml
<olle> thizanne: Hm, yeah
<olle> Thanks
Techcable has quit [Quit: ZNC - https://znc.in]
Techcable has joined #ocaml
waleee has quit [Ping timeout: 264 seconds]
gareppa has quit [Quit: Leaving]
waleee has joined #ocaml
<companion_cube> thizanne: you mean fold left, right? :p
<companion_cube> (does anyone actually use fold_right?)
wonko has joined #ocaml
dhil has joined #ocaml
bartholin has quit [Ping timeout: 252 seconds]
waleee has quit [Ping timeout: 268 seconds]
waleee has joined #ocaml
bartholin has joined #ocaml
waleee has quit [Ping timeout: 272 seconds]
waleee has joined #ocaml
olle has quit [Ping timeout: 272 seconds]
Serpent7776 has quit [Quit: leaving]
<thizanne> companion_cube: how are you writing filter with fold_left ?
<thizanne> obviously if the order doesn't matter or it's actually not a filter-like function that you want, fold_left is likely a best bet
wonko has quit [Ping timeout: 245 seconds]
bastienleonard has quit [Quit: WeeChat 3.1]
bartholin has quit [Quit: Leaving]
mikess has quit [Ping timeout: 264 seconds]
<companion_cube> with List.rev afterwards :p
<companion_cube> I avoid non tailrec functions in general
vb has quit [Ping timeout: 264 seconds]
vb has joined #ocaml
Tuplanolla has quit [Quit: Leaving.]
yoctocell has quit [Ping timeout: 268 seconds]
mikess has joined #ocaml