Leonidas changed the topic of #ocaml to: Discussion about the OCaml programming language | http://www.ocaml.org | OCaml 5.1.1 released: https://ocaml.org/releases/5.1.1 | Try OCaml in your browser: https://try.ocamlpro.com | Public channel logs at https://libera.irclog.whitequark.org/ocaml/
Tuplanolla has quit [Quit: Leaving.]
sroso has joined #ocaml
pi3ce has quit [Ping timeout: 256 seconds]
jabuxas has quit [Ping timeout: 246 seconds]
n8n has quit [Ping timeout: 272 seconds]
<discocaml> <myrlhex> Is there a way to type this? ```ocaml
<discocaml> <myrlhex> let gensym: 'a. 'a -> ('a * int) ref =
<discocaml> <myrlhex> let state = ref (-1) in
<discocaml> <myrlhex> fun (type n) (name: n): (n * int) ref ->
<discocaml> <myrlhex> state := !state + 1;
<discocaml> <myrlhex> ref (name, !state)
<discocaml> <myrlhex> ```
<discocaml> <myrlhex> ```
<discocaml> <myrlhex> Error: This definition has type 'a -> ('a * int) ref
<discocaml> <myrlhex> which is less general than 'a0. 'a0 -> ('a0 * int) ref
<discocaml> <myrlhex> ```
<discocaml> <myrlhex> One way is ```ocaml
<discocaml> <myrlhex> open (struct
<discocaml> <myrlhex> let state = ref (-1)
<discocaml> <myrlhex> let gensym name =
<discocaml> <myrlhex> state := !state + 1;
<discocaml> <myrlhex> ref (name, !state)
<discocaml> <myrlhex> end : sig
<discocaml> <myrlhex> val gensym: 'name -> ('name * int) ref
<discocaml> <myrlhex> end)
<discocaml> <myrlhex> ```
<discocaml> <myrlhex> but too much boilerplate :v
nkatte has quit [Remote host closed the connection]
gentauro has quit [Read error: Connection reset by peer]
Serpent7776 has joined #ocaml
gentauro has joined #ocaml
sroso has quit [Read error: Connection reset by peer]
sroso has joined #ocaml
sroso has quit [Read error: Connection reset by peer]
sroso has joined #ocaml
sroso has quit [Read error: Connection reset by peer]
olle has joined #ocaml
sroso has joined #ocaml
n8n has joined #ocaml
wagle has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
wagle has joined #ocaml
neiluj has joined #ocaml
<discocaml> <_ggole> ```ocaml
<discocaml> <_ggole> let state = ref (-1)
<discocaml> <_ggole> let gensym : 'a. 'a -> ('a * int) ref =
<discocaml> <_ggole> fun name ->
<discocaml> <_ggole> incr state;
<discocaml> <_ggole> ref (name, !state)
<discocaml> <_ggole> ```
<neiluj> hi! what do you think of this way of having record fields whose type depends on a module satisfying a certain module signature: https://bpa.st/5RGA?
<neiluj> have you used/seen this pattern?
<discocaml> <_ggole> It's the value restriction biting you here; it's quite conservative about the kind of expressions that are allowed on the RHS
dnh has joined #ocaml
<discocaml> <lokasku> I've installed an ocaml package with nix (it's the same as with opam), I have to do something special in the project to add it now that it's installed, because open ModuleName doesn't work.
<discocaml> <lokasku> I've installed an ocaml package with nix (it's the same as with opam), I have to do something special in the project to add it now that it's installed, because open ModuleName doesn't work ?
<discocaml> <._null._> Add it as a dependency to dune
<discocaml> <lokasku> ` (depends ocaml dune dream)` where `dream` is the name of my package ?
<discocaml> <._null._> Yes (not sure whether ocaml and dune are really needed since they are needed to read the file in the first place, but thye won't hurt)
<discocaml> <lokasku> I still can't use `Dream`
<discocaml> <lokasku> ```ocaml
<discocaml> <lokasku> open Dream
<discocaml> <lokasku>
<discocaml> <lokasku> let () =
<discocaml> <lokasku> Dream.run (fun _ ->
<discocaml> <lokasku> Dream.html "Good morning, world!")
<discocaml> <lokasku> ```
<discocaml> <lokasku> ```
<discocaml> <lokasku> File "bin/main.ml", line 1, characters 5-10:
<discocaml> <lokasku> 1 | open Dream
<discocaml> <lokasku> ^^^^^
<discocaml> <lokasku> Error: Unbound module Dream
<discocaml> <lokasku> ```
<discocaml> <._null._> Please don't post code blocks in this channel, the bridge to IRC doesn't like them
<discocaml> <lokasku> Sorry
<discocaml> <._null._> How are you running your file ?
<discocaml> <._null._> Oh, wait; you need to add it to the dune files, not just dune-project
<discocaml> <lokasku> WIth `dune exer bin/main.exe`
<discocaml> <lokasku> But how, I'm a newbie
<discocaml> <._null._> Also, I guess ocaml and dune make sense in dune-project, since it will be used by opam as well
<discocaml> <._null._> `(libraries dream)` in the executable / library stanza
<discocaml> <lokasku> I added `(libraries dream)` in `lib/dune` and in `bin/dune`, and added `dream` in `(depends ocaml dune dream)` but `open Dream` in `bin/main.ml` still doesn't work.
bartholin has joined #ocaml
<discocaml> <Kali> NULL: dune automatically adds them
<discocaml> <Kali> it's part of the default file
<discocaml> <Kali> put it in the (libraries ...) clause of ./bin/dune
sroso has quit [Quit: Leaving :)]
jmcantrell has quit [Write error: Connection reset by peer]
henrytill has quit [Remote host closed the connection]
ursa-major has quit [Read error: Connection reset by peer]
pmk has quit [Read error: Connection reset by peer]
soni_ has quit [Remote host closed the connection]
kuruczgy has quit [Remote host closed the connection]
sleepydog has quit [Remote host closed the connection]
lane has quit [Remote host closed the connection]
brettgilio has quit [Read error: Connection reset by peer]
patrick__ has quit [Remote host closed the connection]
toastal has quit [Remote host closed the connection]
Ankhers has quit [Read error: Connection reset by peer]
arya_elfren has quit [Remote host closed the connection]
whereiseveryone has quit [Remote host closed the connection]
seeg has quit [Remote host closed the connection]
philipwhite has quit [Remote host closed the connection]
b0o has quit [Write error: Connection reset by peer]
migalmoreno has quit [Remote host closed the connection]
immutable has quit [Remote host closed the connection]
ggb has quit [Remote host closed the connection]
_alix has quit [Remote host closed the connection]
ymherklotz has quit [Write error: Connection reset by peer]
richardhuxton has quit [Write error: Connection reset by peer]
pluviaq has quit [Remote host closed the connection]
pmk has joined #ocaml
patrick_ has joined #ocaml
jmcantrell has joined #ocaml
ggb has joined #ocaml
lane has joined #ocaml
philipwhite has joined #ocaml
henrytill has joined #ocaml
pluviaq has joined #ocaml
migalmoreno has joined #ocaml
_alix has joined #ocaml
Ankhers has joined #ocaml
ursa-major has joined #ocaml
brettgilio has joined #ocaml
whereiseveryone has joined #ocaml
soni_ has joined #ocaml
seeg has joined #ocaml
toastal has joined #ocaml
b0o has joined #ocaml
kuruczgy has joined #ocaml
ymherklotz has joined #ocaml
arya_elfren has joined #ocaml
richardhuxton has joined #ocaml
sleepydog has joined #ocaml
immutable has joined #ocaml
arya_elfren has quit [Remote host closed the connection]
b0o has quit [Remote host closed the connection]
brettgilio has quit [Remote host closed the connection]
pmk has quit [Remote host closed the connection]
ursa-major has quit [Remote host closed the connection]
henrytill has quit [Remote host closed the connection]
whereiseveryone has quit [Read error: Connection reset by peer]
pluviaq has quit [Remote host closed the connection]
immutable has quit [Remote host closed the connection]
patrick_ has quit [Remote host closed the connection]
_alix has quit [Remote host closed the connection]
Ankhers has quit [Remote host closed the connection]
toastal has quit [Remote host closed the connection]
jmcantrell has quit [Remote host closed the connection]
ggb has quit [Remote host closed the connection]
lane has quit [Remote host closed the connection]
philipwhite has quit [Remote host closed the connection]
soni_ has quit [Remote host closed the connection]
migalmoreno has quit [Remote host closed the connection]
seeg has quit [Remote host closed the connection]
sleepydog has quit [Remote host closed the connection]
richardhuxton has quit [Remote host closed the connection]
ymherklotz has quit [Remote host closed the connection]
kuruczgy has quit [Remote host closed the connection]
philipwhite has joined #ocaml
lane has joined #ocaml
ggb has joined #ocaml
pmk has joined #ocaml
immutable has joined #ocaml
patrick_ has joined #ocaml
_alix has joined #ocaml
kuruczgy has joined #ocaml
Ankhers has joined #ocaml
toastal has joined #ocaml
whereiseveryone has joined #ocaml
jmcantrell has joined #ocaml
pluviaq has joined #ocaml
brettgilio has joined #ocaml
migalmoreno has joined #ocaml
seeg has joined #ocaml
ursa-major has joined #ocaml
arya_elfren has joined #ocaml
b0o has joined #ocaml
ymherklotz has joined #ocaml
soni_ has joined #ocaml
henrytill has joined #ocaml
richardhuxton has joined #ocaml
sleepydog has joined #ocaml
chiselfuse has quit [Ping timeout: 260 seconds]
chiselfuse has joined #ocaml
waleee has joined #ocaml
jabuxas has joined #ocaml
romildo has joined #ocaml
olle has quit [Ping timeout: 272 seconds]
waleee has quit [Ping timeout: 240 seconds]
n8n has quit [Quit: WeeChat 4.2.2]
n8n has joined #ocaml
Serpent7776 has quit [Ping timeout: 264 seconds]
cross has quit [Remote host closed the connection]
romildo has quit [Quit: Leaving]
<discocaml> <andreypopp> @etiennemillon I see you have ocaml-noise archived, curious why, is there a successor?
jabuxas has quit [Ping timeout: 260 seconds]
waleee has joined #ocaml
<hannes> andreypopp: which part of noise do you need?
Tuplanolla has joined #ocaml
alexherbo2 has joined #ocaml
<discocaml> <etiennemillon> There's only so many projects one can maintain so it felt more honest to just archive it
<discocaml> <etiennemillon> You can fork it and release it under the same name
<discocaml> <etiennemillon> I think the mirage folks have a specialized version for wireguard
neiluj has quit [Read error: Connection reset by peer]
alexherbo2 has quit [Ping timeout: 250 seconds]
Serpent7776 has joined #ocaml
zanetti has joined #ocaml
bartholin has quit [Quit: Leaving]
Serpent7776 has quit [Ping timeout: 260 seconds]
cr1901 has quit [Read error: Connection reset by peer]
cr1901 has joined #ocaml
n8n has quit [Quit: WeeChat 4.2.2]
torretto has quit [Remote host closed the connection]
torretto has joined #ocaml
process0 has quit [Ping timeout: 246 seconds]
dnh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dnh has joined #ocaml
torretto has quit [Remote host closed the connection]
torretto has joined #ocaml
sroso has joined #ocaml
jabuxas has joined #ocaml