companion_cube changed the topic of #ocaml to: Discussion about the OCaml programming language | http://www.ocaml.org | OCaml 5.2.0 released: https://ocaml.org/releases/5.2.0 | Try OCaml in your browser: https://try.ocamlpro.com | Public channel logs at https://libera.irclog.whitequark.org/ocaml/
rgrinberg has quit [Quit: My Unrecognized Mac has gone to sleep. ZZZzzz…]
Anarchos has quit [Quit: Vision[]: i've been blurred!]
theblatte has quit [Ping timeout: 244 seconds]
theblatte has joined #ocaml
Tuplanolla has quit [Quit: Leaving.]
bibi__ has quit [Ping timeout: 248 seconds]
bibi__ has joined #ocaml
kurfen has quit [Ping timeout: 252 seconds]
ygrek has joined #ocaml
<discocaml> <astreamingcomesacrossthesky> What am I missing about `ocaml -I`? I have compiled ocaml libs in a directory I'm passing as the arg to -I but it doesn't work. However, if I add the extra path segment pointing to the directory containing the .cmi files, it does. Am I doing something stupid or does it only look at the top level of the specified directory?
ygrek has quit [Remote host closed the connection]
<discocaml> <astreamingcomesacrossthesky> What am I missing about `ocaml -I`? I have a directory containing directories of compiled ocaml libs. I pass this parent dir as the arg to -I but it doesn't work. However, if I add the extra path segment pointing to the directory containing the .cmi files themselves, it does. Am I doing something stupid or does it only look at the top level of the specified directory?
<discocaml> <chrisarmstrong> I don't think it works recursively; I believe you need to pass in each directory containing `.cmi` files as a parameter
<discocaml> <astreamingcomesacrossthesky> Good to know. I'm using a non-opam install of OCaml and I'm trying to wrap my head around how libraries are resolved. I suppose I can just add all the desired dirs to .ocamlinit so I don't have to specify them each time the top level is started
<discocaml> <chrisarmstrong> If you insist on not using opam, at least use `ocamlfind` to locate your libraries when calling the top-level
mbuf has joined #ocaml
kurfen has joined #ocaml
Serpent7776 has joined #ocaml
<discocaml> <inline_93060_96044> ocaml -I just works for flat folder structure, i just tried it on msys2 on windows
Inline has joined #ocaml
bartholin has joined #ocaml
Haudegen has joined #ocaml
agentcasey has quit [Ping timeout: 260 seconds]
cr1901 has quit [Read error: Connection reset by peer]
cr1901 has joined #ocaml
bartholin has quit [Quit: Leaving]
Inline has quit [Read error: Connection reset by peer]
Haudegen has quit [Quit: Bin weg.]
Inline has joined #ocaml
<discocaml> <pierrels> Is it possible to use `Alcotest.skip ()` inside of a QCheck test to make it skip the overlying Alcotest test ? Something like :
<discocaml> <pierrels> ```ocaml
<discocaml> <pierrels> let qcheck_test = QCheck.Test.make ~count:100 ~name:"test" QCheck.(int) (fun k -> Alcotest.skip ()) in
<discocaml> <pierrels> let alcotest_test = QCheck_alcotest.to_alcotest qcheck_test in
<discocaml> <pierrels> Alcotest.run "?" [ "test", [alcotest_test]]
<discocaml> <pierrels> ```
<discocaml> <pierrels> I would like it to mark this test as skipped, instead it is marked as a failed test because it raises the Skip exception from Alcotest core.
alexherbo2 has joined #ocaml
mbuf has quit [Read error: Connection reset by peer]
olle has joined #ocaml
mange has quit [Remote host closed the connection]
domq has joined #ocaml
domq has quit [Quit: domq]
domq has joined #ocaml
Anarchos has joined #ocaml
gentauro has quit [Read error: Connection reset by peer]
gentauro has joined #ocaml
ygrek has joined #ocaml
alexherbo2 has quit [Ping timeout: 240 seconds]
trillion_exabyte has quit [Ping timeout: 248 seconds]
trillion_exabyte has joined #ocaml
<discocaml> <drupyog> Credits to Sebastien Micheland for the idea. Special dédicace to @companion_cube , Fold and simple filters as let-operators:
<discocaml> <drupyog>
<discocaml> <drupyog> ```ocaml
<discocaml> <drupyog> let (let<@) (lst, acc) expr = List.fold_left (fun a b -> expr (b,a)) acc lst
<discocaml> <drupyog> let (and@) (lst : _ list) acc = (lst, acc)
<discocaml> <drupyog> let (and+) l l' = List.map2 (fun x y -> x,y) l l'
<discocaml> <drupyog> let (and*) l l' = List.concat_map (fun x -> List.map (fun y -> x,y) l') l
<discocaml> <drupyog> let (and?=) l v = List.filter_map (fun x -> if x = v then Some (x,()) else None) l
<discocaml> <drupyog> ```
<discocaml> <drupyog>
<discocaml> <drupyog> ```ocaml
<discocaml> <drupyog> let<@ n=[1;2;3]
<discocaml> <drupyog> and=? () = 2
<discocaml> <drupyog> and* m=["foo";"bar";"baz"]
<discocaml> <drupyog> and@ acc="stuff: " in acc^m ^ string_of_int n ;;
<discocaml> <drupyog> - : string = "stuff: foo2bar2baz2"
<discocaml> <drupyog> ```
<discocaml> <drupyog> (I might have a bunch of let-operators to write fake-comprehension on Iters and Seqs in *several* different projets)
<companion_cube> 😂
<companion_cube> I really use `let@` a lot these days
<discocaml> <drupyog> What's `let@` ?
<companion_cube> omg
<companion_cube> `let (let@) = (@@)`
<olle> Just go full Forth at that point
<companion_cube> look at what Gleam did btw
<companion_cube> to just avoid most of the pain with only the equivalent of `let@`
<discocaml> <deepspacejohn> oh yeah let@ is great. I use it all the time.
<discocaml> <drupyog> Wait, how do you us that ?
<companion_cube> let@ ic = with_open "foo" in
<discocaml> <drupyog> oh right
<companion_cube> let@ x = Lock.with protected in
<discocaml> <drupyog> that explains a lot why I don't see the point
<discocaml> <drupyog> (I don't write code like that a lot)
<companion_cube> let@ _sp = Trace.with_span "doing foo" in
<companion_cube> heh :)
<discocaml> <drupyog> (however, I do walk over really weird iteration spaces a lot ...)
<companion_cube> heh :)
<companion_cube> I suspect `let@` would work nicely with `Iter`
<companion_cube> already CPS
<discocaml> <drupyog> Well, it's basically Iter.iter
<discocaml> <drupyog> @companion_cube jokes aside, the let-operators for fold `let@>` and `and@` would fit nicely in lot's of container's stuff
<discocaml> <drupyog> (probably with other names)
<companion_cube> yeah it reads weirdly I guess 😅
<discocaml> <drupyog> it's actually quite nice, you declare you are doing a fold, and the `and@` denotes the accumulator
<discocaml> <yawaramin> on a related note, https://github.com/ocaml/ocaml/pull/13698
<olle> yawaramin, can you add a use-case with and without this op?
<olle> Wait I have to leave anyway
<olle> Still tho
<discocaml> <smondet> The older PR has a bunch of examples https://github.com/ocaml/ocaml/pull/9887
<olle> smondet cool, thanks!
olle has quit [Ping timeout: 248 seconds]
mbuf has joined #ocaml
euphores has joined #ocaml
ygrek has quit [Remote host closed the connection]
spynxic has quit [*.net *.split]
deadmarshal_ has quit [*.net *.split]
pie_ has quit [*.net *.split]
omegatron has quit [*.net *.split]
remexre has quit [*.net *.split]
deavmi has quit [*.net *.split]
malte has quit [*.net *.split]
buoy49__ has quit [*.net *.split]
Boarders_____ has quit [*.net *.split]
zozozo has quit [*.net *.split]
copy has quit [*.net *.split]
ocabot has quit [*.net *.split]
CalimeroTeknik has quit [*.net *.split]
xenu has quit [*.net *.split]
deadmarshal_ has joined #ocaml
spynxic has joined #ocaml
omegatron has joined #ocaml
malte has joined #ocaml
Boarders_____ has joined #ocaml
buoy49__ has joined #ocaml
deavmi has joined #ocaml
remexre has joined #ocaml
pie_ has joined #ocaml
CalimeroTeknik has joined #ocaml
zozozo has joined #ocaml
copy has joined #ocaml
ocabot has joined #ocaml
xenu has joined #ocaml
bartholin has joined #ocaml
mbuf has quit [Quit: Leaving]
domq has quit [Quit: domq]
pie_ has quit [Quit: No Ping reply in 180 seconds.]
pie_ has joined #ocaml
Tuplanolla has joined #ocaml
myrkraverk_ has quit [Read error: Connection reset by peer]
myrkraverk has joined #ocaml
ygrek has joined #ocaml
pie_ has quit [Quit: No Ping reply in 180 seconds.]
pie_ has joined #ocaml
ygrek has quit [Remote host closed the connection]
Serpent7776 has quit [Ping timeout: 252 seconds]
rgrinberg has joined #ocaml
bartholin has quit [Quit: Leaving]
rgrinberg has quit [Quit: My Unrecognized Mac has gone to sleep. ZZZzzz…]
rgrinberg has joined #ocaml
rgrinberg has quit [Client Quit]
mange has joined #ocaml
rgrinberg has joined #ocaml
tobiasu has quit [Quit: WeeChat 3.8]