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/
TakinOver has joined #ocaml
hockpa2e has quit [Quit: basement]
<d_bot> <inkbottle> Latest `eglot` is working out of the box, no configuration needed. Just drop
<d_bot> <inkbottle> ```"devDependencies": {
<d_bot> <inkbottle> "@opam/ocaml-lsp-server": "1.6.1",
<d_bot> <inkbottle> ...```
<d_bot> <inkbottle> in your `package.json` (`esy`). Then run `esy emacs`. Then `M-x package-install` `eglot`. Then `M-x eglot`. (For the purpose of that test, I removed everything related to ocaml from my `dot-emacs`.)
eight has quit [Quit: Lost terminal]
aquijoule_ has joined #ocaml
richbridger has quit [Ping timeout: 268 seconds]
waleee has quit [Ping timeout: 272 seconds]
<d_bot> <inkbottle> ```"devDependencies": {
<d_bot> <inkbottle> "@opam/ocaml-lsp-server": "ulugbekna/ocaml-lsp:ocaml-lsp-server.opam#01e9c4bc798",
<d_bot> <inkbottle> ...```
<d_bot> <inkbottle> in `esy` `package.json`. Maybe. (Instead of what there is right above.)
zebrag has quit [Quit: Konversation terminated!]
jinsun has joined #ocaml
mbuf has joined #ocaml
gravicappa has joined #ocaml
insep has quit [Read error: Connection reset by peer]
insep has joined #ocaml
insep has quit [Read error: Connection reset by peer]
insep has joined #ocaml
insep has quit [Read error: Connection reset by peer]
insep has joined #ocaml
elf_fortrez has joined #ocaml
elf_fortrez has quit [Write error: Broken pipe]
minwuekim has quit [Remote host closed the connection]
minwuekim has joined #ocaml
wilfred has joined #ocaml
shawnw has quit [Ping timeout: 268 seconds]
Haudegen has joined #ocaml
vizard has joined #ocaml
bartholin has joined #ocaml
<d_bot> <Ulugbek> Yes, that was the problem, thanks 🙂
olle has joined #ocaml
wilfred has quit [Quit: Connection closed for inactivity]
dhil has joined #ocaml
vsiles has quit [Remote host closed the connection]
minwuekim has quit [Ping timeout: 245 seconds]
vsiles has joined #ocaml
adanwan has quit [Remote host closed the connection]
adanwan has joined #ocaml
minwuekim has joined #ocaml
insep has quit [Ping timeout: 272 seconds]
cedric has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
minwuekim has quit [Ping timeout: 245 seconds]
minwuekim has joined #ocaml
<dmbaturin> octachron: Regarding the string escaping. The current function makes an effort to allocate a buffer of exactly the size needed for the target string. Do you think avoiding reallocations is important for its performance, or something along these lines would work just as well: https://bpa.st/KRFFGHCCOIJTDRPMU5EVFNFS4U ?
Haudegen has joined #ocaml
waleee has joined #ocaml
<octachron> dmbaturin, that might be acceptable in theory, but String is a dependency of Buffer.
<dmbaturin> octachron: Well, it's a quick prototype. I wasn't aware that Buffer depends on String, that will sure lead to adjustments.
<d_bot> <thangngoc89> Does tyxml-jsx treat `className` specially?
<d_bot> <thangngoc89> I try to add `className` props to a custom element and receive type error
<d_bot> <thangngoc89> ```
<d_bot> <thangngoc89> Error: The function applied to this argument has type
<d_bot> <thangngoc89> ?className:Html_types.nmtoken ->
<d_bot> <thangngoc89> [> Html_types.section ] Tyxml_html.elt
<d_bot> <thangngoc89> This argument cannot be applied with label ~class
<d_bot> <thangngoc89> ```
<d_bot> <thangngoc89> It's a very simple component
<d_bot> <thangngoc89> ```reasonml
<d_bot> <thangngoc89> module SearchWidgetRow = {
<d_bot> <thangngoc89> let createElement = (~className="", ~children, ()) => {
<d_bot> <thangngoc89> <section
<d_bot> <thangngoc89> className=[
<d_bot> <thangngoc89> "flex flex-shrink-0 justify-between max-w-full w-full rounded-2xl px-2 md:px-4",
<d_bot> <thangngoc89> className,
<d_bot> <thangngoc89> ]>
<d_bot> <thangngoc89> ...children
<d_bot> <thangngoc89> </section>;
<d_bot> <thangngoc89> };
<d_bot> <thangngoc89> };
<d_bot> <thangngoc89> ```
<d_bot> <thangngoc89> renaming `className` to anything else would resolve the error
berberman has quit [Quit: ZNC 1.8.2 - https://znc.in]
berberman has joined #ocaml
berberman_ has joined #ocaml
<olle> o0
berberman has quit [Ping timeout: 268 seconds]
mbuf has quit [Quit: Leaving]
<olle> Try asking in the Reason discord channel
<companion_cube> also, for large snippets of code, please use a pastebin (read the topic)
berberman has joined #ocaml
berberman_ has quit [Ping timeout: 268 seconds]
berberman has quit [Quit: ZNC 1.8.2 - https://znc.in]
berberman has joined #ocaml
berberman has quit [Quit: ZNC 1.8.2 - https://znc.in]
berberman has joined #ocaml
<d_bot> <thangngoc89> sorry for dumping the code snippet
<d_bot> <thangngoc89> I'll try reasonml channe;
glassofethanol has joined #ocaml
<d_bot> <thangngoc89> Quick recap: there is an open issue regarding this here https://github.com/ocsigen/tyxml/issues/275
mbuf has joined #ocaml
berberman has quit [Quit: ZNC 1.8.2 - https://znc.in]
berberman has joined #ocaml
<d_bot> <Cyclomatic Complexity> `(f a , f b , f c)` 's evaluation order go through `f c` then `f b` and finally `f a`??
<d_bot> <Cyclomatic Complexity> oh wow, it does, i thought it might have been a JSOO artifact
<d_bot> <Cyclomatic Complexity> I knew that was the case for function args, but not for tuples too
<Armael> its much better to use lets in that case to make the evaluation order explicit
<d_bot> <Cyclomatic Complexity> Yeah, that's what I did, it does make sense
minwuekim has quit [Read error: Connection reset by peer]
<d_bot> <Cyclomatic Complexity> I am getting partial-match warnings in VsCode LSP even though it builds and the case are actually refuted by the GADT
minwuekim has joined #ocaml
<d_bot> <Cyclomatic Complexity> How should I go debugging this?
<d_bot> <Cyclomatic Complexity> (My build doesn't remove warnig 8, I added a `let [ 1 ] = [ 1 ] in` just to be sure, and it does trigger the error)
<d_bot> <octachron> @Cyclomatic Complexity : do you have a refutation clause in your match?
Haudegen has quit [Quit: Bin weg.]
<d_bot> <Cyclomatic Complexity> @octachron it's `let`
<d_bot> <octachron> Did you try with a match to see if the false positive is still there?
<d_bot> <Cyclomatic Complexity> I just did:
<d_bot> <Cyclomatic Complexity> and it still builds without warning
<d_bot> <Cyclomatic Complexity> ~~at least it's not the whole function that is in yellow now~~
<d_bot> <octachron> With a refutation cluase `_ -> .`, a missing branch is an error (not a warning).
<d_bot> <octachron> If the error persists after building, this means that this is not even a synchronization problem. Maybe an issue with local abstract type used as a type-level tag?
oriba has joined #ocaml
<d_bot> <Cyclomatic Complexity> The error is not here in the build
<d_bot> <Cyclomatic Complexity> Only in the editor
<d_bot> <Cyclomatic Complexity> > Maybe an issue with local abstract type used as a type-level tag?
<d_bot> <Cyclomatic Complexity> I have no idea what this means
<d_bot> <Cyclomatic Complexity> let me copy some code so that you have more context
<d_bot> <Cyclomatic Complexity> https://pastebin.com/E4rjBTtK
<d_bot> <inkbottle> @Ulugbek I'm now using your `refactor-open` branch. I've inserted the specific dependencies in `esy` `package.json`, as I described in previous message.
<d_bot> <inkbottle> And it did work with `emacs` `lsp-mode`: `M-x lsp-execute-code-action`, `Select code action: Put module name in identifiers`.
<d_bot> <inkbottle> It does work with `eglot` too.
<d_bot> <inkbottle> Nice.
<d_bot> <Ulugbek> That code action will become even nicer when [merlin#1313](github.com/ocaml/merlin/pull/1313) and [merlin#1314](github.com/ocaml/merlin/pull/1314) land
<d_bot> <octachron> @Cyclomatic Complexity : I don't even get a false positive with just merlin. So that might be an ocamllsp bug somehow?
<d_bot> <Cyclomatic Complexity> ouch
<d_bot> <Cyclomatic Complexity> possibly, @EduardoRFS can help later
<d_bot> <Ulugbek> If you create an issue in the https://github.com/ocaml/ocaml-lsp/issues/ with a (preferably minimal) reproducible case with info about your setup (ocaml-lsp and ocaml compiler versions), I can have a look. Most likely it's either stale diagnostics (I would try rebuilding the project and restarting the language server) or a merlin bug (it may not appear for octachron if he uses a different version of merlin)
<d_bot> <lubega-simon> I get an error when I try to pin odoc to a specific url in my case, a pull request branch
<d_bot> <Cyclomatic Complexity> rebuilding the project as in, copy-pasting it into another folder and re-running esy?
<d_bot> <Cyclomatic Complexity> or just dune clean?
<d_bot> <Ulugbek> I had `dune clean` in mind
<d_bot> <Cyclomatic Complexity> same problem
<d_bot> <Cyclomatic Complexity> i reloaded everything, restarted the language server, etc.
<d_bot> <Cyclomatic Complexity> how can i check my merlin version?
<d_bot> <Ulugbek> try `opam pin add odoc https://github.com/lubegasimon/odoc.git\#flat-files-v2`
<d_bot> <Ulugbek> ocaml-lsp vendors merlin, so it's the ocaml-lsp version that you should check to see which merlin commit is vendored
<d_bot> <Cyclomatic Complexity> It's not part of the package.json
<d_bot> <Cyclomatic Complexity> I'll check on vscode if it appears somewhere
<d_bot> <Ulugbek> you said it's a `let`. Can you maybe do `let a = match expr with your_pat as p -> p | _ -> .` if that makes sense?
<d_bot> <Cyclomatic Complexity> OCaml Platform 1.8.4 if this helps anyone
<d_bot> <Cyclomatic Complexity> let me do so
<d_bot> <Cyclomatic Complexity> exactly the same problem
<d_bot> <Cyclomatic Complexity> oh wait
<d_bot> <Cyclomatic Complexity> i did `let your_pat = match expr with your_pat_with_anon_vars as p -> p | _ -> .`
<d_bot> <Cyclomatic Complexity> if i do `let a` instead of `let your_pat`, the code is expectedly ill-typed, because there are used variables in `your_pat`
eight has joined #ocaml
<d_bot> <lubega-simon> it worked, thanks @Ulugbek
minwuekim has quit [Ping timeout: 245 seconds]
olle has quit [Ping timeout: 268 seconds]
glassofethanol has quit [Quit: leaving]
mbuf has quit [Quit: Leaving]
minwuekim has joined #ocaml
<d_bot> <inkbottle> Maybe the editor has a different view of the project than the build tool (presumably `dune`). I use `esy` because it claims tight and easy sandboxing. I start my editor with `esy emacs`, and so `emacs` is using `esy` command environment. If I don't do that `lsp-mode` isn't working properly. Also, even though, I've got `merlin` installed globally, I don't think it is visible when using sandboxing, only the version that comes wit
yoctocell has joined #ocaml
Tuplanolla has joined #ocaml
vizard has quit [Ping timeout: 272 seconds]
Haudegen has joined #ocaml
dh` has quit [Remote host closed the connection]
dh` has joined #ocaml
glassofethanol has joined #ocaml
glassofethanol has quit [Client Quit]
bartholin has quit [Quit: Leaving]
oriba has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
dwt_ has joined #ocaml
<d_bot> <mad_lad> Not related to OCaml, but does anyone know anything similar to utop for Standard ML?
<companion_cube> I think most SML implems come with a toplevel?
<companion_cube> (probably not MLTon)
<d_bot> <mad_lad> Yea it does.
<d_bot> <mad_lad> Barely usable tho.
<companion_cube> ah well
<companion_cube> I don't know if they have an alive community tbh
<d_bot> <monk> i only see SML in old papers and in context of HOL4
<d_bot> <mad_lad> the theorem prover or the game?
glassofethanol has joined #ocaml
<dmbaturin> MLton is the only one that doesn't have a REPL, AFAIR.
<dmbaturin> SML/NJ is commonly used as a REPL for it.
<dmbaturin> mad_lad: My SML REPL setup used to be Poly/ML+rlwrap.
glassofethanol has quit [Client Quit]
yoctocell has quit [Quit: ERC (IRC client for Emacs 28.0.50)]
<dmbaturin> Anyone remembers if int_of_string ever had a problem with strings like "+42" ? I'm quite puzzled by https://github.com/ocaml-toml/To.ml/blob/master/src/lexer.mll#L49
<d_bot> <monk> the prover thing
<dmbaturin> Well, there's also Ur/Web which is bootstrapped from SML AFAIR.
favonia has joined #ocaml
Stumpfenstiel has joined #ocaml
shawnw has joined #ocaml
<d_bot> <cdisselkoen> Hi everyone! Not sure if this is the right place to ask this, but maybe someone can point me in the right direction.
<d_bot> <cdisselkoen>
<d_bot> <cdisselkoen> I have a program which uses dynamic loading via `findlib`, and I'm trying to generate binaries (of the application and all of its dynamic dependencies) which are portable in the sense that they can be run on machines other than the build machine. Is there any general best practices or advice for how to do this? My naive approach was to install using `dune`, then copy over the entire `/bin` and `/lib` directories of my OPAM
<d_bot> <cdisselkoen>
<d_bot> <cdisselkoen> Any advice or pointers to other docs/advice would be appreciated, thanks!
shawnw has quit [Remote host closed the connection]
Anarchos has joined #ocaml
gravicappa has quit [Ping timeout: 268 seconds]
selimcan has joined #ocaml
selimcan has quit [Client Quit]
<smondet[m]> cdisselkoen: to make findlib happy after relocating you may have to tweak a few envirnment variables: http://projects.camlcity.org/projects/dl/findlib-1.4/doc/ref-html/r775.html#FINDLIB.CONF
toppler has quit [Remote host closed the connection]
<d_bot> <cdisselkoen> Thanks, that is helpful
Anarchos has quit [Quit: Vision[0.10.3]: i've been blurred!]
cedric has quit [Quit: Konversation terminated!]
mikess has joined #ocaml
Tuplanolla has quit [Quit: Leaving.]
Stumpfenstiel has quit [Ping timeout: 268 seconds]
dhil has quit [Ping timeout: 268 seconds]
minwuekim has quit [Ping timeout: 245 seconds]
Haudegen has quit [Ping timeout: 272 seconds]
minwuekim has joined #ocaml
minwuekim has quit [Ping timeout: 245 seconds]
minwuekim has joined #ocaml
minwuekim has quit [Ping timeout: 245 seconds]
Corbin has quit [Ping timeout: 268 seconds]
minwuekim has joined #ocaml
Johann has quit [Ping timeout: 244 seconds]
pippijn has quit [Ping timeout: 244 seconds]
adrien has quit [Ping timeout: 244 seconds]
sadiq has quit [Ping timeout: 244 seconds]
sadiq has joined #ocaml
adrien has joined #ocaml
pippijn has joined #ocaml
mosterdt_ has quit [Ping timeout: 244 seconds]
bacam has quit [Ping timeout: 244 seconds]
bacam has joined #ocaml
Johann has joined #ocaml
mosterdt_ has joined #ocaml
Guest3336 has quit [Quit: Konversation terminated!]