trillion_exabyte has quit [Ping timeout: 260 seconds]
bartholin has joined #ocaml
<discocaml>
<profmonkey07> I quit a project because I couldnt figure out what the problem was for like a week just to find out that I needed to count [1;2;3;4] as being the same as [4;3;2;1] basically
<discocaml>
<profmonkey07> bruhhhhh
<discocaml>
<profmonkey07> and then spend an hour debugging because 2 variabls were swapped
tomku has quit [Remote host closed the connection]
tomku has joined #ocaml
<bartholin>
debugging can be frustrating
Serpent7776 has joined #ocaml
dawids has joined #ocaml
dawids has quit [Remote host closed the connection]
dreadedfrog has joined #ocaml
micro_ is now known as micro
micro has quit [Quit: leaving]
micro has joined #ocaml
habnabit_ has quit [Server closed connection]
habnabit_ has joined #ocaml
toastal has left #ocaml [Disconnected: Hibernating too long]
dhil has joined #ocaml
toastal has joined #ocaml
dreadedfrog has quit [Ping timeout: 264 seconds]
dreadedfrog has joined #ocaml
dreadedfrog has quit [Ping timeout: 268 seconds]
dreadedfrog has joined #ocaml
Tuplanolla has joined #ocaml
steenuil has quit [Remote host closed the connection]
steenuil has joined #ocaml
waleee has joined #ocaml
bartholin has quit [Ping timeout: 268 seconds]
bartholin has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
<discocaml>
<johnkraiven> I have recently stumbled over this OCaml syntax and I was wondering if someone can help me trace its documentation, for I don't even know per se how the thing is called, my assumption is that it is a form of literal enumeration, but I am uncertain whether that's the case or not
<discocaml>
<johnkraiven> I have recently stumbled over this OCaml syntax and I was wondering if someone can help me trace its documentation, for I don't even know per se how the thing is called, my assumption is that it is a form of literal enumeration, but I am uncertain whether that's the case or not
<discocaml>
<johnkraiven> ```ocaml
<discocaml>
<johnkraiven> type t = [ `A | `B ]
<discocaml>
<johnkraiven> ```
<discocaml>
<johnkraiven> and what I find more mistifying is what the type of a variable of type t is that being ```let a = `A;; │~
<discocaml>
<johnkraiven> val a : [> `A ] = `A```
<discocaml>
<johnkraiven> and what I find more mistifying is what the type of a variable of type t is that being ```ocaml let a = `A;; │~
<discocaml>
<johnkraiven> val a : [> `A ] = `A```
<discocaml>
<johnkraiven> and what I find more mistifying is what the type of a variable of type t is that being
<discocaml>
<johnkraiven> ```ocaml
<discocaml>
<johnkraiven> let a = `A;; │~
<discocaml>
<johnkraiven> val a : [> `A ] = `A
<discocaml>
<johnkraiven> ```
<discocaml>
<johnkraiven> and what I find more mistifying is what the type of a variable of type t is that being
<discocaml>
<johnkraiven> ```ocaml
<discocaml>
<johnkraiven> let a = `A;; │~
<discocaml>
<johnkraiven> val a : [> `A ] = `A
<discocaml>
<johnkraiven> ```
<discocaml>
<leviroth> It’s called a polymorphic variant.
<discocaml>
<johnkraiven> thanks!
<discocaml>
<getzapped.> are there any builtins to flatten 'a option list into 'a list option
<discocaml>
<getzapped.> is there a builtin sequence function to flatten 'a option list into 'a list option
<discocaml>
<getzapped.> is there a builtin sequence function to flatten an 'a applicative list into 'a list applicative for applicatives like result or option
<rustyne>
`List.filter_map Fun.id` has the type `'a option list -> 'a list`, if that helps
<discocaml>
<90857467> Hello, my name is Ksenia. I offer account rental services on Upwork, Freelancer, Fiverr, LinkedIn and Workana at favorable prices. Feel free to contact me so we can discuss your needs 🙌
<discocaml>
<getzapped.> This just discards options instead of short circuiting, unfortunately. Not a pain to write manually tho.
<discocaml>
<getzapped.> This just discards nones instead of short circuiting, unfortunately. Not a pain to write manually tho.
toastal has quit [Ping timeout: 268 seconds]
faldor20 has quit []
faldor20 has joined #ocaml
<discocaml>
<limp.biskit> reversed lists tripped me up too coming from languages that all support push
YuGiOhJCJ has quit [Quit: YuGiOhJCJ]
nfc has quit [Server closed connection]
nfc has joined #ocaml
<discocaml>
<leviroth> Thanks @anmonteiro , setting up and running nix was indeed pretty straightforward
<discocaml>
<otini_> sorry what’s the expected semantics? And if it’s obvious to you just given the fact that the elements are applicatives, I’d be curious to know why
<rustyne>
otini_: it is natural to define in Haskell because the semantics there is a combination of the type classes involved
<rustyne>
those implicit parameters would have to be made explicit in OCaml
<rustyne>
(combination of the type class instances, I should have said)
<discocaml>
<otini_> Ah I hadn’t read the question closely enough
<discocaml>
<otini_> I think the short-circuiting in the Haskell definition relies on laziness, as well as the general efficiency of the function
<discocaml>
<otini_> which in addition to the absence of type classes—which makes that kind of generic functions heavier because you need a functor—is another reason why it would not necessarily be desirable to have it in the stdlib
waleee has quit [Ping timeout: 264 seconds]
dreadedfrog has quit [Ping timeout: 268 seconds]
drakonis has quit [Server closed connection]
drakonis has joined #ocaml
<discocaml>
<arthurmiiengineering> hallo!
toastal has joined #ocaml
sadome has joined #ocaml
sadome has quit [Changing host]
sadome has joined #ocaml
sadome has quit [Excess Flood]
jabuxas_ has joined #ocaml
jabuxas_ has quit [Ping timeout: 268 seconds]
<discocaml>
<gooby_clown> Does anyone work with Melange? I was wondering what the normal project structure would be. The generated Melange project is its own dune project, and then I have my backend as another project. I put this under a single `dune-workspace`, and now I was wondering, what should I do to, for example, run both projects at the same time? I could just run them in a shell script, but was wondering if there's a dune way
faldor20 has quit [Quit: Connection closed for inactivity]
<discocaml>
<gooby_clown> Actually I removed the workspace file, makes the Melange build fail
dreadedfrog has joined #ocaml
<discocaml>
<otini_> hi
dreadedfrog has quit [Ping timeout: 268 seconds]
<discocaml>
<ethanrange> Is compiling the OCaml 4.14.1 compiler from source supported on Apple M1, either natively or by using x86 with `env /usr/bin/arch -x86_64 /bin/zsh`? I'm running into errors about inconsistent architectures either way
<discocaml>
<ethanrange> Particularly `Error: The files asmcomp/arch.cmi and /mach.cmi make inconsistent assumptions over interface Arch`
<rustyne>
It should build yes, at least CI on the 4.14 runs also on arm64 mac
<discocaml>
<ethanrange> Hm very odd, I'll give it another run with absolutely minimal flags and options
<rustyne>
“inconsistent assumptions” errors are usually from files left over from compilations with a different configuration or such like
<rustyne>
`make distclean; ./configure ...; make -j` might be the best way to go :-)
<discocaml>
<ethanrange> Ooh is `make distclean` a superset of `make clean`?
<rustyne>
indeed
<discocaml>
<ethanrange> I think I managed to get a successful build without `distclean`, but I'll keep that one for future use. Thanks!
<discocaml>
<ethanrange> Argh nevermind - it looks like it's an issue with the specific modified OCaml compiler I'm trying to build (MetaOCaml)
<discocaml>
<ethanrange> Building the 4.14.1 release works fine, but after applying the MetaOCaml patches, the error appears ```Error: The files asmcomp/arch.cmi and asmcomp/emitenv.cmi make inconsistent assumptions over interface Arch
<discocaml>
<ethanrange> ```
<discocaml>
<ethanrange> Thanks for the help anyway - I'll try debugging this
<rustyne>
you’re welcome
tomku has quit [Ping timeout: 264 seconds]
tomku has joined #ocaml
<companion_cube>
… is there no docs at all for `[@@deriving_inline]`? :/
<companion_cube>
(ppx_deriving_yojson emits non compiling garbage)
<rustyne>
you wondered about deriving_inline only to have a look at the generated code? if yes, do you know dune show pp?
<companion_cube>
no no
<companion_cube>
but it generates code that doesn't compile, so..
mbuf has joined #ocaml
<discocaml>
<ethanrange> `make bootstrap` for anyone who comes across this in the future
dreadedfrog has joined #ocaml
toastal has left #ocaml [Error from remote client]
jabuxas has joined #ocaml
dreadedfrog has quit [Ping timeout: 256 seconds]
<discocaml>
<anmonteiro> Will need a bit more info. How did the melange build fail after you removed the workspace file?
Serpent7776 has quit [Ping timeout: 268 seconds]
mbuf has quit [Quit: Leaving]
dreadedfrog has joined #ocaml
<discocaml>
<gooby_clown> Nono it was the other way round, it succeeded only after removing it, because with it `dune build` goes up a directory to the workspace file, whereas the dune file for Melange has like `../../node_modules/...` which fails with the automatic change of directory
<discocaml>
<gooby_clown> But anyways that wasn't what I wanted to ask about, mostly just how we are supposed to structure codebases involving a Melange project as well as some backend ones
<discocaml>
<anmonteiro> It’s really up to you
<discocaml>
<anmonteiro> Some frameworks like nextjs dictate some structure, but otherwise you’re free to use whatever folders you’d like
<discocaml>
<gooby_clown> A okok I see, thanks ^^
dreadedfrog has quit [Ping timeout: 260 seconds]
jabuxas has quit [Ping timeout: 256 seconds]
<discocaml>
<limp.biskit> eio makes me go ugh
<discocaml>
<limp.biskit> what's resource management? i really wish somebody would've worked it out beforehand
m5zs7k has quit [Quit: m5zs7k]
m5zs7k has joined #ocaml
dhil has quit [Ping timeout: 246 seconds]
<dh`>
(I mean not in the kernel)
<dh`>
oops
jabuxas has joined #ocaml
jabuxas has quit [Read error: Connection reset by peer]
jabuxas_ has joined #ocaml
waleee has joined #ocaml
jabuxas_ has quit [Remote host closed the connection]
jabuxas has joined #ocaml
jabuxas has quit [Ping timeout: 268 seconds]
<discocaml>
<sim642> deriving_inline yojson producing non-compiling code sounds like a ppxlib issue. Because under the hood the parsetree should be fine since it works for normal deriving
<companion_cube>
yeah it makes a bunch of extraneous `let _ = _`
<discocaml>
<limp.biskit> does ppx_yojson_conv work?
<companion_cube>
no idea, haven't tried
<discocaml>
<limp.biskit> apparently it’s implementation is a little more sane than deriving, at least from what jst say
<companion_cube>
ppx_deriving has been upgraded so I'm assuming it's on par, idk
bartholin has quit [Quit: Leaving]
tomku has quit [Ping timeout: 240 seconds]
tomku has joined #ocaml
chiselfuse has quit [Write error: Connection reset by peer]