Platform Dependent types in Scala 3: Crossing those hills

I’ve written the second post in my series on trying to achieve platform dependent types in Scala 3: Crossing those hills

In this post, I explore opaque types, union types as context, type classes with path dependent types, and more.

1 Like

This isn’t the exact same goal but has some overlap: Creating types that represent native types - but for emulated systems. You might find the parallels interesting:

1 Like

Yes, there’s a lot of functionality here that I would want to implement for my platform dependent types. The problem comes from making those types:

  1. User definable while also automating some or most of these definitions
  2. Definable without knowing exactly what the type backing things are

I’m working on the third blogpost now, which goes over adding some of the operations you listed to CLong in a type-safe way, and the problems I encounter there.

1 Like

One note about opaque types: i needed to use scala 3.4 for those definitions to work as expected. Otherwise the type checking was a bit confused.

I’m probably going to be developing with 3.4 in general, but in my use case so far I’ve been on 3.3.1. I’ll keep an eye out for that though!