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/
mechap has quit [Ping timeout: 246 seconds]
mechap has joined #ocaml
infinity0 has quit [Ping timeout: 245 seconds]
infinity0 has joined #ocaml
mechap has quit [Ping timeout: 260 seconds]
mechap has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
wingsorc has quit [Quit: Leaving]
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
John_Ivan has quit [Ping timeout: 246 seconds]
xd1le has quit [Quit: xd1le]
waleee has quit [Ping timeout: 245 seconds]
spip has quit [Ping timeout: 240 seconds]
chrisz has quit [Ping timeout: 245 seconds]
chrisz has joined #ocaml
MarvelousWololo has joined #ocaml
neuroevolutus has joined #ocaml
neuroevolutus has quit [Client Quit]
TrillionEuroNote has quit [Ping timeout: 245 seconds]
TrillionEuroNote has joined #ocaml
Serpent7776 has joined #ocaml
mizlan has quit [Ping timeout: 246 seconds]
azimut has joined #ocaml
mizlan has joined #ocaml
noonien has quit [Ping timeout: 250 seconds]
MarvelousWololo has quit [Read error: Connection reset by peer]
xd1le has joined #ocaml
mizlan has quit [Ping timeout: 252 seconds]
olle has joined #ocaml
spip has joined #ocaml
bartholin has joined #ocaml
mizlan has joined #ocaml
mizlan has quit [Ping timeout: 272 seconds]
Tuplanolla has joined #ocaml
mizlan has joined #ocaml
mizlan has quit [Ping timeout: 264 seconds]
remexre has quit [Read error: Connection reset by peer]
remexre has joined #ocaml
mizlan has joined #ocaml
czy has quit [Ping timeout: 258 seconds]
tomku has quit [Ping timeout: 246 seconds]
mizlan has quit [Ping timeout: 245 seconds]
anpad has quit [Quit: ZNC 1.8.2 - https://znc.in]
anpad has joined #ocaml
mizlan has joined #ocaml
mechap has quit [Ping timeout: 245 seconds]
mechap has joined #ocaml
waleee has joined #ocaml
mechap has quit [Ping timeout: 258 seconds]
mechap has joined #ocaml
mechap has quit [Ping timeout: 264 seconds]
mechap has joined #ocaml
mizlan has quit [Ping timeout: 250 seconds]
mechap has quit [Remote host closed the connection]
mechap has joined #ocaml
mizlan has joined #ocaml
tomku has joined #ocaml
<discocaml> <dexmax> Is there a list function like hd that doesn't fail on an empty list and instead returns an empty list?
<companion_cube> it wouldn't have the correct type
<companion_cube> `List.hd [1] + 2` is ok, but `List.hd [] + 2` is not
<discocaml> <octachron> Well, one could use the `List.t` encoding of option to have
<discocaml> <octachron> `hd_opt_as_list: 'a list -> 'a list`. I am not sure if that function is really .. fruitful however.
<discocaml> <partial.evaluation> you could always boot up common lisp and get what you want
<discocaml> <contificate> at the cost of things you don't want
tomku has quit [Quit: Lost terminal]
waleee has quit [Ping timeout: 258 seconds]
waleee has joined #ocaml
tomku has joined #ocaml
<companion_cube> :D
<companion_cube> it exists, it's called Fun.id
<companion_cube> (for most intent and purpose anyway)
<discocaml> <deepspacejohn> I guess it would make sense if your objective is to "trim" a list, e.g. `trim: int -> 'a list -> 'a list` where you could use `trim 1 [1; 2; 3;] = [1]`
<companion_cube> `CCList.take 1` does it :)
<discocaml> <contificate> was looking at another stdlib impl via its odocs docs and realised that.. at least on that version of odoc, you can't.. Ctrl-f to find things by type
<companion_cube> does it capture ctrl-f?? :s
<discocaml> <contificate> nah, I think it just displays the type in some element that makes it hard to do a "literal" search - unless I'm sorely mistaken
<discocaml> <contificate> this is an older version though, I gather - and at least the docs on ocaml.org/p/ work w/ my browser's C-f
<companion_cube> hmm it works for me on firefox
<discocaml> <contificate> works for me in firefox as well
motherfsck has quit [Read error: Connection reset by peer]
<companion_cube> blame it on Sergei and Larry :p
<discocaml> <contificate> but is it showing a different page in firefox
<discocaml> <deepspacejohn> yeah, searching `'a t -> bool` works for me on that page, but I don't see `is_empty` on that page at all.
<discocaml> <contificate> haha what
<discocaml> <contificate> yeah, so I can search for `is_empty` on chromium, but not `'a t -> bool`, but I can search for instances of `'a t -> bool` that don't concern the non-present `is_empty` in Firefox
<discocaml> <contificate> maybe it's different in a modern build and this has already been addressed but is too obscure a piece of lore to have reached me yet
<discocaml> <deepspacejohn> oh nevermind, it's because I didn't open the collapsible section under `include Container.S1 with type 'a t := 'a t`. I see `is_empty` now.
<discocaml> <contificate> ah
<discocaml> <contificate> I'd still say that I can't search it in chromium, but maybe it's a me problem
<discocaml> <deepspacejohn> I just tried in chrome and it doesn't work for me too. Firefox works as expected. Weird...
<discocaml> <contificate> as I say, just something I noticed - maybe already discovered and addressed in newer version 🤷‍♂️
mizlan has quit [Ping timeout: 250 seconds]
John_Ivan has joined #ocaml
mizlan has joined #ocaml
berberman_ has quit [Quit: ZNC 1.8.2 - https://znc.in]
berberman has joined #ocaml
mechap has quit [Quit: WeeChat 4.0.2]
waleee has quit [Ping timeout: 245 seconds]
patrick has quit [Killed (NickServ (GHOST command used by patrick-!~patrick@fsf/member/patrick))]
patrick has joined #ocaml
sagax has joined #ocaml
dhil has joined #ocaml
MarvelousWololo has joined #ocaml
<olle> Is there an alternative to the |> operator that does not apply the piped functions? Until I "say so"
<olle> Well maybe just wrapping all of it in a lambda is enough
<discocaml> <contificate> I sometimes define "forward" composition, `let (>>) f g x = g (f x)` so I can like: `List.iter (foo >> bar) xs`
<discocaml> <contificate> point-free style isn't that common in OCaml though
<olle> Hm
<discocaml> <contificate> but yeah wrapping in lambda should suffice to delay it
kitzman has quit [Quit: C-x C-c]
kitzman has joined #ocaml
berberman has quit [Quit: ZNC 1.8.2 - https://znc.in]
berberman has joined #ocaml
<companion_cube> it just makes me angry at IO channels again :/
<sleepydog> companion_cube: what part are you angry at? i remember you made a modular IO RFC that got approved awhile back
<companion_cube> oh yeah, it was merged, but no one will have the patience to do it
<companion_cube> certainly not me :((
<sleepydog> ah, i saw the {In|Out}_channel modules come in at 4.1* and just assumed your ideas were taking time to percolate in. That's too bad, it's so nice being able to disguise arbitrary data sources behind a file-like interface in other languages
<companion_cube> it is!
waleee has joined #ocaml
<discocaml> <lubegasimon_> Do teams / individuals still use specification (pre-and postconditions) to reason about correctness or majority rely on writing tests?
<discocaml> <lubegasimon_> Do teams / individuals still use specifications (pre-and postconditions) to reason about correctness or majority rely on writing tests?
mechap has joined #ocaml
Everything has quit [Quit: leaving]
dhil has quit [Ping timeout: 264 seconds]
<discocaml> <sim642> In OCaml the first thing would be good typing even to rule out misuse if feasible
<discocaml> <sim642> Tests are probably more common. I don't remember seeing function contracts because they can't be automatically checked (easily)
<discocaml> <sim642> Property based testing would be somewhere between the two
Serpent7776 has quit [Quit: leaving]
bartholin has quit [Quit: Leaving]
olle has quit [Ping timeout: 272 seconds]
<discocaml> <Ada> yeah, i came to this conclusion myself. OPAM definitely has a learning curve coming from other languages but it works well
mechap has quit [Quit: WeeChat 4.0.2]
mechap has joined #ocaml
sagax has quit [Ping timeout: 246 seconds]
azimut has quit [Ping timeout: 240 seconds]
Everything has joined #ocaml
xd1le has quit [Quit: xd1le]
infinity0 is now known as Guest6325
infinity0 has joined #ocaml
Guest6325 has quit [Ping timeout: 272 seconds]
infinity0_ has joined #ocaml
infinity0 is now known as Guest4083
infinity0_ is now known as infinity0
Guest4083 has quit [Ping timeout: 272 seconds]