KC Sivaramakrishnan
banner
kcsrk.info
KC Sivaramakrishnan
@kcsrk.info
Prof at IIT Madras, CTO of Tarides.com, Trustee at mmht.clinic

kcsrk.info
Reposted by KC Sivaramakrishnan
@kcsrk.info torn between being lazy and strict
October 17, 2025 at 6:02 AM
Strava
July 20, 2025 at 11:59 AM
Thanks for sharing. Congratulations on the paper. I’ll have a look.
June 8, 2025 at 11:47 PM
You can:

# let f : 'a @ unique once -> 'a @ unique once = fun x -> x;;
val f : 'a @ once unique -> 'a @ once unique = <fun>
June 4, 2025 at 9:20 AM
Nice, we can’t get two aliases for physical equality check; if we did the reference is not unique.

I know that Daan Leijen and others worked on uniqueness and reuse, and have published a few papers on this.
June 3, 2025 at 3:40 PM
I think the compiler will not be able to infer the magic there because we're switching the phantom type argument. Compiler can't see that, I think.
June 2, 2025 at 12:30 PM
Indeed. This would work

```
let write r v =
{ contents = v }
```

Then, perhaps explain that the magic is safe since the protocol is encoded in the phantom type argument.
June 2, 2025 at 12:19 PM
I believe this is one of the design goals of the modes system. For Jane Street, it brings the ability to erase modes and release open source libs compatible with upstream OCaml. However, I don’t know the modes system enough to see whether this is possible in all the cases.
May 31, 2025 at 3:31 AM