quernd has quit [Quit: Ping timeout (120 seconds)]
quernd has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
quernd has quit [Read error: Connection reset by peer]
quernd has joined #ocaml
waleee has quit [Ping timeout: 252 seconds]
vicfred has quit [Quit: Leaving]
<lagash>
Is either SILE or Patoline far enough along for real book publishing?
<lagash>
Pardon, I meant SATySFi not SILE
spip has joined #ocaml
Guest4923 has quit [Ping timeout: 265 seconds]
spip is now known as Guest8403
rgrinberg has joined #ocaml
mbuf has joined #ocaml
<d_bot>
<cemerick> @Drup that's fair. For my use case (copy-pasting svg icons, mostly), it seems fine enough to just Html.Unsafe those snippets 🤷
Guest8403 has quit [Ping timeout: 250 seconds]
spip has joined #ocaml
spip is now known as Guest4325
zebrag has quit [Quit: Konversation terminated!]
<hackinghorn>
I would like to make several executables from 1 dune file. How do I separate which source code files is for which executable?
<rgrinberg>
You can use the (modules ..) field to list the modules explicitly. Or you can use an executables and let dune detect this for you
<hackinghorn>
hmm how does it detect?
<hackinghorn>
does the executable name need to match some file name?
<d_bot>
<darrenldl> i believe so
<rgrinberg>
hackinghorn if you have (executables (names x y ..)) you will need a x.ml and y.ml
<rgrinberg>
and dune figures it out from the dependency graph it computes using ocamldep
Haudegen has joined #ocaml
gravicappa has joined #ocaml
humasect has joined #ocaml
<hackinghorn>
ahh thankss
gravicappa has quit [Ping timeout: 240 seconds]
humasect has quit [Quit: Leaving...]
humasect has joined #ocaml
mro has joined #ocaml
gravicappa has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
remexre has quit [Remote host closed the connection]
humasect has quit [Remote host closed the connection]
humasect has joined #ocaml
remexre has joined #ocaml
Anarchos has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
Anarchos has quit [Ping timeout: 256 seconds]
mro has joined #ocaml
Serpent7776 has joined #ocaml
Anarchos has joined #ocaml
humasect has quit [Read error: Connection reset by peer]
humasect_ has joined #ocaml
waleee has joined #ocaml
hackinghorn is now known as dave0smommy
mro has quit [Remote host closed the connection]
dave0smommy is now known as hackinghorn
mro has joined #ocaml
humasect_ is now known as humasect
bartholin has joined #ocaml
<hackinghorn>
hi, is there any problem with reassign variables like this: let tests = ["test"];; let tests = "test2" :: tests;;
<d_bot>
<antron> nope
<d_bot>
<antron> but this isn't reassigning in ocaml. it's "shadowing." the second tests is a new variable that just has the same name, which makes the original one inaccessible in that scope afterwards
<d_bot>
<antron> the compiler does know that the first one is shadowed, though, so this can be optimized in various ways
<hackinghorn>
it will be garbage collected always immediately, I suppose?
Anarchos has quit [Quit: Vision[]: i've been blurred!]
Anarchos has joined #ocaml
<hackinghorn>
I just think it looks like bad code
<d_bot>
<antron> i don't believe so. and in this particular case there is nothing to garbage collect from the first tests, since the actual value that the name referred to is still being pointed to as part of the value in the second tests
<d_bot>
<antron> well, i write code like this rather often, but it depends on the situation
<d_bot>
<antron> sometimes you want to shadow previous names so that you dont accidentally access old "states" (notionally) of a computation in later code
<hackinghorn>
I see now, thankss
<d_bot>
<antron> it vaguely "consumes" them and makes a block of code with shadowing have a sort of "linearity" to it
mro has quit [Remote host closed the connection]
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gravicappa has quit [Ping timeout: 268 seconds]
rgrinberg has joined #ocaml
mro has joined #ocaml
quernd7 has joined #ocaml
<d_bot>
<Drup> @cemerick in general, the syntax extension is a really big help for SVG specifically. Do use `Svg.Unsafe` to inject svg stuff, it'll be more reliable with namespaces. And don't hesitate to collect and report all the missing stuff 🙂
SquidDev9 has joined #ocaml
grobe0ba_ has joined #ocaml
rwmjones_ has joined #ocaml
SquidDev has quit [Killed (NickServ (GHOST command used by SquidDev9))]
SquidDev9 is now known as SquidDev
<d_bot>
<Drup> (I sometimes fall a bit behind on tyxml's maintenance, but the reports are very appreciated even if it sometimes takes me a while to handle them 😊
greyrat has joined #ocaml
quernd7 is now known as quernd
quernd has quit [Killed (NickServ (GHOST command used by quernd7))]
Techcable_ has joined #ocaml
hannes_ has joined #ocaml
engil2 has joined #ocaml
p4bl01 has joined #ocaml
gdd1 has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hannes has quit [*.net *.split]
gdd has quit [*.net *.split]
Techcable has quit [*.net *.split]
dwt_ has quit [*.net *.split]
grobe0ba has quit [*.net *.split]
drewolson has quit [*.net *.split]
theblatte has quit [*.net *.split]
Absalom has quit [*.net *.split]
rwmjones has quit [*.net *.split]
kandu has quit [*.net *.split]
greyrat_ has quit [*.net *.split]
p4bl0 has quit [*.net *.split]
asm has quit [*.net *.split]
engil1 has quit [*.net *.split]
grobe0ba_ has quit [Ping timeout: 268 seconds]
grobe0ba has joined #ocaml
dwt_ has joined #ocaml
theblatte has joined #ocaml
drewolson has joined #ocaml
Absalom has joined #ocaml
kandu has joined #ocaml
Colt has quit [Remote host closed the connection]
Colt has joined #ocaml
asm has joined #ocaml
<d_bot>
<Wulfman> So I have a question, that I'm not sure where to ask so tell me if i should ask in another channel.
<d_bot>
<Wulfman> I'm writing a CLI with Core.command To write the command I need to apply a function `f : 'a1 -> 'a2 -> ... -> 'an -> unit -> unit` to arguments `'a1 t, 'a2 t, ... 'an t` . After trying some stuff, I ended up finding monadic binary operators :
<d_bot>
<Wulfman> ```
<d_bot>
<Wulfman> (*>) : unit t -> 'a t -> 'a t
<d_bot>
<Wulfman> (<*) : 'a t -> unit t -> 'a t
<d_bot>
<Wulfman> (<*>) : ('a -> 'b) t -> 'a t -> 'b t
<d_bot>
<Wulfman> (>>|) : 'a t -> ('a -> 'b) -> 'b t
<d_bot>
<Wulfman> ```
<d_bot>
<Wulfman> So I end up writting `f +> a1 <*> a2 <*> ... <*> an` with `let (+>) a b = b >>| a` which works fine but left me with some question.
<d_bot>
<Wulfman> I don't understand the point of `*>` and `<*` . For me they don't make any sense.
<d_bot>
<Wulfman> I don't understand how to use `>>|` correctly with multiple arguments function. (In my case that would be `a1 >>| f <*> a2 ... <*> an` which is just weird.
<d_bot>
<Wulfman> Or is there a way to use `>>|` better ? I though that `a1 <*> .... <*> an >>| f` could be nice but that doesn't really work either, you would need `<*>` to be flipped and change the priority of operation.
<d_bot>
<Wulfman> Do you guys have some ideas ?
<Anarchos>
wulfman maybe use some parentheses ?
<d_bot>
<Kakadu> @Wulfman does this lib have any functions with a type `'a -> 'a t` ?
<d_bot>
<Wulfman> Well yes, you have a `return`
<Anarchos>
I try to use Fmt to format text : i want to format "Ax(1)" with "Ax" in Cyan and "1" in white. I come up with Fmt.(( styled `Bold (styled `Cyan string)) ++ char ++ int ++ char) f id '(' i ')'
<Anarchos>
but (++) doesn't seem to be concatenation of format strings ?
<d_bot>
<Wulfman> > wulfman maybe use some parentheses ?
<d_bot>
<Wulfman> you mean in the code or in the question 😅 ?
<Anarchos>
Wulfman in the code, of course...
<humasect>
ocaml concat is (^) , in haskell it is (++)
<Anarchos>
octachron i could not grasp dbunzli logic....
<Drup>
in this case, it's not dbunzli's logic, it's exactly how Format works
<Anarchos>
octachron you mean Fmt.pf Fmt.stdout "%a(%a)" .... ?
mro has joined #ocaml
<octachron>
In fact, either `Fmt.pf ppf` or `Fmt.pr`.
<Anarchos>
so every format specifier ends up being %a, and Fmt is used to format every basic type, is that right ?
<Drup>
if you want to style, yes
<Anarchos>
and to finish my line with a return, should i put \n in the format, or use "%a" and "Fmt.cut" ?
<octachron>
It is better to never use `\n` with Format/Fmt.
mro has quit [Ping timeout: 240 seconds]
<octachron>
You can use `@,`.
<octachron>
If you are ending a message to the tty/log, you can use `@.` (which also resets the formatting engine)
<Anarchos>
octachron yes it is the end of my log
humasect has quit [Quit: Leaving...]
gravicappa has joined #ocaml
<Anarchos>
octachron thanks for the help
noze has quit [Remote host closed the connection]
<d_bot>
<leviroth> @Wulfman I'm not sure `<*` and `*>` are particularly likely to be useful with Command. They're probably just there because they're part of the applicative interface that Command follows.
<d_bot>
<leviroth> Though if I were writing that example, I would get rid of the `let open Command.Let_syntax in` and instead write `let%map_open.Command`.
Anarchos has quit [Quit: Vision[]: i've been blurred!]
mro has joined #ocaml
asm has joined #ocaml
asm has quit [Changing host]
mro has quit [Ping timeout: 265 seconds]
mro has joined #ocaml
<d_bot>
<cemerick> Okay, I'll file an umbrella issue and try to capture good testcases of each missing piece. I was going to submit PRs for at least some of them, but I honestly don't grok how the svg bits are working (or, how they _should_ work, I guess), while I basically understand the HTML/XML side.
<d_bot>
<cemerick> Maybe I'll take another swing at some point 🙂
<d_bot>
<cemerick> Your efforts are greatly appreciated in any case, tyxml is great!
<d_bot>
<cemerick> taking on svg in the first place is a little mad lol
mro_ has joined #ocaml
mro has quit [Ping timeout: 256 seconds]
mro_ has quit [Remote host closed the connection]
mro has joined #ocaml
mro has quit [Ping timeout: 256 seconds]
<d_bot>
<Drup> thanks 😊
Guest4325 has quit [Remote host closed the connection]
mro has joined #ocaml
Guest4325 has joined #ocaml
<d_bot>
<darrenldl> is there ongoing effort on ocaml implementation of wireguard? (or some binding usable in mirage)
<hannes_>
darrenIdl: the most recent approach I am aware of is https://github.com/janestreet/noise-wireguard-ocaml/ which is not ready for MirageOS, but may be straightforward to use there (port to lwt, use mirage-crypto{-ec} and digestif)
hannes_ is now known as hannes
mro has quit [Ping timeout: 260 seconds]
<d_bot>
<darrenldl> hannes_: cheers. been a while since last commit though hmm, shall check it out in more detail
Guest4325 has quit [Read error: Connection reset by peer]
Guest4325 has joined #ocaml
zebrag has joined #ocaml
p4bl01 is now known as p4bl0
Anarchos has quit [Quit: Vision[]: i've been blurred!]
SdeSousa has joined #ocaml
<d_bot>
<injuly> Damm we got some frank herbert fans here
<d_bot>
<injuly> Go #dune !
mro has quit [Quit: Leaving...]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
gareppa has joined #ocaml
gareppa has quit [Remote host closed the connection]
olle has joined #ocaml
mro has quit [Remote host closed the connection]
kakadu has quit [Quit: Konversation terminated!]
wingsorc has quit [Read error: Connection reset by peer]
bartholin has quit [Quit: Leaving]
wingsorc has joined #ocaml
Haudegen has joined #ocaml
waleee has joined #ocaml
mro has joined #ocaml
mro has quit [Remote host closed the connection]
SdeSousa has quit [Ping timeout: 256 seconds]
mbuf has quit [Quit: Leaving]
olle has quit [Ping timeout: 260 seconds]
Guest8 has joined #ocaml
<Guest8>
hey, my build is failing with "Error: syntax error" the location it hints at is past the end of input so I have no clue whats going on
<d_bot>
<NULL> What's your code ?
<Guest8>
it had something to do with ; vs ;; apparently
<Guest8>
seems to be working now
<d_bot>
<ostera> has there been any interest in upstreaming the work Bob Zhang did on extending Lambda (particularly the Pmakeblock extension)?
gravicappa has quit [Ping timeout: 256 seconds]
SdeSousa has joined #ocaml
olle has joined #ocaml
Guest8 has quit [Quit: Client closed]
<d_bot>
<ostera> this is super useful for building backends from lambda rather than the typedtree or bytecode, with what would otherwise be lost information (eg., is this block a module, a record, etc)
<d_bot>
<NULL> Congrats, you've made it to the other side
<d_bot>
<bmo> yeah i thought people still were using irc for some reason
<d_bot>
<NULL> The IRC is far from unused
<d_bot>
<bmo> i started using ocaml for this year's aoc, still struggling 🙂
<d_bot>
<Jektrix> There's also a Matrix server but it doesn't have too much traffic
<d_bot>
<let Butanium = raise Not_found;;> I'm using it for aoc too, if you need help to read data or anything else feel free to ask
SdeSousa has quit [Ping timeout: 256 seconds]
olle has quit [Ping timeout: 250 seconds]
Guest8 has joined #ocaml
<Guest8>
let rec string_of_tree t = ((string_of_int t.hash)) :: (List.map string_of_tree t.children);
<Guest8>
the compiler complains that "(List.map string_of_tree t.children)" has type string list list
<Guest8>
and I'm just not seeing it
<Guest8>
string_of_tree has type tree -> string
<Fardale>
List.map take a list and return a list, and string_of_tree for a element return a list, so your map is a list of list
<Fardale>
You may want to use List.flat_map
<d_bot>
<NULL> `string_of_tree` does not have type `tree -> string` with how you wrote it; it returns a list (you're using cons `(::)`)
<Guest8>
oh ffs, but I gave it the type 'tree -> string' , I think the error message is just picking out entierly the wrong thing here
<d_bot>
<NULL> Where did you give it its type ? You could in an annotation (but you didn't here); if you mean in an interface file, I think the compiler checks against it after compiling the source file
<Guest8>
what is the correct way to concatenate two strings
<Guest8>
interface file
<d_bot>
<NULL> `(^)`
<Guest8>
thank you
<d_bot>
<NULL> If you annotated the return type directly, you would have got `Error: This expression has type 'a list but an expression was expected of type string`
Serpent7776 has quit [Quit: leaving]
wingsorc__ has joined #ocaml
wingsorc has quit [Read error: Connection reset by peer]
<rgrinberg>
companion_cube there's no way to add bigarrays to buffer.t, right?
<companion_cube>
nope
<rgrinberg>
ok just making sure i'm not missing something obvious
<companion_cube>
maybe in bigstringaf?
<companion_cube>
but Buffer kind of sucks anyway
<d_bot>
<Anurag> Bigstringaf doesn’t have a buffer api. Jane streets core_kernel has a bigbuffer module that supports adding bigstrings to it.