companion_cube changed the topic of #ocaml to: Discussion about the OCaml programming language | http://www.ocaml.org | OCaml 4.14.0 released: https://ocaml.org/releases/4.14.0.html | Try OCaml in your browser: https://try.ocamlpro.com | Public channel logs at https://libera.irclog.whitequark.org/ocaml/
Haudegen has quit [Ping timeout: 246 seconds]
rgrinberg has joined #ocaml
spip has joined #ocaml
bobo has quit [Ping timeout: 252 seconds]
Tuplanolla has quit [Quit: Leaving.]
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tsns has quit [Remote host closed the connection]
rgrinberg has joined #ocaml
<discocaml> <ec> How do you attach a syntax-extension / attribute to a particular one of several comma-separated let-bindings? i.e. this is syntactically invalid, is there a correct way to write it: `let a, b [@@foo], c = something`
sugarbeet has joined #ocaml
sugarbeet has left #ocaml [#ocaml]
bobo has joined #ocaml
spip has quit [Ping timeout: 260 seconds]
<discocaml> <anmonteiro> `let a, (b [@foo]), c = something`
<discocaml> <anmonteiro> - 1 `@`: algebraic categories
<discocaml> <anmonteiro> - 2 `@@`: blocks
<discocaml> <anmonteiro> - 3 `@@@`: structure / signature items
<discocaml> <anmonteiro> using the language in the manual (https://v2.ocaml.org/manual/attributes.html)
<discocaml> <anmonteiro> - 1 `@`: attached to algebraic categories
<discocaml> <anmonteiro> - 2 `@@`: attached to blocks
<discocaml> <anmonteiro> - 3 `@@@`: (not attached), standalone structure / signature items
<discocaml> <froyo> whats an algebraic category
bobo has quit [Ping timeout: 260 seconds]
spip has joined #ocaml
chrisz has quit [Ping timeout: 246 seconds]
chrisz has joined #ocaml
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #ocaml
azimut has quit [Ping timeout: 255 seconds]
azimut has joined #ocaml
spip has quit [Remote host closed the connection]
spip has joined #ocaml
bgs has joined #ocaml
bgs has quit [Remote host closed the connection]
perrierjouet has quit [Ping timeout: 248 seconds]
perrierjouet has joined #ocaml
ionut_farcas has joined #ocaml
jao has quit [Ping timeout: 256 seconds]
ionut_farcas has quit [Remote host closed the connection]
Haudegen has joined #ocaml
Serpent7776 has joined #ocaml
bartholin has joined #ocaml
<discocaml> <lukstafi> A non-abstract type -- product or disjunctive union: tuple types, record types, variant types, polymorphic variants.
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
azimut has quit [Ping timeout: 255 seconds]
bartholin has quit [Quit: Leaving]
waleee has quit [Ping timeout: 252 seconds]
tsns has joined #ocaml
olle has joined #ocaml
olle has quit [Remote host closed the connection]
<discocaml> <emillon> I'm not sure I follow: attributes are attached to AST nodes, not types?
<discocaml> <emillon> `@` attaches to things like expressions and patterns (as described in the linked manual)
<discocaml> <NULL> It seems to me that this is the answer to the question : "What is an algebraic data type (ADT) ?", not an algebraic *category*
troydm has quit [Ping timeout: 255 seconds]
darchitect has joined #ocaml
<darchitect> hey guys I'm just going through the RealWorldOcaml book
<darchitect> and one of the first examples is about opening modules as a local context within a let binding
olle has joined #ocaml
<darchitect> and it goes something like -> let open Float.O in ...
<darchitect> what is the meaning or ".O" ? can't we just say -> let open Float in ...
<darchitect> ?
<olle> Ehm
<olle> Just dot works too
<olle> let x = 10. in ...
<discocaml> <emillon> Float.O is the name of a module
<discocaml> <emillon> Here O is a module in the Float module
<discocaml> <emillon> This is a naming convention to puts operators in a O submodule
<discocaml> <emillon> This is a naming convention to put operators in a O submodule
<companion_cube> (note that this module only exists in Base)
<olle> Oh god base again
<discocaml> <reynir> I have not heard of this convention before
Anarchos has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
<discocaml> <leviroth> It’s a convention within base, not a general convention of OCaml code.
<discocaml> <beajeanm> One of the numerous JaneStreet conventions. I think MyModule.Infix is bit more used elsewhere.
jao has joined #ocaml
Anarchos has quit [Read error: Connection reset by peer]
<discocaml> <Bluddy> darchitect: I recommend switching to the Cornell book (https://cs3110.github.io/textbook/cover.html), which is more compatible with the stdlib. Once you've learned enough, reading RWO should be easier.
Anarchos has joined #ocaml
<olle> RWO should come with a warning label xD
zozozo has quit [Ping timeout: 260 seconds]
<discocaml> <boosh> bros
<discocaml> <boosh> im wondering whats a cleaner way to write this in ocaml
<discocaml> <boosh> ```ocaml
<discocaml> <boosh> generate_all = (fun duel ->
<discocaml> <boosh> let position_choices = List.init 5 (fun x -> x) in
<discocaml> <boosh> let direction_choices = List.init 2 (fun x -> x |> direction_of_enum |> Option.get) in
<discocaml> <boosh> let guardian_star_choices = List.init 2 (fun x -> x |> guardian_star_choice_of_enum |> Option.get) in
<discocaml> <boosh> List.map (fun position ->
<discocaml> <boosh> List.map (fun direction ->
<discocaml> <boosh> List.map (fun guardian_star ->
<discocaml> <boosh> hand_play_monster_single_cmd position direction guardian_star
<discocaml> <boosh> ) guardian_star_choices
<discocaml> <boosh> ) direction_choices
<discocaml> <boosh> ) position_choices |> List.flatten |> List.flatten);```
<discocaml> <boosh> in haskell could be done in one line with list comprehension ```haskell
<discocaml> <boosh> [hand_play_monster_single_cmd p d gs | p <- positions, d <- directions, gs <- guardian_stars]```
<olle> oh-
<olle> Please don't dump code longer than 5 lines or so
<olle> That's actually readable on IRC tho
<discocaml> <darrenldl> @boosh id try Seq.flat_map first
<discocaml> <KW78> with let binding syntax `x3` (the monad being bound is the non-deterministic monad (bind is flat map indeed here) `let* pos =...`. You need to define your monad `let ( let* ) m kl =...flatmap...`
<discocaml> <reynir> there is as well `List.concat_map`
<discocaml> <NULL> The usual replacement for list comprehension is the monadic let, it would look like `let* p = positions in let* d = directions in let* gs = guardian_stars in return (hand_play_monster_single_cmd p d gs)`
<discocaml> <boosh> thanks very much yall 😋
Haudegen has joined #ocaml
jao has quit [Ping timeout: 252 seconds]
zozozo has joined #ocaml
troydm has joined #ocaml
kakadu_ has joined #ocaml
rgrinberg has joined #ocaml
bobo has joined #ocaml
spip has quit [Ping timeout: 260 seconds]
<olle> NULL can you pipe that too?
<olle> Monadic pipe? o0
tsns has quit [Remote host closed the connection]
grobe0ba has quit [Quit: ZNC 1.8.2 - https://znc.in]
grobe0ba has joined #ocaml
grobe0ba has quit [Ping timeout: 252 seconds]
grobe0ba_ has joined #ocaml
grobe0ba_ is now known as grobe0ba
Anarchos has quit [Excess Flood]
tsns has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rgrinberg has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
trev_ has joined #ocaml
olle has quit [Quit: Lost terminal]
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rgrinberg has joined #ocaml
azimut has joined #ocaml
Haudegen has joined #ocaml
azimut has quit [Remote host closed the connection]
azimut has joined #ocaml
jao has joined #ocaml
infinity0_ has joined #ocaml
infinity0_ is now known as infinity0
infinity0 has quit [Killed (mercury.libera.chat (Nickname regained by services))]
olle has joined #ocaml
azimut has quit [Ping timeout: 255 seconds]
azimut has joined #ocaml
Tuplanolla has joined #ocaml
bartholin has joined #ocaml
infinity0 has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tsns has quit [Remote host closed the connection]
infinity0 has quit [Remote host closed the connection]
hrberg has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
infinity0 has joined #ocaml
hrberg has joined #ocaml
trev_ has quit [Remote host closed the connection]
genpaku has quit [Read error: Connection reset by peer]
genpaku has joined #ocaml
bgs has joined #ocaml
Guest31 has joined #ocaml
Guest31 has quit [Client Quit]
tsns has joined #ocaml
rgrinberg has joined #ocaml
waleee has joined #ocaml
count3rmeasure has joined #ocaml
Anarchos has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rgrinberg has joined #ocaml
<discocaml> <lukstafi> I'm having a hard time compiling manually, via `ocamlopt` or `ocamlfind ocamlopt`... I'm pointing to the folder with the `foo.cmx` (and `foo.o`) file with `-I`, but I'm still getting `Error: Unbound module Foo`.
<discocaml> <froyo> you still need to specify the cmxes
<discocaml> <froyo> `ocamlc -I /some/external/library/path foo.cma bar.cma baz.ml`
<discocaml> <lukstafi> Ah thanks!
bgs has quit [Remote host closed the connection]
<discocaml> <lukstafi> (Still no progress though...)
Anarchos has quit [Remote host closed the connection]
Anarchos has joined #ocaml
<Anarchos> opam uses a lot of hard drive access . is it possible to make it use less ? some cache mechanism or whatever
<olle> mount harddrive to your ram lol
bartholin has quit [Quit: Leaving]
<olle> Anarchos: which fs you on?
<Anarchos> olle befs
<discocaml> <lukstafi> I was not providing the path to `foo.cmi`, seems I'm making progress, thanks!
<olle> Anarchos: hm can you mount folders onto ram there?
<olle> ==14478==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60e000000280 at pc 0x7f86af0e9f3d bp 0x7ffc17b21a50 sp 0x7ffc17b211f8
<olle> C programming is hard... 😛
tsns has quit [Remote host closed the connection]
<olle> wat
<olle> Program works without memory errors if I have a debug print statement
<olle> sorry
tsns has joined #ocaml
<Anarchos> olle no idea
<Anarchos> olle i am not on linux....
Anarchos has quit [Remote host closed the connection]
<olle> oh ok
<olle> :(
<olle> BeOS?
<discocaml> <froyo> oooo ocaml on haiku/beos nice!
<olle> What cpu...? Do I dare ask?
<olle> 68k ^^
<olle> Z80?
oriba has joined #ocaml
Serpent7776 has quit [Ping timeout: 260 seconds]
xenu has quit [Quit: leaving]
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
olle has quit [Ping timeout: 260 seconds]
count3rmeasure has quit [Quit: Leaving]
gwizon has quit [Ping timeout: 260 seconds]
gwizon has joined #ocaml
Anarchos has joined #ocaml
<discocaml> <MasterBuilder> what options are there for realtime MIDI I/O?
bobo has quit [Ping timeout: 255 seconds]
drewolson has quit [Remote host closed the connection]
drewolson has joined #ocaml
companion_cube has quit [Ping timeout: 252 seconds]
companion_cube has joined #ocaml
bobo has joined #ocaml
<discocaml> <mbacarella> is there a black magic way to create an uninitialized Array.t? (I'm aware there's a float_uninitialized but I'm not doing floats)
rgrinberg has joined #ocaml
Haudegen has quit [Ping timeout: 246 seconds]