<neiluj>
brettgilio, great! teaching which subjects?
<brettgilio>
I'm certified in Biology, Earth Science, Mathematics, and Comp Sci,
<brettgilio>
neiluj
<neiluj>
impressive :)
<brettgilio>
The big difficulty with OCaml and Racket as an after-school club is the district is really big on Chromebooks
<brettgilio>
and I honestly have no idea if/how Chromebooks can run an OCaml environment.
<brettgilio>
lol
<brettgilio>
So it may have to be VPS-based
<neiluj>
arf, tricky stuff
<neiluj>
there's learn ocaml
<neiluj>
it's an online environment where you can put exercises along with checks, so that students get feedback about their code (how much tests are passing, etc.)
<Corbin>
If they were just Chromebooks, then https://github.com/dnschneid/crouton would be an option, but presumably they're *managed* too, which really does restrict the options.
<brettgilio>
Corbin My wife's district chromebook allows for a linux-based subsystem of some sort
<brettgilio>
so maybe they arent managed strict-enough to prohibit it
<brettgilio>
I might have to experiment
<brettgilio>
I'm not a fan of VSCode, but maybe https://coder.com/ can fulfill an aim using the ocaml platform
<neiluj>
yw. It's made by teachers at my uni, plus some very skilled OCaml programmers from company ocamlpro
<neiluj>
It was a really nice experience to solve exercises with it
<brettgilio>
neiluj do you use Emacs?
<brettgilio>
Just curious
<neiluj>
sometimes
<brettgilio>
What is your go-to OCaml env?
<neiluj>
I primarily code with vscode, with the ocaml platform extension
<neiluj>
for emacs you can use tuareg+merlin
<brettgilio>
Yeah, thats what I use. I was just generally curious about your preferences haha
<brettgilio>
Nosiness on my part
<neiluj>
yeah, just use whatever you're comfortable with
<neiluj>
good night!
waleee has quit [Ping timeout: 250 seconds]
neiluj has quit [Ping timeout: 258 seconds]
<brettgilio>
so i'm trying the ocamllabs platform, I am not sure I understand the "sandbox" concept. I have core installed in my switch, for example. But I can't `open Core` without getting a module unbound issue. So I am assuming that the lsp-server still relies on the .merlin file in some way?
<brettgilio>
I just think its odd that the sandbox identifies core from the switch but doesnt know to bind it to the environment automatically?
<brettgilio>
Unless I am doing something wrong
<drakonis>
oh
<drakonis>
you are
<drakonis>
it is in the environment, but you need to explicitly enable them
<drakonis>
if you're using dune, it is a bit easier since you can just declare them on the build files
<brettgilio>
is there a way to enable them without using dune (like by interacting with the lsp through vscode directly? a command I suppose)
<brettgilio>
in emacs there is a use-module through merlin
<drakonis>
although i'm sure i'm already telling you something you already now
<drakonis>
know
<brettgilio>
Right. I've got the dune side of it figured out. That is all swell. But for one-off module loading without using dune, what solution is there?
<brettgilio>
Like utop has #require
<drakonis>
hmm
<brettgilio>
merlin in emacs has use-module
<brettgilio>
but without having to add the dependency to the dune build manifest, what do we do?
<brettgilio>
(this could very well just be that im not experienced in vscode at all)
<drakonis>
findlib maybe?
<drakonis>
i think i recall reading something about finally making it easier to load modules
<Corbin>
I'm using Djinn, the Haskell tool, to figure out some nasty OCaml expressions. I don't feel bad about this, but are there similar tools better suited to OCaml?
mbuf has joined #ocaml
<companion_cube>
No one is using parametricity :)
<companion_cube>
Well, there's nothing equivalent I think. You may be trying to write Haskell disguised as OCaml
<Corbin>
I am definitely shopping for a compiler and runtime, it seems. I was idly considering looking into some Lisp compilers, too.
gzj has joined #ocaml
<Corbin>
I tried manually CPS'ing a bunch of code. It hasn't gone well. It would be way better if a compiler were doing it.
gravicappa has joined #ocaml
gzj has quit [Quit: Leaving]
ansiwen has joined #ocaml
berberman has joined #ocaml
berberman_ has quit [Ping timeout: 240 seconds]
<companion_cube>
Chez scheme ?
<Corbin>
I'm thinking of trying both Chez and Chicken. I don't know a whole lot about writing portable Scheme, so this'll be new.
malc has joined #ocaml
wilfred has joined #ocaml
nd__ has joined #ocaml
malc has quit [Quit: ERC (IRC client for Emacs 28.0.50)]
Serpent7776 has joined #ocaml
<d_bot>
<atsignhandle> Is there a preferred channel to post or ask if anyone is looking for work - obviously having to do with OCaml and blockchain stuff - extra points if you can guess the rest. DM me.
mro has joined #ocaml
bartholin has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
glassofethanol has joined #ocaml
malc has joined #ocaml
<Fardale>
@atsignhandle discuss can be use to post job offers.
wilfred has quit [Quit: Connection closed for inactivity]
mro has joined #ocaml
malc has quit [Ping timeout: 240 seconds]
average has quit [Quit: Connection closed for inactivity]
mro has quit [Remote host closed the connection]
kakadu has joined #ocaml
mro has joined #ocaml
mro has quit [Ping timeout: 258 seconds]
<d_bot>
<Ulugbek> re: .merlin configuration
<d_bot>
<Ulugbek> If you use `dune`, you don't need to write `.merlin` config files manually. `dune` and `merlin` communicate with each other, and `dune` passes `.merlin` to melrin directly.
mro has joined #ocaml
<Fardale>
The question was how to do it without dune. I should have mention that in my answer
<d_bot>
<Ulugbek> > so i'm trying the ocamllabs platform, I am not sure I understand the "sandbox" concept. I have core installed in my switch, for example. But I can't open Core without getting a module unbound issue. So I am assuming that the lsp-server still relies on the .merlin file in some way?
<d_bot>
<Ulugbek> Sandbox is basically an opam switch. You can set it by calling command "OCaml: Select Sandbox for this Workspace" or clicking on the package icon at the bottom of vscode. For example, I pick the switch `4.12.0`, where ocaml-lsp-server is installed along with other packages I use, and vscode OCaml Platform automatically runs the language server from that switch.
<d_bot>
<Ulugbek>
<d_bot>
<Ulugbek> Regarding "module not found", are you sure you indicated that your library/executable depends on "core"? Just installing a package, doesn't make it available for use. Your dune file for a library would look like
<d_bot>
<Ulugbek>
<d_bot>
<Ulugbek> ```
<d_bot>
<Ulugbek> (library
<d_bot>
<Ulugbek> (name my_lib)
<d_bot>
<Ulugbek> (libraries core))
<d_bot>
<Ulugbek> ```
<d_bot>
<Ulugbek>
<d_bot>
<Ulugbek> OCaml Platform extension offers a snippet `library` that can generate that for you.
Serpent7776 has quit [Read error: Connection reset by peer]
Serpent7776 has joined #ocaml
kevinsjoberg has joined #ocaml
mro has quit [Remote host closed the connection]
<d_bot>
<KevinSjoberg> 👋
mro has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
mro has quit [Ping timeout: 250 seconds]
nd__ has quit [Ping timeout: 258 seconds]
malc has quit [Quit: ERC (IRC client for Emacs 28.0.50)]
mro has joined #ocaml
nd__ has joined #ocaml
mro has quit [Ping timeout: 256 seconds]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
neiluj has joined #ocaml
mro has quit [Ping timeout: 276 seconds]
<neiluj>
Hello! Trying to extend a set with a functor, but somehow it's not found: https://bpa.st/TL2A
<neiluj>
Set1 is not found at line 15
mro has joined #ocaml
<octachron>
Set1 is at the expression level, and there is indeed no constructor named Set1 in scope.
<neiluj>
hmmm, so maybe put the functor S1 in the function make_set?
<neiluj>
or better yet, no need for a functor Set1, just include Set and call Set1.Make?
<neiluj>
arf no, the Set1 would escape its scope
<octachron>
no? You can just compute at the module with `let module S = Set1 ... in (module S)`
<octachron>
But with the current type constraints you are hiding the function added by the functor.
<neiluj>
yeah, it gets too tricky, is there maybe a simpler way to achieve this?
mro has quit [Remote host closed the connection]
Tuplanolla has joined #ocaml
<octachron>
I am not sure what you mean by "this".
<octachron>
Locally, you could define a `Make1` function that creates a `Set` module with your extended signature.
favonia has joined #ocaml
<neiluj>
Right, extend the Set module with a take function, then write a function that builds an "extended" set with the take and comparison functions.
<neiluj>
oh, that seems doable, going to try it, thanks!
mro has joined #ocaml
mro has quit [Remote host closed the connection]
average has quit [Quit: Connection closed for inactivity]
<neiluj>
still, it's not possible to pass the take function to the Ord module required by the Make functor
<neiluj>
is there a way to "inject" this take function into the Set1?
<neiluj>
or to be more precise, define
<octachron>
You need to redefine the `Make` functor in `Set1` and add the `take` function here rather than adding the `take` function to the `Ord` argument.
<neiluj>
oh, makes sense, thanks
<neiluj>
hmm, how would you pass the take function to a new Make1 functor? naively I'd copy the definition of Set.Make and then add the take function
<neiluj>
Maybe with a new module?
mro has joined #ocaml
<octachron>
"struct include Set.Make(Ord) let take ... end"
<neiluj>
wow, the ability to parametrize modules makes for succinct code!
<neiluj>
it's beautiful
<companion_cube>
it can be cool, yues
<companion_cube>
yes
waleee has quit [Ping timeout: 256 seconds]
mbuf has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
nd__ has quit [Ping timeout: 276 seconds]
mbuf has quit [Quit: Leaving]
nd__ has joined #ocaml
arbipher has joined #ocaml
arbipher has quit [Quit: Client closed]
mro has quit [Remote host closed the connection]
berberman_ has joined #ocaml
arbipher has joined #ocaml
berberman has quit [Ping timeout: 256 seconds]
arbipher has quit [Client Quit]
arbipher has joined #ocaml
<brettgilio>
Something I do not quite understand is how dot-merlin-reader works. After dune completes building, I do not see .merlin files in any of the source directories. How is merlin/dune reading the library module locations?
<companion_cube>
Merlin and dune communicate via a rpc system now
<brettgilio>
companion_cube, do you know of any documentation or explanation for this system?
<companion_cube>
There was a discuss announcement about it
<companion_cube>
Not sure how documented it is though.
<d_bot>
<monk> `sep` and every function after `>>` are themselves parser combinators that return a `('token, 'result) parser`. what i am wondering is there anyway to refactor the `fun x -> ....` pattern that i keep using on the right hand side of the monad operator?
<d_bot>
<monk> i didn't post a snippet per the description of #general
<d_bot>
<monk> i don't know how i pass/capture the knowledge of the specific tag to be matched that i currently do
<d_bot>
<monk> i.e `Symbol` vs `Str` vs `Ident` and so on
<d_bot>
<monk> i think i realized my solution... maybe
<d_bot>
<monk> make a parser for each enum tag, so `str` for `Str` that just does that right hand side work
<d_bot>
<Christophe> at the very least have you considered `map` instead of `bind` to avoid the return?
<d_bot>
<monk> oh lol
<d_bot>
<monk> thank you
<d_bot>
<monk> that's a pattern i totally forgot about
<d_bot>
<Christophe> then you can probably (assuming here that `map` is `>>|`) do `sep >> indent >>| implode >>| ident` if you have defined `let ident x = Ident x` the "smart constructors"
<d_bot>
<Christophe> oh wait there's a name conflict there
<d_bot>
<Christophe> but general idea
<d_bot>
<monk> yeah your idea is generally what i needed, i think
<d_bot>
<monk> thank you
gravicappa has quit [Ping timeout: 240 seconds]
waleee has joined #ocaml
tjammer has joined #ocaml
<d_bot>
<monk> so the small lib i was using provided `=>` as map and i defined another `=|` that ignores the result and maps (i know the token i want) and here's the result thus far