brettgilio has quit [Quit: ZNC 1.7.2+deb3 - https://znc.in]
brettgilio has joined #ocaml
kanishka has quit [Quit: Quit]
nullcone has joined #ocaml
mfp has quit [Ping timeout: 246 seconds]
gjaldon_ has quit [Quit: Connection closed for inactivity]
waleee-cl has quit [Quit: Connection closed for inactivity]
kleisli_ has joined #ocaml
kleisli__ has quit [Ping timeout: 260 seconds]
osa1 has joined #ocaml
_whitelogger has joined #ocaml
<d_bot>
<dj charlie> @Et7f3 i want to use rtop inside an environment that can't interpret control codes/colour
<d_bot>
<dj charlie> that's the q
<d_bot>
<dj charlie> (so i can use reason in the toplevel there)
inkbottle has joined #ocaml
zebrag has quit [Ping timeout: 264 seconds]
osa1 has quit [Ping timeout: 256 seconds]
narimiran has joined #ocaml
<inkbottle>
You can define `let (and+) = ( * );;` But when you try to use it, the answer seems to suggest the types are more predetermined, and the definition shouldn't have been accepted in the first place
<inkbottle>
Is it `and***` that has its type constrained to `'a t -> 'b t -> ('a * 'b) t`, and `let***` that must have its type one of `'a t -> ('a -> 'b) -> 'b t` or `'a t -> ('a -> 'b t) -> 'b t`?
<d_bot>
<craigfe> inkbottle: the restrictions on `let+` and `and+` are syntactic (determined by the desugaring transformation), not type-based. There's no reason that your binary operators have to fit applicative or monadic signatures, they just have to type-check after the transformation has occurred.
<d_bot>
<dj charlie> kicking it off with `rtop -init $HOME/.rtop.init`
<d_bot>
<ostera> 'er we go -- from Path.last to Path.same I wasn't _that_ far off
<d_bot>
<ostera> thanks ๐
<d_bot>
<octachron> Note I was reacting to the "sometimes things go wrong after a recompilation", that should not happen.
<d_bot>
<ostera> I'll keep an eyen on printtyp and printtyped to see more of what I've been hacking around and how to do it properly
<d_bot>
<ostera> okay, so here's what I see
<d_bot>
<ostera> I've got a file
<d_bot>
<ostera>
<d_bot>
<ostera> ```ocaml
<d_bot>
<ostera> let int () = 1
<d_bot>
<ostera> ```
<d_bot>
<ostera> on the first run of `ocamlc -dtypedtree test.ml` the little hack i've got going on prints out `int/1` -- wrong, the last argument here is a unit.
<d_bot>
<ostera> if I run it __again__
<d_bot>
<ostera> it prints out `int/0`
<d_bot>
<ostera> every other run after that seems to have converged on int/0
<d_bot>
<ostera> removing test.cmo and test.cmi restarts the behavior
<d_bot>
<ostera> @octachron what I'd love to _not have to do_ is to build the thing twice if I can't find the corresponding .cmi the first time
<d_bot>
<ostera> my guess is that there's another way of traversing the initial `typedtree.str_type` that'd get me the same information
<d_bot>
<octachron> The traversal and cmi question seem to be a red herring to me. You should focus on debugging your analysis function.
<d_bot>
<ostera> i'm doing that atm
<d_bot>
<ostera> @octachron aaand of course. the first time its a Tlink
<d_bot>
<ostera> ๐คฆ
<d_bot>
<ostera> thanks @octachron ๐
osa1 has quit [Ping timeout: 260 seconds]
osa1 has joined #ocaml
ggole has joined #ocaml
borne has quit [Ping timeout: 244 seconds]
kleisli_ has quit [Ping timeout: 256 seconds]
kleisli_ has joined #ocaml
jnavila has joined #ocaml
borne has joined #ocaml
ransom has joined #ocaml
decentpenguin has joined #ocaml
borne has quit [Ping timeout: 260 seconds]
<inkbottle>
craigfe: thanks for the example `let ( let+ ) x _ = x in let ( and+ ) = ( * ) in let+ x = 3 and+ y = 2 in x ^ y;;` dropping the supposedly functional part of `(let+)` was a smart move. I'd really like to know more about the "desugaring transformation" which is hardly described in https://ocaml.org/manual/bindingops.html.
<d_bot>
<craigfe> (Someone should build a tool that takes a cryptic OCaml AST fragment and emits a few links to explain the dark syntax corners involved...)
<d_bot>
<stab> Thatโs a tricky problem
<ggole>
That's a locally abstract type, you need those in order to use type equalities that come from matching on GADTS
<ggole>
The syntax is a bit funny, I think they wanted to avoid a new keyword
<d_bot>
<stab> Youโd need like a formal specification of the Ocaml grammar that is like labeled with links to the relevant manual pages
<d_bot>
<craigfe> It could be implemented as a PPX tool; similar to `dump_ast`
<d_bot>
<craigfe> No need to bother with formal specifications of the grammar; the parsetree types are enough
<d_bot>
<stab> I mean if youโre willing to go through the effort to manually assign links to each syntax object lol
<d_bot>
<craigfe> There's not _that_ much going on in OCaml
<d_bot>
<stab> Maybe you could try to do something clever like match it with the snippets
<d_bot>
<ggole> A docstring for each node in the syntax tree would be doable
<d_bot>
<stab> Probably way too tricky to do that
<d_bot>
<stab> Lisp syntax is truly ideal , why is there anything besides function application tbh
<d_bot>
<octachron> I would propose to have a more generic channel for long-winded arcane discussions. Maybe named "arcane"? "abstract nonsense"? or the more prosaic "veterans"?
<d_bot>
<octachron> In order to also have a home for talking about type tricks, memory representation, and the compiler internals
<d_bot>
<stab> To be fair if there was a channel named abstract nonsense, without knowing what it is Iโd probably never click on it
<d_bot>
<stab> Idk โlanguage featuresโ? Thatโs a little opaque
<d_bot>
<rgrinberg> The name "arcane" seems counter intuitive to me, such a channel would contain so much useful knowledge ๐
<d_bot>
<rgrinberg> veterans sounds alright as well
<d_bot>
<stab> Eh imo feels weird to discourage beginners from clicking in as well (from the perspective of someone who isnโt great at Ocaml)
kleisli_ has quit [Ping timeout: 260 seconds]
<d_bot>
<octachron> Between, "veterans", "advanced", "expert", "technical discussion", it is hard to convey the idea that everyone is welcome to discuss and ask questions, but that the discussion might end up being hard to follow. And I don't know how many people will be scared by "veterans" but not by "compiler internals" (or the reverse).
<d_bot>
<ostera> if my vote counts for anything, I'd ๐ a #compiler channel
<d_bot>
<stab> Yeah to be fair compiler internals sounds like itโs all discussion of implementation which is a scary place to be compared to like weird language features
<d_bot>
<octachron> At the same time, it is true that "compiler" would be at its place in the ecosystem category.
<d_bot>
<stab> Also to be fair all of this is very bikesheddy any of the names above would probably do
<inkbottle>
cbv fix-point can be expressed like so: `let rec fix f x = f (fix f) x in fix (fun f x -> if x = 1 then 1 else (f (x-1)) * x) 3`. So the problem must be elsewhere.